434MHz RF Transmitter with the Trinket |
Parts List
Temperature Sensor and RF Transmitter:
Click here to get the code for this project ...
Serial Communications on the Trinket
The Trinket doesn't have is a serial interface like most Arduino boards have. Fortunately there are ways around it! With a little research, I found there are three main methods being used to get serial communications with the Trinket:
- Use Virtual Wire to simulate it. I tried a couple of versions of this but I could not get this to compile. Some people also seem to write their own implementation of this.
- Use Software Serial to turn a couple of pins into an RX/TX. The plus side of this is that it works! The downside is that it takes a lot of memory so you may not have much room left for other stuff if you use this. Pulling in the Software Serial put the size of the Transmitter/Temperature reading sketch up to 5,058 bytes, which still fits on the Trinket!
- Another option - use the UsiSerial library posted by Frank Zhao to implement a hardware serial port. The upside of this is a much smaller foot print! Using the UsiSerial, my compiled sketch is only 3,666 bytes! Plenty of room left! Unfortunately, while this compiled and loaded, it didn't work. Maybe because I am using the 3 Volt Trinket? The notes say it was tested on the 16MHz trinket which I believe is the one with 5 Volt Logic.
Circuit Setup
434MHz RF Transmitter Connections:
GND -> Ground on Trinket
DataIn -> Software Serial TX pin 1 on Trinket
Vcc -> 3V from Trinket
ANT -> 13 cm wire used as an antenna
GND -> Ground on Trinket
DataIn -> Software Serial TX pin 1 on Trinket
Vcc -> 3V from Trinket
ANT -> 13 cm wire used as an antenna
TMP36 Connections:
Vcc -> 3.3V on Trinket (TMP36 Pin 1 on left when looking at flat side of sensor)
Vout -> Pin 2/AnalogRead(1) on Trinket (TMP36 Center Pin)
Gnd -> Ground on Trinket (TMP36 Pin 3 on right when looking at flat side of sensor)
No comments:
Post a Comment