go_away

Author Topic: Photoresistor question  (Read 1269 times)

0 Members and 1 Guest are viewing this topic.

Offline ross75Topic starter

  • Jr. Member
  • **
  • Posts: 9
  • Helpful? 0
Photoresistor question
« 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?

Offline pomprocker

  • Supreme Robot
  • *****
  • Posts: 1,430
  • Helpful? 16
  • Sorry miss, I was giving myself an oil-job.
Re: Photoresistor question
« Reply #1 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

Offline ross75Topic starter

  • Jr. Member
  • **
  • Posts: 9
  • Helpful? 0
Re: Photoresistor question
« Reply #2 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.

Offline pomprocker

  • Supreme Robot
  • *****
  • Posts: 1,430
  • Helpful? 16
  • Sorry miss, I was giving myself an oil-job.
Re: Photoresistor question
« Reply #3 on: November 14, 2008, 06:17:42 PM »
Did you read the photo-sensor tutorial on here?

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,132
  • Helpful? 108
Re: Photoresistor question
« Reply #4 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
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline ross75Topic starter

  • Jr. Member
  • **
  • Posts: 9
  • Helpful? 0
Re: Photoresistor question
« Reply #5 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.

 


Get Your Ad Here