Elderphone firmware is used to drive old dial telephones to implement basic phone functions. The basic working principle is as follows:
1) Both ends of the phone provide 10V direct current through the DC-DC boost module. After 1/20 voltage division, the line voltage is detected. When the phone is on-hook, the detection voltage is about 500mV, and the line voltage is about 10V at this time. After off-hook, the voltage drops to about 3V, and the detection voltage is 150mV at this time. The detection port is ADC2
2) When the dial is rotated, both sides of the line are periodically short-circuited, and a dialing pulse is generated that is detected by GPIO9. When the number reaches 11 digits, or it is manually ended with half-dial mode, the call is made.
3) When an external phone is connected and the ring tone circuit is turned on, GPIO19 is set to high level to switch the line boost transformer primary to the 25Hz signal generator, and at the same time GPIO18 outputs a 25Hz square wave pulse driver to generate a ringing signal.
The same model of phone can be purchased on Xianyu.
The system consists of two parts: software and hardware. The phone core board can be purchased by searching for Air724 phone core board on Taobao. The purchase link is: https://item.taobao.com/item.htm?spm=a230r. 1.14.16.7842a199WLhFUA&id=624610770134&ns=1&abbucket=10#detail
The baseboard part drawings are completely open source, and there are currently no circuit boards for sale. The source files of the drawings and the hardware part baseboard&coreboard are provided in this project
Using Lua programming, the source code is open source, and you are welcome to use it with MIT authorization https://gitee.com/miuser00/elderphone
1 Based on Elderphone hardware, each module completes the specified function.
2 Complete inter-module communication through Luatask message mechanism
3. There is no code-level dependency between each module, and it can run independently without public variables.
4 Modules can collaborate with each other through message communication
1) Monitor the networking status. If a successful networking message is received from the bottom layer, the phone status will be [Connected].
2) If you pick up the phone after connecting to the Internet, the phone status changes to [Dial-up Detection]
5) If you receive a call message from the dial pad, turn off the ring and make the call
6) If you receive a hang-up message and the current status is [Call], hang up the phone, change the status to on-hook, and stop playing 450Hz audio.
7) If the incoming call is terminated, the ringing is turned off
8) When the phone state machine changes, print the current state from the serial port
sys.publish(...) publishes messages
sys.subscribe(id, callback) subscribe to messages
sys.publish("UARTOUT",msg) Publish serial port debugging messages
1) Turn on the ringer
require "Alarm"
sys.publish("ALARM_ON)
2) Make a call
require "Call"
sys.publish("CALL",117) Call the number 117
"ALARM_ON" Ring the bell
"ALARM_OFF" turns off the ringtone
"AMARM_ON OK" Ringing successfully
"AMARM_OFF OK" Ringtone turned off successfully
"AMARMING" is ringing
"AMARMING STOP" Ringing stops
"Ring" "Stop ringing"
"CALL",s_TEL Call the number s_TEL
"OVER" hang up the phone
"ANSWER" answers the current call
"CALL OK",s_TEL dialed s_TEL successfully
"OVER OK" Hang up successfully
"ANSWER OK" Answer the current call successfully
"Connected"
"phone connected"
"Call disconnected"
"There is an incoming call, the number is"..num
"PLATE_MOVING" The dial is moving
"PLATE_STOP" dial pad stops
"DIALING", paulseCount dialing pulse count
"DIALOUT", dialNum dial out number
"Dialing:"..dialNum
"turn the dial"
"Dial Stop"
"dial"..paulse
"OFF_HOOK" off-hook
"ON_HOOK" hang up
"Off-hook"
"hang up"
"PLAY_450Hz" plays 450Hz dial tone
"STOP_450Hz" Stop playing dial tone
"PLAY_450Hz OK" Play 450Hz dial tone successfully
"STOP_450Hz OK" Stop playing dial tone successfully
"Play 450Hz dial tone"
"Stop playing dial tone"
"UARTOUT", uartrsv outputs debugging information from the serial port
msg,[arg1],[arg2] publishes any system message and can contain up to two parameters
"NET_STATE_REGISTERED" The network is connected
"CALL_INCOMING",incoming call
"OFF_HOOK" off-hook
"ON_HOOK" hang up
"CALL_DISCONNECTED" call hung up
"DIALOUT",num Dial number num
"PLATE_MOVING" dial movement
"PLAY_450Hz" plays dial tone
"ALARM_ON" Ring the bell
"ANSWER" answers the call
"ALARM_OFF" turns off the ring tone
"ANSWER" answers the call
"CALL",num call number
"OVER" button
"STOP_450Hz" Stop playing dial tone
All reference designs on this site are sourced from major semiconductor manufacturers or collected online for learning and research. The copyright belongs to the semiconductor manufacturer or the original author. If you believe that the reference design of this site infringes upon your relevant rights and interests, please send us a rights notice. As a neutral platform service provider, we will take measures to delete the relevant content in accordance with relevant laws after receiving the relevant notice from the rights holder. Please send relevant notifications to email: bbs_service@eeworld.com.cn.
It is your responsibility to test the circuit yourself and determine its suitability for you. EEWorld will not be liable for direct, indirect, special, incidental, consequential or punitive damages arising from any cause or anything connected to any reference design used.
Supported by EEWorld Datasheet