DIY Capacitive Rotational Encoder on the Cheap with FR4

Rotary encoders are critical to many applications, even at the hobbyist level. While considering his own rotary encoding needs for upcoming projects, it occurred to [Jan Mrázek] to try making his own DIY capacitive rotary encoder. If successful, such an encoder could be cheap and very fast; it could also in part be made directly on a PCB.

First prototype, two etched plates with transparent tape as dielectric material. Disc is 15 mm in diameter.

The encoder design [Jan] settled on was to make a simple adjustable plate capacitor using PCB elements with transparent tape as the dielectric material. This was used as the timing element for a 555 timer in astable mode. A 555 in this configuration therefore generates a square wave that changes in proportion to how much the plates in the simple capacitor overlap. Turn the plate, and the square wave’s period changes in response. Response time would be fast, and a 555 and some PCB space is certainly cheap materials-wise.

The first prototype gave positive results but had a lot of problems, including noise and possibly a sensitivity to temperature and humidity. The second attempt refined the design and had much better results, with an ESP32 reliably reading 140 discrete positions at a rate of 100 kHz. It seems that there is a tradeoff between resolution and speed; lowering the rate allows more positions to be reliably detected. There are still issues, but ultimately [Jan] feels that high-speed capacitive encoders requiring little more than some PCB real estate and some 555s are probably feasible.

This project is a reminder that FR4 (whether copper-clad, etched, or blank) shows up in clever applications: copper tape and blank FR4 can be used to quickly prototype RF filters, PocketNC built an entire small CNC tool around FR4, and our own [Voja] wrote a full guide on making beautiful enclosures from FR4.

Automated Chamber Passes Just the Right Gas

It sounds like an overly complicated method a supervillain would use to slowly and painfully eliminate enemies — a chamber with variable oxygen concentration. This automated environmental chamber isn’t for torturing suave MI6 agents, though; rather, it enables cancer research more-or-less on the cheap.

Tasked with building something to let his lab simulate the variable oxygen microenvironments found in some kinds of tumors, [RyanM415] first chose a standard lab incubator as a chamber to mix room air with bottled nitrogen. With a requirement to quickly vary the oxygen concentration from the normal 21% down to zero, he found that the large incubator took far too long to equilibrate, and so he switched to a small acrylic box. Equipped with a mixing fan, the smaller chamber quickly adjusts to setpoints, with an oxygen sensor providing feedback and controlling the gas valves via a pair of Arduinos. It’s quite a contraption, with floating ball flowmeters and stepper-actuated variable gas valves, but the results are impressive. If it weren’t for the $2000 oxygen sensor, [RyanM145] would have brought the whole project in for $500, but at least the lab can use the sensor elsewhere.

Modern biology and chemistry labs are target-rich environments for hacked instrumentation. From DIY incubators to cheap electrophoresis rigs, we’ve got you covered.

Continue reading “Automated Chamber Passes Just the Right Gas”

“Hey! Don’t Lock the Door, I’m in Here!”

Those that work in front of a computer for a living spend most of the time making very little sound. Unless you’re a member of the clicky mechanical keyboard club, your working time is a low-observables time during which people can forget about you. You can make sure you’re not overlooked with this smartphone hotspot presence detector.

[Emilio Ficara]’s quiet work habits resulted in his housemates locking him in sometimes, to his inconvenience. PIR or microwave occupancy sensors might have worked to fix the problem, except that a few flexing fingers aren’t always enough to trigger them. Luckily, [Emilio] is also wisely distrustful of free WiFi, so his phone is always set up as a mobile hotspot, giving him the means to reliably detect his presence. An ATtiny2313 and an ESP-01 do the business of polling for the SSID of his phone and blinking a bright blue LED by his door for his housemates. It’s not perfect, of course; it could easily be spoofed by anyone else who knows his SSID. But simple works for now.

With almost everyone carrying one now, smartphone detection is a good proxy for the presence of a person. But it doesn’t work in every case, so you may want to familiarize yourself with the aforementioned PIR and microwave methods.

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”

Hackaday Prize Entry: MappyDot, a Micro Smart LiDAR Sensor

[Blecky]’s entry to the Hackaday Prize is MappyDot, a tiny board less than a square inch in size that holds a VL53L0X time-of-flight distance sensor and can measure distances of up to 2 meters.

MappyDot is more than just a breakout board; the ATMega328PB microcontroller on each PCB provides filtering, an easy to use  I2C interface, and automatically handles up to 112 boards connected in a bus. The idea is that one or a few MappyDots can be used by themselves, but managing a large number is just as easy. By dotting a device with multiple MappyDots pointing in different directions, a device could combine the readings to gain a LiDAR-like understanding of its physical environment. Its big numbers of MappyDots [Blecky] is going for, too: he just received a few panels of bare PCBs that he’ll soon be laboriously populating. The good news is, there aren’t that many components on each board.

It’s great to see open sourced projects and tools in which it is clear some thought has gone into making them flexible and easy to use. This means they are easier to incorporate into other work and helps make them a great contestant for the Hackaday Prize.

Garage Distance Sensor Kicks Tennis Ball To Curb

Those with small garages might be familiar with the method of hanging a tennis ball from a ceiling to make sure they don’t hit the back wall with their car. If the car isn’t in the garage, though, the tennis ball dangling from a string tends to get in the way. To alleviate this problem, [asaucet] created a distance sensor that can tell him when his car is the perfect distance from the garage wall.

At the heart of the distance sensor is an HC-SR04 ultrasonic rangefinder and a PIC16F88 microcontroller. [asaucet] uses a set of four LEDs to alert the driver how close they are to the garage wall. [asaucet] also goes into great detail about how to use an LCD with this microcontroller for setting up the project, and the amount of detail should be enough to get anyone started on a similar project.

While this isn’t a new idea, the details that [asaucet] goes into in setting up the microcontroller, using the distance sensor, and using an LCD are definitely worth looking into. Even without this exact application in mind, you’re sure to find some helpful information on the project page.

Continue reading “Garage Distance Sensor Kicks Tennis Ball To Curb”

Going Digital: Upgrading A Boat’s Analog Gauge

The odds are that many of you do not own a boat that you get to tinker around with. [Mavromatic] recently acquired one that had — much to his consternation — analog gauges. So in order to get his ship ship-shape, he built himself a custom digital gauge to monitor his vessel’s data.

Restricted to the two-inch hole in his boat’s helm, trawling the web for displays turned up a 1.38-inch LCD display from 4D Systems. Given the confined space, a Teensy 3.2 proved to be trim enough to fit inside the confined space alongside a custom circuit board — the latter of which includes some backup circuits if [mavromatic] ever wanted to revert to an analog gauge.

Two days of acclimatization to the display’s IDE and he had enough code to produce a functional display right when the parts arrived.

Continue reading “Going Digital: Upgrading A Boat’s Analog Gauge”