This is my second "Instructables" .As I like to make not very usefull things, here is my last project:
This a FM radio with Radio Text with a charging base and which can be monitored via Bluetooth and an Android APP
Therefore I will present you, the Arduino part,the Radio Text part and then the MIT App inventor part (This is the only way I am a skilled enough to build and Android APP)
With a supply voltage of 10;8 volt with AC supply and 9.6 with battery the max power is 2x 1.5/1.25 watt RMS which is widely enought
RMS (root mean square) power is the real power not like the other big numbers that are sold like watt music or peak power or anything else )
I guess 1.5 Watt RMS can be sold as 8 Watts in some shops!!!!!!
First the components needed :
1x Arduino Nano
1x FM radio module SI4703 from Sparkfun or equivalent (5v powered and 3.3V I2C with a 3 poles Jack that can be used as an antenna)
1x HC-06 Bluetooth module (warning the new software version 3.0 have a totaly different commands set (I put some comments in the code).
1x 4channels level shifter 3.3 <=>5 V
1x MC7805 5v DC convertor
1x 2200 µF 25V capacitor
2x 1N5404 3 Amp diods
2x 2N2222 transistors
1x 1Kohm resistor
1x 47 Ohm resistor
2x 3.3 KOhm resistors (for I2C bus pull-up)
3x 330 Ohm resistors (for the led's)
2x 6.8 KOhm resistors
1x 3.9 KOhm resistor
1x 20X4 LCD I2C bus
10x 680 Ohm resistors
1x Red LED (I had no more green!!) for the power supply
1x Yellow LED for the battery mode
1x Blue LED for the BT connection
4x (ON)-OFF-(ON) switches ( like for an electric car-window)
2x push buttons
1x ON/OFF switch
Other componenets for the Radio:
2x 100W 10CM 8 Ohm HP
1x 1m extendible antenna (around 75 cm is the good length for FM in Europe and US)
1x telephone plug that I used to make the contacts for the charging Base
1x 1N5404 3 Amp diod (on the battery contact to avoid smoke in case of mess with the ground or 12V contact)
1x 2X20 watts Power Amp (Any stereo Amp will fit as long as it is 12V) based on TDA2020 bought for 4 Euro
1x 8XAA battery coupler (to have min 9.6V)
Some 10mm and 4 mm plywood for the box
1x 12V 3Amp Power supply
1x little 3 digit /3 wires voltmeter
3 contacts (made withf the telephone plug)
1x 1N5404 3 Amp diod (on the 12V contact)
2 lever switches ( to power on the AC supply when the radio is on the charging base)
1x ON/OFF switch (to power off the charging base if needed)
Some 10mm and 4 mm plywood for the base
Altogether ,including plywood it is not more than 70€
Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.
Step 1: The 4703 Radio Part
First, a modification:
The module is supposed to use the headset cable as an antenna, in my project , it is not usefull, so we will have first to make a small modification in order to connect and external antenna
In this module the 3 poles jack ground is not connected directly to the ground but via an inductance (to stop FM frequencies ) and a capacitor to connect the FM frequencies to the antenna input of the SI4703.
So the best way is to connect directly the antenna to the ground pin of the jack and solder two cables for the audio ouput
To prevent any noises in the audio (especially from Bluetooth), I put the FM module in a small plastic box shielded with copper tape connected to the ground
The RDS/Radio Text protocol:
First, I want to thank Nathan Seidle as I was fully inspired by his program "TEST_FM" of june 2011
And, as agreed, I will be very happy to pay him a beer, if ,one of these days, he is lost in my small village in the deep end of Brittany!!
I used a lot of his program as I didn't want to use the existing libraries which are a little to big for the poor Nano memory space and also because it is always better to go deep in the possibilities of a component by diving directly in the registers
The main modification I made is for the RDS polling
I took advantage of the possibilty to trigger an interupt on GPI02 pin by setting the RDSIEN bit and GPIO2 value to 01
This will trigger an interupt on pin 3 of the nano
This prevents from polling the RDS register as it will trigger the Radio Text program only when the 4 char's group of radio text is available with no errors (non verbose mode)
To have a full radio text, we must gather at most 16 blocks of 4 char's ( registers RDSC/RDSB of group 2A or 2B) .I put a lot of information in the programm to explain what I did.
Here is a description of the Data registers for Radio text (RDSSA/RDSC)
in register RDSSB (block 2)
Value 4 in A3/0 indicates (text group)
B0 indicates A (64 char's) or B(32 char's) text ( in have never seen B text in use...........)
PT0 to PT4 is the index of 4 char's group (0 to 15)
PT5 should be used as text A/B indicator (meaning "this is a new text") but it's not always used like this depending on the Radio station ,so it is not useable for the Radio text program.
4 char's of the Radio Text are in RDSSC and RDSSD (block 3 and 4)
I advise you to read the very interesting document regarding RDS protocol in SI4703 =>AN243 from Silicon labs
I also reset the SKMODE bit in POWERCFG register (see SI4703 datasheet) to stay in the range of frequecy while seeking channels
Reading datashhet will help a lot to understand the code and all the registers handlings
Step 2: The Charging Base
Not very much things to add
The pictures can speak better.
Just added a 1N5404 diod on the 12 volts contact
1) to avoid problems in case battery contact touch the 12 volt contact when putting the radio on the base (but it never happened)
2) to low down the voltage level to 10.8 volt (there is also a diod on the motherboard) as the MC7805 can become a bit hot when going from 12V to 5 volt with 1 Amp current (I screwed a piece of iron as heatsink on the 7805)
I added a small 3 x7 segments voltmeter to indicate the battery load
This device is with 3 wires in order to lower the consumption (more than 1 Mega Ohm on the mesurment wire) which allows to keep the radio on the powered OFF base a long time without discharging the battery
2 lever switches are used to power OFF the AC supply when the radio is off the base ( to avoid having 12V on the contacts)
The box is made with plywood (before painting on the picture) I let you imagine how to make a beautifull box as mine is not very sexy!!!!!
I was very astonished but the charging base is running well and I never had smoke while landing the radio on it.............
Step 3: The Box
I guess anyone should like to do as he wants following his artistic capacities!!!!!
Anyhow I will explain shortly how I could build something which terribly looks like a toolbox
Front and rear are cut in 4 mm plywood 15x45 cm
top and bottom are 10 mm plywood 15x45 cm
Sides and the 2 internal partitions (2 2 places for HP and the components in the middle one) are 10 mm plywood 13x13 cm
On the front panel I made 2 x10 cm holes for the HP and a 14x14 square hole to insert the 15x15 2mm organic glass that I painted in black (adding after painting a transparent printed sticker on, but it is not so readable due to the black color behind)
I made 2 holes on the top:
one for the potentiometer of the Power Amp (to adjust the level if necessary) and also, as heat output
another for the antenna
on the rear panel I made 2 holes:
One for the USB plug (directly plug on the nano)
One 16mm for air cooling (the 14 mm hole of the potentiometer of the power Amp beeing the upper air cooling output)
the handle is made from a 12mm copper tube painted in black
All the components of the picture above find place in the central compartment (later I had to put the batteries in the left HP compartment because it was too near of the HC06 BT module in the main compartment)
Of course there must be something more sexy!!!!!
Step 4: The Arduino Part (schematics and Code)
I tried to put as much information as possible in the comments of the program.
Some more information
The Decode_TXT procedure is used by both Bluetooth procedure and switch procedure
some keywords are used by both procedures
v+ => to increase the volume
v- => to lower
f+ => to increase the frequency of a step of 100 Khz
f- =>to decrease
su+=> seek up
sd-=> seek down
prefu=> increase the preselected channel number
hello =>sent by the Android APP during bluetooth connection, the code sends back the status of the radio
bye => sent by the APP when BT disconnects
pow => sent by the radio to App in power supply mode (on the charging base)
bat => when in battery mode
lb => sent when battery level is too low (around 8 volt)
Bluetooth communication is secured by a control loop :
Each time the FM radio sends an information, a timer is started waiting for the "ok" answer by the android APP
in case of 3 errors (timer expired) the BT link is cut by the Radio. (this cuts also the link on Android side)
On the other side
When App sends a command, it waits for the answer from radio to send another command.
The get_RT procedure is launched when the RDS flag is set (after an interupt on pin 3)
here is the code (link to GITHUB)
The FM radio main board (in fact the SI4703 is apart in a shielded box):
The Front panel:
The Charging base:
The links to the Fritzing files :
Step 5: The Android App
Made with APP inventor
here are the links to GitHub
The app uses 2 clock timers :
1) for the bluetooth communication (100ms)
2) for flashing battery led when load is around 8 v (1000ms)
For the forst time you will have to pair the HC06 module with your smartphone or tablet.
I use TinyDB for saving the BT address of the HC06 module , the first connection the BT address button will be enabled and you will have to choose the HC06 in the list (for my part , I renamed the HC06 module in FM_RADIO)
In the App I not always used the percent for the size of the element , so there might be so disply problemes depending on the smartphone
Mine is a Galaxy note 3 so rather big screen........
So I spent a good time discovering this small but very efficient SI4703.
And took a lot of pleasure writing this instructables
Up to my next project