Heater for small fish bowl

Been working on the code for a fish bowl heater to keep my Betta fish from getting too cold in the winter months, as it gets pretty cold up here.

He has a small bowl which is good for him, being solitary, and Bad for Goldfish (its true. goldfish in bowls is bad, give them room and keep em clean :wink: )

I plan on twinning it up with my light system later but for now i’m keeping them separate.

the general idea is:

thermsistor set in the water and delivers value back on A0,
depending on the value (in this case min is 85 and max is 92, turns out to be ambient temperatures of around 21 - 24 degrees C
24C being a good temp for the fish, so that was it max

but i make sure it doesnt fall below 21 or 22, if it does, on comes the heat in the form of a pad made up of a disk of tin with a peltier heat pump under it stuck with heat transfer material, and surrounded with rubber pads the same thickness as the pump. resting on a pad of foam to make a sandwich (pics later). The bowl sits on top of this.

this is the code i cobbled together from examples i looked at:

/*

Will start and stop a peltier device in a pad under a fish bowl
depending on what the value of the thermsistor returns from
the water temprature and then display a status message 
onto the LCD (2x16) 
 
 The circuit:
 * LCD 1 GND
 * LCD 2 VCC
 * LCD 4 RS pin to digital pin 12
 * LCD 6 Enable pin to digital pin 11
 * LCD 11 D4 pin to digital pin 5
 * LCD 12 D5 pin to digital pin 4
 * LCD 13 D6 pin to digital pin 3
 * LCD 14 D7 pin to digital pin 2
 * LCD 3 VO pin to GND
 * LCD 15 + LED
 * LCD 16 - LED
 
 * Thermsistor to +5 and A0 and A0 resistor to gnd
 * LED D13
 * Heatpump D10
 
 LCD Library and code borrowed from:
  http://www.arduino.cc/en/Tutorial/LiquidCrystal
 */

// include LCD library
#include <LiquidCrystal.h>

// initialize pins and initial value
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
int sensorPin = 0;
int ledPin = 9;
int heatPin = 10;
int sensorValue = 0;

void setup() {
  // set up the LCD, and pins 
  lcd.begin(16, 2);
  pinMode(ledPin,OUTPUT);
  pinMode(heatPin,OUTPUT);
  //Blink to show startup
  digitalWrite(ledPin, HIGH);
  digitalWrite(heatPin, LOW);
  delay(35);
  digitalWrite(ledPin, LOW);
  
  
}

void loop() {
  lcd.setCursor(1, 0);
  lcd.print("-FishFishHeat-");
  lcd.setCursor(13, 1);
  lcd.print(sensorValue);
 sense(); // sensor input
 if (sensorValue <= 85){
   heatOn(); // start heatpump
 }
 else {
    lcd.setCursor(5, 1);
    lcd.print("is OK");
 }
 
 if (sensorValue >= 92) {
   heatOff(); // stop heatpump
 }
  // Turn on the display:
  lcd.display();
  delay(500);
  lcd.clear();
  
 
 /* // trying to havve a '*' displayed on the lcd 
    // while the heater is on...
  if (heatPin == HIGH){
  lcd.setCursor(0, 1);
  lcd.print("*");
  }
  */
  
}

void sense() { // sensor input
  sensorValue = analogRead(sensorPin);
}

void heatOn() { // start heatpump
   digitalWrite(ledPin, HIGH);
   digitalWrite(heatPin, HIGH);
   lcd.setCursor(1, 1);
   lcd.print("is Min Temp");
}

void heatOff() { // stop heatpump
   digitalWrite(ledPin, LOW);
   digitalWrite(heatPin, LOW);
   lcd.setCursor(1, 1);
   lcd.print("is Max Temp");
}

what i would like to do is have the lcd display a * while the heater is active like the led is, but attempts have failed me so far.

tests are good tho, am yet to test on some actual water. thats next. :slight_smile:

updates as i go.

Cool beans! Sounds like a very doable option for regulating fish bowl temperatures! Thanks for the code and everything, can't wait for pictures (to see how exactly you have the Peltier unit placed. If I remember correctly, those things can get pretty darn hot! :)

For LCD help, You may want to take a look at the Liquid Crystal Library Tutorial.

thanks XD

For LCD help, You may want to take a look at the Liquid Crystal Library Tutorial.

i think thats where i got all my lcd code XD

i think its more of a getting the state of the pin and using that to toggle it on screen. was kinda tired by then tho XD

will try looking up pin states and seeing if i can botch summin up for it :3

the peltier will only be getting 5v supplied to it so it shouldn’t get too hot anyway.

i think thats where i got all my lcd code XD

Punches Forehead. I admit I obviously didn't read through the code very thoroughly XD!

worked out the * display bit for when the heater is on :slight_smile:

updated code bellow:

/*

Will start and stop a peltier device in a pad under a fish bowl
depending on what the value of the thermsistor returns from
the water temprature and then display a status message 
onto the LCD (2x16) 
 
 The circuit:
 * LCD 1 GND
 * LCD 2 VCC
 * LCD 4 RS pin to digital pin 12
 * LCD 6 Enable pin to digital pin 11
 * LCD 11 D4 pin to digital pin 5
 * LCD 12 D5 pin to digital pin 4
 * LCD 13 D6 pin to digital pin 3
 * LCD 14 D7 pin to digital pin 2
 * LCD 3 VO pin to GND
 * LCD 15 + LED
 * LCD 16 - LED
 
 * Thermsistor to +5 and A0 and A0 resistor to gnd
 * LED D13
 * Heatpump D10
 
 LCD Library and code borrowed from:
  http://www.arduino.cc/en/Tutorial/LiquidCrystal
 */

// include LCD library
#include <LiquidCrystal.h>

// initialize pins and initial value
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
int sensorPin = 0;
int ledPin = 9;
int heatPin = 10;
int sensorValue = 0;
int state = 0;

void setup() {
  // set up the LCD, and pins 
  lcd.begin(16, 2);
  pinMode(ledPin,OUTPUT);
  pinMode(heatPin,OUTPUT);
  //Blink to show startup
  digitalWrite(ledPin, HIGH);
  digitalWrite(heatPin, LOW);
  delay(35);
  digitalWrite(ledPin, LOW);
  
  
}

void loop() {
  lcd.setCursor(2, 0);
  lcd.print("FishFishHeat");
  lcd.setCursor(13, 1);
  lcd.print(sensorValue);
 sense(); // sensor input
 if (sensorValue <= 85){
   heatOn(); // start heatpump
 }

 else {
    lcd.setCursor(5, 1);
    lcd.print("is OK");
 }
 
 if (sensorValue >= 92) {
   heatOff(); // stop heatpump
 }
  // Turn on the display:
  lcd.display();
  delay(125);
  lcd.clear();
  
 if (state == 1){
  lcd.setCursor(0, 0);
  lcd.print("*");
  lcd.setCursor(15, 0);
  lcd.print("*");
 } 
}

void sense() { // sensor input
  sensorValue = analogRead(sensorPin);
  state = digitalRead(ledPin);
}

void heatOn() { // start heatpump
   digitalWrite(ledPin, HIGH);
   digitalWrite(heatPin, HIGH);
   lcd.setCursor(1, 1);
   lcd.print("is Low Temp");
}

void heatOff() { // stop heatpump
   digitalWrite(ledPin, LOW);
   digitalWrite(heatPin, LOW);
   lcd.setCursor(1, 1);
   lcd.print("is Hi Temp");
}

am about to test with heatpad attached will grab pics of the setup :wink:

Code looks solid. Good luck! ;)

thnx :)

need to wire up a relay for the heatpad, will have that run off of 9 - 12v. also gonna dig out a PC psu from somewhere and use that to power it and the light system, that should prevent any current drain and keep a nice common ground without having wires all over XD

Will we get invitations to try the bouillabaisse once the fish is soft and juicy ?

:P

Will we get invitations to try the bouillabaisse once the fish is soft and juicy ?

:o!

will people stop making jokes about cooked fish XD

ok crap picture of the prototype setup

labeled parts are as follows:

A - RBBB board running code with a atmega168
B - 2X16 white on blue LCD display displaying status and sensor data ? LED to indicate pad on.
C - Relay board with 1N4004 diode and 3904 transistor
D - Heatpad housing peltier heat pump with tin disk from pringles tub

all this will be powered by a pc PSU so the right voltages are distributed to whats needing it and feed enough juice to it.

i’ll be powering the other RBBB board thats running the lights at the moment from it too to save sockets :wink:

ignore the junk on this end of the breadboard :wink: its just spare parts and a laser

Looks good! Wish that LED didn’t throw off the contrast of the whole picture though :P.

yea the brightness does kinda suck XD

currently looking for a casing for this and power supply..