Hacker Newsnew | past | comments | ask | show | jobs | submit | kgs42's commentslogin

Thanks for this, first lecture looks cool!


Hi, maybe not entirely relevant for this topic - but maybe you guys have any idea how to build and cheap system which will gather temperature wireleslly to one place. Ideally I'd like to have 2 sensors (one inside and other outside, with own batteries) which will send data to some central device.

I have home server on MacMini - so WiFi could be option. Any ideas?

I've always wanted to build something like this which - but always ended calculations that are rather expensive and devices are relatively big.


Hi kgs42,

I've actually created such a setup, I have 3 battery powered temperature sensors built on Arduino Pro Minis, they all communicate with a central RPi node via NRF24L01 transceivers, and the node then sends the different temperatures to a server via GSM. The sensors are pretty cheap to make, and if you put them in a sealed box they last for months without recharging the batteries (Currently 7 month battery life on 4 x AA batteries)

Here is some of the sensor code: https://github.com/cuonic/Arduino-NRF24L01-Thermometer


Hi kgs42,

the already mentioned ESP8266 is definitely the way to go. Have a look at [1]. for some example circuits. [2] shows how to connect multiple sensors.

[1] https://www.aisler.net/projects?query=esp8266&src=hn_1 [2] https://www.aisler.net/projects/7890


How about running a http server on the mac exposing restful api, and using something like ESP8266 + temperature sensor, sending basic http requests to the server every minute or so? Should be much cheaper than arduino.


but I have to connect ESP8266 to something (Arduino?) or is it standalone device?


standalone :) some inspirations for you http://hackaday.com/2015/09/05/esp8266-web-server-farm/ http://www.instructables.com/id/ESP8266-Wifi-Temperature-Log...

If you end up working on it, feel free drop me an email, I'm really curious about the result :)


ok, thanks :)


Be careful with that "Instructables" article. The author powers the ESP8266 from the Arduino's 3.3V power out pin. The ESP8266 can want to use more current than the Arduino is rated to supply.

I've looked at a few "Instructables" articles on ESP8266 and Arduino, and a large fraction of them seem to have this issue.

Another issue many of them that use a 5V Arduino have is that they ignore the difference between the logic levels of the 5V Arduino and the 3.3V ESP8266. For the connection from the ESP8266 UART Tx to the Arduino Rx, that's probably fine. The ESP8266 will drive the line to 3.3v, and that is high enough for the Arduino to recognize it as high on the Rx line, as long as you are powering the Arduino through the USB port or through the barrel jack (I'm using Arduino Uno for my examples, so some adjustment may be needed for other models).

If you are powering through the 5V pin, which bypasses the 5V regulator on the Arduino, then you could have a problem if your voltage is high. The minimum voltage seen as a logic 1 on the input pins goes up as supply voltage goes up, and since you are already near the edge when hooking an 3.3V ESP8266 up directly, you have to be careful.

For the connection the other way, Arduino UART Tx to ESP8266 UART Rx, you are putting a 5V signal on a pin that's supposed to only take up to 3.3V. The ESP8266 has built-in protection against over-voltage which probably will save you, but this is not good practice.

Simplest fix here is to use a 1k and 2k resistor to make a voltage divider for the Arduino Tx -> ESP8266 Rx signal. Note that this only works for going from the higher voltage side to the lower voltage side. That's fine here, since on the Tx->Rx connection only the Tx side drives the line.

If you have to hook different voltage I/O pins together and both sides can drive, you need something more elaborate. There's a cool solution that uses two resistors and a MOSFET. That, and some others, is given here [1].

[1] http://electronics.stackexchange.com/questions/97889/is-ther...



I am doing something similar to this. My setup includes multiple temperature sensors in addition to a Raspberry Pi thermostat which controls my heating system. The thermostat also acts as a HomeKit server, and so can be controlled using Siri - which is really just a fun party trick more than anything else.

(I know Nest and Ecobee can probably do all of this out of box -- my reasons for building this were just to tinker and learn)

Here's what I use:

Sensors:

Since these are likely to run on batteries, you'll need to choose a platform with allows for low enough power consumption that you aren't draining the batteries too quickly. This is suitable for the microcontroller-based options (Arduino, ESP8266, NodeMCU, Particle), but not for R-Pi (due to too-high power consumption). In addition to the platform, your code will also need to take advantage of power saving opportunities, like going to sleep and disabling battery-draining radio services like WiFi, waking up periodically to take a measurement, enable WiFi and emit the metric before going back to sleep.

For my temperature sensors, I chose to the $19 Particle Photon [1] for the following features:

  - Built-in WiFi
  - Built-in REST API (goes through Particle's cloud REST API)
  - Add a temperature sensor like TMP36 [2] to it and your sensor hardware is done.
Thermostat:

For this I use a Raspberry Pi (plugged into wall power) + a relay breakout board to interface with my heating system. My thermostat needs to periodically do things like access google calendar, keep a log of temperature data, to run a HomeKit server [3] [4], and to be ever-ready to respond to REST requests from the internet (eg. IFTTT). So, it's more like a real server, for which RPi was much more appropriate.

Data Storage:

Many options here. Take a look at Phant [5] from SparkFun form something quick and simple.

[1] https://store.particle.io/collections/photon

[2] https://www.sparkfun.com/products/10988

[3] https://github.com/KhaosT/HAP-NodeJS

[4] https://github.com/nfarina/homebridge

[5] https://learn.sparkfun.com/tutorials/pushing-data-to-dataspa...


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: