This Cup Holder Crystal Ball Tells Your MPG Future

Hybrid vehicles, which combine an eco-friendly electric motor with a gasoline engine for extended range, are becoming more and more common. They’re a transitional technology that delivers most of the advantages of pure electric vehicles, but without the “scary” elements of electric vehicle ownership which are still foreign to consumers such as installing a charger in their home. But one element which hybrids are still lacking is a good method for informing the driver whether they’re running on petroleum or lithium; a way to check at a glance how “green” their driving really is.

[Ben Kolin] and his daughter [Alyssa] have come up with a clever hack that allows retrofitting existing hybrid vehicles with an extremely easy to understand indicator of real-time vehicle efficiency. No confusing graphics or arcade-style bleeps and bloops, just a color-changing orb which lives in the cup holder. An evolved version which takes the form of a smaller “dome light” that sits on the top of the dashboard could be a compelling aftermarket accessory for the hybrid market.

The device, which they are calling the ecOrb, relies on an interesting quirk of hybrid vehicles. The OBD II interface, which is used for diagnostics on modern vehicles, apparently only shows the RPM for the gasoline engine in a hybrid. So if the car is in motion but the OBD port is reporting 0 RPM, the vehicle must be running under electric power.

With a Bluetooth OBD adapter plugged into the car, all [Ben] and [Alyssa] needed was an Arduino Nano clone with a HC-05 module to read the current propulsion mode in real-time. With some fairly simple conditional logic they’re able to control the color of an RGB LED based on what the vehicle is doing: green for driving on electric power, purple for gas power, and red for when the gas engine is at idle (the worst case scenario for a hybrid).

Check out our previous coverage of OBD hacking on the Cadillac ELR hybrid if you’re looking to learn more about what’s possible with this rapidly developing class of vehicle

Continue reading “This Cup Holder Crystal Ball Tells Your MPG Future”

The Portable, Digital, Visual Theremin

The theremin is, for some reason, what people think of first when they think of electronic musical instruments. Maybe that’s because it was arguably the first purely electronic musical instrument, or because there’s no mechanical analog to something that makes sound simply by waving your hand over it. This project takes that idea and cranks it up to eleven. It’s a portable synthesizer that’s controlled by IR reflectors. Just wave your hand in front of it, and that’s what pitch is going to sound.

The audio hardware for this synth is, like so many winners in the Musical Instrument Challenge in this year’s Hackaday Prize, based on the Teensy and its incredible Audio library. The code consists of two oscillators and a pink noise generator. Pressing down button one activates the oscillators, and the frequency is determined by the IR sensor. Button two cycles through various waveforms, while the third and fourth buttons shift the octaves up and down. The output is I2S, and from there everything is out to an amplifier and speaker.

Of course, it’s really not a musical instrument unless it looks cool, and that’s where this project is really great. It’s a fully 3D printed enclosure that actually looks good. There’s an 8×8 LED array to display the current waveform, and this is something that could actually be a product instead of a project. It’s a great synth, and we’re happy to have it in the running for the Hackaday Prize.

Continue reading “The Portable, Digital, Visual Theremin”

Adaptive Layer Height On The Monoprice Select Mini

If you’ve used a desktop 3D printer, you’re likely familiar with the concept of layer heights. Put simply: thicker layers will print faster, and thinner layers will produce better detail. Selecting your layer height is making a choice between detail and speed, which usually works well enough. For example, prints which are structural and don’t have much surface detail can be done in higher layer heights to maximize speed with no real downside. Conversely, if you’ve got a model with a lot of detail you’ll have to just deal with the increased print time of thinner layers.

At least, that’s how it’s been up till now. Modern slicer software is starting to test the waters of adaptive layer heights, which change the layer height during the print. So the software will raise or lower the layer height depending on the level of detail required for the current area being printed. [Dylan Radcliffe] wanted to experiment with this feature on his Monoprice Select Mini, but it took some tweaking and the dreaded mathematics to get Cura’s adaptive layer height working on the entry-level printer. He’s documented his settings for anyone who wants to check out this next-generation 3D printing technology without forking out the cash for a top of the line machine.

