*Completed* Arduino Temperature Monitor

thenanoreef

Active Member
View Badges
Joined
Feb 27, 2014
Messages
218
Reaction score
90
Location
United States
Rating - 0%
0   0   0
A few months ago I came on here asking for help with an Arduino aquarium monitor only to find that the crossover between the reefing and Arduino is extremely slim. So a few weeks of research later I am back with my Arduino Temperature Monitor. Now, before I show pictures, let me tell you that what I built is an over glorified digital thermometer, so don't get your hopes up. I will say however this project could be expandable to read PH, Salinity, water level, etc. However, considering I somehow fried the USB connection on the board, an Arduino UNO, I will not be doing any expanding (unless I upgrade to the mega). I have pictures and the code below. I will also include the parts you need. Overall the price to build it was around $35, so its a nice little project if you are interested in this kind of stuff.

FullSizeRender 7.jpg FullSizeRender 8.jpg

The Code

//YWROBOT
//Compatible with the Arduino IDE 1.0
//Library version:1.1
[HASHTAG]#include[/HASHTAG] <Wire.h>
[HASHTAG]#include[/HASHTAG] <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x3F,20,4); // set the LCD address to 0x27 for a 16 chars

[HASHTAG]#include[/HASHTAG] <OneWire.h>

int DS18S20_Pin = 2; //DS18S20 Signal pin on digital 2

//Temperature chip i/o
OneWire ds(DS18S20_Pin); // on digital pin 2


void setup(void) {
Serial.begin(9600);

lcd.init(); // initialize the lcd
lcd.init();
// Print a message to the LCD.
lcd.backlight();
lcd.setCursor(0,0);
lcd.print("Jack's Reef");
lcd.setCursor(0,1);
lcd.print("Temp:");
}

void loop(void) {
float temperatureInCelcius = getTemp();
float temperatureInFahrenheit = (temperatureInCelcius * 1.8) + 32.0;
Serial.println(temperatureInFahrenheit);
//just here to slow down the output so it is easier to read
lcd.setCursor(7,1);
lcd.print(temperatureInFahrenheit);
}


float getTemp(){
//returns the temperature from one DS18S20 in DEG Celsius

byte data[12];
byte addr[8];

if ( !ds.search(addr)) {
//no more sensors on chain, reset search
ds.reset_search();
return -1000;
}

if ( OneWire::crc8( addr, 7) != addr[7]) {
Serial.println("CRC is not valid!");
return -1000;
}

if ( addr[0] != 0x10 && addr[0] != 0x28) {
Serial.print("Device is not recognized");
return -1000;
}

ds.reset();
ds.select(addr);
ds.write(0x44,1); // start conversion, with parasite power on at the end

byte present = ds.reset();
ds.select(addr);
ds.write(0xBE); // Read Scratchpad

for (int i = 0; i < 9; i++) { // we need 9 bytes
data = ds.read();
}
ds.reset_search();
byte MSB = data[1];
byte LSB = data[0];

float tempRead = ((MSB << 8) | LSB); //using two's compliment
float TemperatureSum = tempRead / 16;
return TemperatureSum;
}


Item list:
x1 Arduino UNO (or mega)
x1 I2C LCD screen (I used an Arrela 16x2)
x1 DS18B20 Temp Probe (water proof obviously)
x1 bread board
x1 4.7k ohm resistor
x7 male to male jumper wires
x4 male to female jumper wires

There you have it. A really simple, and cool little project. Enjoy and good luck!!!

thenanoreef
 

twilliard

Tank pests..
View Badges
Joined
Jun 3, 2015
Messages
10,333
Reaction score
9,499
Location
Central Washington
Rating - 0%
0   0   0
Nice!!
by chance can you set it up for a relay output?
interested in controlling a heater that doesn't use a 2 degree swing.
high temp low temp programming?
 
OP
OP
thenanoreef

thenanoreef

Active Member
View Badges
Joined
Feb 27, 2014
Messages
218
Reaction score
90
Location
United States
Rating - 0%
0   0   0
Twilliard, the short answer is yes. But, you need to be careful with all of the power consumption and distribution. You would need to do some tests to make sure you can successfully power a 150-200 watt heater through the processor or relay board itself. I'm pretty sure it has been done before and if you are really interested I would got the Arduino Forum to see what other people have done.

thenanoreef
 

twilliard

Tank pests..
View Badges
Joined
Jun 3, 2015
Messages
10,333
Reaction score
9,499
Location
Central Washington
Rating - 0%
0   0   0
Thank you!
I don't want to power the heater but rather run a relay from it based on setpoints
 
OP
OP
thenanoreef

thenanoreef

