4 ms·
> I built one of these temperature loggers and gave it 3xAA but it never lasts more than 2 weeks For comparison purposes, I just changed the 3 x AA batteries o
by emilburzo 10y ago
> I built one of these temperature loggers and gave it 3xAA but it never lasts more than 2 weeks
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 https://twitter.com/emilburzo/status/799886284730892288
[2] https://github.com/ambient-monitoring/node/blob/master/node.ino#L130 https://github.com/ambient-monitoring/node/blob/master/node....
[3] http://ambient.emilburzo.com/ http://ambient.emilburzo.com/
[4] https://www.flickr.com/photos/eaglex/30242342623/in/dateposted-public/ https://www.flickr.com/photos/eaglex/30242342623/in/datepost...
- andmarios 10y agoThis. Or Attiny85 with external programmer and then read the microcontroller's datasheet to see how you can enable various sleep modes. The attiny85 can get to μA while sleeping.
- cuonic 10y agoThere aren't enough IO pins on an Attiny85 to measure the temperature and send it to another device wirelessly, right ?
- sprobertson 10y agoThere are - two for power, two for the DHT sensor, two for RX TX, and you even have one left over (not counting reset pin) I'm using serial from ATTiny85 to a ESP8266 as my wireless transmitter already: https://i.imgur.com/vZzGGZL.png https://i.imgur.com/vZzGGZL.png but the ESP itself is probably the root of the power problem.
- andmarios 10y agoIt has 6 pins you can use which should be more than enough. 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.
- emilburzo 10y agoThere are enough pins, the actual reason I didn't go with the Attiny85 is because of the Arduino libraries I'm using. 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.
- joshvm 10y agoDo you really need an SHT7x? The SHT21 has a datasheet accuracy of ±2% RH and ±0.3C compared to the SHT75 which has ±1.8% RH and ±0.3C. The repeatability of both units is the same (±0.1%RH, ±0.1C. The '21 also consumes about 5 times less power in sleep mode and 3 times less in measurement mode. 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/8854704/?origin=PSF_421367|acc http://uk.rs-online.com/web/p/temperature-sensor-accessories...
- emilburzo 10y ago> Do you really need an SHT7x? 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.
- joshvm 10y agoAlways eBay for this kind of thing http://www.ebay.co.uk/itm/Digital-SHT21-Humidity-And-Temperature-Sensor-Module-Replace-SHT11-SHT15-UK-CF-/272041588659?hash=item3f56f137b3:g:SSgAAOSwcUBYLps5 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-Humidity-Sensor-Module-Temperature-Sensor/162242594396 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.
- cuonic 10y agoI've used an Arduino to do more or less the same thing, well I mean a cheap knock-off arduino mini from AliExpress, and an NRF24L01 module for data transmission, I get about 6 month battery life with 4 AA batteries (1200 mAh each) using the devices outside (also in harsh conditions) so Arduino isn't that bad. I would like to the next level and use ATTiny's directly but I have no real electronics experience, how did you get started ?
- gh02t 10y agoNot OP, but the ATTiny is pretty easy to work with because it doesn't need much in the way of external parts. You need an AVR programmer, but you can use an Arduino flashed with the AVR programmer sketch or buy a cheap tinyISP for ~$10. I recommend investing in a programmer but do NOT get a usbASP (usually the cheapest around $5 for clones), they suck. Spring for the $10 clone tinyISP's or one of the legit Adafruit/Arduino/Sparkfun ones. 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. https://www.arduino.cc/en/Main/Standalone https://www.arduino.cc/en/Main/Standalone
- emilburzo 10y agoThat's pretty good actually, I wasn't able to get over 1 month with all the (software) power saving techniques that I found. 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/B009OVGKTQ https://www.amazon.com/Elegoo-Sensor-Module-Arduino-MEGA/dp/... [2] http://eud.dx.com/product/solderless-breadboard-with-400-tie-point-white-844121534 http://eud.dx.com/product/solderless-breadboard-with-400-tie... [3] http://eud.dx.com/product/chuangzhuo-male-to-male-male-to-female-female-to-female-arduino-dupont-cable-3-x-40-pcs-844278367 http://eud.dx.com/product/chuangzhuo-male-to-male-male-to-fe... [4] https://tkkrlab.nl/wiki/Arduino_37_sensors https://tkkrlab.nl/wiki/Arduino_37_sensors
- sprobertson 10y agoIt sounds like the 433MHz TX module is the big win here, instead of using the ESP8266... I do like having the direct-to-internet connection but it probably makes more sense to have one hub that does that.
- justinsaccount 10y agoThat's neat, I'd like to build something like that. I'm more of a raspberry pi+linux kind of person though.. do you have individual links for each of those parts? The linked code seems straightforward enough, but I wouldn't know what to buy to start with.
- emilburzo 10y agoI don't know if these work for raspberry pi, but that's what I'm using: RX+TX: http://eud.dx.com/product/geeetech-superheterodyne-3400-wirelesss-receiver-433mhz-rf-transmitter-kit-green-844370793 http://eud.dx.com/product/geeetech-superheterodyne-3400-wire... Temperature/humidity: http://eud.dx.com/product/arduino-dht11-digital-temperature-humidity-sensor-844138531 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-rf-transmitter-module-yellow-844228289 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-point-white-844121534 http://eud.dx.com/product/solderless-breadboard-with-400-tie... Cables: http://eud.dx.com/product/chuangzhuo-male-to-male-male-to-female-female-to-female-arduino-dupont-cable-3-x-40-pcs-844278367 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.
- justinsaccount 10y agoWhat about the attiny84 thingy itself?
- emilburzo 10y agoI misunderstood your first post, I thought you wanted to replicate the setup on a raspbpi. In that case, you should get the attiny84 from anywhere reputable. I got it from here: https://www.amazon.co.uk/gp/product/B00P4E2XUC 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-holder-case-box-with-leads-black-844322311 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-improved-version-for-arduino-yellow-844369070 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-removal-puller-tool-green-silver-844184206 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 https://news.ycombinator.com/item?id=13068361 [2] http://highlowtech.org/?p=1695 http://highlowtech.org/?p=1695 [3] https://raw.githubusercontent.com/ambient-monitoring/node/master/node_breadboard.png https://raw.githubusercontent.com/ambient-monitoring/node/ma...
- z2210558 10y agoIt's not just the DHT22's accuracy that's a problem, it's the calibration. 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.omega.com/temperature/Z/pdf/z103.pdf
- gh02t 10y agoSame, I had a lot of trouble with the DHT22 calibration, for temperature as well. And it was nonlinear, so I couldn't just add a correction. I switched to a mix of BME280, Si7021 and DS18B20s. Si7021 is pretty similar to the DHT22 in terms of nominal specs, but it's much better and cheaper. http://www.kandrsmith.org/RJS/Misc/Hygrometers/calib_many.html http://www.kandrsmith.org/RJS/Misc/Hygrometers/calib_many.ht... does a pretty comprehensive review.
- deleted 10y ago[deleted]