~/contents
433MHz RF Transmitter and Receiver Modules for Arduino
I have a few devices I’d like to ‘phone home’ occasionally with small bits of data. I wanted to see if I could have a few sensors transmit information via 433.92 MHz radio frequency. These modules are popularly used with the Radiohead Arduino library. The transmitter is a 3-pin module (GND, VCC, DATA OUT) and the receiver is a 4-pin module (GND, DATA IN, DATA IN, VCC), which has two interchangeable data pins. Some of these modules are sold with small coiled antennas.
In my preliminary testing the range was not far, the best distance I achieved was a couple of meters. These modules benefit from the addition of an antenna, which ideally is a length of wire an even fraction–0.5 or 0.25–of the wavelength. The frequency wavelength of 433Mhz is 69.28 centimeters. A quarter of that is 17.32 cm. The antenna should be soldered to the pad next to small coil on the receiver board. (On most boards, the pad is unmarked.)
Antony Cartwright has a series of videos on Arduino modules and he explains what can be done to improve the range of these RF modules. He recommends 5V, the addition of capacitors, and 2 straight antennas. I have since read you can provide additional power to the transmitters, up to 12V. Theoretically these little cheapy modules can transmit something like 30 meters.
Misadventures with RF Modules and ATTiny
I needed to set up a remote humidity sensor underneath the house. The signal has to travel through the floor, but the sensor location is conveniently close to an Arduino in the kitchen. I could use a Nano and an NRF24L01 module, but I wanted to see if I could pair these RF modules with an ATTiny. The NRF24L01 is SPI-only, requires 3.3V power, and takes up a lot of pins on the Tiny, so these RF modules could theoretically simplify matters.
One issue using RF on ATTiny is library support. I could not use Radiohead with a Digispark ATTiny85 board, nor could I get Manchester.h working. I found sui77’s rc-switch library works with ATTiny for transmitting, however, this library is actually for sending a code to remote controlled devices. For my case, all I needed to know was whether the humidity below the house was above or below 50 percent, which is as simple as sending a 1 or 0, but for testing I wanted to know the actual humidity reading and I had trouble sending the data over. I knew from this forum post someone else was able to do it, but with a different transmitter MCU.
I had a lot of challenges with these modules and the Digispark and ended up switching to a Nano, but I continued to have issues. After a lot of troubleshooting, including swapping out another set of modules, trying different boards, etc., I can’t really explain the behavior except to say the modules are flaky and unreliable and they ended up being a huge time sink for me. In a pinch, I might be willing to try them again for very short range if I had no other parts on hand, but they seem incredibly unreliable and not worth the effort.
Resources:
- https://lastminuteengineers.com/433mhz-rf-wireless-arduino-tutorial/
- https://randomnerdtutorials.com/rf-433mhz-transmitter-receiver-module-with-arduino/
- https://dronebotworkshop.com/433mhz-rf-modules-arduino/
- https://www.instructables.com/id/Receiving-and-sending-data-between-Attiny85/
- https://arduinodiy.wordpress.com/tag/manchester-code/
- https://arduino.stackexchange.com/questions/52558/attiny85-digispark-with-433mhz-rf-transmitter-not-working
- https://github.com/solarkennedy/digi-rc-switch
- https://github.com/sui77/rc-switch/wiki/HowTo_Receive
- https://forum.arduino.cc/index.php?topic=431826.15
- https://forum.arduino.cc/index.php?topic=451489.0
- https://forum.arduino.cc/index.php?topic=60239.0
- https://www.instructables.com/id/Attiny85-RF-Transmitter-to-Arduino-Uno-Receiver-Ma/
- https://crycode.de/diy-funk-wetterstation-mit-dht22-attiny85-und-radiohead
- https://github.com/adafruit/TinyDHT