Close
0%
0%

Cordless phone RESET when off - hook & no audio

My 2018 Hackaday Open Hardware Project involves resetting a cordless phone when an elderly neighbor does not hang up

Similar projects worth following
My idea is to power down the cordless base station for one minute when a cordless phone is Off hook and there is no audio

An elderly neighbor sometimes does not hang up the cordless phone by pressing the end call button, keeping the line busy and no incoming calls can get thru.

My idea is to interrupt power to the cordless base station for 1 minute and then restore power.    

A power on reset to the cordless base station should clear the Off hook condition.

Manual test of taking a cordless phone Off hook to place a call, and then removing power to the base station for one minute, and  then restore power. 
The cordless phone that was Off hook is now back On hook.

Now this project needs a normally closed relay contact that will interrupt the power to an AC outlet where the cordless phone base station would plug into.

Also the phone line going to the cordless phone base station needs to be monitored for:   1) audio present and     2) phone line loop current or phone line voltage to determine if the cordless phone is Off hook.

Possible current and audio sensors are: hall effect, opto isolator, transformer, current transformer, and capacitor coupling to maintain isolation between the project and the phone line so as not to introduce hum onto the phone line, affecting the audio quality on the phone.

RevisedPhoneResetProgram.tif

Image of corrected, revised, and bug free running code

Tagged Image File Format - 89.73 kB - 04/23/2018 at 04:41

Download

ProgramCordlessReset.tif

Image of the working program

Tagged Image File Format - 75.47 kB - 04/20/2018 at 05:06

Download

  • 1 × 2.1 mm barrel jack for 9 Volt 1 Amp Wall Wart
  • 1 × 220 ufd 25 volt Filter capacitor
  • 1 × 4N33 opto isolator darlington
  • 1 × 330 ohm 1/2 watt resistor Current limiting into pin 7 if voltage sample exceeds 5 volts
  • 1 × 10 ufd capacitor

