{{ phil_crump:boards:phil_avr_sensor_v3_top.png?200|Gerber Render}}
This is an AVR and RFM board designed for use as a cheap and simple UKHASnet Node.
It also features a 3.3V LDO, broken out AVR GPIO and connection for a switched Sensor.
**Layout Repository:** [[https://github.com/philcrump/UKHASnet-avr-sensor/tree/master/V3|github.com/philcrump/UKHASnet-avr-sensor/V3]]
* **[[https://raw.githubusercontent.com/philcrump/UKHASnet-avr-sensor/master/V3/Schematic.png|Schematic Image]]**
* **[[https://raw.githubusercontent.com/philcrump/UKHASnet-avr-sensor/master/V3/Layout.png|Layout]]**
==== Errata ====
* 470K and 100K should replace the 4.7M and 1M resistors in the ADC Divider. This is to reduce error caused by thermally correlated leakage current in the ADC input.
====== Potential Applications ======
===== Temp / Humidity Sensor =====
**Sensor Device:** DHT22
**Power Source:** 3x Asda Alkaline AA
**Antenna:** 8.2cm of wire connected to Antenna Pad
**Code:** [[https://github.com/UKHASnet/UKHASnet_Firmware/tree/master/arduino_sensor|github.com/UKHASnet/UKHASnet_Firmware/arduino_sensor]]
In this setup the node could be configured to transmit Temperature, Humidity and Battery Voltage every couple of minutes. Due to the powersaving used on the Microcontroller and Radio, as well as the switching of the DHT22 Supply, the expected battery life would be around 9 months.
===== Repeater =====
**Power Source:** 1x LiPO charged by Solar Panel
**Antenna:** SMA Dipole
**Code:** [[https://github.com/UKHASnet/UKHASnet_Firmware/tree/master/arduino_repeater|github.com/UKHASnet/UKHASnet_Firmware/arduino_repeater]]
In this setup the node is configured to listen, repeating other nodes that are heard and helping extend the network.
In addition the UART output could be enabled to allow an IP-connected device to upload packets to ukhas.net
====== Sensor Options ======
=== DS18B20 ===
{{ phil_crump:boards:sensor-v3-ds18b20-cropped.png?200|DS18B20 Wire-up}}
Accurate Temperature Sensor
**Datasheet:** [[http://datasheets.maximintegrated.com/en/ds/DS18B20.pdf|DS18B20]]
=== DHT22 ===
{{ phil_crump:boards:sensor-v3-dht22-cropped.png?200|DHT22 Wire-up}}
Cheap Humidity and Temperature Sensor
**Datasheet:** [[https://www.adafruit.com/datasheets/DHT22.pdf|DHT22]]
====== Power Source Options =======
=== 3x Alkaline AA Batteries ===
This is the cheapest and will work well for sensors where the average current draw is tiny, and so no recharging will be required.
=== 3x Ni-MH Rechargeable Batteries ===
This is the cheapest rechargeable solution. Research into easy methods of trickle charging Ni-MH is currently underway,
=== 1x 3.7V LiPO ===
If you're confined on space, LiPOs can give you the best energy density. Cells with protection circuits should always be used. You can charge these crudely from 5V solar panels using the very cheap USB LiPO chargers on ebay, however this doesn't appear to work well in winter.
* [[ideas:lipo_solar|Charging Lithium Batteries from Solar Panels]]
====== Antenna Options ======
The PCB has an SMA footprint with a plated through-hole, allowing a variety of options.
=== 1/4 wave Wire Whip ===
{{ phil_crump:boards:v3_board_with_antenna.jpg?140|1/4 Wave Wire Whip}}
This is the cheapest and easiest by far. Solder one end of the wire onto the center pad of the SMA footprint, then bend it vertically and cut so that you have a length of 8.2cm from the PCB surface.
The more exact the length, the better. Ideally you'd want to check it with an antenna analyser, however very few people own one suitable for 869 MHz.
This antenna does rely on a ground-plane. The PCB appears to perform this function adequately. You can extend the PCB using wires from the four corner Ground Pads.
=== SMA 1/4 wave ===
By soldering on an SMA socket, you can then purchase a factory-tuned version of the 1/4 wave wire whip. This is guaranteed to be the correct length and comes cased in plastic for durability.
This antenna does rely on a ground plane and if not mounted directly to the PCB, one should be provided.
eg. [[http://www.rfsolutions.co.uk/acatalog/info_FLEXI_SMA90_868.html|RF Solutions 869 MHz 1/4 wave Antenna]]
=== SMA Dipole ===
This also requires an SMA socket. The dipole is a lot more efficient than the 1/4 wave and does not rely on a ground-plane.
It is also a lot longer and may need additional mechanical support!
eg. [[http://www.rfsolutions.co.uk/acatalog/info_ANT_8WHIP3H_SMA.html|RF Solutions 869 MHz Dipole Antenna]]
====== Bill Of Materials (aka. BOM) ======
1x 28DIP ATMega328P
* [[http://uk.farnell.com/atmel/atmega328p-pu/mcu-8bit-atmega-20mhz-dip-28/dp/1715487|Farnell 1715487]] - £2.37 each
1x RFM69[H]W
* [[http://ava.upuaut.net/store/index.php?route=product/product&path=71_63&product_id=109|HAB Supplies (max 20mW)]] - £3.59 each
* [[http://www.hoperf.nl/RFM69HW|HopeRF (100mW)]] - € 3,22 each
1x TO-92 MCP1700 3.3V LDO
* [[http://uk.farnell.com/microchip/mcp1700-3302e-to/ic-v-reg-ldo-250ma-to-92-3/dp/1296588|Farnell 1296588]] - £0.26 each
===== Passives =====
6x 100nF 50V Cap
* [[http://uk.farnell.com/multicomp/mc0805b104k500a2-54mm/cap-mlcc-x7r-100nf-50v-rad/dp/2309020|Farnell 2309020]] - £0.029 each
1/4W Through-Hole Resistors
* 1x 100K
* 1x 470K
* 1x 10K
* 1x 4.7K (Required for DS18B20/DHT22)
===== Connectors =====
1x 6-pin ICSP Header
* [[http://uk.farnell.com/te-connectivity-amp/826925-3/header-tht-vertical-2-54mm-6way/dp/1248132|Farnell 1248132]] - £0.253 each (MOQ: 10)
1x JST-PH 2 Pin Socket
* [[http://uk.farnell.com/jst-japan-solderless-terminals/b2b-ph-k-s-lf-sn/header-top-entry-2way-2mm/dp/9491856|Farnell 9491856]] - £0.0884 each (MOQ: 10)
* Ready made leads available, eg. [[http://www.ebay.com/itm//281382971591|ebay]]
1x 28-pin DIP Socket (Optional)
====== Arduino Board Definition ======
==== 8MHz internal oscillator ====
sensorv3i.name=UKHASnet Sensor V3 (8MHz internal)
sensorv3i.upload.protocol=arduino
sensorv3i.upload.maximum_size=30720
sensorv3i.upload.speed=57600
sensorv3i.bootloader.low_fuses=0xE2
sensorv3i.bootloader.high_fuses=0xDA
sensorv3i.bootloader.extended_fuses=0x07
sensorv3i.bootloader.path=atmega
sensorv3i.bootloader.file=ATmegaBOOT_168_atmega328_pro_8MHz.hex
sensorv3i.bootloader.unlock_bits=0x3F
sensorv3i.bootloader.lock_bits=0x0F
sensorv3i.build.mcu=atmega328p
sensorv3i.build.f_cpu=8000000L
sensorv3i.build.core=arduino:arduino
sensorv3i.build.variant=arduino:standard
==== 8MHz Resonator (untested) ====
sensorv3.name=UKHASnet Sensor V3 (8MHz resonator)
sensorv3.upload.protocol=arduino
sensorv3.upload.maximum_size=32256
sensorv3.upload.speed=115200
sensorv3.bootloader.low_fuses=0xff
sensorv3.bootloader.high_fuses=0xde
sensorv3.bootloader.extended_fuses=0x05
sensorv3.bootloader.path=optiboot
sensorv3.bootloader.file=optiboot_atmega328.hex
sensorv3.bootloader.unlock_bits=0x3F
sensorv3.bootloader.lock_bits=0x0F
sensorv3.build.mcu=atmega328p
sensorv3.build.f_cpu=8000000L
sensorv3.build.core=arduino
sensorv3.build.variant=standard