Posts with «encoder» label

2D-Scanner Records Surfboard Profiles for Posterity

[Ryan Schenk] had a problem: he built the perfect surfboard. Normally that wouldn’t present a problem, but in this case, it did because [Ryan] had no idea how he carved the gentle curves on the bottom of the board. So he built this homebrew 2D-scanner to make the job of replicating his hand-carved board a bit easier.

Dubbed the Scanbot 69420 – interpretation of the number is left as an exercise for the reader, my dude – the scanner is pretty simple. It’s just an old mouse carrying a digital dial indicator from Harbor Freight. The mouse was gutted, with even the original ball replaced by an RC plane wheel. The optical encoder and buttons were hooked to an Arduino, as was the serial output of the dial indicator. The Arduino consolidates the data from both sensors and sends a stream of X- and Z-axis coordinates up the USB cable as the rig slides across the board on a straightedge. On the PC side, a Node.js program turns the raw data into a vector drawing that represents the profile of the board at that point. Curves are captured at various points along the length of the board, resulting in a series of curves that can be used to replicate the board.

Yes, this could have been done with a straightedge, a ruler, and a pencil and paper – or perhaps with a hacked set of calipers – but that wouldn’t be nearly as much fun. And we can certainly see applications for this far beyond the surfboard shop.

Upgrading a MIDI Controller with an FPGA

While the “M” in MIDI stands for “musical”, it’s possible to use this standard for other things as well. [s-ol] has been working on a VJ setup (mixing video instead of music) using various potentiometer-based hardware and MIDI to interface everything together. After becoming frustrated with drift in the potentiometers, he set out to outfit the entire rig with custom-built encoders.

[s-ol] designed the rotary-encoder based boards around an FPGA. It monitors the encoder for changes, controls eight RGB LEDs per knob, and even does capacitive touch sensing on the aluminum knob itself. The FPGA communicates via SPI with an Arduino master controller which communicates to a PC using a serial interface. This is [s-ol]’s first time diving into an FPGA project and it looks like he hit it out of the park!.

Even if you’re not mixing video or music, these encoders might be useful to any project where a standard analog potentiometer isn’t accurate or precise enough, or if you just need something that can dial into a specific value quickly. Potentiometers fall short in many different ways, but if you don’t want to replace them you might modify potentiometers to suit your purposes.

Manual 3D Digitizer Works a Bit Like 3-Dimensional Measuring Tape

Digitizing an object usually means firing up a CAD program and keeping the calipers handy, or using a 3D scanner to create a point cloud representing an object’s surfaces. [Dzl] took an entirely different approach with his DIY manual 3D digitizer, a laser-cut and 3D printed assembly that uses rotary encoders to create a turntable with an articulated “probe arm” attached.

Each joint of the arm is also an encoder, and by reading the encoder values and applying a bit of trigonometry, the relative position of the arm’s tip can be known at all times. Manually moving the tip of the arm from point to point on an object therefore creates measurements of that object. [Dzl] successfully created a prototype to test the idea, and the project files are available on GitHub.

We remember the earlier version of this project and it’s great to see how it’s been updated with improvements like the addition of a turntable with an encoder. DIY 3D digitizing takes all kinds of approaches, and one example was this unit that used four Raspberry Pi Zeros and four cameras to generate high quality 3D scans.

High-Effort Streaming Remote for Low-Effort Bingeing

There’s no limit to the amount of work some people will put into avoiding work. For instance, why bother to get up from your YouTube-induced vegetative state to adjust the volume when you can design and build a remote to do it for you?

Loath to interrupt his PC streaming binge sessions, [miroslavus] decided to take matters into his own hands. When a commercially available wireless keyboard proved simultaneously overkill for the job and comically non-ergonomic, he decided to build a custom streaming remote. His recent microswitch encoder is prominently featured and provides scrolling control for volume and menu functions, and dedicated buttons are provided for play controls. The device reconfigures at the click of a switch to support Netflix, which like YouTube is controlled by sending keystrokes to the PC through a matching receiver. It’s a really thoughtful design, and we’re sure the effort [miroslavus] put into this will be well worth the dozens of calories it’ll save in the coming years.

A 3D-printed DIY remote is neat, but don’t forget that printing can also save a dog-chewed remote and win the Repairs You Can Print contest.

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.

[Editor’s note: This is a Hackaday writer’s hack, hence the “I” in place of the usual “we”. We all love custom peripherals though, and a good number of us love OpenSCAD, so you could probably read it either way, but we don’t want to take credit for [Brian]’s work.]


Filed under: 3d Printer hacks, Arduino Hacks

This Old Mouse Keeps Track of Filament Usage

Keeping track of your 3D-printer filament use can be both eye-opening and depressing. Knowing exactly how much material goes into a project can help you make build-versus-buy decisions, but it can also prove gut-wrenching when you see how much you just spent on that failed print. Stock filament counters aren’t always very accurate, but you can roll your own filament counter from an old mouse.