Active Member
View Badges
Joined
Feb 27, 2014
Messages
218
Reaction score
90
Location
United States
Rating - 0%
0   0   0
Yes I understand that, but in order to run a relay the power and ground from the heater goes to the relay and then the relay goes to the micro-controller
 

Brstock513

New Member
View Badges
Joined
Aug 6, 2015
Messages
3
Reaction score
1
Rating - 0%
0   0   0
In the process of building one now but using a combination of a Raspberry Pi and Arduino. Arduino simply handles the signals to the devices. Raspberry Pi handles the software. Currently controls a 7 strand DIY Led lights with full dimming on each channel, 7 outlet plug system, 4 temp probes (light heat sink, tank, sump and ambient) and two water level sensors in the sump, emails me status every 2 hours, and streams video I can access on my phone when I'm away.

I actually built a heater/fan control using an STC-1000 (on amazon) before I started the controller so that handles the control to two heat outlets and two cooling outlets. For the heater question above you would need to wire an outlet to a relay and control the relay with the Ard based on the temp sensor. Wire the outlet to an old computer cord and plug in to supply power to the outlets and the relay interrupts the circuit to turn on and off the outlet. The ground referenced above is for the arduino and will have to loop back to the arduino from the relay which is why I only have 7 controlled plugs, the 8th wire of the network cable handles the ground loop. I wish I had time to post pictures and the like but they can be found in the DIY forum of www.care4reefs.com (new to this forum, hopefully I can post that address.)

For the arduino code above you can use the dallas temperature library to make your life easier. Also something to note is that you can connect multiple temp sensors like the one you are using to the same pins. They will maintain their own address and the dallas libary will help you get the temp from each. I can't remember if there is a limit to the number but I have two running on a single pin. I believe there isn't a limit to the number although you would eventually end up with a voltage issue so I stuck to two on each. I just got done learning how to do everything I want to do so now I'm beginning to rebuild it from scratch and document everything and inventory the supplies needed although I will not post the wiring details because I'm not an electrician and the last thing I want is for someone to get hurt or worse kill their fish ;) .
 

cosmith71

New Member
View Badges
Joined
Jun 11, 2013
Messages
10
Reaction score
1
Location
Oklahoma City
Rating - 0%
0   0   0
A few months ago I came on here asking for help with an Arduino aquarium monitor only to find that the crossover between the reefing and Arduino is extremely slim.

The Reef Angel controller is Arduino based and open source. It uses those same temp probes.

I like this stand alone version. I trust these probes for general use more than I do the cheap aquarium thermometers.
 

Kungpaoshizi

Valuable Member
View Badges
Joined
Jan 22, 2014
Messages
1,309
Reaction score
513
Location
Earf
Rating - 0%
0   0   0
Just got the RA myself, check out GitHub for the libs.
Pretty surprised the Arduino is faster than the Apex..
 

kevindo123

Active Member
View Badges
Joined
Nov 9, 2013
Messages
316
Reaction score
62
Rating - 0%
0   0   0
I have entire arduino setup if interested.
temp/ph/relay controllable 6 outlets/battery backup/ independent dosing schedules calcium and alk/fan control/wifi/ OLED display /remote monitoring and control via your ipad/iphone etc..

I have been running it for almost a year now and have no problems. Let me know if you are interested.
 
OP
OP
thenanoreef

thenanoreef

Active Member
View Badges
Joined
Feb 27, 2014
Messages
218
Reaction score
90
Location
United States
Rating - 0%
0   0   0
@kevindo123 I would definitely like to see your work. But sounds far to complex for me. The inspiration for the project was a couple of big diy controllers on youtube, but I just am not skilled enough, nor do I have the time to program something that large scale.

On a side note. For all of you who read this thread, I do not recommend the clone board that I go. It was fried within a week. smh.

Now I'm either going to get a real UNO or maybe even a clone mega, we will see.

thenanoreef
 

kevindo123

Active Member
View Badges
Joined
Nov 9, 2013
Messages
316
Reaction score
62
Rating - 0%
0   0   0
@kevindo123 I would definitely like to see your work. But sounds far to complex for me. The inspiration for the project was a couple of big diy controllers on youtube, but I just am not skilled enough, nor do I have the time to program something that large scale.

On a side note. For all of you who read this thread, I do not recommend the clone board that I go. It was fried within a week. smh.

Now I'm either going to get a real UNO or maybe even a clone mega, we will see.

thenanoreef

You should go with a Yun or Mega+Yun combo. I'm currently using a Yun, below is the memory size. Yun+Mega will allow you to develop even more advance features (my current project). The reason for Yun is you can setup a web server so you can get a web interface to interact with the arduino reef controller (eg change dosing schedule, change temperature, turning on/off relays - very convenient for water change).


Build options changed, rebuilding all

