subota, 12. ožujka 2011.

Connecting optical sensors to microcontroller

My task was to make instrumentation for measuring speed of reaction and speed for crossing two points in space. I used 2 optical sensors that I had laying around and connected them through relays to microcontroller. As microcontroller I used Atmel ATMEGA16 and some development kit i bought on Ebay. As output I used RS232 to send data.

Biggest problem was with sensors that I have no specifications and could not find them on internet. There are 3 wires, one black, one blue and one brown. On sensor is only specification that black and blue are power wires (I connected them to 12V DC) and brown is output. So I decided to use relay.

Fig 1: Atmega16 connected with optical sensor through relay

Note: maybe for your application you will need to use pull-up resistor.I think you can use 10K and connect it to VCC(5V) of Atmega and to that pin.

Nema komentara:

Objavi komentar