FM Radio With Audio Assist for the Visually Impaired (Version 1.0)
by sncarter in Circuits > Arduino
326 Views, 5 Favorites, 0 Comments
FM Radio With Audio Assist for the Visually Impaired (Version 1.0)
This project started when my cousin, who is visually impaired, asked me if I could make her a radio that tells her what channel it is on. A few years ago I did make her a radio that could do that but I built it all manually and it was very time consuming. I built about 8 radios for members of the visually impaired community, but it was very, very time consuming to do so and after that I did not have the energy to build more.
Recently I decided to revisit this project and see if I could make building them easier an more automatic as well as adding several features such as a rechargeable battery. I also wanted to reduce the cost if possible. This Instructable details what I came up with and you can follow it to build a similar radio for any of your friends or relatives with visual impairment.
Supplies
The BOM with quantities and prices that I sourced components for is in the attached PDF document. For the less common items I have included a link to the product. This is not to say you should source it from the same place unless you want to, but it gives you the exact items I used. Also prices vary a lot so this is just an estimate of the cost.
Downloads
Radio Features
The Radio has the following features:
FM Radio tunable from 88.0 to 108MHz in 100KHz steps.
Audible notification of:
Power on.
Frequency.
Pre-set Setting activated or preset selected along with frequency selected.
Battery Low.
USB-C Connected or disconnected.
Audible beeps with each turn of the rotary encoder (100KHz steps) high tome for up, low tone for down.
LCD Display for anyone assisting with the radio's use:
Displays Frequency.
Displays Relative Signal level
Displays Battery level momentarily on power up.
Displays Logic level (5V) momentarily on power up.
Also:
Custom raised lettering next to each control to help the user (0.075" extruded x 0.4" height raised letters.
Absolute minimum number of controls and complexity.
Independent potentiometers to adjust radio volume, announce volume and beep volume.
Rechargeable 3.7V lithium battery which will last for around 20 to 25 hours depending on battery type used.
USB-C Power plug for charging and running the radio.
High quality mid-range speaker with great sound.
Reasonably compact at 8.5" x 4.75" x 2.8" in size.
When tuned past the end of the useable range the tuning "wraps around". For example if you tuned it past 108.0 MHz to what would be 108.1MHz it wraps around to the bottom of the range and goes to 88.0 MHz and vice-versa.
Circuit Diagram
The Circuit Diagram is attached. Some explanation is required here. The radio is powered by a 3.7V 18650 format Lithium battery. This battery requires charging and conversion from 3.7V to 5V logic level.
So we have a DKARDU 18650 Lithium Li-ion Battery Charger Board 3.7V 4.2V to 5V/9V 1A DC-DC Step Up Boost Module connected to the main PCB. It comes on its own little PCB and is interconnected with the main PCB. It is powered through a USB-C connector, so it is mounted at the side of the radio case with a hole in the case that matches the USB-C connector.
Now this charging module has it's own peculiarities. When the battery is connected to it, it draws a few tenths of a milliamp of current. If left connected to the battery for long periods, it will drain the battery even if the radio is off. When the USB-C cable is plugged in it will pass 5V to the output regardless of whether the battery is connected. This means that if you have the USB-C cable plugged in and switch to the battery off, the radio will be on unless there is another switch to isolate the radio circuit from it's output. This is the reason for the rather complicated looking circuit at the bottom left of the circuit diagram. This is also why the power switch is a DPST switch. SW1A connects/disconnects the battery and SW1B connects/disconnects power to the radio. They are ganged together so both are on or off at the same time.
So if the radio is running on battery power alone; when SW1A/B is on, the battery is connected to the module and the module is connected to the radio. The radio has power from the battery via the module and the battery is not charging. If we turn switch SW1A/B off then the battery is disconnected from the module and the radio is disconnected from the module output. The radio is off.
When the USB-C cable is plugged into the module with SW1A/B off, power from the USB-C supply activates relay K1, this connects the battery to the module for charging, this is because K1's contacts bridge SW1A. The radio remains off because SW1B is off. Here we use both sets of K1's contacts for more reliability and current carrying capability. C7 and R12 form a snubber network across the relay contacts to suppress any chance of arcing due to transient high current. D1 suppresses back EMF from the relay coil, it is critical to have it in place.
CRITICAL STEP - Note: The DKARDU 18650 Lithium Li-ion Battery Charger module has a very small adjustable potentiometer on it. It is CRITICAL that you adjust this potentiometer before you connect this module to any 5V circuitry! This module can output up to 28V which will destroy any 5V logic including the TEA 5767 radio module, the LCD, the PAM8403 and microcontroller.
To do this connect a 3.7V battery or power source to the module. Connect a voltmeter to the module Vo+ and Vo- terminals and adjust the potentiometer so that you have a 5V output. The ones I had came from the factory set to 6.7V which would have destroyed all the major components if I had not checked it first - an expensive mistake.
Note that I have each connection designated as a plug on the PCB e.g. P1, P2, P3 etc. If you want you could add plugs and jacks for these connections to the PCB. However I just solder wires directly to the PCB. Not only is this more reliable but it also saves the cost of all those plugs. It is however easier to use P1, P2, P3 etc. designation in the PCB design software as it makes it easier to create a footprint for each connection, so that's why I did it that way. I used "EasyEDA" design software to create the circuit and the PCB design.
Some other components: SW2 is the announce or talk button, when you press this it tells the microcontroller to read the current frequency setting and audibly announce it. SW3, SW4 & SW5 are presets. If you tune to a channel and press one of these for more than 3 seconds it writes that frequency in to permanent memory. Now if you momentarily press the button the radio goes to that frequency. These are reprogrammable at any time. By default, when you power on the radio it always tunes to the preset in preset number 1 set by SW3.
The microcontroller constantly scans rotary encoder ROT1. If it is turned it changes the radio frequency in 100KHz steps as is the standard basic increment used in channel spacing in North America. The current frequency is displayed on the LCD along with the received signal level in %. 100% being perfect reception, although levels far below this are perfectly clear. The display also shows the battery level and logic level (+5V) voltages on the LCD momentarily on power on.
Header H1 can be used to program the microcontroller on board the PCB, if you have a programming dongle. If not plug your ATMEGA328P into an Arduino Uno or other standard Arduino board and program it there then transfer it to the PCB. Potentiometers RP2 and RP3 can be used to adjust the announce and audio beep levels. Set these to midway and they should be just about right. I have left two small holes in the radio case above these pots, so they can be adjusted at anytime with a small screwdriver.
Prototype on Breadboard
I highly recommend that you build this on a breadboard first and control and power it with an Arduino Uno or similar board. Not only will you understand all the workings of it better, but you can test that all your components are working and get the program up and running on the Arduino . Also if you prefer a different way of doing things you can experiment on your own with rewiring the circuit. Maybe for example you don't want a rechargeable battery, then you can eliminate the whole section of circuit in the lower left of the circuit diagram. But you better check your modifications with a breadboard circuit first, at least that would be my advice. See the attached photo of my breadboard test setup.
Circuit and PCB Design
As mentioned, this was designed in EasyEDA software. The PCB was manufactured by PCBWay. www.pcbway.com. The good people at PCBWay were kind enough to sponsor this project. They did a beautiful job on the PCB; see it in the pictures and video. It looks really professional and I'm extremely pleased with the way it turned out. In the accompanying pictures you can see a photo of the PCB design as well as the finished PCB. Thank you PCBWay!
Some of what PCBWay offers:
One of the most established PCB manufacturers in China:
1.Quick quotation. Obtain an initial quote within seconds using the online ordering system.
2.Exceptional Service. You can always reach out to the live customer service team anytime you have queries.
3.Great Value. The price are highly competitive globally, without compromising on quality.
4.Swift Delivery. Benefit from their expedited production services (24/48/72 hours) for urgent orders.
Populating and Wiring the PCB
Populate the PCB with all components first. Then add wires for the switches, rotary encoder, LCD, Power module etc. Remember that some items must be mounted in the case before the wires can be attached.
3D Printing the Radio Case
As part of the updates to the original project, I wanted to 3D print the radio case. Previously I had purchased generic plastic cases and they were expensive - usually in the $20 to $30 range. It was difficult to get the size I wanted and they don't look great. Drilling and cutting holes in them is very time consuming and it is hard to make it look nice. With 3D printing we can make a custom case with everything fitting properly and custom raised lettering on the case for each control to help the user. Also it's much cheaper - anywhere from 75 to 80% cheaper! I had to make a couple of attempts with prototypes to finally get it right. You can see my prototypes in the video and pictures. (As well as initial mistakes)
To design the radio case I used FreeCad. Although it is free and has great capability it has some issues. It is very buggy, throws out a lot of error messages, is not intuitive to use and is very unforgiving. Be aware of this if you are going to use it. I have attached my FreeCad and other design files if you want to use them or make modifications. There are two sets of files, one for the case and one for the back panel or lid. I have also included the FreeCad export file or .STL file as well as the gcode file from the Prusa Slicer software. If you don't want to bother with all that just load the gcode file into your printer and print it. Be aware that it is a long print job depending on the resolution you pick. My radio case print took about 32 hours at fairly high resolution. Use higher quality PLA filament for a good result.
You can find the Files associated with the design and production of the 3D printed case at the following link:
SNCarter/FM_Radio_with_Audio_Assist: This is an FM Arduino project
Calibration
The DKARDU 18650 Lithium Li-ion Battery Charger module has a very small adjustable potentiometer on it. It is CRITICAL that you adjust this potentiometer before you connect this module to any 5V circuitry! This module can output up to 28V which will destroy any 5V logic including the TEA 5767 radio module, the LCD, the PAM8403 and the microcontroller.
See the attached photo of the battery charging module. The potentiometer with the round Phillips head screwdriver receptacle just to the left of the USB-C connector is the control to adjust the output voltage.
To do this connect a 3.7V battery or power source to the module's B+ and B- terminals or plug in the the USB-C cable. Connect a voltmeter to the module's Vo+ and Vo- terminals and adjust the potentiometer so that you have a 5.0 Volt output. The ones I had came from the factory set to 6.7V which would have destroyed all the major components if I had not checked it first - an expensive mistake.
Next calibrate the Announce and Beep audio levels. You will need the radio completed to do this, so it is pretty much the last step. You can turn down the radio volume knob almost to zero while doing this procedure to make it easier to hear. While pressing the announce button to initiate an announcement adjust potentiometer RP2 at the top right of the PCB to a comfortable audio level. Approximately mid-way should be about right. Next while rotating the rotary encoder knob up and down, adjust potentiometer RP3 at the top right of the PCB to a comfortable audio level. Approximately mid-way should be about right. Next turn up the radio volume level to a comfortable level and initiate an announce and make sure you can hear it clearly. Same with the beep level. If not adjust RP2 and RP3 accordingly.
Next calibrate the Arduino ADC reading of the battery level. This is required because R16 and R17 are necessary to isolate the Arduino from the battery when the radio is off. R17 can be in the range of 1k to 10k. If you hear a clicking in the loudspeaker with the radio off and USB-C cable plugged in and charging the battery use a higher value for R17 and then calculate a correction factor to be used in the Arduino program. To do this first turn on the radio with the USB-C cable disconnected and then measure the present battery voltage with a DVM. This can be any value as long as it is above about 3.5 volts so the radio and Arduino are receiving sufficient power and voltage. Once you have this value, we'll call it Measured Voltage, record this value. Next turn the radio off and then turn it back on and see what the Battery Voltage says on the radio LCD screen at power on. This is the ADC Voltage as seen by the Arduino. Now determine a Correction Factor by dividing the Measured Voltage by the ADC Voltage. So Correction Factor = Measured Voltage/ADC Voltage. For example if the measured voltage is 4.0 Volts and the indicated ADC Voltage is 3.9 Volts then the correction factor is 4.0/3.9 = 1.025. Next put this correction factor into the Arduino code on line 172 0f the Arduino program. Save the program and load it into the ATMEGA328P.
Arduino Code
The Arduino code is fully commented. You should be able to mostly follow it. It uses the following libraries to control the radio module, LCD, speaking announcements etc. You need to place these in your own library using the Arduino Library Manager.
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,16,2);
#include <TEA5767.h>
#include <tea5767_core.h>
#include <Wire.h>
#include "Talkie.h"
#include "Vocab_US_Large.h"
#include <EEPROM.h>
CRITICAL STEP:
You need to load the Arduino program for this project into the ATMEGA328P twice. The first time you do, you MUST uncomment line 117 of the program so that this code is active. This is the first line in the Void setup {}. This line is:
//EEPROM.put(0, 99.1); EEPROM.put(10, 98.1); EEPROM.put(20, 97.3); //To PREPROGRAMME THE PRESELECTS USE THE FIRST TIME YOU PROGRAM THE ATMEGA 328P then reprogram without this line.
What this does is pre-program some useable frequencies into the pre-select button memory locations. Remember that on power up the radio draws its frequency information from the frequency in pre-select 1 or EEPROM location 0. If there is nothing in there it will draw a blank and no frequency will be programmed into your radio and it won't work, you will not see a frequency displayed on the LCD either.
Once you have done this, then comment out line 117 again and reprogram your ATMEGA328P a second time. Now that you have a dummy starting value for the frequency in memory you do not want to continuously write to memory every time the radio powers up, which is what will happen if this line is left active. The reason for this is that the ATMEGA328P only has so many read/write cycles to EEPROM memory before read/write ceases to function. The number of cycles allowed is huge but nevertheless will eventually run out.
Once you have done this the radio will have a default frequency to use on startup. From now on you may change the pre-set frequencies anytime you like by tuning to the frequency you want and holding down the pre-set button for more than 3 seconds.
Downloads
Modifications and Future Improvements
As mentioned in the video I had to make some minor modifications to the circuit on the PCB. I left a small work area on the PCB for this as with any initial PCB design there are bound to be items you forget about, things you don't notice on the breadboard version or errors you make etc. In this case I had an issue with power feeding back into the ATMEGA328P through the wire connected from the battery to an ADC pin. This was causing a clicking sound in the speaker when the radio was switched off and the USB-C power cable was connected and charging the battery. To fix this I added R16 and R17. I also forgot about C13 the 1000uF capacitor on the line to the speaker. So I added these in on the prototype PCB using the small work area I'd reserved for just such errors. I have already fixed these on the PCB Design files I'm giving you in this Instructable.
Another issue I have is with the quality of the Arduino Talkie sound or the announcement sounds. Using the Arduino Talkie library which uses older LPC technology produces robotic, noisy, scratchy audio and popping sounds. I don't like the sound quality at all. You could say it is adequate and get's the job done but it is not all that pleasant to listen to. It just does not sound quite ready for prime time. I've tried adding noise filtering capacitors and even a low pass filter but nothing works completely well because the issue is the original sounds produce by the Talkie library. So I'm planning on doing a version 2.0 of this radio soon. I plan to use a dedicated text to voice module to do this and it should have much better sound quality. So if you care about this, don't build this project yet, I will be working on it and I will have version 2.0 ready in a couple of months.
Additional Note on the Power Module
There is no pad with a hole on the DKARDU power module for the USB-C Vin+. However there is a flat pad on the bottom of the module that is connected to the USB-C Vin+. Solder your wire that goes to P7 pin 2 to this pad. See the picture, on my prototype this is the blue wire.
The quality of Lithium=Ion batteries is highly variable. There are a lot of knockoffs with poor quality build and dubious claims about battery capacity. These can be unsafe to use. Always use a battery from a well known and reputable company such as Sony, Panasonic, Molicell etc. They are more expensive but safer. Always select a battery with built in protection such as short circuit protection. Be aware that some batteries with protection will be longer than the standard 18650 65cm length so you will need a battery holder that accommodates this. And lastly, never leave a Lithium-Ion battery of any type charging unattended.