While Cura is a popular slicer, the fact of the matter is that it’s developed by Ultimaker primarily for their own line of high-end printers. It will control machines from other manufacturers, but it makes no promises that all the features in the software will actually work as expected on lesser printers. In the case of the Monoprice Mini, the issue is the rather unusual Z hardware. The printer uses a 7.5° 48-step motor coupled to 0.7 mm thread pitch M4 rod. This is a pretty suspect arrangement that was no doubt selected to keep costs down, and results in an unusual 0.04375 mm step increment. For the best possible print quality, layer heights should be a multiple of this number. That’s where the math comes in.

After enabling adaptive layers in Cura’s experimental settings, you need to define the value which Cura will add or subtract to the base layer height. In theory you could enter 0.04375 mm here, but while that’s the minimum on paper, the machine itself is unlikely to be able to pull off such a small variation. [Dylan] recommends doubling that to 0.0875 for the “variation step size” parameter, and setting the base layer height to 0.175 mm (4 x 0.04375 mm).

[Dylan] reports these settings reduced the print time on his topographical map pieces from 12 hours to 7 hours, while still maintaining high detail on the top surface. Of course print time reduction is going to be highly dependent on the model being printed, so your mileage may vary.

If Cura isn’t your style, our very own [Brian Benchoff] gave us a tour of “variable layer height”, the Slic3r version of this technique. Perfect for that Prusa i3 MK3 you finally spent the cash on.

Video Quick Bit: The Best DIY Musical Instruments

The Hackaday Prize is almost over, and soon we’ll know the winners of the greatest hardware competition on the planet. A few weeks ago, we wrapped up the last challenge in the Hackaday Prize, the Musical Instrument Challenge. This is our challenge to build something that goes beyond traditional music instrumentation. Majenta’s back again looking at the coolest projects in the Musical Instrument Challenge in the Hackaday Prize.

We’re old-school hardware hackers here, and when you think about building your own drum machine, there’s really nothing more impressive than building one out of an Atari 2600. That’s what [John Sutley] did with his Syndrum project. It’s a custom cartridge for an Atari with a fancy ZIF socket. Of course, you need some way to trigger those drum sounds, so [John] is using an Arduino connected to the controller port as a sort-of MIDI-to-Joystick bridge.

If you want more retro consoles turned into musical instruments, look no further than [Aristides]’ DMG-01 Ukulele. It’s a ukulele with a 3D printed neck, bolted onto the original ‘brick’ Game Boy. Yes, it works as a ukulele, but that’s not the cool part. There are electronics inside that sense each individual string and turn it into a distorted chiptune assault on the ears. Just awesome.

How about a unique, new musical instrument? That’s what [Tim] is doing with Stylish!, a wearable music synthesizer. It’s based heavily on a stylophone, but with a few interesting twists. It’s built around an STM32, so there are a lot of options for what this instrument sounds like, and it’s all wrapped up in a beautiful enclosure. It’s some of the best work we’ve seen in this year’s Musical Instrument Challenge.

The Hackaday Prize is almost over, and on Saturday we’ll be announcing the winners at this year’s Hackaday Superconference. Tune in to the live stream to see which project will walk away with the grand prize of $50,000!

Mini LEGO Technic Tank Patrols Your Desk Under ESP32 Control

We probably don’t have to tell the readers of Hackaday that LEGO isn’t just for kids; we’ve seen plenty of projects that live in an enclosure made of the multi-color bricks, and let’s not even get started on the Mindstorms builds we’ve seen over the years. But while LEGO (and especially the Technic product line) is fine for prototyping and putting together quick projects, the stock electronic components aren’t exactly top of the line. Which is why [Jason Kirsons] has been working on bridging the gap between LEGO and “real” parts.

