Gamebuino Thermometer and cool outside air alert

Show us your Gamebuino clone or the last module you made.

Gamebuino Thermometer and cool outside air alert

Postby lastfuture » Sat Jul 25, 2015 1:38 am

Hi,

I've already asked for input in the project guidance section but since it's complete now I'd like to present this little hack here.

Image

I've combined my Gamebuino with two DS 1820 digital temperature sensors to make a thermometer that compares outside to inside temperature and sounds alarms when it's time to let cool outside air in or when to close the windows once it's cooler inside.

Quick demo:


The DS 1820 digital temperature sensors use the 1-wire protocol so I'm just connecting them to the I2C ports for convenience, not to actually talk I2C (1-wire also allows multiple parallel devices on one bus, which is why I connected one sensor to each port)

Here's the data sheet for the DS1820 and the 1-wire Library and Dallas Temperature Control Library.
The wiring I used is straight forward: GND to I2C GND, VDD to I2C 3V3 and DQ to I2C SDA (which is A4 or Pin 18 respectively)
then just include the libraries in the sketch and set up with the right pin
Code: Select all
#include <OneWire.h>
#include <DallasTemperature.h>
#define ONE_WIRE_BUS 18 // Pin 18 / A4 SDA of I2C
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);

and then read the temperatures like so
Code: Select all
sensors.requestTemperatures();
temp_outside = sensors.getTempCByIndex(0);
temp_inside = sensors.getTempCByIndex(1);

(there's also a handy Fahrenheit conversion function)

Since the 1-wire library can address the sensors by index and the order is determined by their unique id the port I plug each of them into is irrelevant.

Image

I weatherproofed both sensors with the help of a friend who had some molding silicone left over, but next time I'll try coating them in nail polish instead because I assume that's going to dampen the temperature response less than millimeters of silicone.

Curious to hear your thoughts on this or any tips and improvements.
-- Peter
lastfuture
 
Posts: 29
Joined: Mon Jul 14, 2014 7:20 pm

Re: Gamebuino Thermometer and cool outside air alert

Postby Sorunome » Sat Jul 25, 2015 8:47 am

This is looking quite interesting!
What are the advantages of OneWire over I2C? (As in, why did you chose that one)
User avatar
Sorunome
 
Posts: 629
Joined: Sun Mar 01, 2015 1:58 pm

Re: Gamebuino Thermometer and cool outside air alert

Postby lastfuture » Sat Jul 25, 2015 11:57 am

Initially I wanted to use a simple thermistor and just map voltage to temperature. I found out that I can't get good accuracy from that.
I then looked around for I2C temperature sensors and just found breakout boards or surface mount chips which I can't solder. I found that too bulky/difficult for my purpose
The local electronics shop happened to recommend the DS 1820 sensor to me, it won me over because I only need 3 pins (or even only 2 when using parasitic power, but I played it safe) and it's a very compact part with no breakout board that's easy to coat and hang out the window without a case.
lastfuture
 
Posts: 29
Joined: Mon Jul 14, 2014 7:20 pm

Re: Gamebuino Thermometer and cool outside air alert

Postby Sorunome » Sat Jul 25, 2015 12:07 pm

Sounds nice!
Might be good to advertise the gamebuino that it also supports OneWire ^.^
User avatar
Sorunome
 
Posts: 629
Joined: Sun Mar 01, 2015 1:58 pm

Re: Gamebuino Thermometer and cool outside air alert

Postby lastfuture » Sat Jul 25, 2015 7:12 pm

Yeah the I2C ports' built in 4k7 pull-up resistors are perfect because that's exactly what the 1-wire bus expects, too.
lastfuture
 
Posts: 29
Joined: Mon Jul 14, 2014 7:20 pm


Return to Hardware Gallery

Who is online

Users browsing this forum: No registered users and 20 guests

cron