SolarRC: Difference between revisions
Jump to navigation
Jump to search
(A very inexpensive and simple solar powered ATtiny circuit to collect data from the environment.) |
No edit summary |
||
| Line 1: | Line 1: | ||
== | == Description == | ||
A | A quite inexpensive and simple solar powered [http://www.atmel.com/products/microcontrollers/avr/tinyavr.aspx AVR ATtiny] circuit to collect data from the environment. | ||
== Overview == | |||
== transmitter == | We've tested the following hardware: | ||
* RF Wireless Transmitter & Receiver Kit Module (433 MHz) [http://www.aliexpress.com/item/New-RF-Wireless-Transmitter-Receiver-Kit-Module-433Mhz-for-Arduino-ARM-MCU-WL-fWu/32246292651.html ordered at AliExpress for US $0.99] | |||
* Solar Panel 5V / 260mA [http://www.aliexpress.com/item/1pcs-solar-panel-5V260mA-travel-portable-cell-phone-charger-LED-lights-DIY-Solar-Controller/1866615924.html at AliExpress for US $5.19] | |||
* LiPo battery 1000mah [http://www.aliexpress.com/item/Universal-3-7V-20C-1000mAh-Li-Po-Battery-Spare-Part-RC-Accessories-for-RC-Quadcopter-Wholesale/2044301059.html ordered at AliExpress for US $4.73] | |||
* LiPo Rider Pro [http://www.aliexpress.com/item/LiPo-Rider-Pro-development-board-Stable-5V-USB-power-supply-regardless-of-source-POW12059P/1855452128.html ordered at AliExpress for US $14.95] | |||
In combination with: | |||
* 2x Arduinos (on the same computer, good for debugging via serial monitor) | |||
* 2x ATtiny85 (great for final devices, placed somwhere outside) | |||
Software: Those two Arduino libraries were tested successfully: | |||
* [https://github.com/cano64/ManchesterRF ManchesterRF] (only that one works on the ATtiny!) | |||
* [https://code.google.com/p/rc-switch/ RCSwitch] (doesn't work on the ATtiny) | |||
Tests showed that it is possible to transmit data reliably indoor up to a distance of about 20 meters. The signal gets weaker, depending on the obstacles between sender/receiver of course. To improve the signal quality it was helpful to use a simple wire on stick of 17.3cm in length (quarter wavelength) as an antenna on both, sender/receiver modules. | |||
== TODO == | |||
* Measure power consumption and average solar charging rate... is it possible to run the device non-stop, also during the night, collecting data? | |||
* Investigate more about low power usage/sleep mode... and energy harvesting in general. | |||
* What's the minimal number of parts/price needed to shrinkify the the whole setup to a single board? | |||
* Mesh network with receiver/transmitter pair (transceiver) on every node? Can the nodes be used as "relays" to increase transmission range? What kind of protcol is ideal for this? How to minimize collisions/corrupted data (send checksum)? Does it make sense ($$$) compared to XBee, BLE, WiFi etc.? | |||
* It is possible make a very simple radio transmitter, by using just the internal oscillator of the microcontroller! Have a look at this '''great hack [http://www.swharden.com/blog/2011-08-06-ridiculously-simple-avr-mcu-am-radio-transmitter/ by Scott W Harden]'''. To receive the data, a [http://www.radio-electronics.com/info/rf-technology-design/am-reception/diode-detector-demodulator.php diode detector] could be used to demodulate the AM signal and read it in again on an analog pin... but this is just fantasy, no clue if/how/how good this will work, we'll see... | |||
== Setup == | |||
== Code == | |||
=== Transmitter === | |||
<pre> | <pre> | ||
| Line 53: | Line 88: | ||
== | === Receiver === | ||
<pre> | <pre> | ||
Revision as of 19:15, 6 May 2015
Description
A quite inexpensive and simple solar powered AVR ATtiny circuit to collect data from the environment.
Overview
We've tested the following hardware:
- RF Wireless Transmitter & Receiver Kit Module (433 MHz) ordered at AliExpress for US $0.99
- Solar Panel 5V / 260mA at AliExpress for US $5.19
- LiPo battery 1000mah ordered at AliExpress for US $4.73
- LiPo Rider Pro ordered at AliExpress for US $14.95
In combination with:
- 2x Arduinos (on the same computer, good for debugging via serial monitor)
- 2x ATtiny85 (great for final devices, placed somwhere outside)
Software: Those two Arduino libraries were tested successfully:
- ManchesterRF (only that one works on the ATtiny!)
- RCSwitch (doesn't work on the ATtiny)
Tests showed that it is possible to transmit data reliably indoor up to a distance of about 20 meters. The signal gets weaker, depending on the obstacles between sender/receiver of course. To improve the signal quality it was helpful to use a simple wire on stick of 17.3cm in length (quarter wavelength) as an antenna on both, sender/receiver modules.
TODO
- Measure power consumption and average solar charging rate... is it possible to run the device non-stop, also during the night, collecting data?
- Investigate more about low power usage/sleep mode... and energy harvesting in general.
- What's the minimal number of parts/price needed to shrinkify the the whole setup to a single board?
- Mesh network with receiver/transmitter pair (transceiver) on every node? Can the nodes be used as "relays" to increase transmission range? What kind of protcol is ideal for this? How to minimize collisions/corrupted data (send checksum)? Does it make sense ($$$) compared to XBee, BLE, WiFi etc.?
- It is possible make a very simple radio transmitter, by using just the internal oscillator of the microcontroller! Have a look at this great hack by Scott W Harden. To receive the data, a diode detector could be used to demodulate the AM signal and read it in again on an analog pin... but this is just fantasy, no clue if/how/how good this will work, we'll see...
Setup
Code
Transmitter
/*
Manchester Receiver example
In this example transmitter will transmit two 8 bit numbers per transmittion
*/
#include "ManchesterRF.h" //https://github.com/cano64/ManchesterRF
#define TX_PIN 3 //any pin can transmit
#define LED_PIN 13
ManchesterRF rf(MAN_300); //link speed, try also MAN_300, MAN_600, MAN_1200, MAN_2400, MAN_4800, MAN_9600, MAN_19200, MAN_38400
uint8_t data = 0;
boolean state = false;
void setup() {
pinMode(LED_PIN, OUTPUT);
digitalWrite(LED_PIN, HIGH);
rf.TXInit(TX_PIN);
Serial.begin( 9600 );
}
void loop() {
int a, b;
rf.transmitByte(a = ++data, b = data*data);
digitalWrite(LED_PIN, state); //blink the LED on receive
state = !state;
Serial.print( a );
Serial.print( ", " );
Serial.print( b );
Serial.println();
delay(500);
}
Receiver
/*
Manchester Receiver example
In this example receiver will receive two 8 bit numbers per transmittion
*/
#include "ManchesterRF.h" //https://github.com/cano64/ManchesterRF
#define RX_PIN 4 //any pin can receive
#define LED_PIN 13
ManchesterRF rf(MAN_300); //link speed, try also MAN_300, MAN_600, MAN_1200, MAN_2400, MAN_4800, MAN_9600, MAN_19200, MAN_38400
uint8_t a, b;
boolean state = false;
void setup() {
pinMode(LED_PIN, OUTPUT);
digitalWrite(LED_PIN, HIGH);
rf.RXInit(RX_PIN);
Serial.begin( 9600 );
}
void loop() {
if (rf.available()) { //something is in RX buffer
if (rf.receiveByte(a, b)) {
//process the data
//...
digitalWrite(LED_PIN, state); //blink the LED on receive
state = !state;
Serial.print( a );
Serial.print( ", " );
Serial.print( b );
Serial.println();
}
}
}