Sketch uses 24,968 bytes (87%) of program storage space. Maximum is 28,672 bytes.
Global variables use 1,886 bytes (73%) of dynamic memory, leaving 674 bytes for local variables. Maximum is 2,560 bytes.


Here is some pics I just took:
https://www.flickr.com/photos/95992624@N03/shares/M460F4
https://www.flickr.com/photos/95992624@N03/shares/9062o5
 
Last edited:

marciomrqz

Community Member
View Badges
Joined
Feb 18, 2014
Messages
44
Reaction score
3
Location
Canada
Rating - 0%
0   0   0
You should go with a Yun or Mega+Yun combo. I'm currently using a Yun, below is the memory size. Yun+Mega will allow you to develop even more advance features (my current project). The reason for Yun is you can setup a web server so you can get a web interface to interact with the arduino reef controller (eg change dosing schedule, change temperature, turning on/off relays - very convenient for water change).


Build options changed, rebuilding all

Sketch uses 24,968 bytes (87%) of program storage space. Maximum is 28,672 bytes.
Global variables use 1,886 bytes (73%) of dynamic memory, leaving 674 bytes for local variables. Maximum is 2,560 bytes.


Here is some pics I just took:
https://www.flickr.com/photos/95992624@N03/shares/M460F4
https://www.flickr.com/photos/95992624@N03/shares/9062o5
Hey, been thinking of ordering the parts to make my own controller. The ability to host a server for Web based control is exactly what I've been looking for. Was thinking of using raspberry pi but been reading that arduino is better for a reef controller. Would love to see more of your work and parts you've collected to build your masterpiece.

I'd like to create a controller to control temp, Ph, ato, dosing pumps, lights and Web cam.
 

kevindo123

Active Member
View Badges
Joined
Nov 9, 2013
Messages
316
Reaction score
62
Rating - 0%
0   0   0
Let me know if you need help. My setup is super reliable. I'm planning to sell my Neptune controller as my arduino based controller does pretty much the same thing. And it's very customizable and can do everything you mentioned and more. You just need some programming experience and can solder.
 

marciomrqz

Community Member
View Badges
Joined
Feb 18, 2014
Messages
44
Reaction score
3
Location
Canada
Rating - 0%
0   0   0
Let me know if you need help. My setup is super reliable. I'm planning to sell my Neptune controller as my arduino based controller does pretty much the same thing. And it's very customizable and can do everything you mentioned and more. You just need some programming experience and can solder.
Right on. I have a little programming experience using excel. Lol. But I'm tech savvy so should be able to learn quickly. As for soldering, I'm comfortable doing that.

Would you mind posting some pictures of your controller and such?
 

rajkovich207

Well-Known Member
View Badges
Joined
Feb 5, 2012
Messages
880
Reaction score
91
Location
northern suburbs of chicago
Rating - 0%
0   0   0
Actually you shouldn't need much programming experience. In theory if you know the code for the part you are using you could get away with using the wizard tool on the RA site to write your program and just change the code to your parts.

Nano did you by chance get the knockoff board from banggood.com? I've been eyeballing several adruino things from them. They actually have an uno clone for less then $5.
I order from them regularly for rc parts only down side is shipping takes forever unless you can find it in their USA wh.
 

rajkovich207

Well-Known Member
View Badges
Joined
Feb 5, 2012
Messages
880
Reaction score
91
Location
northern suburbs of chicago
Rating - 0%
0   0   0
+1 I'd love more info on your controller, I've wanted to build my own for a long time and after getting more exposure to programming from the flight control boards we use in our drones I'm a lot less leary of it.
 

marciomrqz

Community Member
View Badges
Joined
Feb 18, 2014
Messages
44
Reaction score
3
Location
Canada
Rating - 0%
0   0   0
Actually you shouldn't need much programming experience. In theory if you know the code for the part you are using you could get away with using the wizard tool on the RA site to write your program and just change the code to your parts.

Nano did you by chance get the knockoff board from banggood.com? I've been eyeballing several adruino things from them. They actually have an uno clone for less then $5.
I order from them regularly for rc parts only down side is shipping takes forever unless you can find it in their USA wh.
Not sure if your familiar with Aliexpress.com but they have anything and everything you could think of. Iv ordered a lot of other things from them and never any issues. They have a lot of arduino stuff and it's super cheap. Comes from China, so it will take about 2 to 5 weeks for delivery to Canada.
 

Ingenuity against algae: Do you use DIY methods for controlling nuisance algae?

  • I have used DIY methods for controlling algae.

    Votes: 40 48.8%
  • I use commercial methods for controlling algae, but never DIY methods.

    Votes: 17 20.7%
  • I have not used commercial or DIY methods for controlling algae.

    Votes: 19 23.2%
  • Other.

    Votes: 6 7.3%
Back
Top