Project:Enhanced Door Bell: Difference between revisions

From CoMakingSpace Wiki

No edit summary
(Out of Order)
 
(16 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{ProjectInfoBox
{{ProjectInfoBox
|project title=Enhanced Door Bell
|project title=Enhanced Door Bell
|image=
|image=DoorBell V2 Case Installed.jpg
|status=planned
|status=Not installed
|date=
|date=November 2018
|initiator=[[User:NitramLegov|Martin]] [[User:Johannes|Johannes]]
|initiator=[[User:NitramLegov|Martin]], [[User:Johannes|Johannes]]
|team=[[User:NitramLegov|Martin]] [[User:Johannes|Johannes]] {{HelpNeeded}}
|team=[[User:NitramLegov|Martin]], [[User:Johannes|Johannes]] {{HelpNeeded}}
|materials=[[Arduino]]
|materials=[[ESP32]]
|tools=[[3D printer|laser cutter]]
|tools=[[3D Printer]]
|software=undecided
|software=[https://github.com/comakingspace/DoorBell custom development]
}}
}}
We would like to have an enhanced Door Bell with a Soundboard.


==Planned Features==
'''The Enhanced Door Bell is not installed right now. You can help reinstall it though.'''
* Integrate the door bell
 
Our Workshop is equipped with speakers in each room which can be controlled centrally. [https://github.com/comakingspace/do-something/issues/2 Issue #2] describes these speakers in a little bit more detail.<br/>
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
* Code separation between critical (Door Bell Task) and optional (MQTT stuff) Task.
 
== Hardware ==
The door bell is based on a [[ESP32]] and thus has integrated WiFi Control.<br/>
In order to play MP3 Files, we are using a [http://www.geeetech.com/wiki/index.php/Arduino_MP3_shield_board_with_TF_card MP3 shield] based on the VS1053B.<br/>
The whole thing is powered by a 24V notebook power supply which is attached to the speaker cables.<br/>
It is enclosed in a custom casing.<br/>
 
===Wiring===
[[File:DoorBell Installed.jpg|x300px|right]]
[[File:DoorBell Steckplatine.jpg|x300px|right]]
For the wiring, please see the fritzing sketch on the right or check the original file on [https://github.com/comakingspace/DoorBell/tree/master/documentation GitHub]. <br/>
Unfortunately, there was no fritzing part available for the ESP32 board we are using (DEVKIT V1). Therefore, the fritzing sketch does not contain the connection between the ESP and the MP3 board. <br/>
The VS1053 is attached to the ESP as follows:
{| class="wikitable"
|-
! 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
|}
 
<br clear="all"/>
 
== Software ==
You can find the software over on [https://github.com/comakingspace/DoorBell GitHub].
 
In order to make the ESP32 work with the VS1053B board, we are using a [https://github.com/danclarke/Adafruit_VS1053_Library fork] of the [https://github.com/adafruit/Adafruit_VS1053_Library Adafruit VS1053 Library].
 
In addition, we are using [https://github.com/knolleary/pubsubclient PubSubClient] 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.<br/>
The JSON should (for example) look as follows:<br/>
<code>
{<br/>
'command': 'play',<br/>
'payload': '/track001.mp3'<br/>
}
</code><br/>
Within the JSON, the following commands are available:
{| class="wikitable"
|-
! 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
| folder to list (e.g. '/' for listing all content)
| publishes the content of the SD card to /DoorBell/Answer
|-
| listconfig
| none
| publishes the current configuration to /DoorBell/Answer
|}
 
===Ringtone Randomization===
There is a python script over at [https://github.com/comakingspace/CommonRoomPiSettings/blob/master/OtherScripts/RandomizeRingtone.py GitHub], which makes use of the above-mentioned MQTT commands in order to get a list of available ringtones and randomly select one.
 
It is scheduled via a cronjob, so every day you come in to the space, there should be a new ringtone waiting for you.
 
On the SD-Card, the Ringtones have to be in the folder <code>/Ringtones/</code>. Please be aware that any file in this folder might be chosen as a ringtone. So be careful, what you put there!
 
 
==Building Process==
<gallery mode="packed-hover">
File:DoorBell V1 Case Installed.jpg|Version 1 of the Case
File:DoorBell CleanerWiring.jpg|The wiring got adjusted and cleaner
File:DoorBellTestWiring.JPG|The first test of the new wiring
File:DoorBell TopPrinting.jpg|Printing the top of case V2
File:DoorBell_CasePrinting.jpg|Printing the case V2
File:DoorBell Installed.jpg|We hung it up!
File:DoorBell V2 Case Installed.jpg|Done
</gallery>
 
==Planned Features ==
* Integrate a Soundboard
* Integrate a Soundboard
* Attach to the speakers (see [https://github.com/comakingspace/do-something/issues/2 issue #2])
 
* Possibility to make announcements


==Todos==
==Todos==
* Create list of Hardware options
* Decide on soundboard functionality
* Decide on Hardware to use
* Create and test door bell integration circuit


==Needed==
==Needed==
* Arduino
* Audio Shield for the Arduino (e.g. [http://www.geeetech.com/vs1053-mp3-breakout-board-sd-card-slot-p-611.html?zenid=rhi98d0sj02ju3bh7hvi8gl184 Geetech VS1053])
* Board for Bell integration (Convert 9V AC to 5V DC)
* Case for the soundboard
* Case for the soundboard
* Buttons for the soundboard
* Buttons for the soundboard


[[Category:Microcontrollers]]
[[Category:Audio]]
[[Category:Audio]]
[[Category:Electronics]]

Latest revision as of 18:38, 17 August 2020

ProjectInfoBox

Enhanced Door Bell

DoorBell V2 Case Installed.jpg
Status: Not installed
Release Date: November 2018
Initiator: Martin, Johannes
Team: Martin, Johannes who else would like to help?
Materials Used: ESP32
Tools Used: 3D Printer
Software Used: custom development


The Enhanced Door Bell is not installed right now. You can help reinstall it though.

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
  • Code separation between critical (Door Bell Task) and optional (MQTT stuff) Task.

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

DoorBell Installed.jpg
DoorBell Steckplatine.jpg

For the wiring, please see the fritzing sketch on the right or check the original file on GitHub.
Unfortunately, there was no fritzing part available for the ESP32 board we are using (DEVKIT V1). Therefore, the fritzing sketch does not contain the connection between the ESP and the MP3 board.
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 PubSubClient 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 folder to list (e.g. '/' for listing all content) publishes the content of the SD card to /DoorBell/Answer
listconfig none publishes the current configuration to /DoorBell/Answer

Ringtone Randomization

There is a python script over at GitHub, which makes use of the above-mentioned MQTT commands in order to get a list of available ringtones and randomly select one.

It is scheduled via a cronjob, so every day you come in to the space, there should be a new ringtone waiting for you.

On the SD-Card, the Ringtones have to be in the folder /Ringtones/. Please be aware that any file in this folder might be chosen as a ringtone. So be careful, what you put there!


Building Process

Planned Features

  • Integrate a Soundboard


Todos

  • Decide on soundboard functionality

Needed

  • Case for the soundboard
  • Buttons for the soundboard