NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.
Support Forum » ADC not returning anything from tempsensor
January 18, 2012 by travin |
Hi, I've verified my code by loading the provided complete tempsensor.c In both attempts (mine and your .c file) the ADC is returning nothing from the sensor. I suspect a bad sensor? I've verified that the sensor is connected properly as well. Right to GND Middle to PC0 Left to AREF Thoughts? |
---|---|
January 19, 2012 by hevans (NerdKits Staff) |
Hi travin, What do you mean when you say you get nothing from the the temperature sensor? Is it all 0, or is it constant at some ADC value? If you could include a good close up picture of your setup, we would be happy to help you double check everything. Humberto |
January 19, 2012 by travin |
The value is constant at 0. I'll post a few images later tonight but I'm pretty certain the connections are proper. In your experience, will the LM34 normally just produce nothing on failure or is it usually erratic values? |
January 19, 2012 by Rick_S |
From my experience, the LM34 is very unlikely to fail. If you want to test your circuit and program, remove the LM34, then jumper a wire from ADC0 to GND. You should see zero for your ADC value. Then remove the jumper and connect ADC0 to VCC, you should see a value of 1023 (or very close to that). With no jumper and the ADC floating, you should see erratic numbers. |
January 25, 2012 by travin |
Sorry it has taken a bit to get back to you. I have just now attempted to jumper as you specify and the readout remains zero at all positions. Below are images showing the wiring:
|
January 26, 2012 by Rick_S |
I have to assume you had the temperature sensor removed when you jumpered ADC0 to VCC or GND correct? Everything in your photo above looks good from what I can see. Can you post the code you were running? One other thing you could try would be to use a different ADC input. To try this, you would need to make a few changes to the tempsensor program as outlined below. 1) Remove the Temperature sensor. 2) in adc_init() change the line that reads
to
Compile and load the program. To test, do as before only with ADC1 (Pin 24) Leave the wires at pins 20 Thru 22 as is. Then Place a jumper from pin 24 (ADC1) to GND. You should have a zero reading. Remove the jumper at pin 24 and replace it with a jumper from pin 24 to VCC. You should see a reading of 1023. Rick |
January 26, 2012 by hevans (NerdKits Staff) |
Hi travin, In addition to all of Ricks awesome suggestions, double check that you do in fact have an LM34 temperature sensor on your board. The 2n7000s MOSFETs and LM34s look really similar. Humberto |
January 27, 2012 by BobaMosfet |
Travin, Make sure you have the right pins from the LM34, in the right rows on the breadboard.
BM |
Please log in to post a reply.
Did you know that an electroluminescent backlight for an LCD panel requires hundreds of volts AC to run? Learn more...
|