Posts with «arduino hacks» label

Piggy Bank Slot Machine Puts a Spin on Saving

Saving money is inherently no fun until the time comes that you get to spend it on something awesome. Wouldn’t you be more likely to drop your coins into a piggy bank if there was a chance for an immediate payout that might exceed the amount you put in? We know we would. And the best part is, if you put such a piggy bank slot machine out in the open where your friends and neighbors can play with it, you’ll probably make even more money. As they say, the house always wins.

Drop a coin in the slot and it passes through a pair of wires that act as a simple switch to start the reels spinning. Inside is an Arduino Uno and a giant printed screw feeder that’s driven by a small stepper motor and a pair of printed gears. The reels have been modernized and the display is made of four individual LED matrices that appear as a single unit thanks to some smoky adhesive film.

This beautiful little machine took a solid week of 3D printing, which includes 32 hours wasted on a huge piece that failed twice. [Max 3D Design] tried rotating the model 180° in the slicer and thankfully, that solved the problem. Then it was on to countless hours of sanding, smoothing with body filler, priming, and painting to make it look fantastic.

If you want to make your own, all the files are up on Thingiverse. The code isn’t shown, but we know for a fact that Arduino slot machine code is out there already. Check out the build and demo video after the break.

As much as we like this build’s simplicity, it would be more slot machine-like if there was a handle to pull. Turns out you can print those, too.

Thanks for the tip, [zwapz]!

Auto Strummer Can Plectrum the Whole Flat-Strumming Spectrum

Playing the guitar requires speed, strength, and dexterity in both hands. Depending on your mobility level, rocking out with your axe might be impossible unless you could somehow hold down the strings and have a robot do the strumming for you.

[Jacob Stambaugh]’s Auto Strummer uses six lighted buttons to tell the hidden internal pick which string(s) to strum, which it does with the help of an Arduino Pro Mini and a stepper motor. If two or more buttons are pressed, all the strings between the outermost pair selected will be strummed. That little golden knob near the top is a pot that controls the strumming tempo.

[Jacob]’s impressive 3D-printed enclosure attaches to the guitar with a pair of spring-loaded clamps that grasp the edge of the sound hole. But don’t fret — there’s plenty of foam padding under every point that touches the soundboard.

We were worried that the enclosure would block or muffle the sound, even though it sits about an inch above the hole. But as you can hear in the video after the break, that doesn’t seem to be the case — it sounds fantastic.

Never touched a real guitar, but love to play Guitar Hero? There’s a robot for that, too.

ECG Project With All the Messy Safety Details

We’ve seen a number of heart rate monitoring projects on Hackaday, but [Peter’s] electrocardiography (ECG) Instructable really caught out attention.

If you’ve followed Hackaday for any period of time, you’re probably already somewhat familiar with the hardware needed to record the ECG. First, you need a high input impedance instrumentation amplifier to pick up the millivolt signal from electrical leads carefully placed on the willing subject’s body. To accomplish this, he used an AD8232 single-lead ECG module (we’ve actually seen this part used to make a soundcard-based ECG). This chip has a built-in instrumentation amplifier as well as an optional secondary amplifier for additional gain and low-pass filtering. The ECG signal is riddled with noise from mains that can be partially attenuated with a simple low-pass filter. Then, [Peter] uses an Arduino Nano to sample the output of the AD8232, implement a digital notch filter for added mains noise reduction, and display the output on a 2.8″ TFT display.

Other than the circuit itself, two things about his project really caught our attention. [Peter] walks the reader through all the different safety considerations for a commercial ECG device and applies these principles to his simple DIY setup to ensure his own safety. As [Peter] put it, professional medical electronics should follow IEC 60601. It’s a pretty bulky document, but the main tenets quoted from [Peter’s] write-up are:

  1. limiting how much current can pass through the patient
  2. how much current can I pass through the patient?
  3. what electrical isolation is required?
  4. what happens if a “component” fails?
  5. how much electromagnetic interference can I produce?
  6. what about a defibrillator?

[Peter] mentions that his circuit itself does not fully conform to the standard (though he makes some honest attempts), but lays out a crude plan for doing so. These include using high-valued input resistors for the connections to the electrodes and also adding a few protection diodes to the electrode inputs so that the device can withstand a defibrillator. And of course, two simple strategies you always want to follow are using battery power and placing the device in a properly shielded enclosure.

