Help controlling solar powered laing pump by reading thermistor with arduino

hi this is my first time ever using arduino and C++ and need some guidance on what parts to use and how to program this to make it work. Our goal is to get the arduino to read a certain temperature from a thermistor and when it sees a certain temperature it turns on or off the power of the laing pump, that is directly hooked to a solar panel. Ive been reading and i see you need to use a transistor, diode, to connect any type of DC motor to arduino but don't know what else i would need to make this work. if someone could help i would greatly appreciate it.

Hi, we need to know more about the pump - what voltage/current requirements. What is being pumped, by the way?

Initial thoughts would be: why do you need an Arduino for this? Sounds too simple, an Arduino would be wasted, unless there are other duties it would be performing, or other complex rules/timing to be followed in addition to the thermistor reading.

Paul

jb0322: The pump is a low voltage laing pump, 8-24V and 1.5 amp max, we have it connected directly to a solar panel now. This is a circulation pump on a solar water heater( you can google image search "solar water heater"). The problem is that the water temps get 180F+ on hot days. We are trying to stop the pump when the water temp gets to 130F and restart when it gets below 100F. We will be using two 10K thermistors, one inside the water tank and one in the solar collector. We don't want the pump to run when the water temp in the tank, is warmer than the air temp in the collector (it will then cool the water quicker, counter productive). We also plan to add a lcd display to show water temperatures, and in the future maybe a shade to roll out over the solar collector. We have purchased an arduino uno kit with a few LED lights and resistors included.

The pump is a low voltage laing pump, 8-24V and 1.5 amp max, we have it connected directly to a solar panel now. This is a circulation pump on a solar water heater( you can google image search "solar water heater"). The problem is that the water temps get 180F+ on hot days. We are trying to stop the pump when the water temp gets to 130F and restart when it gets below 100F. We will be using two 10K thermistors, one inside the water tank and one in the solar collector. We don't want the pump to run when the water temp in the tank, is warmer than the air temp in the collector (it will then cool the water quicker, counter productive). We also plan to add a lcd display to show water temperatures, and in the future maybe a shade to roll out over the solar collector. We have purchased an arduino uno kit with a few LED lights and resistors included.

Thanks

It's probably easiest to control the pump with a relay that is controlled by the Arduino. You will still need a small transistor to switch the relay coil current as it will be much greater than the Arduino pins can provide.

While it is more expensive than a solution using, for example, op-amp comparators I think an Arduino solution will be much easier to implement unless the OP is already familiar with analog electronics.

It would also be fairly easy to transfer the system to a much cheaper breadboard Atmega328 when it is working. Then the Arduino could be reused for another project.

LM335 or LM35 temperature sensors might be easier to use than thermistors - although a bit more expensive.

...R

Our temperature sensor needs to be inside a water tank, so we were thinking about using a waterproof thermistor, such as this https://www.adafruit.com/products/372 . We were going to use the same model thermistor to measure the air temp inside the collector, so we can just compare resistances instead of converting to a temperature scale in the code. We are mechanical engineering students and have to use arduino for this project due to class requirements and constraints. Here is a picture of a diagram of our idea for the pump. Right now, the pump is connected to the solar panel directly and will run whenever the solar panel can provide enough power to run it. According to the manufacturer specs, the max amp draw for the laing pump is 1.5amps and will operate on a voltage of 8-24 volts.

I wouldn’t consider using a TIP120 for this. I think a logic level mosfet would be a better choice.

Also, you might consider using a factory waterproofed DS18B20 ONEWIRE SENSOR
http://www.lightinthebox.com/ds18b20-waterproof-digital-temperature-probe-black-silver_p1117911.html?currency=USD&litb_from=paid_adwords_shopping&pla_adwid=2097558121_165391281_13008890361_68765414721&gclid=CODm1e_-070CFc1afgod5gIAZQ

The DS18B20 digital thermometer provides 9-bit to 12-bit Celsius temperature measurements and has an alarm function with nonvolatile userprogrammable upper and lower trigger points. The DS18B20 communicates over a 1-Wire bus that by definition requires only one data line (and ground) for communication with a central microprocessor. It has an operating temperature range of -55°C to +125°C and is accurate to ±0.5°C over the range of -10°C to +85°C. In addition, the DS18B20 can derive power directly from the data line (“parasite power”), eliminating the need for an external power supply.

http://playground.arduino.cc/Learning/OneWire

(see attached)

DS18B20.pdf (529 KB)

DS18B20_SCHEMATIC.jpg

I went ahead and bought the N-channel MOSFET transistor, the DS18B20 temperature sensor, Diodes, LCD screen and a proto shield to connect anything to. With what we have bought will the wiring diagram that we proposed work to power the pump when it sees a certain temperature from the sensors. Also on the temperature sensors can you extend the wires on them if we need to? I am very new to this and need as much help as possible so if there are any suggestions on what I should do please let me know. C++ coding is the next question as i really don’t know how to code in C++ so if there are any codes out there that will do what i need that would be helpful

Have a look at these links, they are from the Arduino playground.

http://www.milesburton.com/Dallas_Temperature_Control_Library

http://www.arduino.cc/en/Reference/LiquidCrystal

Paul

Hi. [u]Laing[/u] Pump === [u]Circulation Pump[/u] Is this it?

http://www.au.aquatuning.com/product_info.php/info/p10088_Laing-D5-pump-12V-D5solar-38-700-B.html

Forget using thermstors, they need extra hardware to use, and the sensors suggested will be much easier to connect and use considering the temperatures you are measuring.

Tom...... :)