His LEGO Technic tank is a perfect example of this principle. While the tank design itself is standard LEGO fare, he’s gone all in on the electronics. With an Adafruit Feather ESP32, custom motor controller board, and NEMA 8 steppers with 3D printed Technic adapters, this little tank has a lot more going on under the hood than you might expect. While this project is more a proof of concept than anything, the methods [Jason] demonstrates might be something to consider the next time you’re building with Billund’s best.

[Jason] chose the Feather ESP32 because of its small size, but you could get away with a generic board if you’re not trying to compress everything down into such a small footprint. Of course, if you go with another board you won’t be able to use the PCB he’s designed which attaches to the Feather and holds four Pololu DRV8835 motor drivers.

Easily the most broadly applicable element of this project is the work [Jason] has done designing adapter plates that let you use NEMA 8 motors with LEGO Technic parts. He’s put the adapters up on Thingiverse, for anyone looking for a drop-in solution to give their Technic creations a bit more oomph (technical term).

LEGO has a long history with hackers and makers. We’ve covered some absolutely incredible projects built with the famous construction set, and we don’t see any sign of it slowing down in the future.

Continue reading “Mini LEGO Technic Tank Patrols Your Desk Under ESP32 Control”

Hands On With The Arduino FPGA

All of the tools you need to work with the FPGA Arduino — the Vidor — are now in the wild!

We reported earlier that a series of French blog posts finally showed how all the pieces fit together to program the FPGA on the Arduino MKR4000 Vidor board. Of course, I wasn’t content to just read the Google translation, I had to break out the board and try myself.

I created a very simple starter template, a tool in C to do the bitstream conversion, required, and bundled it all together in one place. Here’s how you can use my starter kit to do your own FPGA designs using the Vidor. I’m going to assume you know about FPGA basics and Verilog. If you don’t, why not check out the FPGA boot camps first?

The first thing you’ll want to do is grab my GitHub repo. You’ll also need the Arduino IDE (a recent copy) and Intel’s Quartus software. Inside, you’ll find three directories, two of which contain slightly modified copies of original Arduino files. But before you start digging in, let’s get the high-level overview of the process.

Continue reading “Hands On With The Arduino FPGA”

Drawing On An OLED With An ATtiny85, No RAM Buffers Allowed

Small I2C OLED displays are common nowadays, and thanks to the work of helpful developers, there are also a variety of graphics libraries for using them. Most of them work by using a RAM buffer, which means that anything one wants to draw gets written to a buffer representing the screen, and the contents of that buffer are copied out to the display whenever it is updated. The drawback is that for some microcontrollers, there simply isn’t enough RAM for this approach to work. For example, a 128×64 monochrome OLED requires a 1024 byte buffer, but that’s bad news if a microcontroller has only 512 bytes of RAM in total like the ATtiny85. [David Johnson-Davies] has two solutions: a Tiny Graphics Library that needs no RAM buffer and an even slimmer Tiny Function Plotter, which we’ll discuss in order.

Tiny Function Plotter works on both SSD1306 and SH1106-based displays.

[David]’s Tiny Graphics Library works by taking advantage of a feature of SH1106 driver-based displays: the ability to read the display over I2C as well as write to it. With the ability to perform read-modify-write on a section at a time, using a large RAM buffer can be avoided. The only catch is that the library only works with OLEDs using the SH1106, but the good news is that these are very common at the usual Chinese resellers. ([David] notes that SH1106 is sometimes misspelled as “SSH1106”, so keep that in mind when searching.)

What about all those other SSD1306-based OLED displays out there? Are they out of luck? Not quite. [David] has one more trick up his sleeve: his Tiny Function Plotter works on the SSD1306 and also requires no RAM buffer. It’s unable to write text, but it can easily handle drawing graphs plotting things like values over time while needing very little overhead.

Another approach we’ve seen for using OLEDs driven by microcontrollers with limited memory is the solution [Michael] used in Tiny Sideways Tetris, which was done in part by realizing the smallest screen element he needed was a 4×4 block, and using that premise as the basis of a simple compression scheme.