Multi analog Thermometer sensor NTC 12Kohm displayed on a lcd

Hi all, i have a question about reading out 8 analog thermometers and displaying them on a LCD, also I want it to be multi LCD, 2 sensors on 1 LCD and 4 LCD.

i have a starters kit, and lesson 25 lears me about portraying 1 sensor on a lcd, i made that happen. But i can't write code myself, and i have no cleu how to set up a project with 8 sensors

i have a adruino mega 2560.
and 8 NTC 12Kohm at 25 degrees.

can anybody help me?

Begin by describing your project and how you desire it to work. We don't have a clue either.

Sounds like an interesting project but I see a lot of potential problems as this progresses. You have your bill of materials before your design, an interesting way to go. From your question I am assuming you are not experienced in electronics. I believe 1 LCD and 4 LCD refer to the number of lines in the display, not the number of displays. I have a significant concern with NTC thermistors and their non-linear response. How will you deal with this? Consider digital sensors instead, depending on your temperature range, a DS18B20 comes to mind, there are many others. What else are you planning on doing in your project. So far we know you have displays and sensors, no clue on what you are going to do with them. Post a schematic, not a frizzy picture of your preliminary design showing all power and ground connections. Also post links to technical information on each of your devices. What accuracy do you need? Here is a typical curve for a 10K NTC, it should be about the same just shifted a bit.
image
We are to help as you need it.

haha yea it kinda is a intresting projecty,
It is little project to show how diffrend valves on radiators work, with a pre settings and flow measurements, also i have little radiadors set up so you can feel the diffrends between ventilated radiators and those who are not, also i have 2 electric elements to see and feel diffrence between hydrolic balanced system and the system who is not balanced.
and i want to messure the IN going themp and the OUT going themp, and displaying that on a LCD,
like you see on the photo there are 4 radiators and 8 sensors, the sensors are direct in contact with the water, if i work with a digital sensor like BS18B20, it must be water tight some how. the tread is 1/4 or 3/8.

hope you understand XD
if you have an idea for digital sensors its fine too. but i got these sensors of the shelf.

From what I can see from the picture the probes may fit your existing setup. 1 variety comes with a closed metal tube with the sensor potted inside and a wire lead coming out to connect to. Adafruit offers the one pictured below. Waterproof 1-Wire DS18B20 Digital temperature sensor : ID 381 : $9.95 : Adafruit Industries, Unique & fun DIY electronics and kits

Did you calibrate the thermistors before mounting them in the pipes?
Are all the thermistors identical? Can you post a datasheet for them?
What temperature range are you working in?

it seems to me that this set up problomatic, and would not work without major problems
therfore im going to use digital DS18s20 sensors with a rvs casing.
the code has been writen a few time's.
the only thing im worrying about is how am i going to display 8 sensors on 1 or more lcd displays. with a calculation between delta temperatuur.

One thing you might consider is getting displays that have more space. A 20x4 character display would likely do all of your temperatures as long as you keep the descriptions of which is which short.

One of the Nextion range would give you plenty of space too. Lots of options.

The DallasTemperature library has a couple of examples for reading multiple temperature sensors.

The displays should not be a problem either, basically just writing to the correct display in the correct position. Are you intending to wire the LCD display(s) directly to the Mega, or do the displays have I2C interfaces? The I2C interface makes wiring much easier.

HI all

the idea is that i have 4 sensors printend on 2 x lcd 20x4 I2C so 2 sensors on 1 lcd.
i know this is 2 sensors on both lcd displays but it is jet in test fase but... i have a problem.

I have a problem with my code, there is no fault code but my LCD is printing extra numbers, and i dont know/understand wy. can someone help?

code:
// This Arduino sketch reads DS18B20 “1-Wire” digital
// temperature sensors.

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

// Connections:
// SDA to Arduino pin 20
// SCL to Arduino pin 21

LiquidCrystal_I2C lcd1(0x27, 20, 4); // << Address 1
LiquidCrystal_I2C lcd2(0x23, 20, 4); // << Address 2

// Data wire is plugged into pin 8 on the Arduino
#define ONE_WIRE_BUS 8

// Setup a oneWire instance to communicate with any OneWire devices
OneWire oneWire(ONE_WIRE_BUS);

// Pass our oneWire reference to Dallas Temperature.
DallasTemperature sensors(&oneWire);

// Assign the addresses of your 1-Wire temp sensors.
// See the tutorial on how to obtain these addresses:
// Arduino 1-Wire Address Finder

