Posts with «arduino hacks» label

Underwater Logging for Science

Logging data with an Arduino is old-hat for most Hackaday readers. However, [Patricia Beddows] and [Edward Mallon] had some pretty daunting requirements. Their sensors were going underground and underwater as part of an effort to study conditions underwater and in caves. They needed to be accessible, yet rugged. They didn’t want to use batteries that would be difficult to take on airplanes, but also wanted more than a year of run time. You can buy all that, of course, if you are willing to pay the price.

Instead, they used off-the-shelf Arduino boards connected together inside PVC housings. Three alkaline AA batteries are compact and give them more than a year of run time. They wrote a journal paper to help other scientists use the same techniques for the Sensors journal published by the Multidisciplinary Digital Publishing Institute.

If you regularly read Hackaday, you probably won’t find the electronic part of the build remarkable. However, that’s kind of the point, as this is all off-the-shelf and inexpensive. They do however modify the boards in some cases to allow the controller to power them down, for example.

In fact, they put a lot of thought into reducing power requirements. Since your eye is more sensitive to green, for example, they use green LEDs with very low currents as indicators. They also speed up the serial bus going to sensors because they found that the increased power required was more than offset by finishing the transaction faster (and, thus, going back to sleep sooner).

The PVC enclosures are also interesting. The paper shows some practical deployments in some very harsh conditions. If you want more practical details, the Cave Pearl project has been blogging about their development of these loggers for a while. They have a good “how to” page, as well.

If an Arduino seems too last-year for you, we’ve seen long-duration logging done with ESP8266s and ESP32s. However, they did use lithium-ion cells. Spoiler alert: The ESP8266 lasts longer than the ESP32. If you want to minimize power when sending things out over a network connection, consider MQTT.

Arduino Keyboard is Gorgeous Inside and Out

While the vast majority of us are content to plod along with the squishy chiclet keyboards on our laptops, or the cheapest USB membrane keyboard we could find on Amazon, there’s a special breed out there who demand something more. To them, nothing beats a good old-fashioned mechanical keyboard, where each key-press sounds like a footfall of Zeus himself. They are truly the “Chad” of the input device world.

But what if even the most high end of mechanical keyboards doesn’t quench your thirst for spring-loaded perfection? In that case, the only thing left to do is design and build your own. [Matthew Cordier] recently unveiled the custom mechanical keyboard he’s been working on, and to say it’s an elegant piece of engineering is something of an understatement. It may even better inside than it does on the outside.

The keyboard, which he is calling z.48, is based around the Arduino Pro Micro running a firmware generated on, and features some absolutely fantastic hand-wiring. No PCBs here, just a rainbow assortment of wire and the patience of a Buddhist monk. The particularly attentive reader may notice that [Matthew] used his soldering iron to melt away the insulation on his wires where they meet up with the keys, giving the final wiring job a very clean look.

Speaking of the keys, they are Gateron switches with DSA Hana caps. If none of those words mean anything to you, don’t worry. We’re through the Looking Glass and into the world of the keyboard aficionado now.

Finally, the case itself is printed on a CR-10 with a 0.3 mm nozzle and 0.2 mm layers giving it a very fine finish. At 70% infill, we imagine it’s got a good deal of heft as well. [Matthew] mentions that a production case and a PCB are in the cards for the future as he hopes to do a small commercial run of these boards. In the meantime we can all bask in the glory of what passes for a prototype in his world.

We’ve seen some exceptionally impressive mechanical keyboards over the years, including the occasional oddity like the fully 3D printed one and even one that inexplicably moves around. But this build by [Matthew] has to be one of the most elegant we’ve ever come across.

[Thanks to DarkSim905 for the tip]

Debugging an Arduino with an Arduino

As every Hackaday reader knows, and tells us at every opportunity in the comments, adding an Arduino to your project instantly makes it twice as cool. But what if, in the course of adding an Arduino to your project, you run into a problem and need to debug the code? What if you could use a second Arduino to debug the first? That would bring your project up to two Arduinos, instantly making it four times as awesome as before you started! Who could say no to such exponential gains?

Debugging an ATTiny85

Not [Wayne Holder], that’s for sure. He writes in to let us know about a project he’s been working on for a while that allows you to debug the execution of code on an Arduino with a second Arduino. In fact, the target chip could even be another AVR series microcontroller such as a the ATTiny85. With his software you can single-step through the code, view and modify values in memory, set breakpoints, and even disassemble the code. Not everything is working fully yet, but what he has so far is very impressive.

The trick is exploiting a feature known as “debugWIRE” that’s included in many AVR microcontrollers. Unfortunately documentation on this feature is hard to come by, but with some work [Wayne] has managed to figure out how most of it works and create an Arduino Sketch that lets the user interact with the target chip using a simple menu system over the serial monitor, similar to the Bus Pirate.

