Call Blocker / Telemarketer Stopper

39K300107

Intro: Call Blocker / Telemarketer Stopper

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.......

102 Comments

I want to use this project to determine if an incoming call is from the front gate, and if it is, then I want it to play the right DTMF tones that will open the gate... can you point me in the right direction for sending out DTMF tones? I'm most likely going to use the ATMEGA 328-PU chip because I have a few laying around. :-)

Can you tell me what type of arduino you have used? UNO? MEGA?

can provide a schematic on how the components are connected to each other.

By looking at the sketch I suspect he is using an Arduino Mega, Due or Leonardo, since - as far as I know - the Serial1 command is not part of the Arduino UNO instruction set. The project is interesting, however not much details about how it interfaces to the Arduino, neither in the schematic nor the yah-dah-yah-dah.

As the Arduino UNO provides just one imbedded serial port, the same one used to connect to the computer, you may want to consider including the SoftwareSerial library, which allows to use other two pins as software controlled serial port.

You'll need to update the sketch accordingly.

BTW, there is a New Software Serial library but, so far have not used it, so can not comment if better or not.

You have to be careful with these projects by fellows that assume everyone has at home the very same stuff they have.

He didn't use an Arduino for this project as he mentions in the tutorial. He used a LinkitONE because of it's built in ability to play MP3 files.
Can you add a unblock function so if it blocks your grandma you can fix it?
Just add something to the code that will ALWAYS allow grandma's phone number and before you run the code that looks for blockable numbers, have it run through a list of accepted numbers which would bypass the number blocking code. Here is some pseudocode that shows how something like that might look in your code:

void checkInboundCallerID() {
if (!knownGoodCallers(callerID)) //the ! means NOT
{
runFilterForBadCallers(callerID);
}
else {
//This is the code that would run if the call is from someone that
//you pre-determined was a wanted call.
}
}

boolean knownGoodCallers(String callerID) {
boolean response = false; //This will be the default response
if (callerID.contains("213-555-1212")) response = true;
else if (callerID.contains("714-555-1212")) response = true;
else if (callerID.contains("619-555-1212")) response = true;

return response; //This will always be false unless the callerID matches one of the above numbers.
}

void runFilterForBadCallers(String callerID) {
//This is where you put the code that checks for bad callers etc.
//Which will ONLY run if the check for known good phone numbers fails.
}
Hi to the designer and others,

Great circuit!! Out of interest can this circuit be modified (or can someone help me get started to design a circuit) that when a telemarketer phones or you receive a robo call or a scammer calls that it blocks them by having a circuit that asks phone caller to enter two initials of person they wish to reach as most of these callers cannot enter initials or do not know your name. Your phone would only ring if the caller enters the initials you program in device (you will not miss any important calls as that person will know your initials) Also, with this system you do not have the expense of caller ID (it does not require this). Thanks everyone David Turner
Sounds like an automated attendant or IVR.

The problem comes in when you say “ring the phone” to do that right on a POTS line requires a lot more switching, a need to disconnect the incoming line from the house, and a ~90V 20 or 30 HZ ring generator. Depending on your country.

Or you could do the centralized ringer I had mentioned. It’s not the phones that ring but a single sounder connected to an io pin. That way you shut all the ringers in the phone.

You don’t need fancy messages if you want to go stealth. Just use a standard answering machine to answer all calls and silence all phone ringers.

Then you use an Arduino uno to listen for a number after every incoming call

Only tell you friends to “dial 123” while the message is playing to make your uno connected ringer go off

You could even listen for different number sequences and have them out different ring sequences. Like 2 ring for mom 2 rings for dad. Even Morse code if you wanted....

Not impossible and I did do this once but then I took an open source approach and used asterix to create a VOIP server in my house. So much easier to do all attendant stuff in software.

Plus with voip phones in every room I could use them as intercoms.

I guess it comes down to are you more comfortable with hardware or software?

I use to use Asterisk on a small Dell workstation that I installed CentOS on ... it was lovely. What I'm curious about is what hardware did you use for Asterisk? Did you use a typical PC or some other small footprint linux capable hardware?
My phone is VOIP using Google voice and an OBI box. I scored a CPR CallBlocker at a thrift store and it works OK. That said it won't work between my VOIP box and the house, with three pones. The CPR CallBlocker instructions indicate that may not work, so I'm not surprised. The down side is the other phones in the house ring once or possibly twice before the CPR CallBlocker picks up, then hangs up. I have an Arduino board which I picked up for something else and it's now sitting, so putting it to good use would be perfect. I'm not versed in writhing Arduino code, but think there is a need for a flexible home built unit with some options as discussed in several of the responses. One question is; does anyone know, if there is a means to generate a ring command, for 3 phones or more? Blocking a call, seems simple enough, but as OP noted, being able to pass a call through after it met specific criteria is clearly valuable. I would hate to build something only to learn there is no capability to do what I need.
Every home is wired with the phone wiring on each jack connected in Parallel (in the United States anyways) ... so I would think that if you could figure out which phone jack is closest to the CPE, you could pull the jack out of the wall and you'll discover that the wire is either stripped without the wire having been cut, or it's been cut and both pieces have been stripped then twisted together and wrapped around a screw terminal. Simply untwist the wires so that jack location has direct access to the CPE on the side of the house and feed that line to this project.

So at that point you would have tip and ring coming from the side of your house and feeding this project. You would also have the tip and ring for the rest of the house available for use but it would be effectively "dead" (the phone company not connected to it) which you could then control whether or not those wires are connected based on the inbound caller ID using a couple of relays to re-connect those wires to the wires coming in from the phone company... Here are two ways I can think of that would make such a scenario useful to you or anyone really.

1) You could have two relays, one for tip and one for ring, then have your micro controller activate both of these relays when the call is known to be wanted, and simply allow the inbound ringing to continue as the call normally progresses. The phones ring in your house and you pick up one of the receivers and you just hang up when you're done with the call. You would need some way of knowing when a phone somewhere in the house actually hung up so that you could disengage those relays while the device waits for the next call. I'm not exactly sure what to look for on the line to know when the call has ended but I'm sure it would be a drop in voltage between tip and ring which could be detected by the micro controller ... a properly designed voltage divider with the right caps etc. would allow you to monitor that voltage and have that code run only once an inbound call was determined to be friendly. When the voltage drops on the line, disengage the relays and you're done.

(edit) I just looked it up, and it looks like when the phone hangs up, there is actually an INCREASE in line voltage between tip and ring, so while a call is in progress there is around 5 volts between tip and ring and when the call hangs up, that voltage goes up to around 50 volts ... the added complexity to this is that it is a NEGATIVE voltage meaning that ground is the positive in a phone line ... this had something to do with copper getting corroded when normal polarity was used over long distances with direct current ... it only makes sense to me when I consider that in a positive ground circuit, when you actually use the earth as the ground, you will have less electrons moving in the wire when you configure the circuit for a negative voltage ... which I suppose is why it doesn't cause corrosion. Either way, the actual detecting of when a call is dropped sounds like a job for PNP transistor arrangements. :)

Option 1 would be the simplest way to go about doing this.

2) The second option I'm thinking of would be more complicated and I'm less sure about how to go about it, but it would involve generating a ring voltage for the tip and ring going to the rest of the house once the call has been determined to be a good call. Then when someone picks up the receiver somewhere in the house, you could then implement everything I mentioned from option 1 (activate the relays which effectively patches the call through to the rest of the house).

The advantage of option 2 would help you recover the time lost in identifying the call ... lets say for example it costs two rings to determine if the call was friendly... well if you have an impatient caller, then they might hang up before you answer the call because by the time you hear the first ring, they have already heard two ... so what you could do with option 2 is when you determine the call is friendly, you could play an MP3 file that says something like, "Please hold while we see if someone is home" ... then while you generate the ringing for the rest of the house, the caller is already expecting to be heard so they will wait ... then if you wanted to, after say 30 seconds or so if no one answers, you could let the caller know that no is available at the moment to take the call so please call back later.
I made this BUT the software is incomplete. No "LAuido.h library exist? Which Arduino to use?
This one didnt use an arduino but a LinkitONE. It had a built in mp3 player.

It also used 2 serial ports so if you comment out the laudio stuff it might work on a mega but instead of playing a message it will just hang up on people.

If you remove the serial debug routines then it should work on a uno....

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 "crap call rate" had dropped from about 12 calls a day down to 0, maybe1. BUT, I can easily either hit the red "Block button" 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 "missed calls" 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.

Ahh but thanks to the good people at instructables the total cost to me for this project was about $3!

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!

Plus I get to build something!

Truthfully I use an asterisk pbx and its IVR menu could do this too. With the added benefit of no initial ring!

With a few more parts I could make this circuit do that too.

The no 1st ring part I mean. It means a loop detector and a couple of more relays and code.

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.

Then when you do make that commercial device purchase you a little better informed.

So your saying I should add a button to "add last call to block list" wow that's easier than editing the csv file.

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

Looks like a version 2 build coming!

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 "flash" 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.

Great project!

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.

You can also sd card as i did

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.

i'm not against EEprom's I just like the librarys available for SD

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.

More Comments