Rotary Dial Remote Control for Home Automation
Rotary Dial Remote Control for Home Automation

- Rotary dial phone S63
x 1
French phone
- DFPlayer
x 1
Mini MP3 player
- Custom board
x 1
High-voltage inverter, etc.
https://arduino-pico.readthedocs.io/en/latest/ - Arduino-Pico
x 1
Raspberry Pi Pico Arduino core, for all RP2040 boards
DFRobot - DFRobotDFPlayerMini
x 1
MP3 player Arduino library
Introduction
In this project the WIZnet W5100S-EVB-Pico board is used to turn an old analog rotary-dial phone into a remote control and alarm for a home automation system.
Functions
The modified rotary-dial phone has the following functions:- When the handset is on the phone and a number is dialed, the corresponding appliance is switched on or off, depending on its current state.
- When the handset is lifted, the dial can be used to compose a text message in a way similar to mobile phones from some twenty years ago. Replacing the handset on the phone will send the message.
- The bell of the phone is available to the HAC as an alarm and can e.g. be routed to the doorbell or function as a kitchen timer or (unpleasant) wake-up alarm.
- The loudspeaker of the phone will be connected to an MP3 player to play prerecorded messages or music. This allows for implementing for instance a talking clock as was common in the previous century.
Wired vs Wireless
Even though today wireless networking appears to be the standard, there are still many applications for cabled or tethered Ethernet. One advantage of wired Ethernet is that it is possible to provide power to the connected nodes. This feature is used in this project (see below). Furthermore, as rotary-dial phones always have had a cable running to a wall outlet somewhere, it would even be strange to have one without. Therefore, the WIZnet W5100S-EVB-Pico board is a perfect choice for this application.
Arduino
The WIZnet W5100S-EVB-Pico board is supported by libraries intended for use with the official Raspberry Pi RP2040 MCU development environment. I do not like this environment too much as I find it complex and cluttered with all the Cmake stuff. Luckily there exists also an Arduino boards package for the RP2040, and so I ported the WIZnet libraries to this IDE. This makes things much simpler and, I think, more accessible and easier to share. The complete application program consists now of an Arduino sketch and an easy to install library. The library is avaible in the GitHub repository that I created for this project. The RP2040 boards package for Arduino was created by Earle F. Philhower III, I used version 1.13.1.MQTT
The MQTT example provided by WIZnet was used to build my program on. This helped me to get up and running quickly. The only problem I encountered was a missing and undocumented call to MilliTimer_Handler (see mqtt_interface.h). Once I added it to my millisecond timer callback, MQTT worked fine. This short video shows how the phone controls the lights of my livingroom.mDNS
Because my HAC relies on DHCP to connect to the network, it may be attributed a new IP address at any moment. To find its peripherals and to communicate with them, the HAC uses multicast DNS or mDNS. As I did not want to hard-code a temporary HAC's IP address in my program and recompile it every time the HAC's address changes, I added mDNS support to it. For this I adapted the WIZnet DNS library as mDNS is quite similar to plain DNS. Now the program issues an mDNS request to obtain the HAC's IP address before trying to connect to it. This makes the system much more flexible and reliable.Dialing
The vintage phone's dialing mechanism can be viewed as two switches: one indicates that dialing is in progress (busy/idle) while the other closes a certain number of times depending on the chosen digit. A '1' produces one pulse, a '9' nine pulses and '0' is ten pulses.


Texting
When the handset is lifted, dialing produces besides a multi-digit number also letters to compose text messages with. The 26 letters of the alphabet are distributed over the digits 2 to 9, three characters per digit, except 6, which only has two ('m' and 'n'). Digit 0 also has two ('o' and 'q'), digit 1 has none. This is the distribution printed on the French S63 phone. For some reason there is no 'z' and so I added the option to add it to digit 0.

High-Voltage Bell Inverter
The bell of the phone requires a relatively high AC voltage to ring, at least 35?VAC as I found. I therefore built a simple low-power voltage inverter controlled by the MCU. The MCU generates two 50?Hz square waves with a 180° phase difference that drive the secondaries of a small 230?VAC mains transformer. The bell is connected to the primary side of the transformer. A small 2x 9?V 1 VA transformer suffices to get a decent bell volume.

MP3 Player
An MP3 player module was added for playing audio files through the speaker of the phone's handset. The MP3 module communicates with the MCU over a 9,600-baud serial port (Serial1). The HAC can send MQTT message to the phone to select the MP3 file to play, or the MCU can control it all by itself. This arrangement allows for e.g. playing waiting music, reproduce analog phone line sounds, play prerecorded messages or create a talking clock. Sound and music files are stored on a microSD card.
VOIP
Currently the microphone of the phone is not used but one could imagine using it for a voice-over-internet or VOIP service. The RP2040 can support I²S, so standard microphone interface ICs can be used for this.Power Supply
The W5100S-EVB-Pico board requires a 5?VDC power supply, the high-voltage bell inverter needs at least 10?VDC. To supply power to the phone the two free wire pairs of a normal Ethernet cable are used. The five meter long cable I used introduces a noticeable voltage drop, even with two conductors in parallel for each power supply connection. A 12-V AC/DC wall wart therefore powers the phone. Inside the phone a small DC/DC converter was added to create the 5?VDC for the MCU board.
Conclusion
In this article I showed how to turn an old analog rotary-dial phone into a remote control and alarm for a home automation system by adding the WIZnet W5100S-EVB-Pico board to it and some additional circuitry. The modified phone becomes an MQTT client that can both send and receive messages from the home automation controller (HAC). Multicast DNS (mDNS) support was added to allow easy discovery of and connection to the HAC. Dialing the phone allows controlling other appliances of the home automation system and sending text messages. The phone's bell serves as an alarm for e.g. a doorbell extender. The phone's speaker together with the built-in MP3 player can play music and prerecorded messages, and make e.g. phone line sounds.
-
Arduino sketch
including libraries
-
Kicad6 project
-
Demo video 2
Home Assistant controlling the phone
-
Demo video 1
Phone controlling Home Assistant