DeviceAddress insideThermometer = {0x28, 0x43, 0x50, 0x96, 0xF0, 0x01, 0x3C, 0x1B};
DeviceAddress outsideThermometer = {0x28, 0x43, 0x47, 0x96, 0xF0, 0x01, 0x3C, 0x36};

void setup(void)
{
// Start up the library
sensors.begin();
// set the resolution to 10 bit (good enough?)
sensors.setResolution(insideThermometer, 10);
sensors.setResolution(outsideThermometer, 10);

lcd1.init();
lcd2.init();

lcd1.backlight();
lcd2.backlight();

lcd1.begin(20,4); // columns, rows. use 20,4 for a 20×4 LCD, etc.
lcd1.clear(); // start with a blank screen

lcd2.begin(20,4); // columns, rows. use 20,4 for a 20×4 LCD, etc.
lcd2.clear(); // start with a blank screen
}
void printTemperature(DeviceAddress deviceAddress)
{
float tempC = sensors.getTempC(deviceAddress);
if (tempC == -127.00)

lcd1.print("/");
lcd1.print(" C=");
lcd1.print(tempC);

lcd2.print("");
lcd2.print(" C=");
lcd2.print(tempC);
}

void loop(void)
{
lcd1.setCursor(0,0);
lcd1.print("In:");
printTemperature(insideThermometer);
lcd1.setCursor(0,1);
lcd1.print("Out:");
printTemperature(outsideThermometer);

lcd2.setCursor(0,0);
lcd2.print("In:");
printTemperature(insideThermometer);
lcd2.setCursor(0,1);
lcd2.print("Out:");
printTemperature(outsideThermometer);

delay(2000);
}

mvg meindert

Try clearing the remainder of the line after you write data to it. It appears some part of the program wrote data to line zero as well.

Your printTemperature function prints to both displays every time you call it.

do you mean:

void printTemperature(DeviceAddress deviceAddress)

?

Yes, that function prints to both lcd1 and lcd2 every time you call it, at whatever cursor position the displays are currently at. That results in " C=25.00" being printed twice after the "Out: C=25.00" on the 2nd line. The text appears on the 4th line because when you write past the end of the 2nd line, it wraps around to the 4th line, not the 3rd line (line wrap is a bit unusual on a 20x4 display).

Here is the end result of the project...

the code
#include <Wire.h>
#include <OneWire.h>
#include <DallasTemperature.h>
#include <LiquidCrystal_I2C.h>

// Connections:
// SDA to Arduino pin 20
// SCL to Arduino pin 21

LiquidCrystal_I2C lcd1(0x27, 20, 4); // << Address 1
LiquidCrystal_I2C lcd2(0x23, 20, 4); // << Address 2
LiquidCrystal_I2C lcd3(0x22, 20, 4); // << Address 3
LiquidCrystal_I2C lcd4(0x26, 20, 4); // << Address 4

float insideTemp1;
float outsideTemp1;
float insideTemp2;
float outsideTemp2;
float insideTemp3;
float outsideTemp3;
float insideTemp4;
float outsideTemp4;

// Data wire is plugged into pin 8 on the Arduino
#define ONE_WIRE_BUS 8

// Setup a oneWire instance to communicate with any OneWire devices
OneWire oneWire(ONE_WIRE_BUS);

// Pass our oneWire reference to Dallas Temperature.
DallasTemperature sensors(&oneWire);

DeviceAddress insideThermometer1 = {0x28, 0x41, 0x31, 0x96, 0xF0, 0x01, 0x3C, 0xA9};
DeviceAddress outsideThermometer1 = {0x28, 0xC1, 0x01, 0x96, 0xF0, 0x01, 0x3C, 0xC7};
DeviceAddress insideThermometer2 = {0x28, 0x43, 0x50, 0x96, 0xF0, 0x01, 0x3C, 0x1B};
DeviceAddress outsideThermometer2 = {0x28, 0x43, 0x47, 0x96, 0xF0, 0x01, 0x3C, 0x36};
DeviceAddress insideThermometer3 = {0x28, 0x9A, 0x44, 0x96, 0xF0, 0x01, 0x3C, 0x2A};
DeviceAddress outsideThermometer3 = {0x28, 0x25, 0x9D, 0x96, 0xF0, 0x01, 0x3C, 0xA4};
DeviceAddress insideThermometer4 = {0x28, 0xE7, 0x65, 0x96, 0xF0, 0x01, 0x3C, 0xCD};
DeviceAddress outsideThermometer4 = {0x28, 0xB7, 0x91, 0x96, 0xF0, 0x01, 0x3C, 0x5A};

