I have a project using an atmega168pa, and I want to be able to use a gpio pin with some sort of phototransistor/photodiode sensor to detect proximity. I was thinking of using a TCRT1000 http://za.rs-online.com/web/p/ph...
My idea so far is to somehow convert the analog signal from the phototransistor to a pulse train that I can then drive the gpio with. what I would like is for like a 1khz signal at far away and 10khz or so at hard up close and naturally everything in between. I dont just want an on/off sensing ability but want to be able to detect how far away the the sensor is from something, ideally up to a 4cm range minimum. I was thinking of perhaps driving a 555 timer and then interfacing the output of that to the atmel ?
What are your thoughts on this, do you have any suggestions ? I have not been able to find any ready made schematic ideas for this, so if you guys can suggest anything, it would really help.
Thanks in Advance,