[Wayne] goes into plenty of detail on his site and in the video included after the break, showing many of the functions he’s got working so far in his software against an ATTiny85. If you spend a lot of time working on AVR projects, this looks like something you might want to keep installed on an Arduino in your tool bag for the future.

Debugging microcontroller projects can be a huge time saver when your code starts running on real hardware, but often takes some hacking to get working.

I’ll Have a Beer With a Compliment Chaser

[Andrew MacPherson] found out that compliments, even insincere ones, make the recipients feel better. So, he put together a thermal printer and a hilariously large button with an Arduino and created a machine that prints compliments. And where best to put a machine that prints out compliments? The local bar, where else?

An Arduino Nano clone runs the show connected to a thermal printer. The Nano clone didn’t like the 9 volt power supply, so a buck converter was used to reduce the voltage down to 5 volts for the Nano, while the printer gets the full power. During initial trials, the printer was very slow to print and it took [Andrew] a while to adjust the parameters – after tweaking the speed as well as the heating time, he was able to get the printer working without burning the paper or taking forever to print.

Once the machine was working, it was time to add a button. A large, light-up button was connected and glued to the side of the printer. More glue was used (after some “modifications” to the printer chassis) to secure a barrel connector for the power adapter.

[Andrew] decided that since he’s down at his favorite bar quite a lot, he’d set it up there. The customers could push the button and receive a compliment while drowning their sorrows. He got a friend of his who’s a copywriter to come up with some nicely written compliments to print out. The printer was such a hit that the bartender sent [Andrew] a message on Facebook saying so. If you have a thermal printer lying around, you can use this tutorial to connect it to the internet, or, if you don’t have one, you can build your own.

Junk Build Printer Uses Pencil To Print

Sometimes, it is interesting to see what you can build from the bits that you have in your junk drawer. [Dr West] decided to build a printer with spare parts including a hard drive, a scanner base and an Arduino. The result is a rather cool printer that prints out the image using a pencil, tapping the image out one dot at a time. The software converts the image into an array, with 0 representing white and 1 representing black. The printer itself works a bit like an old-school CRT TV: the scanner array moves the printer along a horizontal line, then moves it vertically and along another horizontal line. It then triggers the hard drive actuator to create a mark on the paper if there is a 1 in the array at that point.

We’ve seen a few drawing printers before, but most use a plotter or CNC approach, where the motors move the pencil on an X-Y . This type of dot matrix printer (sometimes called a dotter) isn’t as efficient, but it’s a lot of fun and shows what can be achieved with  a few bits of junk and a some ingenuity.

Strumbot: The Guitar that Strums Itself

[Clare] isn’t the most musically inclined person, but she can strum a guitar. Thanks to a little help from an Arduino, she doesn’t even have to do that.

She built the strumbot, which handles the strumming hand duties of playing the guitar. While [Claire] does believe in her strumbot, she didn’t want to drill holes in her guitar, so hot glue and double-sided foam tape were the order of the day.

The business end of the strumbot is a micro servo. The servo moves two chopsticks and draws the pick across the strings. The tiny servo surprisingly does a great job getting the strings ringing. The only downside is the noise from the plastic gears when it’s really rocking out.

Strumbot’s user interface is a 3D-printed case with three buttons and three LEDs. Each button activates a different strum pattern in the Arduino’s programming. The LEDs indicate the currently active pattern. Everything is powered by a USB power pack, making this a self-contained hack.

[Clare] was able to code up some complex strum patterns, but the strumbot is still a bit limited in that it only holds three patterns. It’s good enough for her rendition of “Call Me Maybe”, which you can see in the video after the break. Sure, this is a simple project, not nearly as complex as some of the robotic guitar mods we’ve seen in the past. Still, it’s just the ticket for a fun evening or weekend project – especially if you’re introducing the Arduino to young coders. Music, hacking, and modding – what more could you ask for?


DIY Dungeon Crawler Game Plays on Single LED Strip

A delightful version of a clever one-dimensional game has been made by [Critters] which he calls TWANG! because the joystick is made from a spring doorstop with an accelerometer in the tip. The game itself is played out on an RGB LED strip. As a result, the game world, the player, goal, and enemies are all represented on a single line of LEDs.

How can a dungeon crawler game be represented in 1D, and how is this unusual game played? The goal is for the player (a green dot) to reach the goal (a blue dot) to advance to the next level. Making this more difficult are enemies (red dots) which move in different ways. The joystick is moved left or right to advance the player’s blue dot left or right, and the player can attack with a “twang” motion of the joystick, which eliminates nearby enemies. By playing with brightness and color, a surprising amount of gameplay can be jammed into a one-dimensional display!

Code for TWANG! is on github and models for 3D printing the physical pieces are on Thingiverse. The video (embedded below) focuses mainly on the development process, but does have the gameplay elements explained as well and demonstrates some slick animations and sharp feedback.

