Rotary Encoders Become I2C Devices

Rotary encoders are the bee’s knees. Not only do you get absolute positioning, you can also use a rotary encoder (with a fancy tact button underneath) for an easy UI for any electronics project. There’s a problem with rotary encoders, though: it’s going to use Gray code or something weird, and getting a rotary encoder to work with your code isn’t as easy as a simple button.

For his Hackaday Prize project, [fattore.saimon] has come up with the solution for using multiple rotary encoders in any project. It’s a board that turns a rotary encoder into an I2C device. Now, instead of counting rising and falling edges, adding a rotary encoder to a project is as easy as connecting four wires.

The project is built around the PIC16F18344, a small but surprisingly capable microcontroller that reads a rotary encoder and spits data out as an I2C slave device. Also on board are a few pins for an RGB LED, general purpose pins, the ability to set all seven bits of the I2C address (who wants 127 rotary encoders?), and castellated holes for connecting several boards together.

This project is an update of [fattore]’s earlier I2C Encoder, and there are a lot of improvements in the current version. It’s slightly smaller, has better connectors, and uses a more powerful microcontroller. That’s just what you need if you want a ton of rotary encoders for all those cool interactive projects.

Eavesdropping On A VGA Monitor’s Conversations

Did you ever wonder what your monitor and your computer are talking about behind your back? As it turns out, there’s quite a conversation going on while the monitor and the computer decide how to get along, and sniffing out VGA communications can reveal some pretty fascinating stuff about the I²C protocol.

To reverse engineer the configuration information exchanged between a VGA monitor and a video card, [Ken Shirriff] began by lopping a VGA cable in two. The inside of such cables is surprisingly complex, with separate shielding wires for each color and sync channel and a host of control wires, all bundled in multiple layers of shielding foil and braid to reduce EMI. [Ken] identified the clock and data lines used for the I²C interface and broke those out into a PocketBeagle for analysis using the tiny Linux machine’s I²C tools.

With a Python script to help decode the monitor’s Extended Display Identification Data (EDID) data, [Ken] was able to see everything the monitor knows about itself — manufacturer, serial number, all the supported resolution modes, and even deprecated timing and signal information left over from the days when CRTs ruled the desktop. Particularly interesting are the surprisingly limited capabilities of a VGA display in terms of color reproduction, as well as [Ken]’s detailed discussion on the I²C bus in general and how it works.

We always enjoy these looks under the hood that [Ken] is so good at, and we look forward to his reverse engineering write-ups. His recent efforts include a look at core memory from a 50-year old mainframe and reverse engineering at the silicon level.

Tiny Function Generator On The ATtiny85, Complete With OLED

It’s easy to have a soft spot for “mini” yet perfectly functional versions of electronic workbench tools, like [David Johnson-Davies]’s Tiny Function Generator which uses an ATtiny85 to generate different waveforms at up to 5 kHz. It’s complete with a small OLED display to show the waveform and frequency selected. One of the reasons projects like this are great is not only because they tend to show off some software, but because they are great examples of the kind of fantastic possibilities that are open to anyone who wants to develop an idea. For example, it wasn’t all that long ago that OLEDs were exotic beasts. Today, they’re available off the shelf with simple interfaces and sample code.

The Tiny Function Generator uses a method called DDS (Direct Digital Synthesis) on an ATtiny85 microcontroller, which [David] wrote up in an earlier post of his about waveform generation on an ATtiny85. With a few extra components like a rotary encoder and OLED display, the Tiny Function Generator fits on a small breadboard. He goes into detail regarding the waveform generation as well as making big text on the small OLED and reading the rotary encoder reliably. His schematic and source code are both available from his site.

Small but functional microcontroller-based electronic equipment are nifty projects, and other examples include the xprotolab and the AVR-based Transistor Tester (which as a project has evolved into a general purpose part identifier.)

Reading 16 Rotary Encoders At The Same Time

We’re digging these daisy-chainable encoders built by [fattore.saimon]. Each module consists of a rotary encoder attached to a PCB with a PIC16F15386 on the back. As we’ve covered in the past, the Microchip released their feature-rich PIC16 microprocessor just this year, and it’s great to see them start to crop up in projects. With 4 address jumpers on the back of each PCB, [fattore.saimon] is able to connect up to 16 of the encoders on the bus. The modules also have male and female plugs so he can connect them physically as well, to simplify wiring. Each module also has a PWMable bicolor LED for keeping track of each encoder’s setting.

If you’re interested in making your own you can buy the PCBs from Tindie or download the project files from the creator’s GitHub, including an Arduino library.

We love encoders here on Hackaday — building DIY encoders, as well as using them in projects like this precision cutting jig. And definitely read our colleague [Al]’s great piece on encoders.

Ultrasonic Array Gets Range Data Fast And Cheap

How’s your parallel parking? It’s a scenario that many drivers dread to the point of avoidance. But this 360° ultrasonic sensor will put even the most skilled driver to shame, at least those who pilot tiny remote-controlled cars.

Watch the video below a few times and you’ll see that within the limits of the test system, [Dimitris Platis]’ “SonicDisc” sensor does a pretty good job of nailing the parallel parking problem, a driving skill so rare that car companies have spent millions developing vehicles that do it for you. The essential task is good spatial relations, and that’s where SonicDisc comes in. A circular array of eight HC-SR04 ultrasonic sensors hitched to an ATmega328P, the SonicDisc takes advantage of interrupts to make reading the eight sensors as fast as possible. The array can take a complete set of readings every 10 milliseconds, which is fast enough to allow for averaging successive readings to filter out some of the noise that gets returned. Talking to the car’s microcontroller over I2C, the sensor provides a wealth of ranging data that lets the car quickly complete a parallel parking maneuver. And as a bonus, SonicDisc is both open source and cheap to build — about $10 a copy.

Rather use light to get your range data? There are some pretty cheap LIDAR units on the market these days.

Continue reading “Ultrasonic Array Gets Range Data Fast And Cheap”

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.

A Beverage Cooler That Comes To You!

Feel like taking a long walk, but can’t be bothered with carrying your drinks? Have no fear, this  “Follow Me” Cooler Bot is here!

Really just a mobile platform with a cooler on top, the robot connects to smartphone via Bluetooth, following it using GPS. Making the platform involves a little woodworking skill, and an aluminium hub with a 3D-printed hub adapter connects the motors to a pair 6″ rubber wheels with a swivel caster mounted at the rear. A pocket in the platform’s base houses the electronics.

The Arduino Uno — via an L298n motor driver — controls two 12V DC, brushed and geared motors mounted with 3D printed brackets, while a Parallax PAM-7Q GPS Module in conjunction with an HMC 5883L compass help the robot keep its bearing. A duo of batteries power the motors and the electronics separately to prevent  any malfunctions.

Continue reading “A Beverage Cooler That Comes To You!”