Color Sensor from an RGB LED and a Photocell

When you need to quantify the color of an object, you’ve got quite a few options. You can throw a Raspberry Pi camera and OpenCV at the problem and approach it through software, or you can buy an off-the-shelf RGB sensor and wire it up to an Arduino. Or you can go back to basics and build this reflective RGB sensor from an LED and a photocell.

The principle behind [TechMartian]’s approach is simplicity itself: shine different colored lights on an object and measure how much light it reflects. If you know the red, green, and blue components of the light that correspond to maximum reflectance, then you know the color of the object. Their sensor uses a four-lead RGB LED, but we suppose a Neopixel could be used as well. The photosensor is a simple cadmium sulfide cell, which measures the intensity of light bouncing back from an object as an Arduino drives the LED through all possible colors with PWM signals. The sensor needs to be white balanced before use but seems to give sensible results in the video below. One imagines that a microcontroller-free design would be possible too, with 555s sweeping the PWN signals and op-amps taking care of detection.

And what’s the natural endpoint for a good RGB sensor? A candy sorter, or course, of which we have many examples, from the sleek and polished to the slightly more hackish.

Continue reading “Color Sensor from an RGB LED and a Photocell”

Sound Card Tachometer Rises From the Junkbox

We love writing up projects that re-use lots of old parts. In fact, we save the links and use them as defense when our significant other complains about the “junk” in the basement. No, that tactic hasn’t ever worked, but we’re going to keep trying. Case in point, [Wotboa] needed a non-contact tachometer. There are plenty of commercial products which do just that. After consulting his parts bin, [wotboa] realized he had everything he needed to hack out his own. An IR break beam sensor from an old printer was a perfect fit in an aluminum tube. With the outer shell removed, the emitter and detector were mounted in the nylon shell of an old PC power supply connector, effectively turning them pair into a reflective sensor. To amplify the circuit, [wotboa] used a simple 2n2222 transistor circuit. The key is to keep the voltage seen by the sound card the range of a line level signal. This was accomplished by adding a 2.2 Megohm resistor in line with the output. [wotboa] drew his schematic in eagle, and etched his own PCB for the project. Even the tachometer’s case came from the parts bin. An old wall wart power supply gave up its shell for the cause, though [wotboa] is saving the transformer for another project.

For sensing, [wotba] used [Christian Zeitnitz’s] Soundcard Oscilloscope software.  Measuring the RPM of the device under test is simply a matter of determining the frequency of the signal and multiplying by 60. A 400 Hz signal would correspond to a shaft turning at 24,000 RPM. The circuit performs well in the range of RPM [wotboa] needs, but using a sound card does have its limits. The signals on the scope look a bit distorted from the square waves one would expect. This is due to the AC coupled nature of sound cards. As the signal approaches DC, the waveform will become more distorted. One possible fix for this would be to remove the AC coupling capacitor on the sound card’s input. With the capacitor removed, an op amp buffer would be a good idea to prevent damage to the sound card.

[Via Instructables]

Counting bees

This is the bee counter which [Hydronics] designed. It’s made to attach to the opening for a hive, and will count the number of bees entering and exiting. We’re not experienced bee keepers ourselves (in fact we’re more of the mind of getting rid of stinging beasties) but we understand their important role in agriculture and ecosystem so we’re glad someone’s making a nice home for them.

Most of the apparatus is a circuit board lined with reflective sensors. There is a double-row of pin sockets on the top of the board which accepts the Teensy+ which monitors those sensors. The bees must pass below this PCB every time they enter or leave the hive, thereby tripping a sensor. In the video after the break [Hydronics] shows off the system with a netbook used to monitor the output. But it sounds like he has plans for an integrated display system in future versions of the bee counter.

Continue reading “Counting bees”