View all 22 components

  • An unexpected power down leads to change

    Boelens, Leland04/29/2018 at 05:10 0 comments

    Testing the Cordless Phone Reset on my cordless phone, I experienced the phone base powering down during a call, at a low audio volume.

    A software change was in order. I changed the no Audio voltage to be between 0 and .02443  volts, it had been between 0 and .03421 volts.  So far the change is working.

    I also decided to give me a visual status indicator as to what loop the program is in by using a two color common cathode LED. I used pin 5, port 0 for the GREEN LED, and pin 6, port 1 for the RED LED. The program turns on the required LED, or both at the beginning of each of the three loops.

    GREEN is for Loop 1,  testing for Off Hook plus No Audio,  which then advances to

    RED for Loop 2, testing for Off Hook plus No Audio for 2 minutes, which then advances to

    AMBER for Loop 3, Powering off the phone base for 1 minute. Then go back to Loop1. 

    Getting a visual indicator during a program by turning on a 2 color LED is a useful troubleshooting aid. As this program has three loops one after the other this tool is useful. Now if I find the RED LED lit during a call I can make a noise or power down before RED turns to AMBER. I could have made the LED s blink but program wise it is much simpler to write a single line of code such as :

    digitalWrite(0, HIGH), digitalWrite(1, HIGH); to turn on both LED s to produce AMBER, on a common cathode  dual color Red and Green LED.

    Loop 1 needs to reset the LED color each and every time as most tests that fail go back to Start. So the first line of code is then :

    digitalWrite(0, HIGH), digitalWrite(1, LOW);  //  GREEN LED ON.

  • Thank you

    Boelens, Leland04/27/2018 at 04:22 0 comments

    I would like to thank hackaday.io and their sponsors  for the opportunity to enter the 2018 Hackaday Prize Open Hardware Design Challenge.

    I would also like to thank the Arduino.cc community for providing the IDE software tools, along with Arduino C++ with its reference, and example programs with documentation, as well as the software and documentation to turn an UNO into an ArduinoISP programmer for programming an ATMega 328P, as well as the ATtiny 44, 84, 45, and 85 etc., so those chips can be programmed to do wonderful things, and not just be tied to a shield.

    I would also like to thank SparkFun.com for putting together kits and example programs around their Red board with supporting documentation and tutorials on their web site, as well as providing links to the ATMega 328P, almost 500 page manual.

    I am also thankful that a whole lot of information and documentation is readily available for download from the internet, from the manufacturer, the supplier, sparkfun.com, and also wikipedia.com, for having information on electronic chips. I usually need three sources to get the whole picture, as I get some of the information from one and clarification from others.

  • Project all boxed up

    Boelens, Leland04/27/2018 at 04:09 0 comments

    The Cordless Phone Reset prototype board has undergone many changes since this project began, and has just completed its last transformation with the removal of the (4) 1N4002 diodes that formed the bridge rectifier for the Audio Detector, replaced with a VM48 bridge rectifier, and the re-positioning of the resistors and zener diodes for the opto isolator with the addition of 2 modular phone jacks. Also the current sense transformer is secured to the side of a plastic box, with the 115 volt AC and Outlet inside, safe from human touch.

    I will continue testing and eventually install at the neighbors house so  I will no longer have to go over and find the phone OFF HOOK again.

  • Sensor operation described

    Boelens, Leland04/27/2018 at 03:18 0 comments

    The On Hook Sensor, is a voltage sensor that provides a logic low when the phone line voltage is 29 volts to 48 volts DC when the phone is On Hook ( hung up). The zener voltage(14 x2=28) plus the opto LED forward voltage drop determines the lowest voltage that will be sensed. Once the voltage drops below 29 volts the opto LED is off, and the output of the darlington  photo transistor will be high, indicating an OFF hook condition, On hook is low.

    The Audio Detector uses a 115 volt AC to 12 volt AC, 1 Amp step down transformer wired backwards. The 12 volt secondary winding has fewer turns, and has possibly a 22 gauge or 18 gauge wire, and a low DC resistance.  When the 12 volt secondary is wired in series with one of the phone line wires to the cordless phone base, it becomes a current sense transformer. It actually has a DC current flowing in the secondary wire turns, but the fluctuations of this DC current is basically a moving magnetic field cutting across the hundreds of turns of the 115  volt primary, inducing an AC  voltage which is rectified by the 1N4002 diode into + DC, the 10 ufd capacitor stores this + DC voltage, the 220 K ohm resistor provides a discharge path for the capacitor. The formula T=RC was discussed before about the discharge time. The 330 ohm 1/2 watt resistor is to limit the current into the ATtiny 85 input only when the input voltage exceeds +5 volts. If higher than +5 volts is present, the input clamp  diode in the ATtiny 85 will become forward biased and limit the positive input voltage  to +5.7 volts. Originally I expected  a higher max AC voltage from the current sense transformer, and that is why the series resistor and zener diode were in the original design. This last version works very well, using fewer components

  • Rework and Design Modification

    Boelens, Leland04/22/2018 at 05:25 0 comments

    While running tests on the design up to this point several un-expected results occurred. It seems that the program got out of program once the power was cycled to the base, and sometimes the phone would power off during a conversation. This is why testing is done to work out any hidden bugs.

    A basic software error occurred when I put a "goto Start", when the program exited the 1 minute delay and restored the base power. The program is an infinite loop until you put a goto at the end that normally loops back to the beginning. I also shortened the delay from 5 seconds to 3 seconds between the ON hook, and Audio samples. 

    I made changes to the AUDIO detector that rapidly charged the capacitor, increased the discharge time, eliminated the zener diode from restricting the high level, added a 330 ohm resistor and used the internal input diodes on the Analog input to limit the high level to + 5.7 volts. The Resistor x Capacitor ( T=1 RC ) time is now 220 K ohm  x  10 ufd = 2.2 seconds for one time constant. Since it takes 5 time constants to charge and discharge the time for discharge is 2.2 seconds  x 5 = 11.0 seconds. The sample rate is now 3 seconds between samples. Also the charge has no limiting resistance  and should be fast. Also the design change has raised the DC voltage to around .5 volts with some spikes at approx 1.5 volts with normal audio. The noise on the phone line after     "If you would like to make a call, please hang up and try again",       does not get detected and decays to DC a level below .025 volts. The program looks for a DC level greater than or equal to .03 volts as  audio present. To do this the Analog input is looking for a binary number 7 or higher.  How I arrived at that number is the Analog reference voltage is +5.0 volts I usually represent it as 4.999 volts then divide by 1023 to arrive at = .0048866 per 1 unit bit x 7 =.0342. So a binary number equal to 7 up to 1023 is in the audio voltage range. The program is only concerned with the level between 0 and 6 for being NO audio present.

    I made changes to the ON HOOK  detector to lower the current draw from the phone line as some calls did not ring thru during testing. I changed the 10 K ohm series resistor on the opto LED to 20 K ohm. I expected the opto output transistor ON voltage drop to rise from its near 0 volts, it did rise to 3 volts. I replaced the MCT2E opto isolator with a darlington transistor in the output, by installing a 4N33 opto isolator. The output transistor on voltage is now .6 volts, still in the range for a low logic level. If I need to lower the opto LED current draw more, I should be able to do so.

    I also installed a .1 ufd capacitor across the ATTiny 85 power supply pins.

    I also supplied the Relay power thru a series 1N4002 diode and on the Relay coil side I also installed a 470 ufd capacitor from the Relay coil high side and ground. This should isolate the ATtiny 85 from any supply drops as the Relay is energized. Once the Relay has pulled in, the hold current draw should be less due to the voltage drop across the series diode.

  • Operational NOTES

    Boelens, Leland04/20/2018 at 20:39 0 comments

    When conducting testing of the project to reset a Cordless Phone Off hook  with no audio, the annoying noise present when a phone is left off hook usually preceeded by "If you  would like to make a call, please hang up and try again", that noise was not detected by the Audio Detector, but that is OK as normal audio keeps the Cordless Phone Base from being reset.

    In choosing the I/O pins for the type and function, I know that any pin can be configured as a digital input or output, but only designated pins can be an Analog input, and other designated pins can be PWM outputs.

    Also I programmed the un-used PWM pins  as INPUT_PULLUP so I did not have to install pull up resistors. Also the reset pin is not connected and it is using its internal pull up resistor.    Why not use the reset pin?      It is not needed, the compiled code using Aduino C++ has the ATMega ATtiny 85 in a tight loop it cannot get out of program.

    I thought of using the un-used outputs to light status LEDs but that would involve un-necessary parts for operation.

    Why did I use the ATtiny 85 instead of the ATtiny 45?       The 85 cost was cheaper than the 45 when I bought two, the one I used in this project has been re-programmed many times it is ready to do something else even if it is constantly polling for an Off hook condition.

    This project has an AC power cord and a low voltage barrel jack for the 9 volt DC to power up the electronics. A final product would have one AC power cord with a switching supply inside its enclosure.

    As I pointed out earlier this project would be better designed into a Cordless Phone, using software, to reset the OFF HOOK phone, and add a do not disturb function, while silently recording messages.

  • Some final thoughts

    Boelens, Leland04/20/2018 at 19:03 0 comments

    As with every solution comes a problem.

    This project was to solve a problem with an elderly neighbor not hanging up their cordless phone by pressing End Call, or placing in the charging cradle.

    It will perform that function, but here is the other problem, this neighbor takes the phone OFF HOOK on purpose so as not to be disturbed by incoming calls  while taking a nap.  This is hopeless.

    This whole project could be implemented by the Cordless  Phone Manufacturer using their existing hardware with software changes. They probably monitor the modulation level between the base station, and the cordless phone, and they certainly monitor the Off hook condition.

    Thru software changes and probably no hardware changes the Cordless Phone Manufacturer could reset the offending OFF HOOK phone with no audio, and
    could add a do not disturb for an hour or more, or for a specific time while routing incoming calls to the answering machine with the ring turned off and the message audio turned off.

  • The prototype is up and running

    Boelens, Leland04/20/2018 at 17:53 0 comments

    I used goto label in writing the program to keep with the flow chart, and keep the program simple to understand.

    The first draft of the program I used Analog inputs to measure the voltage for both the Audio current sensor, and the ON hook sensor. The analog input for the Audio current sensor is OK as no audio results in 0 volts due to the .1 ufd capacitor and its 220 K ohm bleed resistor has a RC time of .022 seconds and the sample rate is at 5 second intervals.

    Sometimes there may be 0 volts, but there should be at least one that is more than 0 volts during the 2 minutes, that would send the program back to the beginning.

    A problem occurred with the ON hook sensor when ON hook. The opto isolator with its low LED current did not provide 0 volts when the output photo transistor was turned on. I simply changed the Analog input to a Digital input, I am looking for a LOW and a HIGH, which is what the opto isolator is providing.

    One other problem I had was intermittent operation during the One Minute and Two Minute delay routines, as the variables twoMinuteTimer and oneMinuteTimer were originally int. I changed them to static int and the intermittent problem went away.

    I have found that the Arduino C++ compiler reuses variable memory space unless it is made static, and if not static your counting variable will change during the program unexpectedly.  Static prevents the memory space being reused  during the program, it is reserved for that variable only, to be changed for that variable!

    In keeping memory usage down I saved 4 bytes by changing the variables twoMinuteTimer and the oneMinuteTimer to static byte. The binary numbers for 12 and 24 easily fit within a 8 bit byte of memory.

    START
    The program is checking the sensor inputs every 5 seconds, starting if ON HOOK. The most common event is the phone is ON HOOK, but once OFF HOOK the audio sensor is checked for NO audio, if no audio is detected the program moves to the test for NO audio for 2 minutes, otherwise go to Start.

    WAIT 2 MINUTES
    Once in the Wait2Minute area of the program and the On hook remains OFF HOOK, and there is NO AUDIO, the program moves to the BasePowerOff for 1 minute, otherwise go to Start.

    BASE POWER OFF
    Once in the BasePowerOff area the relay output turns on the relay, breaking the Normally Closed contacts,

     
    waits one minute,

    turns off the relay re-making the Normally Closed contacts,
    and then go back to START.

    To start the process all over with the offending cordless phone that was OFF HOOK, now back ON HOOK!



  • Describing operation of the two sensing circuits

    Boelens, Leland04/20/2018 at 08:14 0 comments

    Please excuse the hand drawn schematic. I can draw by hand faster than learning how to operate a new drawing program. I am finding hackaday a challenge without having my data entry disappear and having to re-enter it over and over.

    The ON HOOK  sensor has two 14 volt .5 watt zener diodes rather than one 28 volt .5 watt zener diode as I had the two 1N5244 diodes left over from another project, and the combined voltage drop with the forward voltage drop from the opto LED put the operating voltage around 29 to 32 volts. When the phone is hung up (ON HOOK) the phone line is around 48 volts, when OFF HOOK (making a call) the  voltage drops to around 5 to 8 volts DC. So when the phone is ON HOOK , current flows thru the opto LED and the output photo transistor  turns on pulling its pullup to 0 volts. When OFF hook the the voltage of 5 to 8 volts is too low to allow current to flow thru the reverse biased zener diodes. The zener diodes act like a reverse biased diode until the reverse breakdown voltage is reached, then the voltage regulating property of the zener diode starts working and the zener voltage is held unless the zener current is starved when the series resistor value is too big or the load current draw is too much. I am not too concerned as the purpose is to keep the opto isolator current off until the phone line voltage is certain to indicate an ON hook condition.

    The combined voltage for the two series zener diodes is 28 volts. When wiring zener diodes in series to produce a combined voltage, they must have the same wattage. 

    I must mention that some telephone devices have a maximum ON hook line voltage of 24 Volts DC. The zener voltage would need to be set lower than that possibly to 20 volts.

    The AT tiny 85 input pin 7 is programmed as a digital input and sees the 0 volts as an low. 

    The bridge rectifier in front of the ON HOOK sensor is there as the sensor is polarity sensitive and phone line polarity may be opposite of what is needed. I forgot to label the connections to the bridge rectifier formed with the 4 diodes. The 2 diodes with their Cathodes connected is +, and the 2 diodes with their Anodes connected is -, all other connections with one Cathode and one Anode are the AC connections.

    The current sense transformer is converting the small audio currents into a higher AC voltage which is limited to a maximum positive voltage if it got there of +4.3 volts when the zener diode is reverse biased  (on the positive 1/2 AC cycle), and a maximum - .7 volts when the zener diode is forward biased (on the negative 1/2 AC cycle). The series 1N4002 diode only passes the positive voltage to the .1 ufd capacitor and its bleed / pull down resistor of 220 K ohms. The 1N4002 diode also blocks the capacitor from draining thru the 10 K ohm resistor and the current sense transformer winding.

  • Finalize audio current, and On hook voltage sensors

    Boelens, Leland04/19/2018 at 05:11 0 comments

    I  first tried to wind my own current sense transformer but I needed more primary turns than the core could hold. I finally used a 115 VAC to 12 VAC transformer. The 12 volt secondary was wired in series with one phone line wire, in order to sense the fluctuating audio currents. The DC resistance of the 12 volt winding was very low so it did not cause problems with the cordless phone operation. The 115 volt primary winding had enough turns to boost the small audio currents to provide .2 to .4 volts DC. This is OK as I was planning to look for 0 volts which occurs with no audio!

    I did add a diode between the cathode of the 4.3 volt zener diode and the integrating .1 ufd capacitor and the parallel bleed resistor, to only allow the positive voltage and block the  - .7 volts. The capacitor bleed resistor is now 220 K ohms. The bleed resistor is also the input pull down for the Analog input monitoring the audio DC level.

    I also put together the On hook voltage sensor monitoring the phone line voltage.

    I used a MCT2E opto isolator that I had in my parts bin. I found that it is obsolete but electronics parts warehouses have thousands in stock. Anyway I used its input LED wired in series with a 10 K ohm resistor and ( 2 ) 1N5244,    14 volt .5 watt zener  diodes to require a phone line voltage higher than 28 volts DC to turn on the LED in the opto isolator. I also wired a bridge rectifier AC inputs to the phone line wires and the + terminal went to the cathode of one zener diode, the anode connected to the cathode of the next zener, then the anode connected to the anode of the opto LED and the cathode of the opto LED connected to the 10 K ohm resistor and then to the - terminal of the bridge rectifier. I actually wired 4 diodes to form the bridge rectifier. I had a small bridge rectifier, but I also had 4 diodes that I had used in an earlier version that I did not want to waste. The purpose of the bridge rectifier is that the opto voltage sense circuit is polarity sensitive, and not all phone lines are properly wired to provide the same polarity to the wall jack. The bridge rectifier takes care of polarity reversals.

    I had a 3.4K ohm resistor before I replaced it with the 10 K ohm resistor. The phone would not ring with approx 5 ma current draw, but with approx 1 ma current draw, the cordless phone does ring. The On hook voltage sensor, does sense that the line voltage is higher than 30 volts by turning on the opto isolator output transistor which pulls down a 10 K ohm pullup resistor. When the cordless phone is off hook the phone line is pulled down to 5 to 8 volts DC. The opto isolator turns off the output transistor, as there is not enough voltage to turn it's LED on. My concern was the opto LED current would be too low to drive the output photo transistor. I was prepared to increase the resistance of the output photo transistor pullup resistor to 100K ohms if it was necessary. So far it is working.

View all 11 project logs

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates