Roll Your Own Rotary Encoders

[miroslavus] hasn’t had much luck with rotary encoders. The parts he has tested from the usual sources have all been problematic either mechanically or electrically, resulting in poor performance in his projects. Even attempts to deal with the deficiencies in software didn’t help, so he did what any red-blooded hacker would do — he built his own rotary encoder from microswitches and 3D-printed parts.

[miroslavus]’s “encoder” isn’t a quadrature encoder in the classic sense. It has two switches and only one of them fires when it turns a given direction, one for clockwise and one for counterclockwise. The knob has a ratchet wheel on the underside that engages with a small trip lever, and carefully located microswitches are actuated repeatedly as the ratchet wheel moves the trip lever. The action is smooth but satisfyingly clicky. Personally, we’d forsake the 3D-printed baseplate in favor of a custom PCB with debouncing circuitry, and perhaps relocate the switches so they’re under the knob for a more compact form factor. That and the addition of another switch on the shaft’s axis to register knob pushes, and you’ve got a perfectly respectable input device for navigating menus.

We think this is great, but perhaps your project really needs a legitimate rotary encoder. In that case, you’ll want to catch up on basics like Gray codes.

Continue reading “Roll Your Own Rotary Encoders”

16-Cylinder Stirling Engine Gets A Tune Up

Tiny catapults, kinetic sculptures, a Newton’s Cradle — all kinds of nifty toys can adorn the desk of the executive in your life. On the high end of the scale, a 16-cylinder butane-powered Stirling engine makes a nice statement, but when it comes equipped with a propeller that looks ready for finger-chopping, some mods might be in order before bestowing the gift.

We don’t knock [JohnnyQ90] for buying a rotary Stirling engine from one of the usual sources rather than building, of course. With his micro Tesla turbine and various nitro-powered tools, he’s proven that he has the machining chops to scratch-build one of these engines. And it wasn’t just the digit dicing potential of the OEM engine that inspired him. There was a little too much slop in the bearings for his liking, so he machined a new bearing block and shaft extension. With a 3D-printed shroud, a small computer fan, and snappy brass nose cone, the engine started looking more like a small jet engine. And the addition of a pulley and a small generator gave the engine something interesting to do. What’s more, the increased airflow over the cold end of the engine boosted performance.

Need the basics of Stirling engines? Here’s a quick look at the 200-year history of these remarkable devices.

Continue reading “16-Cylinder Stirling Engine Gets A Tune Up”

Add Intuitiveness To OpenSCAD With Encoders

The first time I saw 3D modeling and 3D printing used practically was at a hack day event. We printed simple plastic struts to hold a couple of spring-loaded wires apart. Nothing revolutionary as far as parts go but it was the moment I realized the value of a printer.

Since then, I have used OpenSCAD because that is what I saw the first time but the intuitiveness of other programs led me to develop the OpenVectorKB which allowed the ubiquitous vectors in OpenSCAD to be changed at will while keeping the parametric qualities of the program, and even leveraging them.

All three values in a vector, X, Y, and Z, are modified by twisting encoder knobs. The device acts as a keyboard to

  1. select the relevant value
  2. replace it with an updated value
  3. refresh the display
  4. move the cursor back to the starting point

There is no software to install and it runs off a Teensy-LC so reprogramming it for other programs is possible in any program where rotary encoders may be useful. Additional modes include a mouse, arrow keys, Audacity editing controls, and VLC time searching.

Here’s an article in favor of OpenSCAD and here’s one against it. This article does a good job of explaining OpenSCAD.

Continue reading “Add Intuitiveness To OpenSCAD With Encoders”

Thermal Panorama One Pixel At A Time

Inspiration can strike from the strangest places. Unearthing a forgotten Melexis MLX90614 thermopile from his  ‘inbox,’ [Saulius Lukse] used it to build a panoramic thermal camera.

[Lukse] made use of an ATmega328 to control the thermal sensor, and used the project to test a pair of two rotary stage motors he designed for tilt and pan, with some slip rings to keep it in motion as it captures a scene. That said, taking a 720 x 360 panoramic image one pixel at a time takes over an hour, and compiling all that information into an intelligible picture is no small feat either. An occasional hiccup are dead pixels in the image, but those are quickly filled in by averaging the temperature of adjoining pixels.

The camera  rig works — and it does turn out a nice picture — but [Lukse]  says an upgraded infrared camera to captured larger images at a time and higher resolution would not be unwelcome.


Another clever use of a thermopile might take you the route of this thermal flashlight. if you don’t build your own thermal camera outright.

[Thanks for the tip, Imn!]

Broken Promises Of The Wankel Engine

Through the history of internal combustion engines, there has been plenty of evolution, but few revolutions. Talk of radically different designs always leads to a single name – Wankel. The Wankel rotary engine, most notably used in automobiles by Mazda, has been around since the late 1950’s. The Wankel rotary is an example of a design which makes sense on paper. However, practical problems cause it to underperform in the real world.

Invention and History

felixwankelFelix Wankel’s engine was conceived during a dream. In it, 17-year-old Felix was driving his car to a concert. When he arrived, he bragged to his friends that his car used a new type of engine – half turbine, half reciprocating. “It is my invention!” he told his friends. Upon waking up, Wankel became dedicated to building his engine. Though he never received a formal degree (or a driver’s license), Wankel was a gifted engineer.

Young Wankel’s checkered history includes membership in several anti-semitic groups in the 1920’s. He was also involved with the founding of the Nazi party. His conflicting views on the direction of the party lead to his arrest in 1933. Eventually released through action of Hitler himself, Wankel joined the SS in 1940. The end of the war saw Wankel spending several months in a French prison for his wartime involvement.

Continue reading “Broken Promises Of The Wankel Engine”

Video Gives You The Basics Of DIY Rotary Encoders

Is it really possible to build a rotary encoder out of a flattened tin can and a couple of photodetectors? Sure it’s possible, but what kind of resolution are you going to get from such a contraption? Is there any way that you’d be able to put them to work in a DIY project like a CNC router? If you pay attention to the basics then the answer is yes, and [HomoFaciens] wants to prove that to you with this detailed video on homebrew encoder design.

Faithful Hackaday readers will no doubt recognize [HomoFaciens] from a number of prior appearances on these pages, including this recent hardware store CNC router build. When we first ran across his builds, we admit a snicker or two was had at the homemade encoders, but if you watch the results he manages to get out of his builds, you quickly realize how much you can accomplish with very little. The video is a primer on encoder design, walking you through the basics of sensing rotation with phototransistors, and how a pair of detectors is needed to determine the direction of rotation. He also discusses the relative merits of the number of teeth in the chopper; turns out more isn’t necessarily better. And in the end he manages to turn a car wiper motor into a high-torque servo, which could be a handy trick to have filed away.

Continue reading “Video Gives You The Basics Of DIY Rotary Encoders”

King Of Clever Reads 4-Pin Rotary Encoder With One Analog Pin

Rotary encoders are pretty interesting pieces of technology. They’re a solid way to accurately measure rotation including the direction. [David] recently wrote some software to handle these input devices, but unlike everyone else, his application can get by on only one microcontroller pin.

Most people will use three pins to handle a rotary encoder with a microcontroller: one to handle the switch and two to handle the quadrature inputs. With only one pin left available on his project [David] had to look for another solution, and he focused on the principle that the encoder pins behaved in very specific ways when turning the shaft. He designed a circuit that generates an analog voltage based on the state of those pins. He also wrote a program that can recognize the new analog patterns produced by his rotary encoder and his new circuit.

If you’ve been stuck on a project that uses a rotary encoder because you’ve run out of pins, this novel approach may help you get un-stuck. It’s a pretty impressive feat of circuit design to boot. Just think of how many other projects use these types of input devices and could benefit from it!

[via Project Page go give it a Skull!]