by emilburzo · 10y ago · 0 comments
For comparison purposes, I just changed the 3 x AA batteries on my outside sensor[1], the batteries lasted for 13 months (again, in outside conditions, including a very harsh winter).
I'm planning to write a post one of these days, but the gist of it is:
- attiny84 (don't even think about using an Arduino)
- DHT22 sensor (looking into SHT7x for better accuracy, but they're expensive as hell)
- TX module (I went with 433MHz because of better penetration)
I made 4 of these sensors, powered by batteries, so I can put them anywhere (within range, of course).
They send the reading every 4..7 x 8 seconds[2], both to keep the frequency clear (as required by law, I think it was 95% of the time) and as a poor man's anti packet collision.
They all report to a master RX, which is connected via USB to my server (which is always on anyway).
A small parser reads from serial USB and saves it in Mongo.
From there I can see the data in a simple webapp[3].
Oh yeah, and as a bonus, I made another thing that intercepts the outside sensor and display it on a 7 segment display[4], which looks really cool (plus I don't have to open the web page to see what's it like outside)
[1] https://twitter.com/emilburzo/status/799886284730892288
[2] https://github.com/ambient-monitoring/node/blob/master/node....
[3] http://ambient.emilburzo.com/
[4] https://www.flickr.com/photos/eaglex/30242342623/in/datepost...
You can pick up an SHT21 for about $3 (breakout included) and Sensirion sell clip on IP-rated membrane covers for outdoor applications - you just need to build it into your housing and provide an o-ring.
http://uk.rs-online.com/web/p/temperature-sensor-accessories...
AFAIK the only difference between the SHT21 and SHT71 is the "packaging", they both use the same circuitry.
So SHT21 == SHT71 and SHT25 == SHT75.
> You can pick up an SHT21 for about $3 (breakout included) [...]
Any links? I've had a lot of trouble finding something with an "Arduino" friendly breakout in that price range.
http://www.ebay.co.uk/itm/Digital-SHT21-Humidity-And-Tempera...
You can even get a knockoff Sparkfun board (well it's open source, so not exactly knockoff):
http://www.ebay.com/itm/Breakout-HTU21D-Temperature-and-Humi...
I'd go for the first one though, it looks like it has a membrane cover and does all the level conversion for you (it's only 3V3 tolerant). For some reason the SHT7x is an order of magnitude more expensive, no idea why.
I have 8 of these, and they are up to 30%RH off - both in terms of their readings relative to each other, and relative to the true RH of a saturated salt solution[1]. Moreover, some of them have a strange "stickiness" to certain levels.
I've heard good things about the BME280, and that's what I intend to replace my DHTs with.
[1] See e.g. http://www.omega.com/temperature/Z/pdf/z103.pdf
http://www.kandrsmith.org/RJS/Misc/Hygrometers/calib_many.ht... does a pretty comprehensive review.
To get started with e.g. the tiny85 you just lookup the pinouts and connect the programmer, then change the settings in the Arduino IDE to use the programmer instead of serial. If you wanna get more advanced you can upgrade to ATMega's, but those really need an external crystal so it's more parts, but not that bad.
Final step is to stop using Arduino and move to using the native C SDK or even assembly. Make Magazine has a book on programming AVR's, I highly recommend it.
This article is a good starting point that walks you through how to duplicate an Arduino Uno on a breadboard. It's a bit old though so make sure to do some googling for more.
For me it made more sense, because using just 3 x AA I get about 5V so I don't have to use a voltage regulator (less power used).
That way I can also use the attiny's internal voltage reference to measure remaining battery life without any additional circuitry.
Plus the smaller package, no annoying red lights everywhere, etc.
> I would like to the next level and use ATTiny's directly but I have no real electronics experience, how did you get started ?
I started with zero experience as well.
I bought an Arduino, did the LED example and put it away for a year.
Then I found a 37 sensor kit[1], together with a breadboard[2] and some wires[3] and this wonderful wiki[4] and... everything was different, because I was doing real practical (albeit simple) things with it.
The rest was just experimentation and reading about it, which was easy once I've found my "spark".
See @gh02t's answer for the attiny part, I went the lowest friction way with using an existing Arduino to program the attiny84.
[1] https://www.amazon.com/Elegoo-Sensor-Module-Arduino-MEGA/dp/...
[2] http://eud.dx.com/product/solderless-breadboard-with-400-tie...
[3] http://eud.dx.com/product/chuangzhuo-male-to-male-male-to-fe...
RX+TX: http://eud.dx.com/product/geeetech-superheterodyne-3400-wire...
Temperature/humidity: http://eud.dx.com/product/arduino-dht11-digital-temperature-...
TX with more range (using it just for the outside sensor): http://eud.dx.com/product/zsd-t3-315-433mhz-ask-high-power-r...
Small breadboard: http://eud.dx.com/product/solderless-breadboard-with-400-tie...
Cables: http://eud.dx.com/product/chuangzhuo-male-to-male-male-to-fe...
Oh yeah, if you're from the US, I think you need to get the 315MHz version (instead of the 433MHz), so be sure to double check that.
In that case, you should get the attiny84 from anywhere reputable.
I got it from here: https://www.amazon.co.uk/gp/product/B00P4E2XUC
You are also going to need a battery holder: http://eud.dx.com/product/diy-4-5v-3-slot-3-x-aa-battery-hol...
And I'm using this arduino for the master RX hub: http://eud.dx.com/product/new-nano-v3-0-module-atmega328p-au...
And if you want to make your life easier, a little extractor tool: http://eud.dx.com/product/proskit-908-609-ic-chip-extractor-...
To program the attiny84, see @gh02t's post[1].
I opted for the use-another-Arduino-as-the-programmer method[2] -- I don't know if you can do it with the nano, I did it with an old Arduino Duemilanove I had laying around.
And here's a fritzing sketch[3] (ignore the fact that there are 4 batteries, the library didn't have a model for the 3 battery case holder).
If you need help with anything after they arrive, feel free to email me (email is on profile website).
[1] https://news.ycombinator.com/item?id=13068361
[2] http://highlowtech.org/?p=1695
[3] https://raw.githubusercontent.com/ambient-monitoring/node/ma...
The attiny85 can get to μA while sleeping.
Once I had two DS18B20 sensors (temp), one 1602 LCD (over I2C) and a PIR sensor to act as interrupt connected to a attiny85. One temp sensor shared the same pin with the I2C data line. I just had to make sure they weren't used at the same time.
This setup let me with two pins free, one of which I used as sink (ground) for the LCD, thus effectively being able to turn it off by pulling up the pin.
I'm using serial from ATTiny85 to a ESP8266 as my wireless transmitter already: https://i.imgur.com/vZzGGZL.png but the ESP itself is probably the root of the power problem.
I think they needed an extra timer that the attiny85 didn't have.
Attiny84 wasn't exactly plug and play either, as I had to adapt the Arduino libraries code to it, but at least all the hardware was there.