[Peter] also does a great job breaking down the electrophysiology of the heart and relates it to terms maybe a bit more familiar to non-medical professionals. Understanding the human heart might be a little less intimidating if we relate the heart to a simple voltage source like a battery or maybe even a function generator. You can imagine the ions in our cells as charger carriers that generate electrical potential energy and nerve fibers as electrical wires along which electrical pulses travel through the body.

Honestly, [Peter] has a wealth of information and tools presented in his project that are sure to help you in your next build. You might also find his ECG simulator code really handy and his low-memory display driver code helpful as well. Cool project, [Peter]!

Measuring ECG is something that is near and dear to my heart (sorry, couldn’t resist). Two of my own projects that were featured on Hackaday before I became a writer here include a biomedical sensor suite in Arduino shield form factor, and a simple ECG built around an AD623 instrumentation amplifier.

An Arduino With A Floppy Drive

For many of us the passing of the floppy disk is unlamented, but there remains a corps of experimenters for whom the classic removable storage format still holds some fascination. The interface for a floppy drive might have required some complexity back in the days of 8-bit microcomputers, but even for today’s less accomplished microcontrollers it’s a surprisingly straightforward hardware prospect. [David Hansel] shows us this in style, with a floppy interface, software library, and even a rudimentary DOS, for the humble Arduino Uno.

The library provides functions to allow low level work with floppy disks, to read them sector by sector. In addition it incorporates the FatFS library for MS-DOS FAT file-level access, and finally the ArduDOS environment which allows browsing of files on a floppy. The pictures show a 3.5″ drive, but it also supports 5.25″ units and both DD and HD drives. We can see that it will be extremely useful to anyone working with retrocomputer software who is trying to retrieve old disks, and we look forward to seeing it incorporated in some retrocomputer projects.

Of course, Arduino owners needn’t have all the fun when it comes to floppy disks, the Raspberry Pi gets a look-in too.

Ooohhh, That Smell: Arduino Monitors Air Quality

According to [Dr. Tom Lehrer’s] song Pollution, “Wear a gas mask and a veil. Then you can breathe, long as you don’t inhale!” While the air quality in most of the world hasn’t gotten that bad, there is a lot of concern about long-term exposure to particulates in the air causing health problems. [Ashish Choudhary] married an Arduino with a display and a pollution sensor to give readings of the PM2.5 and PM10 levels in the air.

The sensor uses a laser diode and a photodiode to detect and count particles, while a fan moves air through the system. If you aren’t up on pollution metrics, PM2.5 is a count of very fine particles (under 2.5 microns) and PM10 is a count of particles for 10 microns. You can find a datasheet for the device online.

One thing to note is that the sensor has a finite lifespan. The datasheet claims “up to” 8,000 hours. If you ran the sensor continuously that’s not quite a year, so you might want to be judicious about how often you light up the device.

This isn’t the first time we’ve seen this particular sensor. If you want to find the exact source of a pollutant, consider this build.

You Need an Automated Overhead Camera Assistant

It’s 2021. Everyone and their mother is filming themselves doing stuff, and a lot of it is super cool content. But since most of us have to also work the video capture devices ourselves, it can be difficult to make compelling footage with a single, stationary overhead view, especially when there are a lot of steps involved. A slider rig is a good start, but the ability to move the camera in three dimensions programmatically is really where it’s at.

[KronBjorn]’s excellent automated overhead camera assistant runs on an Arduino Mega and is operated by typing commands in the serial monitor. It can pan ±20° from straight down and moves in three axes on NEMA-17 stepper motors. It moves really smoothly, which you can see in the videos after the break. The plastic-minimal design is interesting and reminds us a bit of an ophthalmoscope — that’s that main rig at the eye doctor. There’s only one thing that would make this better, and that’s a dedicated macro pad.

If you want to build your own, you’re in luck — there’s quite a lot of detail to this project, including a complete BOM, all the STLs, code, and even assembly videos of the 3D-printed parts and the electronics. Slide past the break to check out a couple of brief demo videos.

Not enough room for a setup like this one? Try the pantograph version.

Eyecam is Watching You in Between Blinks

We will be the first to admit that it’s often hard to be productive while working from home, especially if no one’s ever really looking over your shoulder. Well, here is one creepy way to feel as though someone is keeping an eye on you, if that’s what gets you to straighten up and fly right. The Eyecam research project by [Marc Teyssier] et. al. is a realistic, motorized eyeball that includes a camera and hangs out on top of your computer monitor. It aims to spark conversation about the sensors that are all around us already in various cold and clinical forms. It’s an open source project with a paper and a repo and a how-to video in the works.

The eyebrow-raising design pulls no punches in the uncanny department: the eye behaves as you’d expect (if you could have expected this) — it blinks, looks around, and can even waggle its brow. The eyeball, brow, and eyelids are actuated by a total of six servos that are controlled by an Arduino Nano.

Inside the eyeball is a Raspberry Pi camera connected to a Raspi Zero for the web cam portion of this intriguing horror show. Keep an eye out after the break for the Eyecam infomercial.

Creepy or fascinating, it succeeds in making people think about the vast amount of sensors around us now, and what the future of them could look like. Would mimicking eye contact be an improvement over the standard black and gray oblong eye? Perhaps a pair of eyes would be less unsettling, we’re not really sure. But we are left to wonder what’s next, a microphone that looks like an ear? Probably. Will it have hair sprouting from it? Perhaps.

Yeah, it’s true; two eyes are more on the mesmerizing side, but still creepy, especially when they follow you around the room and can shoot frickin’ laser beams.

Thanks for the tip, [Sven, greg, and Itay]!

Hacking the Classroom

With so many students attending class virtually these days, how can you give kids — or adults — some hands on experience with electronics projects? [Ben Finio] says you can by moving your lab to the virtual world using — of all things — Tinkercad. [Ben] should know something about a classroom since he is a lecturer at Cornell.

Of course, you could do this trick with any online simulator, but Tinkercad is nice because it is easy to use, looks real, and doesn’t cost the students a dime. [Ben] mentions there are some scenarios where it is especially useful like large classes or online classes. There are probably some cases where it doesn’t make sense, like teaching RF design, for example. Even then, maybe you just need a different tool.

It would be something else if Tinkercad would add some features to support this use case. Imagine an instructor being able to peek at a student’s circuit or modify it without having to screen share to the whole class. Or perhaps provide a connector to connect one student’s outputs to another student’s inputs.

We couldn’t help but think you could do some more hardcore electronics using our favorite Falstad simulator. It doesn’t have the realistic look, but it can simulate a lot of interesting circuits. After all, we’ve long been a fan of project-based learning.

Hack a Day 09 Apr 03:00

Nixie Shot Timer Adds Useful Elegance to Espresso Machine

Once you’ve ground the beans and tamped the grounds just so, pulling the perfect shot of espresso comes down to timing. Ideally, the extraction should last 20-30 seconds, from the first dark drips to the tan and tiger-striped crema on top that gives the espresso a full aftertaste.

[Marco] has a beautiful espresso machine that was only missing one thing: an equally beautiful shot timer with a Nixie tube display. Instead of messing with the wiring, [Marco] took the non-invasive approach and is using a DIY coil to detect the magnetic field of the espresso machine’s pump and start a shot timer.

An LM358-based op-amp magnifies the current induced by the machine and feeds it to an Arduino Nano, which does FFT calculations. [Marco] found a high-voltage interface driver to switch 170 V to the Nixies instead of using two handfuls of transistors. Grab yourself a flat white and check it out after the break.

The last Nixies may have been mass-produced in the 1980s, but never fear — Dalibor Farny is out there keeping the dream alive and making new Nixies.

Arduino CLI for I/O Pin Testing

Need to quickly toggle or read some logic signals without the hassle of writing a quick program? [Thor_x86], aka [Eric], built an Arduino sketch that does just that — and he threw in the ability to send (or receive) serial messages, too. This is a neat idea — kind of a simplified Bus Pirate.

We should warn you that this is an early release, and there are a few minor issues which we are sure [Eric] will iron out soon. We discovered the function strtol() was misspelled in cmd_send.cpp, and there are some configuration #defines which need to be sorted out in file parsePin.cpp, depending on which Arduino module you are running. We got it running on an Arduino Leonardo the quickest, because it has support for Serial1().

Don’t be discouraged by these glitches in this rev 0 deployment — [Eric] has really made quite a nice tool here. Check his GitHub repository for updates (or submit corrections yourself). All in all, it’s a good addition to your digital tool box. On a completely unrelated note, we really like [Eric]’s USB cable with the right-angle micro connector, grungy though it may be.

Besides the standard tools like Bus Pirate, GreatFET, FTDI modules, etc., are there any similar tools you like to use for bit banging and serial testing? Let us know in the comments below.

Hack a Day 21 Mar 21:00