This text explains how to reproduce the project. The first section presents the MMR-70 transmitter, how to open it and where to solder wires. The second section presents the hardware connections between the Trinket pro, the MMR-70, the 7-segments display and the two buttons. The last section presents the software and points you towards parts you might want to change (mainly pins configuration).
Read more after the break ;-)
---------- more ----------
Preparation of the FM transmitter
The MMR-70 is a plastic enclosure with no screws. You'll have to insert a blade or a screwdriver to open the case. If you look on the side, you'll see a strip of orange translucid plastic. Insert the blade between this orange plastic and the back if the module (the front is the side with the Walkman logo).
Once the case is open, the PCB can be removed easily. It should look like this (picture from the FMBerry project) :
You see that a lot of test points are available. Solder a wire on each of those test points :
- 1 GND
- 2 RESET
- 6 RDS Interrupt
- 8 SDA
- 9 SCL
- 13 Voltage Input
- 15 Audio Right
In this project, we use a monoaural sound sample. If you want to reuse the module for future projects, you can also solder a wire to '16 Audio Left'.
It might be easier to solder if you put a little solder on the test points and if you pre-tin the wires.
Connect the following test points to the Trinket Pro :
- Test point 1-GND to the GND pin
- Test point 2-Reset to the GND pin. It prevents the integrated Atmel MCU to start
- Test point 6-RDS Interruption to pin 8. This can be changed in the source code
- Test point 8-SDA to pin A4
- Test point 9-SCL to pin A5
- Test point 13-Voltage Input to the +3V pin
- Test point 15-Audio Right to pin 11. This can be changed in the source code of the PCM library
With those connections, you will have a working project but you will not be able to view or change the broadcast frequency.
We will now add the seven-segments display. Connect the following pins of the display to the Trinket pro :
- Pin + to the +3V pin
- Pin - to the GND pin
- Pin D to pin A4
- Pin C to pin A5
Finally, we add two buttons. For each button, connect a side of the button to the +3V pin. Connect one end of a 10 KOhms resistor to the other side of the button. Connect the other end of the resistor to the GND pin. Between the button and the 10 KOhms resistor, connect a 100 Ohm resistor and connect it to pin 3 for frequency down (pin 4 for frequency up). The pins can be changed in the source code.
The 10 KOhms is a pull-up resistor. The 100 Ohms resistor is optional and is here to protect the input pin in case it is incorrectly configured as an output.
If this text confuses you, here is a schematic :
/ +3V ------/ |----R10K---- GND | |----R100---- Pin 3 or 4
The code is avaible at the following address : http://wikisend.com/download/563348/TrollMaster3000.zip
The main file is TrollMaster3000.ino . It is fully commented so you should easily understand it.
In this file, you might be interested in changing the value of RDINT_pin, FREQUP_pin and FREQDOWN_pin. Those variables define the pins used on the Trinket pro for the RDS Interrupt signal and the two buttons.
The code uses the PCM library from High-low tech . It is included in the archive because I had to hack it in order to loop the sound sample. The hack is commented in the source code. The files are PCM.c and PCM.h . You might want to change the value of speakerPin in PCM.c . This variable defines the pin used on the Trinket pro to output the sound.
Finally, the file soundsample.h contains the sample from the 'trololo' song. The values have been generated by the EncodeAudio application from High-low tech (see link above). The input file must be a 8Khz .wav file. You can convert a wav file to this format with sox (sox in.wav -c 1 -r 8000 -u -1 out.wav).
I hope you will be able to reproduce this fun project. Do not hesitate to comment this post if you have any questions ! :-)