Go Down

Topic: RF link display using the ATtiny85 (Read 17 times) previous topic - next topic


I wanted to display my weather station data in other rooms in my house without using wires:


I chose a simple and cheap(AUD5.6 for tx/rx pair) 433.92 MHz link:


They are really only meant for things like a garage door controller.

The frequency response is very limited, I run them at 2000 b/sec.

I use VirtualWire(modified) library for the Transmitter which uses a ATmega328:



//Transmitter. Sends integer as 2 bytes once per second

#include <VirtualWire.h>
#undef round

uint16_t data =0;  //the integer to send

void setup()
    vw_setup();    // 2000 Bits per sec

void loop()
    data +=1;
    uint8_t number[2] ;
    number[0] = data;
    number[1] = data >> 8;  //send 2 bytes
    vw_send(number, 2);
    vw_wait_tx(); // Wait until the whole message is gone
    delay(1000);  //send every second

I further modified this library to get VirtualWireTiny library to work with the ATtiny85.
It handles receive only at 2000 b/sec.

The display is 4 digits of 7 segments. I use my SEVENtiny library.


The receive code is very simple for the ATtiny85 RX:


//Receiver. Waits to receive two bytes. Displays the integer.

#include <SEVENtiny.h>
#include <VirtualWireTiny.h>
#undef round

void setup()
    vw_setup();    // 2000 Bits per sec
    vw_rx_start();       // Start the receiver PLL running
}//end of setup

void loop()
    uint8_t buf[VW_MAX_MESSAGE_LEN];//message length defined as 12 bytes
    uint8_t buflen = VW_MAX_MESSAGE_LEN;
    vw_rx_start();       // Start the receiver PLL running
    if (vw_get_message(buf, &buflen)) // Non-blocking
         uint16_t data = buf[1]; 
         data =(data << 8) | buf[0];       
     }//end of got data
}//end of loop

This code only uses 1756 bytes of Flash.

To program the ATtiny85 I use:


The lfuse must be set to 0xE2.

Download tinyRFlink.zip from:



Cool project!

I can think of some ways to use an affordable RF link at 2000 b/s
Occasional activity,
sporadic progress


Thanks theepdinker.

It does have some limitations like I cant use it to monitor my Oregon weather station.

It uses 433.92 but needs a 10 kb/s to get an output.


Why you used modified library for the ATmega328 Transmitter? This lib works on it perfectly (at least for me.).


Yes it works perfectly for me to when I use a 328(with xtal) to TX and a 328(with xtal) to RX.

When I used a ATtiny85 with an internal clock for RX I got a lot of dropouts.
I guessed it was because the setting of Timer1 in VirtualWire was not quite right.

I tried using Timer2 in the 328 transmitter and this seemed to give much more reliable results.

Go Up