[Bin Sun]’s build is based around an old ball-type PS/2 mouse, the kind with the nice optical encoders. Mice of this vintage are getting harder to come by these days, but chances are you’ve got one lying around in a junk bin or can scrounge one up from a thrift store. Stripped down to its guts and held in place by a 3D-printed bracket, the roller that used to sense ball rotation bears on the filament on its way to the extruder. An Arduino keeps track of the pulses and totalizes the amount of filament used; the counter handily subtracts from the totals when the filament is retracted.

Simple, useful, and cheap — the very definition of a hack. And even if you don’t have a 3D-printer to keep track of, harvesting encoders from old mice is a nice trick to file away for a rainy day. Or you might prefer to just build your own encoders for your next project.


Filed under: 3d Printer hacks, Android Hacks

Wheel of Resistors Form Unique Rotary Encoder

Continuing his tradition of making bits of wire and scraps of wood work wonders, [HomoFaciens] is back with a unique and clever design for an electromechanical encoder.

There are lots of ways to build an encoder, and this is one we haven’t seen before. Not intended in any way to be a practical engineered solution, [HomoFaciens]’ build log and the video below document his approach. Using a rotating disc divided into segments by three, six or eight resistors, the encoder works by adding each resistor into a voltage divider as the disc is turned. An Arduino reads the output of the voltage divider and determines the direction of rotation by comparing the sequence of voltages. More resistors mean higher resolution but decreased maximum shaft speed due to the software debouncing of the wiped contacts. [HomoFaciens] has covered ground like this before with his tutorial on optical encoders, but this is a new twist – sort of a low-resolution continuous-rotation potentiometer. It’s a simple concept, a good review of voltage dividers, and a unique way to sense shaft rotation.

Is this all really basic stuff? Yep. Is it practical in any way? Probably not, although we’ll lay odds that these encoders find their way into a future [HomoFaciens] CNC build. Is it a well-executed, neat idea? Oh yeah.


Filed under: misc hacks

Mechaduino- Closed Loop Stepper Servos For Everyone

Is it something in the water, or have there been a lot of really cool servo projects lately? Mechaduino is a board that sits on a regular stepper motor and turns it into a servo with a closed loop control of 0.1degree.

Whenever we post something about using cheap brushless motors for precision control, someone comments that a stepper is just a brushless motor with a lot of poles, why not just control it like one. That’s exactly what the Mechaduino does. They also hint at doing something very clever with a magnetic encoder on the board which allows them, after a calibration routine, to get the accuracy they’ve promised.

T
he Arduino-sounding bit of the name comes from their full compatibility with the Arduino development environment. The brains of the board is the compatible,  SAMD21 ARM M0+  chip. They wanted the board to be as accessible as possible. On top of this, it also allows the user to use any control algorithm they want for the board. Most industrial controllers are limited to PID control, for returning to the last sent position. Opening up the control allows for interesting applications, such as motors that behave like mass spring damper systems, or electronically gearing the input of one stepper to the output of another.

The board supports lots of standard communication protocols, but the acceptance of regular stepper inputs make it extra interesting. It can become a drop-in replacement for the motors on a normal CNC or 3D printer, which have full closed loop control as shown in the video after the break.

They intend to keep working on the project until it gets to a level where they could kickstart it. However, rather than vaguely promise an open source release sometime after the launch like some have done, interested readers can skim all the design files off their GitHub and get to playing with it today. Firmware and Hardware.


Filed under: cnc hacks

USB Volume Control

If you buy expensive computer speakers, they often have a volume knob you can mount somewhere on your desk so you aren’t dependent on the onboard volume control. [Kris S] decided to build his own version of the remote volume control. Not surprisingly, it uses an Arduino-compatible Digispark board and a rotary controller. The Digispark (that [Kris S] bought for $2) is compatible with the Adafruit Trinket. This is key because the Trinket libraries are what make it easy to send media keys over the USB (using the HID interface) to control the volume.

Really, though, the best part of the build is the good looking knob made out of a pill bottle (see the video below). The micro Digispark is small enough to fit in the lid of the pill bottle, and some wax and pellets add some heft to the volume control.

The standard Arduino library has trouble sending multimedia keys, but in a previous post I built a gesture-based volume control that managed to pull it off.  We’ve also covered a similar volume control in the past. That one is also very good looking, but was a more complicated build than what [Kris S] pulled off here.


Filed under: Arduino Hacks, peripherals hacks

Prevent Failed Prints With A Filament Speed Sensor

If you have used a 3D printer for any length of time, you’ve probably experienced a failed print caused by a clogged nozzle. If you’re not around to stop the print and the nozzle stays hot and full of filament for hours, the clog gets even worse. [Florian] set out to solve this issue with an encoder that measures filament speed, which acts as an early warning system for nozzle clogs.

[Florian] designed a small assembly with a wheel and encoder that measures filament movement. The filament passes under the encoder wheel before it’s fed into the 3D printer. The encoder is hooked up to an Arduino which measures the Gray code pulses as the encoder rotates, and the encoder count is streamed over the serial port to a computer.

When the filament slows down or stops due to a nozzle clog, the Python script plays a notification sound to let you know that you should check your nozzle and that your print might fail. Once [Florian] works out some of the kinks in his setup, it would be awesome if the script could stop the print when the nozzle fails. Have any other ideas on how to detect print failures? Let us know in the comments.


Filed under: 3d Printer hacks