loading

Some days it seems like the phone never stops ringing. The caller ID always says "Toll Free Call" or some other nonsense. I wanted a way to just drop these calls. I was going to use an Arduino to watch the caller ID and answer each one of these calls. I was looking at Audio recorder modules but then I got a Linkit One. With it's built in audio mp3 player it was perfect.

Best part is if you play the official "This number has been disconnected" message most telemarketer dialing machines recognize hose three tones at the beginning and remove you from their active dial list......

Step 1: Finding a Caller ID Chip


Before you think about doing a project that connects to an old fashioned phone line know this.

The ringing signal used in my area is ~90Volts AC at 20 Hz. If you happen to be touching the wires when the phone rings it will feel like you stuck your finger in a light socket. It will hurt for a while. If you have friends like mine they will stand behind you and call you while you try to work on it.......

I use a VOIP system in my house but it supplies standard caller ID signaling on its POTS lines. If your going to use this on the PSTN you may want to go with an FCC approved interface or just grab an old US Robotics modem but I don't have to worry about that so I chose the HT9032D. I got these from Tayda Electronics. Really cheap but they only stock the surface mount package. You could pay more and get a dip package from another supplier but I had some oddball adapter boards on hand....

I used a blank Shield prototype board to hold all the parts. I had some RJ-11 connectors and 600 ohm matching transformers in the parts cabinet. I have a habit of buying stuff like this in bulk.....

Step 2: Making Sense of the Data

A long time ago I got a development board from MeLabs called the Lab-XT. It was for pic micro-controllers and it had support chips for DTMF and CallerID. I was surprised that no one really has any examples for the Arduino world. There is one out there, repeated many times, but it just didn't work for me.

Using the MeLabs Caller ID info page as a guide I set out to build a simple state machine to parse the incoming packet. It may not look simple but I tried to stretch things out so you can follow along in the code. I only implemented the MDMF since that's whats in my house. The SDMF is simpler but don't have an actual dump to go by.

If somebody sends me a terminal log of an SDMF message I will add it to the code. I can replay dumps into the decoder to test it.

And that's the first thing to do. Get a data dump. I used a Prolific USB to serial breakout board to monitor the data out pin. I used Putty to log a few calls and Midnight Commander to view the log in HEX. There are plenty of other terminals and viewers. Use your favorite.

There is a lot of noise on the line but there is no mistaking those 30 U's in a row. Just in case I miss some I test for > 25 U's received. I then look for the 0x80 identifier of the MDMF packet. This is where you would look for a 0x04 if you wanted to also do SDMF decoding.

I then save the packet length so I know when were done.

There are 5 message ID's to watch for and I process each one separately. It ends with a check sum but I ignored that for now. Maybe later. I'd rather see a garbled name than an error message....

The date message seems to be local to the provider. One local voip server was off by 1hr but that was a daylight savings error on the server itself.

I tried a couple of different providers and the messages do not always come in the same order. Sometimes its "Date - Name - Number" and on others it was "Date - Number - Name". YMMV

Step 3: Schematic and Code

There are a lot of parts here but its really a very simple set of circuit blocks. A transistor driving a relay from a digital I/O pin, an analog modem chip and support components, a header for an I2C display, plus the usual decoupling capacitors and protection diodes.

I planned out a circuit board for the shield but I haven't had time to verify the design yet. I added a power jack for a future project with this shield. I may make a few for my friends......

Step 4: Assembling the Shield

I hand wired the prototype. It may not be pretty but it works. If I get some quiet time I'll work on Version 2. I am making two different boards. One for the Dip chip version and one for my oddball wired adapter boards. The blue post-it shows the odd pin-out of these adapters.Be careful what you buy on eBay. Sometimes 50 pieces for $2 is not a bargain.....

Step 5: Power It Up

Since I planned to tap off an existing PC power supply I use in my home monitoring system I got a floppy drive molex power connector from an old worn out PC fan. Just make sure you swap the power pin from the +12V side to the +5V side.

Step 6: Mounting It

