Using Node red on Raspberry Pi with Temperature sensor and IR blaster

2,029 views
Skip to first unread message

Giles Roadnight

unread,
Apr 29, 2016, 5:58:00 AM4/29/16
to Node-RED
Hi All

I am pretty new to Node Red and Raspberry pi but I am loving the possibilities and want to get as many things as I can hooked up and automated.

I want to have a Pi in my bedroom that records the temperature and when it gets too hot turns on my air con using an IR blaster.

I would have thought that adding a temperature sensor to a raspberry pi would be dead simple but they all seem to involve bread boards and circuit diagrams. I want this to be installed in my bedroom so I don't want breadboards with electronic components sticking out...

Is there a neat PCB that I can just plug into my pi without having to have a breadboard - or even a USB sensor.

I have found this IR blaster:


which connects to a pi with a pi to arduino bridge.

Does anyone have any idea how I would control this from node-red?

What I am trying to do here must have been done before. Does anyone have any tips on the best approach?

Many Thanks

Giles

Julian Knight

unread,
Apr 29, 2016, 7:41:03 AM4/29/16
to Node-RED
Well, if you can get away with just an IR LED then all you really need is the LED and a resistor - it doesn't get much simpler than that. If you want some freedom, solder the resistor to the LED itself and attach wires (you need 2). The wires will need to end in plugs that fit over the GPIO pins on the Pi. You can buy ready-built wires off eBay or wherever. You might want to get some heat-shrink too - use it to hide the bare wires and make everything neat.

This shows you a really simple setup:

For the sensor, probably the easiest setup is to get an I2C temperature sensor as this requires minimal wiring. Attach in a similar way to above. Don't skimp on the sensor, the cheap ones are rubbish, inevitably several degrees out and too variable.

Obviously you will have some wires sticking out but with heat-shrink wraps it's fairly easy to make things fairly tidy and doing it that way gives you scope for positioning the pi, the sensor and the IR blaster in convenient places.

Dave C-J

unread,
Apr 29, 2016, 7:49:43 AM4/29/16
to node...@googlegroups.com
Yes - the DS18B20 is cheap enough on ebay - either as a chip like those ir sensors or in a metal case  - https://www.google.co.uk/search?q=ds18b20
yes needs one extra resistor to be done properly but that can be hidden in shrinkwrap / sticky tape :-)

Julian Knight

unread,
Apr 29, 2016, 7:55:38 AM4/29/16
to Node-RED
Looking at the link you gave, that is a very expensive solution! It will cost you EUR70 if you use their bridge. Even then, it looks like you would have to program the IR side using C++ as you would with an Arduino. It would be a LOT cheaper just to buy an Arduino Nano and connect it over USB to the Pi - you can then talk to the Arduino using the Serial function of the Pi and NR. Alternatively, it is possible that the Jonny-Five library would help you.

You really want a native Pi addon if you are going to buy something. However, taking a quick look, it seems as though HVAC control might be somewhat time-sensitive and the Pi isn't good at that because it has to handle the whole of the Linux OS. Microcontrollers are good at that however which is why most if not all of the write-ups on how to do this hand the control off to an Arduino or similar.

It does look possible to record the IR sequence for HVAC controls as long as you have the original remote - though maybe not that easy. 


On Friday, 29 April 2016 10:58:00 UTC+1, Giles Roadnight wrote:

Julian Knight

unread,
Apr 29, 2016, 8:14:14 AM4/29/16
to Node-RED
This seems a good write-up on getting HVAC control working on a Pi: https://www.stavros.io/posts/how-turn-your-raspberry-pi-infrared-remote-control/

Giles Roadnight

unread,
Apr 29, 2016, 8:34:16 AM4/29/16
to Node-RED
Thanks for the replies guys. It seems that it's not going to be as simple as I had hoped. Given that I typically only have a few hours a months to play with this sort of stuff I think it'll be a while before I can make much progress.

--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+u...@googlegroups.com.
To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.
For more options, visit https://groups.google.com/d/optout.

Julian Knight

unread,
Apr 29, 2016, 9:59:07 AM4/29/16
to Node-RED, gi...@roadnight.name
I know that feeling! I've been fortunate to have some more time recently but it comes and goes.

Start with the sensor and build from there.

Dave C-J

unread,
Apr 29, 2016, 10:50:53 AM4/29/16
to node...@googlegroups.com
well the Pi Sensehat has temperature amoung many others... https://www.raspberrypi.org/products/sense-hat/
so as usual it's the time/effort/value tradeoff

Giles Roadnight

unread,
Apr 29, 2016, 11:08:05 AM4/29/16
to node...@googlegroups.com
Fantastic, that looks great. I suppose I'd probably have to write nodes to communicate with these sensors?

Thanks for the link.

On Fri, Apr 29, 2016 at 3:50 PM Dave C-J <dce...@gmail.com> wrote:
well the Pi Sensehat has temperature amoung many others... https://www.raspberrypi.org/products/sense-hat/
so as usual it's the time/effort/value tradeoff

--

Nicholas O'Leary

unread,
Apr 29, 2016, 11:13:29 AM4/29/16
to Node-RED Mailing List
You could write your own... or use ours: http://flows.nodered.org/node/node-red-node-pi-sense-hat

Nick

Giles Roadnight

unread,
Apr 29, 2016, 11:23:40 AM4/29/16
to Node-RED Mailing List
brilliant. this looks great. Just need to figure out the IR now.

Patrick Murray

unread,
Nov 8, 2017, 9:33:59 AM11/8/17
to Node-RED

Jan Van den Audenaerde

unread,
Nov 8, 2017, 10:26:18 AM11/8/17
to Node-RED
Hi Giles,

Regarding the temperature sensor.

I managed to connect the bme280 sensor (= cheap) to my raspberry pi.

Besides temperature, it also gives you humidity and barometric pressure.

The following link tells how you can link it to the pi (no resistors or breadboard needed!)

I think I have also used the following in node-red (need to check) : https://github.com/andreiva/raspberry-pi-bme280

Assure that the sensor is not too close to the pi as the pi is also producing heat.

kr
Jan

Julian Knight

unread,
Nov 9, 2017, 3:04:58 PM11/9/17
to Node-RED
The bmp280 is the same without the pressure sensor. They are great sensors and I'm replacing (slowly) all those rubbish DHT11's and DHT22's
Reply all
Reply to author
Forward
0 new messages