Arduino Uno + potentiometer + OLED == virtual circular dial

What am I talking about?

Well, I was just compiling the blogs pages for the next issue of Electronics Weekly magazine and I selected, for Engineer In Wonderland, Alice’s blog about an easy way to manually set a 16-bit number in an Arduino (you can see Part 1 and Part 2).

The aim was to be able to quickly, accurately and manually set up a 16-bit binary number in an Arduino following the demise of a FY6900 DDS signal generator. Alice needed a source of crystal-controlled square waves.

The post finishes with a paean to a newly discovered project that contains a “most wonderful potentiometer interface”. It pushes an Arduino Uno to its max as a graphics controller to drive a small graphical OLED display right behind the potentiometer knob. It was created by the person behind the ‘upir’ YouTube channel, apparently based in the Czech Republic.

All well and good. But then the next thing I turn to, for possible projects to feature on Gadget Master, is a stored Newsletter from the Arduino team highlighting recent prototypes. One of which contains the very same OLED display looking back at me…

Virtual circular dial

It’s featured on the Arduino blog – Take things up a notch by turning the humble OLED into a rotary dial

A key style feature – tho the graphics themselves are top-notch – is that the potentiometer sits ‘over’ the display so the curved face is circled round neatly with changing values – a virtual circular dial, as it were. I would have just lumpenly sat the control beneath the LED panel… Small things make a big difference, as you can see above, and below when you see it in action in the video…

Not only does the display show the current reading, clearly highlighted, but it also scrolls the values on the display being generated by the turns of the physical pot.

Based on an Arduino Uno and using an 128×64 I2C/SPI OLED, the system’s display responds in real-time, using the U8glib library, to the external potentiometer also connected to board.

The Arduino team writes:

“Originally, the system achieved an average of 10 FPS, but upir wanted to push it even further for maximum performance. Sending new pixel values to the screen caused the pixel calculations to be run multiple times, so by placing the intermediate data into a series of buffers and only drawing pixels once per page instead, a new FPS of 27.53 was achieved — an almost 3x improvement.”

Indeed, excellent. And you can view the full post here, where there are also more detailed videos, if you want to try to follow in his footsteps.

Alternatively, you may – like ‘Alice’ – feel rather like ‘hanging up your keyboard’!

Source link

We will be happy to hear your thoughts

Leave a reply

Enable registration in settings - general
Shopping cart