I have an old alarm case on the wall in the basement. It houses a PIC micro-controller monitor board that communicates back to my server through an IP to Serial converter. It's been there for over a decade now and probably could use an update. There maybe a second Linkit One going in this cabinet soon......

Step 7: Testing It

I added a define at the top for debugging. If you set it to true it waits for the serial console before it starts up.

There is also an I2C port on the bottom You can connect an LCD with an I2C backpack. if your making a tabletop version this is a nice feature to have.

The debug output follows the machine state and shows the length of each message. I probably should put the "if (debug" thing around every serial.print but I'm lazy and it doesn't seem to bother the Linkit One

Right now its simply one message on a hard coded list. Just add more checks to the blocked callers function. You can use a separate message for each blocked number

With the capabilities on the Linkit One I can easily upgrade this to use the SD card and keep a log of all calls and add a csv file of blocked numbers vs mp3 file names. I just have to write a routine for handling the csv files then maybe a web update form.....

With a unique message for each number I can be sure that the more annoying the caller, the more appropriate will be the message they get!

Step 8: The Future?

What more is there?

I really didn't like the small display. I changed it to use a 20x4. A little bit better but I still will run it headless. This makes it more useful as a tabletop device.

Lately, I noticed that Community Blood Service calls me three times in a row for every blood drive. Maybe a block on the number of calls per day? Since we're all type O they seem to like us but I only need one call since we do talk to each other.

Maybe add a second relay to drive a piezo siren to give a local alert for high priority callers. It wouldn't pick up and play them anything just wake me up or get my attention over the noise in my shop.

Step 9: Making It Better Than the Commercial Alternatives

I looked at a couple of commercial blockers and realized they all suffer from one annoying thing. The phone always rings once.

Please no "Postman Always Rings Twice" references because I beat you to it.....

To fix this flaw just duplicate the relay driver circuit on pin 2 and connect it to pin 3. This relay is used to drive a ringer and lamp. Now turn off the ringer on your phone and you will have bliss.

There is a new function called "AllowCallers". Only the numbers placed here will activate the new relay and its replacement ringer. I originally though about using a Vishay h11aa1 optocoupler to detect the incoming ring, add an 11th state to allow the ring to be passed through from the source. That would require a timeout routine too but then I realized I only want to hear it ring twice. I copied the standard 2-4 second ring cadence and put it in the loop.

I still may write that timeout loop but only to turn the LCD backlight off.

As far as a ringer goes I used a 110V AC rated relay so I just used a standard house lamp and one of these replacement ringers. Great for the noisy workroom.

It didn't seem to mind the 110v 60Hz input. Just put a small fuse in series to be sure.......

<p>Looks like a lot of effort for $86--that's the cost of the CPR Callblocker V202 I got from Amazon. I've had it about 5 weeks now, and have blocked about 65 calls. My &quot;crap call rate&quot; had dropped from about 12 calls a day down to 0, maybe1. BUT, I can easily either hit the red &quot;Block button&quot; on the CPR unit, or tap #2 on my land line mobile phone to block further calls--as long as a phone number appears on caller ID. You need the caller ID on your phone service for this to work. I know they're still trying to call, as I normally see 15 or 20 &quot;missed calls&quot; on my phone display, yet there may only be 0 ,1 or 2 messages on my phone. And my phone blocker is on the simplest mode. You can also program unit to block, 800 numbers, unknown callers, out of area callers, etc.</p>
Ahh but thanks to the good people at instructables the total cost to me for this project was about $3!<br><br>I paid for the ht9032d and Zener diodes. The rest were leftovers from scrapping everything I get my hands on. Hmmm maybe I should put this in the leftovers contest. Thanks for the idea!<br><br>Plus I get to build something!<br><br>Truthfully I use an asterisk pbx and its IVR menu could do this too. With the added benefit of no initial ring!<br><br>With a few more parts I could make this circuit do that too. <br><br>The no 1st ring part I mean. It means a loop detector and a couple of more relays and code. <br><br>I know there are those like me who would rather build than buy. It's a learning experience. Plus you become intimately acquainted with what's possible. <br><br>Then when you do make that commercial device purchase you a little better informed.<br><br>So your saying I should add a button to &quot;add last call to block list&quot; wow that's easier than editing the csv file. <br><br>To do the dtmf press to add call I'd have to add another chip. The lab xt already has it but sounds like a challenge<br><br>Looks like a version 2 build coming!
<p>In addition to suppressing the first ring for v2, maybe for v3 you could add detecting/decoding call waiting caller id. I wouldn't expect it to do a switch hook &quot;flash&quot; to hangup the incoming call, but just display on the LCD that the incoming caller is on the block list so I wouldn't bother putting the current caller on hold to answer the telemarketer.</p>
<p>Great project!</p><p>Using an eeprom for blocked caller list (ie. 24LC256) would be fairly simple to do and provide a fair bit of space for the undesirable callers.</p>
You can also sd card as i did
<p>I figured the linkit internal 10mb flash would be all I'd need. if i were to remake it with the mega or similar I'd probably use a cheapie SD card adapter. That way i could keep the same library calls.</p><p>i'm not against EEprom's I just like the librarys available for SD</p>
<p>If some has the parts, expertise, education on electronics, test equipment, time, etc., then it's an easy project. But without those things, the CPR is an option that would save me days or weeks of time, major anxiety, frustration--a trade off I would spend the $86 to stop the phone calls. Glad you can do it with a minimal investment, but I also imagine there are others who would opt for the CPR unit for themselves or a Holiday gift. Nothing negative here, just pointing out facts.</p>
<p>Didn't think it was negative, I actually do like the idea of a &quot;block now&quot; button.</p><p>It's not good enough for a remix of the project but definitely a new feature to be added. </p><p>For some reason I like fixing things and building stuff. </p><p>To give you an idea of how how far I will go to waste time fixing stuff here's a true story although it happened 20 years ago I still do the same stuff. </p><p>I was walking home from a friends house with my wife. it was a quick 3 block walk. we passed 2 19&quot; TV's on the sidewalk put out for the trash. when we got home i jumped in the car and went back to pick them up.</p><p>I got them home and started checking them out when my wife says &quot;what are you going to do with those?&quot; so I said &quot;fix them!&quot; she countered &quot;then what?&quot; well i hadn't thought that far ahead so I ignored her and went about fixing them. 2 hours later they both worked perfectly.</p><p>well now it was back to her question &quot;What now?&quot; I ended up putting them by the curb in front of my house.......</p><p>I did run an extension cord out to leave them powered up so passers by could se how well they worked. I put the first one out and when I went back for the second someone scooped up the first one...</p><p>so i put out the second one and in 10 mins thats was gone too. practically the time it took me to walk upstairs and look out the window</p><p>I do these things for fun. </p><p>if you'd find building something like this frustrating then forget the project and hopefully this story has amused you. </p><p>It made me laugh thinking about it.</p><p>hopefully you got a laugh too......</p>
<p>Honestly I think that is what Instructables is all about, the fun of being able to build stuff yourself.</p><p>Great instructable, if I wass still using a landline I would have followed your steps to create one myself.</p><p>Keep up the good work rjkorn.</p>
<p>Thanks! I never thought this was going to be so popular with all the VOIP conversions out there....</p>
<p>I TOTALLY get you! Kinda like an addiction and can, sometimes, be as expensive as one. Think I was 5 or 6 when I found a Timex watch (no electronic watches then) didn't work so I took it to bits - no two pieces touching) and put it back together. Worked but didn't keep good time. There was a lot I didn't understand at the time. Used tweezers and a jeweler's loupe, kinda tedious.</p>
<p>Yep, I bet it was fun. Still have the watch hanging around? I</p><p> keep a few trophies like that. Always good for a laugh.</p>
<p>For me, the whole concept of Instructables satisfies my curiosity on how to make things, how other people happened to solve some problem. Financial is important but comes second term for me.</p>
<p>According to the description of the CPR V202, it blocks PRIVATE, UNKNOW and INTERNATIONAL, however my phone shows UNAVAILABLE instead, and this project would allow me to block those. In addition I can connect a larger display, so I do not have to run and find my reading glasses first.</p>
<p>Hi. How do you play the song while the telephone is still ringing?</p><p>Thanks!<br>Marc.</p>
You'd have to add a ring detector. there are many ways like using a standard opto coupler and dc blocking capacitor or my favorite, one made from a neon light like i did for my fog machine timer. see step 3 of that instructable:<br>https://www.instructables.com/id/Fog-Machine-Timer/step3/The-Controller/
<p>Thanks!</p><p>But i don't know how to lift the phone with Arduino ?</p><p>How can i do that?</p><p>Thank You.</p><p>Marc.</p>
<p>after the ring detector what i do with my music, i have the isd1820 module i can play music through the phone..</p><p>thanks!</p><p>marc.</p>
<p>What do i do after the ringing is detected to play my music?</p><p>Thank You.</p><p>Marc.</p>
What if i Want To lift the phone n'y Arduino And playing music on telemarketer . How do i do that? Thanks.
<p>Excellent Project, I&acute;ve received today my HT9032D and I will build this caller Id following your circuit. Thanks in advance!!!</p>
<p>Good work!</p>
<p>Thanks, Sometimes it takes something annoying you to get you working....</p><p>Nothing like telemartketers to annoy you....</p>
How would i know if an unknown call is calling?
<p>With a new routine. I block by number. You'd want to block by name.<br> Specifically one character names of &quot;O&quot; and &quot;P&quot;. I could probably add <br>that in the next revision. I was planning on expanding those names to <br>&quot;Out of Area&quot; and &quot;Private - Blocked&quot; for readability.</p>
I would like to know if the relay is connected to the primary and how do you trigger the audio? Thanks.
<p>I used a 600:600 audio isolation transformer so the primary and secondary are interchangeable. if you use a 1000:8 then the secondary (8ohm) goes to the audio source and the primary getts connecte dto the relay and phone line.</p>
What about a 800:8 transformer? Whats the difference between 600:600 and 800:8 ?<br>Thank you so much for your Time
<p>Hi. Nice project! I managed to make it work on the HT9032C with direct connection with a bridge rectifier. I have never used audio transformer that's why i don't understand to wire it to the phone line. As i can understand, the primary of the transformer is wire on the tip / ring on the phone line, and again the primary is in input on the TIP / RING of the HT9032D , and the secondary of the transformer is wire to a output jack 3.5mm to your speaker? Where is the relay is connected to ??</p><p>Thank you.</p><p>Have a great day!</p><p>Marc.</p>
<p>The relay is just for audio. Either from an mp3 module or the Linkit's audio out jack. You could even use a radio and let them thing they're on hold....</p><p>the transformaer and relay are separate from the HT decoder chip function and you can build and test them as seperate bocks of hardware.</p>
I have the isd1820 audio module. Im wondering if you know how To get it To the phone?<br><br>Thank you very much <br>Have a good day <br>Marc.
I have the isd1820 audio module. Im wondering if you know how To get it To the phone?<br><br>Thank you very much <br>Have a good day <br>Marc.
<p>The relay is just for audio. Either from an mp3 module or the Linkit's audio out jack. You could even use a radio and let them thing they're on hold....</p><p>the transformaer and relay are separate from the HT decoder chip function and you can build and test them as seperate bocks of hardware.</p>
<p>MDMF begins with the 0x80 not the 0x55 ? Why do you begin with 0x55 ?</p><p>thank you!</p><p>Marc.</p>
<p>The 55's are the sync or wake up characters.</p><p>noise might give you a stray 80 and start the loop running but there not much chance you get 25+ 55 characters's in a row</p><p>just my way of ignoring noise on an open line</p><p>the best way is to use a ring detector and then the 55's loop counter</p>
<p>Love the concept, but what i love even more, is screwing with bill collectors and telemarketers. Love it when i get a telemarketer, i rack up a nice huge package, then give them my netspend card that has a zero balance. then be like ahh man, forgot, i'm broke, later. click. </p>
<p>Great Idea! Another method is to put them on hold indefinitely.</p>
<p>I like that idea. Have to add a loop current monitor to see when they hangup. Could even keep track of the length of their wait to see whose the most desperate. Maybe put up a public roster of the most pathetic calls!</p><p>We could be starting something here. </p><p>Just need appropriate waiting music</p><p>Waiting by Green Day</p><p>Loser by 3 Doors Down</p><p>????</p>
<p>&quot;Never Gonna Give You Up&quot;, Rick Astley. </p>
<p>That's a good one too....</p>
<p>needed features:</p><p>1) add to block list button</p><p>2) remember how long they hold for, then just before they hang up, give a &quot;we really appreciate your time, will be with you shortly. You are currently number xxx in the queue&quot; etc message....then back on hold</p><p>any of those two songs sound perfect. find the most boring line (preferably instrumental) and play it in an endless loop.</p>
<p>Probably should play a &quot;We really appreciate your call. Please hold we will be with you&quot; or &quot; we really value your time&quot; message first. Take a line or two from their script...</p>
<p>I string them along for as long as possible, to keep them from calling other suckers. </p><p>&quot;Microsoft&quot;: I tell them that my PC takes a long time to boot (20 minutes), or I'm going to get my credit card, or whatever; then finally admit I'm running Linux. Or, I go to the loo and treat them to the audio of my micturation or defecation. </p><p>Roofing, siding, &amp; window sales: tell them I just got new roofing, siding and windows.</p><p>&quot;Bridget&quot; who wants to lower my interest rate: press 1 to get the salesperson, then lay the phone down until they hang up, tying up their line. </p>
<p>I used to answer the calls from my local paper with a pitch for the New York Times Sunday edition. I tried answering with &quot;Hello, Dominoes, we deliver!&quot; but they hang up right away.</p><p>Hmmm, I think I'll go record those to mp3's now. Thanks!</p>
<p>Good instructable!</p><p>I did a lot of time ago something similar, but I went a bit crazy and implemented all the functions using a single chip (a dsPIC). It does signal acquisition, FSK decoding, CID command parsing, audio playback using PWM technique, SD card handling (for storing a call log and for reading audio files), etc. If interested, you can find it here:</p><p><a href="http://kernelhacks.blogspot.com/2013/12/balsamo-reloaded.html" rel="nofollow">http://kernelhacks.blogspot.com/2013/12/balsamo-re...</a></p><p>There is also a github repo with schematics and sources:</p><p><a href="https://github.com/doragasu/Balsamo" rel="nofollow">https://github.com/doragasu/Balsamo</a></p>
That's pretty good. <br><br>I'm a fan of the Mid-range and smaller PIC's. I still use OTP 16C54 chips today in place of logic gates.<br><br>Just did a small production run of Alarm Controller cards that use 628's<br><br>I never got to play much with the DsPic's though. I just need time......
<p>Thanks for the update.</p><p>The eBay order have not arrived as of today, but as soon as it makes it, I'll try to make it.</p><p>You would not have one of your PCB's for sale for me, would you?</p><p>Also, just LOVE the peoples coments here!!!!</p>
<p>I just hand the phone to hubby. He's GOOD, jerks them around like a trout. I made one cry; but he made one QUIT--right there during the call.</p>
<p>When I answer the phone, and they ask me, &quot;How are you today?&quot;, I say &quot; I am fine thank you. I really appreciate your concern for my health, goodbye&quot;. and then hang up.</p>
<p>Well I can usually weed them out when I answer the phone if there is more than 2 seconds of silence, I can figure out it's an auto-dialer and hang up or, whatever.</p><p>There is an instructable on youtube (darnit) for using an OBi100 that weeds out telemarketers, you program it to have the caller press a code to get to the person they wish to speak to. They don't have this code, and the phone won't ring without it. Kind of interesting, but then what if the hospital calls to tell you your spouse has been in an accident? oh well</p>

About This Instructable

30,672views

291favorites

License:

Bio: Disclaimer: The author is not responsible for loss of life, limb or property. The author is not responsible for your actions. The author is not ... More »
More by rjkorn:The GEO Metro Drone V2 $12 Bluetooth Upgrade Quickie 3D Printed Power Supply 
Add instructable to: