This is an OLED attachment to the doorbell to display messages and images. It is connected via WiFi
and can be controlled via a phone with internet. This all started with the wife needing a way to
stop people from ringing the doorbell whilst Anne was sleeping.
Here is the list of materials and tools used for this project. Arduino software
as well as FreeCAD was used for the programming and 3D design, respectively.
1. ESP 8266 Microcontroller with WiFi
2. Adafruit 128x64 OLED screen
3. Custom 3D printed case
4. Cables and soldering
3. Multimeter / Oscilloscope
The ESP 8266 microcontroller is a good choice for this project because it has a large RAM,
WiFi enabled, and small form-factor. The Adafruit OLED has pins for serial connection
and power supply from the ESP board. These two pieces of hardware were connected with
via a breadboard for the software design and integration.
The ESP board uses C code and was coded with the Arduino IDE. To enable WiFi communication,
the ESP8266WebServer library was used to initialize the controller. The board first
initializes the OLED screen and then attempts to connect to the WiFi network. After
a successful connection, the URL is printed on the OLED screen. The server (ESP board)
waits until another computer requests an http connection at which point it sends the
index page.
Here is an
example of the webpage hosted by the ESP board. The page has three different options to
display messages on the OLED screen. The first two large buttons for quick messages.
When a user selects a button, the appropriate text is written to the OLED screen and a
confirmation page is sent back to the user. The second message option is custom text.
The custom text is entered by the user and sent to the server to display on the OLED.
The final message type is an image. These images are preset but can be altered within
the arduino code. Users cannot upload images due to the lack of RAM on the ESP board.
The bitmaps of the preset images are stored in the bitmaps.h file on the github repo and
can be changed using
this tool
that I have published on this website.
The plan for this project was to mount the OLED attachment to the doorbell which meant
it would be outside and for everyone to see. Therefore presentation is important which
meant that I could not just shove it in a recycled container and nail it to the wall.
I used FreeCAD 0.19 which worked very well and I highly recommend it for anyone looking
to create something similar in scale. I followed a couple of tutorials and soon enough
I had a good design. The local library has a 3D printer and it only cost $4 which is
significantly cheaper than buying my own 3D printer. The first iteration was okay but the
lid was too big for the box and did not slide on. I went back to freeCAD and added some
margin for machine-error and tried again. This time the lid did fit which was relieving.
I installed the hardware and cabling into the case with some solder and electrical tape.
The pins on both boards are catered toward jumper cables rather than solder so I did a
combination of both.
With everything installed I powered it on using a microUSB plugged into a hole I added to
the side of the casing. It worked well and the only thing left to do was install it onto the wall.
The ESP board requires 3.3V DC power. Typically this can be achieved one of two ways. Either via
a dynamic power supply such as a computer, or a special adapter. The former works with a USB
cable and the ESP board and computer communicate to deliver the correct amount of power. The latter
works because the manufacturer supplies a wall plug that converts the 120V AC power to 3.3V DC.
There are no computers near the doorbell so my best option was to go with the wall plug, however
the closest wall plug is about 10ft away. This led me to a great, but disastrous, idea. The
doorbell has power so I could just create a custom power adapter that converts the doorbell
power to ESP power.
After some research I realized that the doorbell is most likely powered with a lower level of AC
power. To confirm this theory, I connected my multimeter across the doorbell to measure the power.
(I also had some help with this step from my wife and daughter)
The measured power was around 21V AC which confirmed the research. This meant that I had to create
an adapter that went from 21V AC to 3.3V DC. I planned this conversion to happen in two stages. The
first was to rectify the AC power to DC and then step down the DC power to 3.3V. For AC to DC, one
of the best circuits to use is called a Full Bridge Rectifier.
I installed the rectifier to the doorbell and sure enough it converted the power to DC. To step
down the power I used an IC regulator. This regulator can have a variable output power by changing
the two resistors on the two outputs.
The equation for the output power was supplied in the datasheet and I used Python to calculate
the ideal resistor ratio. I did the math for the correct resistors and bought the components
from Digi-Key.
When I installed everything, I didn't get the output power I expected which was odd. I double-checked
my math and the circuit connections. I found when I installed the regulator in different orientations,
I got slightly better results.
I dug through my resistor collection and started trying different combinations. The problem was that
I am colorblind so I couldn't read the resistor code. I got my wife to help and had a set-up like this:
I kept testing the resistors but my predictions always missed the actual results. At one point I did
have an output power of 3.3V yet the ESP power was not powering on. I decided to start hot-swapping
resistors which was a terrible idea. I started to smell burning and quickly unplugged everything. I
went back to my computer and plugged in my board to the dynamic power supply. I got a notification on
my computer that the device I connected was requesting more power than the computer could deliver, uh oh.
After about 5 seconds I heard a pop and smoke starting coming from the board. I destroyed the regulator and
thus the board.
I decided to investigate why the power output of my adapter wasn't what I expected. Firstly I verified the
output of the doorbell power. I used an oscilloscope this time to give a proper 2D representation of the
power.
The scope is old and not the most accurate, however it does clearly show the AC sine wave from the bell.
When I add the rectifier into the circuit I get the following:
The rectifier eliminates the negative voltage, but we still see a drop in voltage, this is because there is
no smoothing, ie the diodes do not hold any charge so the AC pattern slips through. To remove this I added
a smoothing capacitor between the two outputs.
This plot is not that different from without the capacitor. Therefore one of the issues with my
custom adapter was that I was not using the proper size of capacitor for the system. I also observed that
when I connected my oscilloscope, the light in the doorbell dimmed. This meant that the power across it
decreased which was not expected behavior. The doorbell transformer was not designed for an additional
load such as an oscilloscope or my OLED attachment. These findings are useful because I have learned
more about how residential power works and its related limitations.
I ordered a new ESP board from Amazon and decided to abandon the custom power-supply and just use the
manufactor's plug. It looks slightly more messy but it works.