http://shop.solardirect.com/product_info.php?products_id=363 this is the pump we are running and would someone be willing to help me code this as i really have no clue what I'm doing in c++

Not sure what you mean about the code.
In order for us to help you , you need to list the devices to be controlled and post their datasheets, then list the sequence of events in plain english (since you probably don’t know what an algorithm is or how to create one) that is effectively a “TO DO” list for the
uController (arduino).
You should also use the attached schematic. The one you posted is electrically correct but the format is not correct. You can take a bunch of components and connect them electrically correct but if it doesn’t conform to standard convention it’s just awkward.
The battery symbol in the attached schematic represents your solar cell. Note the pulldown resistor on the gate to assure OFF state .

Arduino Pump Control Schematic.jpg

Okay the only devices to be controlled is the pump and the temperature sensors.
http://shop.solardirect.com/product_info.php?products_id=363- pump
http://www.adafruit.com/datasheets/DS18B20.pdf- temp sensors

How its going to work is we have a solar water heater now that heats the water from outside and a pump that is constantly being powered by a solar panel at all times with no control other than that of the daylight powers the pump which circulates the water through the system to a tank inside and then goes back through a cycle outside. Our objective is to be able to control this pump by two temperature sensors because the water temperatures get well above 180 F and we want to be able to shut off the pump when the temperature sensors in the tank reaches a certain temp and the outside air temperature in the solar water heater outside is at a certain temperature. This will therefore shut of the pump and stop circulation so the water temp can be lowered and when it reaches a certain min temp to come back on. This is how we plan it to work so if that helps understand it so y’all can help.

How its going to work is we have a solar water heater now that heats the water from outside

and a pump that is constantly being powered by a solar panel at all times with no control other than that of the daylight powers the pump which circulates the water through the system to a tank inside and then goes back through a cycle outside.

PUMP
http://shop.solardirect.com/product_info.php?products_id=363

Our objective is to be able to control this pump by two temperature sensors because the water temperatures get well above 180 F and we want to be able to shut off the pump when the temperature sensors in the tank reaches a certain temp and the outside air temperature in the solar water heater outside is at a certain temperature.

You need to specify these temperatures. If they are certain , why are they not given ?.

I requested all the specific information necessary to write the program and you give me a description with the words “certain temperatures”. If you are not ready to proceed because you don’t know what those "certain temperatures are then just say so. If not , please provide the information requested if you want help with the code

. Temp Sensors

This will therefore shut of the pump and stop circulation so the water temp can be lowered and when it reaches a certain min temp to come back on.

another unspecified [min] temp

Attached is a simple temp controller sketch. It was designed to control a relay (see relay module schematic)
http://www.electroschematics.com/8998/arduino-temperature-controlled-relay/
When you get your DS18B20s the basic concept of the temp control is the same regardless of the sensor used. You can apply
the method used in this sketch to your DS18B20 temp controller.

Arduino Pump Control Schematic.jpg

RELAY_TEMP_CONTROLLER.ino (655 Bytes)

arduino-relay-module-550x296.jpg

I assume you know the DS18B20 is digital so the Temp conversion code in the example I gave you needs to be changed.

sorry i haven’t responded and sorry i wasn’t specific this is my first time for everything and didn’t know what you were asking and i have came up with a code from my understanding of all this and wanted to see if this is close to what im trying to do.

#include <OneWire.h>
#include <DallasTemperature.h>


#define ONE_WIRE_BUS 3


OneWire oneWire(ONE_WIRE_BUS);
 
DallasTemperature sensors(&oneWire);




DeviceAddress TankTemp = { enter serial };


    int setpoint = 83;     
    int differential = 30;   
    int relayPin = 13;      

void setup(void)
{
      pinMode (13, OUTPUT);

  Serial.begin(9600);

  sensors.begin();
 
  sensors.setResolution(TankTemp, 10);

}

void printTemperature(DeviceAddress deviceAddress)
{
  float tempC = sensors.getTempC(deviceAddress);
  if (tempC == -127.00) {
    Serial.print("Error getting temperature");
  } else {
    Serial.print("C: ");
    Serial.print(tempC);
    Serial.print(" F: ");
    Serial.print(DallasTemperature::toFahrenheit(tempC));
  }
}

void loop(void){ 
  
  Serial.print("Getting temperatures...\n\r");
  sensors.requestTemperatures();
  
  Serial.print("TankTemp ");
  printTemperature(TankTemp);
  Serial.print("\n\r");
  
      
  if (sensors.getTempC(TankTemp) >  setpoint)
      {
      digitalWrite (relayPin, LOW);            //if tank temp is greater than x degree turn pin "ON"
      Serial.println("Pump OFF");       
       }
  
      
      else (sensor.getTempC(TankTemp) <   (setpoint - differential)  
      {
       digitalWrite (relayPin, HIGH);            //if temp is below x degree - the differential temp  turn pin "ON"
      Serial.println("Pump ON");      
      }
  
  delay(1000*15);
}

Please redo your last post using the MODIFY button.

click the MODIFY button in the upper right of the post window.
Highlight all you code.
click the “#” CODE TAGS button on the toolbar above just to the left of the QUOTE button.
click SAVE (at the bottom).
When you post code on the forum, please make a habit of using the code tags “#” button.

thanks i redid it

Have you seen this ?
http://playground.arduino.cc/Learning/OneWire
Have you tried to run this code yet ?
After you try it, try the attached program on one (or more of your DS18B20s)
Do you know about the pullup resistors ?

DS18x20_Temperature.pde (2.7 KB)