Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: ross75 on November 14, 2008, 05:15:11 PM

Title: Photoresistor question
Post by: ross75 on November 14, 2008, 05:15:11 PM
I have a photoresistor hooked up too an a2d port and it either reads 255 when its pluged in or 0 when its not but never changes value when its in. what could the problem be? did i wire the sensor wrong?
Title: Re: Photoresistor question
Post by: pomprocker on November 14, 2008, 05:23:15 PM
What values are read on your multimeter in different levels of light and dark?

It seems that the 8-bit ADC is maxed out at 255
Title: Re: Photoresistor question
Post by: ross75 on November 14, 2008, 05:44:47 PM
its reading 8.5 m ohm in the dark and 11.5 k ohm in the light. I must have the wrong resistor. I'm A rookie and have no clue as to what im doing lol.
I built the board for the $50 dolar robot using an atmega168 and it works i can make leds flash and what not but now im trying to figure out how to work with inputs. I didnt build the robot because i wanted to see if i could even get the mcu to work before i went and got servos and stuff.
Title: Re: Photoresistor question
Post by: pomprocker on November 14, 2008, 06:17:42 PM
Did you read the photo-sensor tutorial on here?
Title: Re: Photoresistor question
Post by: Webbot on November 14, 2008, 08:00:22 PM
Did you read the photo-sensor tutorial on here?

Pomprocker is correct - you need to look at the tutorial -it will tell you what other resistor to use with your photoresistor in order to get a good value range.


Quote
it works i can make leds flash and what not but now im trying to figure out how to work with inputs. I didnt build the robot because i wanted to see if i could even get the mcu to work before i went and got servos and stuff.
Seems like a good cautious approach
Title: Re: Photoresistor question
Post by: ross75 on November 14, 2008, 08:12:46 PM
yea i went back to the tutorial and realized im an idot. I had the photocell hooked up wrong! now it works. Thanx for the help i should have read more before i posted.