Just another Arduino weather monitor
Just a quickie project, mostly consisting of smushing Adafruit modules and eBay modules together in hardware, and a few choice libraries in software.
I’ve moved to Canada and I have a garage with mains power. I’ve never been through this kind of winter before, so I thought it would be interesting to log the inside and outside temperature and outside barometric pressure.
While there is power, there’s no connectivity in the garage, so I’m following in the footsteps of some of my friends back in England, and using a pair of Nordic nRF24 modules to establish a reliable radio link.
The source code to the whole thing is on GitHub, and it depends on the RF24 and Adafruit Sensor libraries.
I tested my set up by starting with low power amplifier settings on the radios and using an example sketch provided with the library. It might seem like setting power to the maximum is the best, but that also puts the most load on your 3.3V voltage regulator, and some Arduinos and clones don’t deal well with that.
Luckily, I was able to verify that mine does, and use that. I also only transmit at 250Kbps, which results in acceptable performance at higher ranges.
Sensor Node
Arduino Pin | BMP180 Pin | nRF2401+ Pin |
---|---|---|
GND | GND | GND |
VCC | VCC | - |
3.3 | - | VCC |
7 | - | CE |
8 | - | CSN |
11 | - | MOSI |
12 | - | MISO |
13 | - | SCK |
A4 | SDA | - |
A5 | SCL | - |
Receiver Node
Arduino Pin | nRF2401+ Pin |
---|---|
GND | GND |
3.3 | VCC |
7 | CE |
8 | CSN |
11 | MOSI |
12 | MISO |
13 | SCK |
Reading the Output
As long as the Receiver node can pick up the signal from the Sensor node, you’ll get regular data output over the USB serial:
picocom --baud 9600 /dev/ttyUSB0
...
OHAI
P1022.41T4.30
That’s 1022.41 hPa and 4.30C outside.
Because I have a local Graphite install, I can just send metrics to
127.0.0.1:2003
with a tiny Ruby script, which parses the serial output
and spits Carbon formatted data over TCP to my Graphite install.