DIY Open Source IVRS System

This project is an Interactive Voice Response System based on a personal computer. The data of an institution or firm is stored in a computer as a MySQL database, the world’s most popular open source database.Parents or students can then access and retrieve data from this database just by making a call to a predetermined mobile number. The user should provide the student details like admission number, semester number, exam code etc. when requested by the computer. The computer will then speak back the data requested, using a speech synthesizer. The Block diagram is given below:


The hardwire side consists of an embedded system which interfaces a GSM mobile phone or modem to the USB port of the computer. This particular example, is designed for our college and uses the academic data of the students as the database.  PC side programming is done in python with MySQL  bindings  and the embedded system is programmed in C. The text to speech conversion is done using espeak- the open source speech synthesizer and the audio output of the sound-card is routed to the mobile phone.

Circuit Diagram

When there is an incoming call, the call detector detect the call and attend it automatically. Then the call detector will send a signal to enable the micro-controller. It will then signal the PC through the virtual serial port created by the USB to serial converter. On receiving the signal, the python program running in the PC  greets the user by saying a welcome message, and prompts the user to enter student details like admission number. When the user presses the keys on his phone, DTMF tones are generated ,which are received by the mobile phone and decoded using the popular DTMF decoder IC MT8870. The Decoder outputs BCD code of the key pressed. The AVR micro-controller will then read the BCD code and send it to the PC. The STD pin of MT8870 (Pin15) will go high only when the decoder receives a valid DTMF tone. It is used to signal the micro-controller to read the data.

The call detector is built around a general purpose Op amp LM324  wired as a comparator and a 555 wired as an a monostable.  During  an incoming call the voltage level of the headphone output goes high  and remains high for some time. Also during each key press, the voltage goes high and remains high for a few seconds. During that time, the output of Op amp will be low and it will  trigger the monostable. The time period of the monostable  is set to approximately 25 seconds. If the user does not presses any key within this time period, the monostable output will go low and it will trigger the micro-controller  to go signal to hang up the call.The circuit was wired on a veroboard and is shown below:

The first prototype
The first prototype

On the PC side, the program waits for data from the micro-controller. The python interface to MySQL database is through  MySQLdb API in python. The database is created in MySQL.  The hardware interfaces the computer through a USB to serial converter.

The main disadvantage of this system is that, it requires a computer to operate. Instead of a fully fledged computer, smaller boards based on processors like Atom or smaller boards like Beagleboard or Gumstix can be used.The documents (codes, schematics) can be downloaded from here.

22 thoughts on “DIY Open Source IVRS System

  1. My partner and I stumbled over here coming from a different web page and thought I might as well check things
    out. I like what I see so i am just following you.
    Look forward to checking out your web page repeatedly.

  2. I was looking at the picture of the prototype. Do you have any video where I can see a demo of this IVR. And also, can you suggest me for which specific industry will you target with this model?
    Like call centers, stock trading firms. It would be better if you provide some detailed specifications.

    1. Hi, this project was done a couple of years ago, and I couldn’t make a video documentation. It was targeted to implement in colleges, which can provide student info through phones

    2. HI,I’M nshimiyimana esron ,i live in RWANDA ,i would so much to know how IVR works,because in my studies i want to make a project wtat i put in industry whict includes the functions of IVR also i’m at the end of year in ELECTRONICS department at TUMBA COLLEGE OF TECHNOLOGY if is possible can you send me a video just as IVR works so that i see and make in plactice.


  3. Hi,
    I saw ur project it impressive.
    but slight confused in usb to serial converter
    can u please tell me ic name for that………….
    please reply…………

  4. Respected Achuwilson,
    could you please mail me the detailed procedure along with the hardware or software requirements.

  5. You have explained it in simple way quite nicely.

    I understand that on left side of circuit diagram, there is an interface from microcontroller to PC (USB to Serial port). And on right, there is interface between cell phone and this circuit to microcontroller.

    I would like some more information about that connection i.e. which output from cellphone will connect to the board etc.

    I am interested in receiving the calls through microcontroller directly and eliminate the PC. Then after receiving the numbers, there is a possibility of controlling the output devices directly from microcontroller.

    1. Yes thats possible.. The audio output of the cell phone can be fed fed to ta DTMF decoder to generate corresponding digital signals. Once you get those 4 bit digital signal, you can do anything you want with it is your microcontroller, like controlling devices etc.

      1. Thanks for the reply.

        How is the physical connection from cellphone to the board? You open the USB cable and just get D+ and D- to IN+ and IN- of MT8870 in that case?

        In your circuit as well, USB to Serial converter you have shown in left hand upper corner of the circuit, is that a separate IC component or just the adapter cable? From the photo, there doesn’t seem to be such component.

        I am anxious to get started on this and this is the only part which stops me from it. How am I going to connect the cellphone physically to the circuit? I assume USB output from the phone, but where/how do I connect that to this circuit?

      2. Hi, I used the USB to Serial converter to interface the microcontroller (Atmega8) to USB Port of the computer. It cannot interface with the USB port of a cellphone, simply because the USB port of the most cellphones (except android and meamo devices) cannot act as a USB host and enumerate other USB devices like USB to serial converters. If you have to use USB output from cellphone, the options are use an android device and an android ADK kit, use a superior microcontroller like an arm which can provide USB host capability or use a low end old model mobile which does not have a USB port, but a small serial port and interface the microcontroller and use AT codes for communication between microcontroller and cellphone.

      3. Achu,

        Thanks for your replies and help.

        Today after I wrote to you, I found what I was looking for. There are two things:

        1. To interface output of mobile to deliver DTMF tones received to microcontroller – you need to use output from mobile headset to DTMF decoder.

        2. And for interfacing the mobile directly to microcontroller, what you mention is perfectly true.

        I am quite novice and had confusion about #1. Since I found that its headset (earphone) output, I am on my way to interfacing this and have DTMF decoder (8870) output to microcontroller to control devices with input key values.

        But #2 will also be quite useful to me in future attempts if I need to drive the mobile from my computer, like the application you have.

      4. Respected Achuwilson,
        i have absolutely no word to describe your openhearted thought.please keep up the good work.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s