I am building a display lcd for car make (JHD 162A) which will display 1.temperature for which k type temp sensor will be used ,2, water level indicator ,3.oil pump sensor function ,4,and a temperature cut out sensor all command of sensor 2,3,4 will be connected to relay and these commands will be relayed to to arduino and the relay will give on/off signal only to arduino except sensor 1 ,i am using lcd 16/2 and getting a variable signal as follows on the lcd but i want a controlled signal ie a constant signal
//tmp=500 to 640 roughly
//mob=100 to 116 roughly
//wat=600 to 700 roughly
//eng=500 to 640 roughly
and shown in the picture also
https://lh3.googleusercontent.com/-uf8PHuQsiLk/UvUWu-U2kEI/AAAAAAAAAKE/US510-FvEXM/w140-h105-p/IMG_240x320_0006.jpg
https://lh4.googleusercontent.com/-jqzXDhVIJB4/UvUWytJgkwI/AAAAAAAAAKM/26osauXjdxY/w140-h105-p/IMG_240x320_0007.jpg
https://lh4.googleusercontent.com/uRn672KUum-OS-A3QXPDY0rz2yil-Rjw0VXOfw0FCoU=w93-h145-p-no
#include <LiquidCrystal.h>
#include <LiquidCrystal.h>
#include <sensepin = 0>
#include <sensepinh = 7>///////extra temperature censor attached to car
#include <sensepina = 8>/////connected to engine oil sensor
#include <sensepinb = 9>///connectd to engine water bottle
#include <sensepinc = 10>///////extra temperature cut out switch attached to car
// include the library code:
#include <LiquidCrystal.h>
////////Define Pins
int sensepin =0;
int sensepinh =7;///////extra temperature censor attached to car
int sensepina = 8;/////connected to engine oil sensor
int sensepinb = 9;///connectd to engine water bottle
int sensepinc = 10;///////extra temperature cut out switch attached to car
int ledpin =13;
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup() {
lcd.begin(16, 2);
lcd.setCursor(0, 0);
analogReference(DEFAULT);
pinMode (ledpin=13, OUTPUT); //The LED pin needs to be set as an output
Serial.begin(9600);
}
void blinkTwice ( ) {
digitalWrite(ledpin,HIGH);/////////will trigger the alarm
delay(1000);
digitalWrite(ledpin,LOW);
}
void loop() {
delay(100); // delay for sms not to be detctived(7000-8000)
int val = analogRead(sensepin=0);
if (val >70 ) { //what are you reading??? should it be (val > 70)?
blinkTwice();
delay(1000); //delay for the call to be compleated ie 1;08sec
Serial.println (val);
//////////////////////////////////////////////////////////////////////////1111111 sensor
lcd.setCursor(0, 0);
int sensepinh = 7;
int val = analogRead(sensepinh=0);
if (val <900)////assumed value
{
lcd.print ("TMP=");
lcd.print (val);
}
if (val >900)////assumed value
{
// Turn off the display:
lcd.noDisplay();
delay(200);
// Turn on the display:
lcd.display();
delay(200);
lcd.print ("STOP ENGINE");////////extra temperature censor attached to car
blinkTwice();
}
///////////////////////////////////////////////////////////////////////////222222222 sensor
lcd.setCursor(8, 0);
int sensepina = 8;
if (val <900 )////assumed value
{
lcd.print ("/MOB=");
lcd.print (val, sensepina);
//lcd.print ("FULL");////will show the display, not yet
}
if (val >900 )////assumed value
{
lcd.print ("/MOB=");/////connected ti engine oil sensor
lcd.print (val,sensepina);
//lcd.print ("EMPTY");////will show the display, not yet
blinkTwice();
}
///////////////////////////////////////////////////////////////////////////////////////////33333333 sensor
lcd.setCursor(0, 1);
int sensepinb = 9;
if (val <900 )////assumed value
{
lcd.print ("WAT=");///connectd to engine water bottle
lcd.print (val ,sensepinb);
//lcd.print ("FULL");////will show the display, not yet
}
if (val >900 )////assumed value
{
lcd.print ("WAT=");
lcd.print (val,sensepinb);
//lcd.print ("HALF");////will show the display, not yet
blinkTwice();
}
}
//////////////////////////////////////////////////////////////44444444444444 sensor
lcd.setCursor(8, 1);
int sensepinc = 10;
if (val <900 )////assumed value
{
lcd.print ("/ENG=");
lcd.print (val,sensepinc);
//lcd.print ("FULL");////will show the display, not yet
}
if (val >900)////assumed value
{
lcd.print ("/ENG=");////////extra temperature cut out switch attached to car
lcd.print (val,sensepinc);
//lcd.print ("HEAT");////will show the display, not yet
blinkTwice();
}
}
/////////////////////////////////////////////////////////////////