Project:Enhanced Door Bell: Difference between revisions
NitramLegov (talk | contribs) (Adding MQTT Control) |
NitramLegov (talk | contribs) m (wording and formatting) |
||
Line 78: | Line 78: | ||
At every press of the bell button, the door bell publishes "Ring Ring" to the /DoorBell/Ring topic. | At every press of the bell button, the door bell publishes "Ring Ring" to the /DoorBell/Ring topic. | ||
===/DoorBell/Control=== | ===/DoorBell/Control=== | ||
In order to control the door bell, cou can send a JSON to the /DoorBell/Control topic. The JSON should (for example) look as follows: | In order to control the door bell, cou can send a JSON to the /DoorBell/Control topic.<br/> | ||
The JSON should (for example) look as follows:<br/> | |||
<code> | <code> | ||
{ | {<br/> | ||
'command': 'play', | 'command': 'play',<br/> | ||
'payload': '/track001.mp3' | 'payload': '/track001.mp3'<br/> | ||
} | } | ||
</code> | </code><br/> | ||
the following commands are available: | Within the JSON, the following commands are available: | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- |
Revision as of 11:07, 14 November 2018
ProjectInfoBox Enhanced Door Bell | |
---|---|
Status: | planned |
Initiator: | Martin, Johannes |
Team: | Martin, Johannes who else would like to help? |
Materials Used: | Arduino |
Tools Used: | 3D Printer |
Software Used: | undecided |
Our Workshop is equipped with speakers in each room which can be controlled centrally. Issue #2 describes these speakers in a little bit more detail.
When discussing a proper usage of these speakers, we came up with the idea of building an enhanced door bell, which should be capable of playing custom sounds and be heard in each and every room.
Features
- Play MP3 Files
- Play sound in every room
- Custom bell button
- MQTT Control
Hardware
The door bell is based on a ESP32 and thus has integrated WiFi Control.
In order to play MP3 Files, we are using a MP3 shield based on the VS1053B.
The whole thing is powered by a 24V notebook power supply which is attached to the speaker cables.
It is enclosed in a custom casing.
Wiring
The VS1053 is attached to the ESP as follows:
VS1053 Pin | ESP Pin |
---|---|
5V | 5V |
GND | GND |
DREQ | D13 |
X-CS | D5 |
X_DCS | RX2 (D16) |
X_RESET | EN |
CS | TX2 (D17) |
MOSI | D23 |
MISO | D19 |
SCK | D18 |
Software
You can find the software over on GitHub.
In order to make the ESP32 work with the VS1053B board, we are using a fork of the Adafruit VS1053 Library.
In addition, we are using Paho as the MQTT Client of our choice.
MQTT Integration
/DoorBell/Ring
At every press of the bell button, the door bell publishes "Ring Ring" to the /DoorBell/Ring topic.
/DoorBell/Control
In order to control the door bell, cou can send a JSON to the /DoorBell/Control topic.
The JSON should (for example) look as follows:
{
'command': 'play',
'payload': '/track001.mp3'
}
Within the JSON, the following commands are available:
Command | Expected Payload | purpose |
---|---|---|
play | filename to play | plays the given filename |
selectRingFile | filename to use as the ringtone | sets the given filename as the future ringtone |
setVolume | Volume (lower numbers = higher Volume) | sets the given Volume |
listSD | none | publishes the content of the SD card to /DoorBell/Answer |
listconfig | none | publishes the current configuration to /DoorBell/Answer |
Planned Features
- Integrate a Soundboard
Todos
- Test the code further
- Finalize MQTT control
- Decide on soundboard functionality
Needed
- Case for the soundboard
- Buttons for the soundboard