Using a spring doorstop as a controller is neat as heck as well as intuitive, but possibly not quite as intuitive as using an actual car as a video game controller.

Building a Better Kerbal Space Program Controller

If you have even the most passing interest in space and what it takes to get there, you’ve probably already played Kerbal Space Program (KSP). If you haven’t, then you should set aside about ten hours today to go check that out real quick. Don’t worry, Hackaday will still be here when you get back. Right now you need to focus on getting those rockets built and establishing a network of communication satellites so you can get out of low orbit.

For those of you who’ve played the game (or are joining us again after playing KSP for the prescribed 10, 12, 16 hours), you’ll know that the humble computer keyboard is not very well suited to jaunts through space. You really want a joystick and throttle at the absolute minimum for accurate maneuvers, but even you’ll be spending plenty of time back on the keyboard to operate the craft’s various systems. If you want the ultimate KSP control setup, you’ll need to follow in the footsteps of [Hugo Peeters] and build your own. Luckily for us, he’s written up an exceptionally well detailed guide on building KSP controllers that should prove useful even if you don’t want to clone his.

Wiring switches and buttons to the Arduino.

At the most basic level, building a KSP controller consists of hooking a bunch of switches and buttons to a microcontroller such as the Arduino or Teensy, and converting those to USB HID key presses that the game understands. This works fine up to a point, but is limited because it’s only a one-way method of communication. For his controller, [Hugo] forked KSPSerialIO, a plugin for KSP that allows bidirectional communication between the game and your controller, enabling things like digital readouts of speed and fuel levels on the controller’s panel.

Once the logistics of how you’ll talk to the game are settled, the rest is really up to the individual. The first step in building your own KSP controller is deciding what you want it to do. Are you looking to fly planes? Control a rover? Maybe you just want a master control panel for your space station. There’s a whole lot of things you can build in KSP, and the layout, inputs, and displays on your controller should ideally reflect your play style.

[Hugo] went with a fairly general purpose panel, but did spend quite a bit of extra time to get some slick LED bar graphs hooked up to display resource levels of different systems on his craft. That’s an extra step that isn’t strictly required for a build like this, but once you see it, you’re going to have a hard time not wanting to include it on your own panel. He also went through the expense of having the panel and case professionally laser cut and etched, which definitely gives it a polished feel.

We’ve covered quite a number of custom KSP controllers here at Hackaday. The overlap between KSP players and hackers seems unusually high, but of course a game that lets you build and fly contraptions of your own design does sound like something that would be right up our alley.

We Couldn’t Afford An Oculus, So We Built One

Like a lot of 16-year-olds, [Maxime Coutée] wanted an Oculus Rift. Unlike a lot of 16-year-olds, [Maxime] and friends [Gabriel] and [Jonas] built one themselves for about a hundred bucks and posted it on GitHub. We’ll admit that at 16 we weren’t throwing around words like quaternions and antiderivatives, so we were duly impressed.

Before you assume this is just a box to put a phone in like a Google Cardboard, take a look at the bill of materials: an Arduino Due, a 2K LCD screen, a Fresnel lens, and an accelerometer/gyro. The team notes that the screen is what will push the price unpredictably, but they got by for about a hundred euro. At the current exchange rate, if you add up all the parts, they went a little over $100, but they were still under $150 assuming you have a 3D printer to print the mechanical parts.

The system uses two custom libraries that you could use even if you wanted a slightly different project. FastVR creates 3D virtual reality using Unity and WRMHL allows Unity to communicate with an Arduino. Both of these are on the team’s GitHub page, as well.

There was one other member of the team, their math teacher [Jerome Dieudonne] who they call [Sensei]. According to [Jerome] he is “… the theoretician of the team. I teach them math and I help them solving algorithm issues.” He must be very proud and we always applaud when someone takes the time to share what they know with students.

We don’t know what’s next for this group, but we will be keeping an eye on them to see what’s next. Maybe they’ll work on smell-o-vision.

A Keyboard To Stomp On

Macros are useful things. They allow one to execute a series of commands with a single keypress. There exists a wide variety of hardware and software solutions to create and use macros to improve your workflow, and now [Evan] has brought the open-source ManyKey into the fray, along with a build tutorial to boot.

The tutorial acts as a great introduction to ManyKey, as [Evan] walks through the construction of a macro keyboard designed to be operated by the feet. Based around the Arduino Leonardo and using off-the-shelf footswitches commonly used in guitar effects, it’s accessible while still hinting at the flexibility of the system. Macros are programmed into the keyboard through a Python app which communicates over serial, and configurations are saved into the Arduino’s onboard EEPROM. The ManyKey source is naturally available over at GitHub.

[Evan] tells us he uses his setup to run DJ software with his feet while his hands are busy on the turntables. That said, there’s all manner of other applications this could be used for. Efficiency is everything, and we love to see keyboard projects that aim to improve workflow with new ideas and custom builds – this shortcut keyboard makes a great example.