Question

ESP8266/Arduino UNO and temperature sensor MCP9700A. Temperature sensor gives incorrect temperature readings in celsius. Both ESP8266...

ESP8266/Arduino UNO and temperature sensor MCP9700A.
Temperature sensor gives incorrect temperature readings in celsius.
Both ESP8266 and UNO uses 3.3v pin.

Codes:
float temp;

void setup() {
Serial.begin(57600);
};

void loop () {
temp = analogRead(0)*3.3/1024.0;
temp = temp - 0.5;
temp = temp / 0.01;
Serial.println(temp);
delay(500);
};
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Here is the code , that actually works

float temp;
int tempPin = 0;

void setup() {
Serial.begin(9600);
}

void loop() {
temp = analogRead(tempPin);
// read analog volt from sensor and save to variable temp
temp = temp * 0.48828125;
// convert the analog volt to its temperature equivalent
Serial.print("TEMPERATURE IS = ");
Serial.print(temp); // display temperature value
Serial.print("*C");
Serial.println();
delay(1000); // update sensor reading each one second
}

Add a comment
Know the answer?
Add Answer to:
ESP8266/Arduino UNO and temperature sensor MCP9700A. Temperature sensor gives incorrect temperature readings in celsius. Both ESP8266...
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
  • Assume the following script is uploaded to an Arduino UNO and a digital multimeter is used...

    Assume the following script is uploaded to an Arduino UNO and a digital multimeter is used to measure the voltage between Arduino pin 12 (red probe or +) and pin 13 (black probe or -). void setup) pinMode(13, OUTPUT); pinMode(12, OUTPUT); } void loop(){ digitalWrite(13, HIGH); digitalWrite(12, LOW); delay(500); digitalWrite(13, HIGH); digitalWrite(12, HIGH); delay(500); } Select one: о a. -5 Volts, 500 second delay, 0 volts, 500 second delay, repeat second delay, 0 volts, V2 second delay, repeat о b....

  • Assume the following script is uploaded to an Arduino UNO and a digital multimeter is used...

    Assume the following script is uploaded to an Arduino UNO and a digital multimeter is used to measure the voltage between Arduino pin 12 (red probe or +) and pin 13 (black probe or -). void setup() { pinMode(13, OUTPUT); pinMode(12, OUTPUT); void loop() { digitalWrite(13, HIGH); digitalWrite(12, LOW); delay(500); digitalWrite(13, HIGH); digitalWrite(12, HIGH); delay(500); O O Select one: a. -5 Volts, 500 second delay, 0 volts, 500 second delay, repeat b. - 5 Volts, 12 second delay, +5 Volts,...

  • An Arduino Uno is configured with the voltage divider connected to Analog input pin AO as...

    An Arduino Uno is configured with the voltage divider connected to Analog input pin AO as shown, and the code shown below is uploaded. What happens? testCodeA Arduino 1.8.11 Hourly Build 2019/10/29 11:12 Arduino Uno testCodeA #define LED 13 to sv 13o 5ke & void setup() { pinMode(LED, OUTPUT); to A 10KZ Ž ŞR void loop() { int voltage-analogRead(AO); if (voltage > 1024/2) digitalWrite(LED, HIGH); else digitalWrite(LED, LOW); GND GND Done compiling Sketch uses 778 bytes (2%) of program storage...

  • An Arduino Uno is configured with the voltage divider connected to Analog input pin AO as...

    An Arduino Uno is configured with the voltage divider connected to Analog input pin AO as shown, and the code shown below is uploaded. What happens? testCodeA Arduino 1.8.11 Hourly Build 2019/10/29 11:12 Arduino testCodeA Uno #define LED 13 to SV 130 5ks § void setup() { pinMode(LED, OUTPUT); B toap ŹR 10 Kaş void loop 1 int voltage analogRead(AO); if (voltage > 1024/2) digitalWrite(LED, HIGH); else digitalWrite(LED, LOW); HOGNO Gong Done compiling Sketch uses 778 bytes (2%) of program...

  • I am doing an Arduino Uno project where I made a "Simon says" memory game with 3 neopixel LED str...

    I am doing an Arduino Uno project where I made a "Simon says" memory game with 3 neopixel LED strips and 3 - ultrasonics. I have them working independently but I need to combine the code so they work together. Here is what I have: Memory Game #define PLAYER_WAIT_TIME 2000 // The time allowed between button presses - 2s byte sequence[100]; // Storage for the light sequence byte curLen = 0; // Current length of the sequence byte inputCount =...

  • Using the template provided in the lab details section, formulate a program for the Arduino to...

    Using the template provided in the lab details section, formulate a program for the Arduino to generate a PWM signal duty cycles between 0% and 100% at intervals of 10% where a button will increment the PWM signal. Remember the RC is 10 milliseconds. Provide a copy of the final code and explain how it works. Arduino PWM Example int Pin = 9; void setup() { pinMode (Pin, OUTPUT); } void loop() { analogWrite (Pin, 127); // Generate 50% duty...

  • In the code below i am using a LS-3006 SERVO on the arduino uno and everytime...

    In the code below i am using a LS-3006 SERVO on the arduino uno and everytime i hit the pushbutton to input a time the servo comes on. Would anyone be able to tell me what a solution is to this problem? Thanks #include <Wire.h> #include <DS3231.h> #include <Servo.h> #include <LiquidCrystal.h> #include <Keypad.h> const byte ROWS = 4; // # of rows const byte COLS = 4; // # of columns // Define the Keymap char keys[ROWS][COLS] = { {'1','2','3','A'},...

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