Go Down

Topic: Sharp IR Sensor (Read 714 times) previous topic - next topic

Aaron2010

Does anyone know how to go about turning the sharp IR sensor on and off so the beam isn't always on.

Grumpy_Mike

What Sharp IR sensor, there are lots if them?

Aaron2010

im using the sharp GP2Y0A21YK.  i need to turn it on for a second and off for 5 sec, then have the next sensor in the row come on after that first second and off for 5 sec and sequential repeat down the row.  my objective is to have a matrix of sensors detecting something in the middle of it while avoiding cross talk.  i cant have all the sensors on at once because the beams might interrupt each other or cross.

Grumpy_Mike

Simply connect the +5V line to one of the output pins. As the sensor only takes 30mA there will be enough current capacity. Then set the pin to be an output, write a HIGH to it to turn it on and a LOW to turn it off.

Go Up