Subscribe To Robotics | IntroDuction | History | Home


Friends Dont Forget To check the archieve at the left end of the page



Make Your Own Robot Tutoials



Simple Beetle Bot | Wired Robot | Combat Robot | Solar Engine |



Beam Symet | Photopopper | Beam Trimet | Line Follower |

Latest Updates
Driver Less Car | I-Sobot | MotherBoard | MicroController | Artificial Brain |

Camera Sensors Hardware | Remote Control Working

Google

Wednesday, May 28, 2008

Cadmium-Sulfide Color Sensor

Over the years, a number of methods have been tried to create an inexpensive color sensor. One way is to surround an ordinary photocell with a red, green, and blue ultra-bright LED.



All three LEDs are never actually turned on at the same time. Each LED is turned on one at a time and the intensity of light reflected back to the cadmium-sulfide photocell is measured. An analog-to-digital converter measures the voltage divided between a fixed resistor (usually between 470 ohms and 10,000 ohms) and the photosensitive resistor (the photocell).

Ultra-bright LEDs are available from any electronics seller or eBay. Back when I first wrote this article, I got the LEDs from AllElectronics. I purchased red #LED-50 for $0.50, true green #LED-57 for $3.75, and blue #LED-58 for $3.50. Prices have come down considerably since then.

The advertised brightness of red is 3000 mcd, green is 3000 mcd, and blue is 1200 mcd. The resistor values that provided equivalent readings reflecting off white paper are red with 100 ohms, green with 800 ohms, and blue with 100 ohms. Either the green LED is a lot brighter than the others or the photocell's peak sensitivity is to green (or probably some combination of both).




The LEDs are water clear when turned off. Black electrical tape surrounds the photocell in the center of the LEDs. The tape blocks the direct light from the LEDs from reaching the photocell, thus detecting only reflected light.

After the amount of red light, green light, and blue light is measured, each component is individually scaled based on minimum and maximum values obtained at calibration. One-time calibration consists of aiming the completed sensor first at a white piece of paper and then at a piece of black conductive foam. The maximum and minimum values are plugged into the EEPROM of the microcontroller. Scaling based on actual data allows the individual attributes of that particular sensor and set of LEDs to be accounted for.



Alternatively, you can adjust the balance of the colors in hardware by using with three separate trimpots (trimmer potentiometers). Dialing a trimpot changes the brightness of a particular LED. For example, if there's too much red being sensed, simply increase the resistance to decrease the LED brightness by turning the trimpot attached to the red LED.

It's a good idea to always include a minimum fixed resistor value (100 ohms to 150 ohms) in series with each trimpot so that if you accidentally dial the trimpot to 0 ohms the LED won't be damaged.

The photo above includes an Atmel ATtiny45 microcontroller for turning on and off each of the LEDs, reading the results, and outputting the values to a personal computer. You can use any microcontroller of your choice. Or, if you just want a color mixer to play with various output colors, simply pull the microcontroller and feed the resistors 5V.



above is a pic of Regular and small cadmium-sulfide photocells.

Improvement

The above readings were taken through a clear plastic case (not shown). By substituting a few black threads on which to rest the candy, the contrast between colors improved significantly. Perhaps the shiny plastic reflected too much LED light back into the sensor, regardless of the actual color of the object being examined.

Position Problem!

Later discovered a significant flaw with the sensor as currently designed. The candies had always been manually centered for reading. However, misplacement of objects causes more light to reflect from one of the LEDs than the other LEDs. This causes a false detection of color, since it now appears that the object has more of one particular color simply because that LED is closer to the object.

The design could be modified so that the LEDs can be placed together with all light appearing through a single tube or source. A disadvantage to this approach would be a reduction in brightness. An advantage would be that only one light source (the tube) needs to be aligned with the sensor for optimal and equal reflection.



For objects up close, the multicolor LED (also called an RGB LED) works pretty well for reducing object-position errors. Unfortunately, as the RGB LED is lifted up, it becomes apparent that the position of the individual color chips within the single lens causes the light sources to diverge. Perhaps this isn't as much of a problem with other RGB LEDs?

Speed Limitation

Only two or three complete color readings can be performed per second. The cadmium-sulfide photocell needs time to react to the brightness changes. Blinking the LEDs faster than this rate reduces contrast until all colors result in the same apparent reflective value, as though all LEDs were lit at the same time.

A visible-light phototransistor would provide superior speed. The infrared (remote-control quality) phototransistors I possess are all nearly insensitive to visible light, especially blue. Therefore, infrared diodes and infrared phototransistors won't work.

At first I thought I could use the "visible phototransistor" from Jameco Electronics (part number 120221, product number BPW77, for $1.99 each). However, the datasheet shows that the phototransistor is 100% sensitive for infrared, 50% sensitive for red, 33% sensitive for green, and even less sensitive for blue. This could be somewhat compensated for by using lower-value resistors on the green LED and blue LED so that they would emit more light.

A better choice is the family of TAOS light-to-voltage converters. Each consists of a fast true-visible-light photodiode and an amplifier in a hobbyist-friendly three-pin package. No external voltage-divider resistor is necessary.

At Mouser Electronics, you can find three major visible-light varieties that trade off speed vs. light sensitivity. (But even the slowest one is 1000 times faster than a cadmium-sulfide photocell.)