void setup() {
// Start up the library
sensors.begin();
// set the resolution 10 bit = 0.25°C, 11 bit = 0.125°C, 12 bit = 0.0625°C
sensors.setResolution(insideThermometer1, 12);
sensors.setResolution(outsideThermometer1, 12);
sensors.setResolution(insideThermometer2, 12);
sensors.setResolution(outsideThermometer2, 12);
sensors.setResolution(insideThermometer3, 12);
sensors.setResolution(outsideThermometer3, 12);
sensors.setResolution(insideThermometer4, 12);
sensors.setResolution(outsideThermometer4, 12);
lcd1.init();
lcd2.init();
lcd3.init();
lcd4.init();

lcd1.backlight();
lcd2.backlight();
lcd3.backlight();
lcd4.backlight();

lcd1.begin(20,4); // columns, rows. use 20,4 for a 20×4 LCD, etc.
lcd1.clear(); // start with a blank screen

lcd2.begin(20,4); // columns, rows. use 20,4 for a 20×4 LCD, etc.
lcd2.clear(); // start with a blank screen

lcd3.begin(20,4); // columns, rows. use 20,4 for a 20×4 LCD, etc.
lcd3.clear(); // start with a blank screen

lcd4.begin(20,4); // columns, rows. use 20,4 for a 20×4 LCD, etc.
lcd4.clear(); // start with a blank screen
}

void loop() {

// command to make DS18B20 measure the temperatures (but it hasn't been send to arduino yet)
sensors.requestTemperatures();

// commands to read the temperature from the DS18B20's
insideTemp1 = sensors.getTempC(insideThermometer1);
outsideTemp1 = sensors.getTempC(outsideThermometer1);
insideTemp2 = sensors.getTempC(insideThermometer2);
outsideTemp2 = sensors.getTempC(outsideThermometer2);
insideTemp3 = sensors.getTempC(insideThermometer3);
outsideTemp3 = sensors.getTempC(outsideThermometer3);
insideTemp4 = sensors.getTempC(insideThermometer4);
outsideTemp4 = sensors.getTempC(outsideThermometer4);

lcd1.setCursor(0,0);
lcd1.print("lcd #1");
lcd1.setCursor(0,1);
lcd1.print("In:");
lcd1.print(tempString(insideTemp1));
lcd1.setCursor(0,2);
lcd1.print("Out:");
lcd1.print(tempString(outsideTemp1));

lcd2.setCursor(0,0);
lcd2.print("lcd #2");
lcd2.setCursor(0,1);
lcd2.print("In:");
lcd2.print(tempString(insideTemp2));
lcd2.setCursor(0,2);
lcd2.print("Out:");
lcd2.print(tempString(outsideTemp2));

lcd3.setCursor(0,0);
lcd3.print("lcd #3");
lcd3.setCursor(0,1);
lcd3.print("In:");
lcd3.print(tempString(insideTemp3));
lcd3.setCursor(0,2);
lcd3.print("Out:");
lcd3.print(tempString(outsideTemp3));

lcd4.setCursor(0,0);
lcd4.print("lcd #4");
lcd4.setCursor(0,1);
lcd4.print("In:");
lcd4.print(tempString(insideTemp4));
lcd4.setCursor(0,2);
lcd4.print("Out:");
lcd4.print(tempString(outsideTemp4));
delay(100);
}

// float conversion to String with proper rounding (to one decimal)
String tempString(float tempFloat){
int temp = int(tempFloat*100.0);
int tempBeforeDot = int(temp/100);
int tempAfterDot1 = int(temp/10)-int(temp/100)*10;
int tempAfterDot2 = int(temp)-int(temp/10)*10;
String TempString = "";
if(tempBeforeDot >= 0 && tempAfterDot1 == 9 && tempAfterDot2 >= 5){
TempString = String(tempBeforeDot+1);
TempString += ".0";
} else if (tempBeforeDot < 0 && tempAfterDot1 == 9 && tempAfterDot2 >= 5){
TempString = String(tempBeforeDot-1);
TempString += ".0";
} else if (tempAfterDot2 >= 5){
TempString = String(tempBeforeDot);
TempString += ".";
TempString += String(tempAfterDot1+1);
} else {
TempString = String(tempBeforeDot);
TempString += ".";
TempString += String(tempAfterDot1);
}
return TempString;
}

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.