Introduction: Attiny85 RF Transmitter to Arduino Uno Receiver (Manchester Library /w Arduino 1.0)

For this project you will need:

  • Arduino Uno
  • Attiny85
  • 315 Mhz Transmitter
  • 315 Mhz Receiver
  • 10uF Capacitor
  • Bread Board
  • Bread Board Jumper Cables
  • Wire Jumper Cables

Step 1: Download Arduino Software, Attiny Support, and Manchester Radio Library

  1. The Arduino software can be found at this link:

http://arduino.cc/en/Main/OldSoftwareReleases

Extract the .zip file so that "arduino-1.0" is in your C://Program Files

2. The Attiny support is a little tricky to install. Go to the link below, download the .zip file and view the "README" in wordpad for detailed instructions

https://code.google.com/p/arduino-tiny/

3. I would like to thank this tutorial for the Manchester library, look for "EDIT (29/01/2012)" and click the "available here" link.

http://mchr3k-arduino.blogspot.fr/2012/01/wireless...

Step 2: Programming Attiny85 With Arduino As ISP

Before wiring the chip as depicted in the diagram, open Arduino 1.0 and open the ArduinoISP example and upload it to your Arduino Uno.

Make sure the correct board (tools>board>Arduino Uno) and programmer (tools>programmer>AVR ISP) are chosen

Wire the Attiny85 to the Arduino just as in the diagram. Make sure the 10uF capacitor is placed negative side to ground and positive side to "reset"

Next, choose the speed at which to program your Attiny85

tools>board>Attiny 85 @ 8 Mhz (internal oscillator; BOD disabled)

Then, make sure programmer is set to "Arduino as ISP"

tools>programmer>Arduino as ISP

When you are ready, click "Burn Bootloader" (tools>Burn Bootloader)

You may see these errors:

avrdude: please define PAGEL and BS2 signals in the configuration file for part ATtiny85

avrdude: please define PAGEL and BS2 signals in the configuration file for part ATtiny8

These errors are normal and the process worked


Now that your board is bootloaded, you may upload any programs you like.

Step 3: Transmitter and Receiver Code

This is the test transmitter code I used:

#include <manchester.h>

/*

Manchester Transmitter example
In this example transmitter will send one 16 bit number per transmission

try different speeds using this constants, your maximum possible speed will depend on various factors like transmitter type, distance, microcontroller speed, ...

MAN_300 0
MAN_600 1 MAN_1200 2 MAN_2400 3 MAN_4800 4 MAN_9600 5 MAN_19200 6 MAN_38400 7

*/

#define TX_PIN 0 //pin where your transmitter is connected

uint16_t transmit_data = 2761;

void setup() { man.setupTransmit(TX_PIN, MAN_1200); }

void loop() {
man.transmit(transmit_data); delay(200); }

This is the test receiver code I used:

#include <manchester.h>

/*

Manchester Receiver example

In this example receiver will receive one 16 bit number per transmittion

Try different speeds using this constants, your maximum possible speed will

depend on various factors like transmitter type, distance, microcontroller speed, ...

MAN_300 0
MAN_600 1 MAN_1200 2 MAN_2400 3 MAN_4800 4 MAN_9600 5 MAN_19200 6 MAN_38400 7

*/

#define RX_PIN 7

void setup() { Serial.begin(9600); man.setupReceive(RX_PIN, MAN_1200); man.beginReceive(); }

void loop() {
if (man.receiveComplete()) { uint16_t m = man.getMessage(); Serial.println(m); man.beginReceive(); //start listening for next message right after you retrieve the message } }

Step 4: Testing the Transmitter

First, program your Attiny85 with the transmitter code, then change the board setting to Arduino Uno and the programmer to "AVR ISP" then upload the receiver code to the Arduino.

Wire the Transmitter, Receiver, and Attiny85 so that they run off the Arduino's power. Then plug the Arduino into the computer and open the serial monitor. If the project is working correctly, you will see the code "2761" printed over and over in the window.