* TSL12S-LF or TSL250R-LF: Slower speed but more light sensitive.
* TSL13S-LF or TSL251R-LF: Middle speed and middle light sensitivity.
* TSL14S-LF or TSL252R-LF: Faster speed but less light sensitivity.



The [sloppy] paint job on the RGB LED is to prevent light from going directly to the TAOS photosensor. This sensor arrangement works by have each LED color (red, green, and blue) in the RGB LED turned on one at a time, the light then reflects off of an object, and is read by the photosensor. The next color is turned on, the results read, and so on.

Friday, May 23, 2008

TINY MOTOR



Tiny motors are wonderful for driving little robots (like Appetizer or Chicago) or turning small parts (like sensors) on big robots. Illustrated above, from left to right:

* Blue m&m's candy for size comparison
* Cell-phone vibrating motor (salvaged)
* Solarbotics #TPM tiny pager motor. Replaced by TMP2 ($4.95) -- comes with clean shaft (no weight)
* Solarbotics #RPM pager motor. Replaced by RMP2 ($3.95) -- comes with clean shaft (no weight)

Electronic Goldmine has a number of pager motors with weights on their shafts: G12809 ($0.99), G13566 ($1.29), G15241 ($0.99), G15768 ($0.99), G15768 ($0.99 for 2), G16153 ($1.00).
BGMicro has a pager motor with a weight on its shaft: MOT1030 ($0.99).
All Electronics has a pager motor with a weight on its shaft: #DCM-204 ($1.25).

Solarbotics sells tiny geared pager motors!!

Geared motors are far superior to ordinary pager motors for robotics, since they have more torque (pushing power) and rotate more slowly. See the GM10 ($12) and GM15 ($19) in the Motors section of Solarbotics. Although slightly larger than most pager motors, the GM11, GM11a, GM12a, GM13a, GM18, GM19 ($19.75-$23 each) are still relatively small and are worth a look.

Parts

Before discarding a damaged or obsolete cell phone, pager, or force-feedback joystick (aka game controller), crack it open and recover the vibrating element! The vibrating part usually consists of a miniature motor with an offset-weighted shaft. Because the piece of metal on the shaft is not centered, when the motor spins it causes the device to shift back-and-forth as the weight of the metal piece shifts around and around the motor shaft. Vibration.



Dremel High-Speed Rotary Tool Failure

The offset weight must be removed to make an effective robot motor.

My first attempt at removal was to use a cutting wheel. Then, I tried to use a grinding stone. Although I successfully removed the weight, the process was difficult and took a long time. More significantly, the motor shaft got damaged. In the above photos, the shaft is nearly ground to half diameter. That's not good!

Someone with greater skill and tool-accessory knowledge could probably perform the operation better than I could. The Dremel isn't at fault.

Seriously, always wear goggles or protective eye wear when working with tools!



Locking Pliers

The metal attached to my cell-phone vibrating motors is extremely strong. It doesn't appear to be made of lead or some other malleable element. The metal ended up dulling or damaging the heads of standard pliers and cutters. Even when I could get a grip, I ended up pulling out the entire shaft of the motor. That's not good either!

While attempting to get a better grip on the motor, I accidentally discovered a reliable, repeatable, and easy way to remove the metal weight. Simply applying the locking force of locking pliers to the weight seems to crush or deform the metal very slightly, but enough to pop the crimp.

Unless you've got super powers, normal pliers won't work. The leveraged force of locking pliers is absolutely necessary.



Position, Squeeze, and Tug:

Grip the metal weight at the end of the locking pliers like popping off a beer cap with your molars. (The American Dental Association would like to point out that the prior sentence is very reckless and is likely to result in the enrichment of your local dental specialist.) Try to grip across only the crimped portion of the metal weight, so that it can squish out rather than crimp further. The motor body shouldn't be touching the pliers at all.

Use the greatest squeezing force the pliers can reasonably apply. The more the initial resistance to the squeeze, the easier it is to remove the motor shaft. When positioned and squeezed just right, I barely had to tug on the motor body to pull the shaft from the weight.

Use only your hand to pull on the motor body. No other pliers or tools should be necessary.



Alternate Method: Slitted Metal:

Depending on your access to precision machine tools (like a lathe and a milling machine), it may be possible for you to make a custom gear puller. If not, then a slightly more crude method can produce similar results.



Find the thickest piece of flat stock metal sheet (can be from a junk drawer) that will fit between the end of the motor and the gear or other object you want to remove. Saw or cut a slit part of the way through the metal sheet. See item (1) in above picture. The slit should be wide enough that the motor shaft can be slid on, leaving the gear on one side of the sheet and the motor on the other side of the sheet.

Then, find a rod (like from a consumed Dremel grinding bit) or make a punch tool that can fit through the object to make contact with the motor shaft. See item (2) in the above picture.



Place this setup on a vise or something similar to support the metal sheet. With the rod making contact with the motor shaft, gently tap the rod with a hammer. This should force the motor shaft out of the gear. At some point, the motor will fall to the floor. Be sure to put a blanket or something there to catch the motor.

Better still, if you have an arbor press, you can use the same tools to ease the motor free, rather than tapping on it with a hammer.