Tuesday, January 25, 2011

Light-Based Orientation Sensor

This quarter is turning out to be significantly more work than I hoped for, which is why things have been particularly quiet as of late.

This is a simple proof-of-concept for an orientation sensor based on sensing the angle of overhead lighting.  This is done by mounting two phototransistors 90 degrees apart, such that as the object rotates under a fixed overhead light, a differential signal from the phototransistors indicate the direction and magnitude of orientation.  The phototransistors pass a current as a function of the intensity of light striking them.  By feeding this into the base of an NPN transistor, this current can be amplified to a point where passing it through a pair of 100Ω resistors generates a low-impedance differential voltage signal as a function of tilt.

Video:


I sketched this out during my professional ethics lecture today, but was definitely surprised how sensitive it ended up being when I actually put it together.  The resulting signal is generally +/- 25 mV under a 25W light, so conditioning with an amplifier and filter will definitely be needed before being used in control circuitry, but nothing more than 20dB of gain is needed to be useful.  It was showing several tenths of mV change in output for as little as an envelope placed under one side of the breadboard.
 The obvious application for this is to be used on a single axis balancing robot to give a linear tilt indication.  As the robot begins to tilt one way or the other, the resulting change in signal is used to move the bottom of the robot back under the top.  This could be done with either entirely analog circuitry, or using a microcontroller with an ADC and PWM output to the H bridge on the motor.

 Parts list is pretty short:
  • 2 phototransistors, 400-800nm
  • 2 NPN transistors (2N2222)
  • 2 100Ω resistors
Obviously, the signal conditioning will take quite a bit more, but that's a function of what you want to do with it.

I was inspired by this video of a balancing robot which used a simple CdS resistor voltage divider to the same effect.  It's a very well done video, but I find videos a rather tedious medium for presenting more than a demonstration of these things.  He also has some interesting ideas on using a 555 as a controller, so it's an interesting watch.

No comments:

Post a Comment