Go Down

Topic: TMP36 fine with USB, bad value with battery (Read 83 times) previous topic - next topic

electrotech256

Aug 28, 2016, 02:15 am Last Edit: Aug 28, 2016, 04:22 am by electrotech256
Hello,

I'm fairly new to the Arduino world.  I went through the starter kit and had success with all of the experiments, so I decided to combine two.  I wanted to read the TMP36 temperature sensor with my UNO, and output temperatures in Fareneheit to the LCD display.  It was pretty straightforward and I had success with it, showing around 74 degrees F.

Then I tried to check the temperature outside.  When I powered my Arduino using a 9v battery to the Vin pin, 5v power supply to Vin pin, or 5v wall wart, the display showed 105-130.  I read that the temperature sensor needs its own ground so I have a wire going to one of the Arduino grounds on the other side of the board from the LCD's ground.

Any ideas on why this would happen?  I went over my code for about an hour, the whole time plugged in to USB and the temperature stayed between 72 and 74.



    voltage = (sensorVal/1024.0)*5.0;
      Serial.println(voltage);
    float temperature = (voltage-0.5)*100;  //new variable Temperature which is equivalent to the (voltage-0.5)*100
    float Fah = (temperature*9/5)+32;
    lcd.setCursor(0, 1);
    lcd.println(Fah, 2);
    lcd.print("Deg F");
 

Wawa

A 9volt battery can barely power an Arduino, and not for long.
Forget about powering an Arduino + LCD/backlight from a 9volt battery.
Leo..

fatmanonabike

I had some similar issues that ended up being intermittent breadboard connections. It doesn't like mechanical instability. I had about 3' of lead wire. I braided that and added a tiny random ceramic disc capacitor across the power leads, all of which seemed to improve stability. I dragged the laptop into the kitchen so I could dunk it it boiling water. As long as I kept the device leads out of the water it read properly 100 C and 212ish F.

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy