Question

• Control the Arduino so it checks an entered pattern, if it is equal to11112222, then the temperature value should be prin

i want an arduino code for this
0 0
Add a comment Improve this question Transcribed image text
Answer #1

ANSWER

Hi here is your answer. Here i am using follwing components

1)Aurduio UNO R3

2)LCD

3)Temperature Sensor TMP36

Here I created a device, when 11112222 is passed the temp value will print. Other Times it will show off.

Circute

Name 6 DIGITAL PWM 2 O UNO ARDUINO ghi POWER ANALOGIN

SKETCH

/*
  The circuit:LCD RS pin to digital pin 12,LCD Enable pin to digital pin 11,
              LCD D4 pin to digital pin 5,LCD D5 pin to digital pin 4,
              LCD D6 pin to digital pin 3,LCD D7 pin to digital pin 2,R/W pin to ground,VSS pin to ground

              VCC pin to 5V,10K resistor,ends to +5V and ground,wiper to LCD VO pin (pin 3)

This code available when simulate with TinkerCard(only for lcd)
*/

// include the library code:
#include <LiquidCrystal.h>
int outputpin= 0;
const int numRows= 4;
const int numCols= 20;


// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);



void setup() {
  Serial.begin(9600);
  // set up the LCD's number of columns and rows:
  lcd.begin(16, 2);
  // Print a message to the LCD.
//goto first column (column 0) and first line (Line 0)

 //Print at cursor Location

 //Print at cursor location
}

void loop() {
  
  String len; 
    Serial.print ("\r\nPlease type something: ");  // this is used for read the value from serial monitor
    len=Serial.readString();
    Serial.print ("\r\nYou typed: \"");
    Serial.print (len);
  if(len=="11112222"){
int rawvoltage= analogRead(outputpin);
float millivolts= (rawvoltage/1024.0) * 5000;
float fahrenheit= millivolts/10;
  lcd.setCursor(0,1); //goto first column (column 0) and second line (line 1)

lcd.print("Temp F = ");
  lcd.print(fahrenheit);
    lcd.setCursor(6, 0);
    delay(3000);
    lcd.clear();
  }
  else if(len=="")
  {
    lcd.setCursor(0,1); //goto first column (column 0) and second line (line 1)
    lcd.print("off ");
    lcd.setCursor(6, 0);
    Serial.print("Please enter correct ssequence");
  }

}

Output

Temperature Sensor (TMP36) Text Name 6 DIGITALIPWM- O UNO ARDUINO POWER ANALOG IN } i 22 76 77 lcd.print(Temp F = ); 78 lcd

Temperature Sensor (TMP36] Text 1 (Arduinc Name 6 } DIGITALPWM O UNO { ARDUINO T POWER ANALOG IN } 76 77 lcd.print(Temp F =

**** Please note Here we can add LED easily. Just add code in the if condition for , but before code please setup pin, and values.

any doubts please comment....and upvote too...

Thanks in advance

Add a comment
Know the answer?
Add Answer to:
i want an arduino code for this • Control the Arduino so it checks an entered...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT