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.

Continue reading “Debugging An Arduino With An Arduino”

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.

Continue reading “I’ll Have A Beer With A Compliment Chaser”

A Grandfather Clock BarBot

As the saying goes, it’s five o’clock somewhere; when the clock finally strikes the hour, that same clock can pour you a drink thanks to redditor [Diggedypomme].

This bar-clock can dispense beverages with up to four different spirits and four mixers, and takes orders over voice, keyboard, or web-controls. A belt-driven drink loading platform pushes out through a spring-loaded door and once the vessel is in place and the order received, peristaltic pumps dispense the spirits while servos open taps for the mixers — a far easier method to administer the often carbonated liquids. A Raspberry Pi acts as this old-timer’s brain, an Arduino controls the lights, and a HAT to controls the servos. Here’s a more in-depth tour of what’s going on behind the bar, but check out the video after the break for a full run through of a few drink orders!

Continue reading “A Grandfather Clock BarBot”

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.

Continue reading “Junk Build Printer Uses Pencil To Print”

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?

Continue reading “Strumbot: The Guitar That Strums Itself”

Counting Is For Sheep: Use A Light To Fall Asleep

How do you get to sleep at night? For some of us, it can be the most difficult thing we do all day. Worrying about falling asleep and letting other intrusive thoughts in night after night only compounds the problem, as less sleep leads to depression which (for us) leads to even less sleep. We lay there, trapped inside a vortex of churning thoughts, imprisoned in a mind that feels like it’s malfunctioning and half-wishing for a future where instructor-led meditation videos can be beamed to the insides of our eyelids. In the meantime, there is FADing, the Fall Asleep Device.

FADing takes its cues from a relaxation technique that uses light to focus your attention and control your breathing. The light’s intensity waxes and wanes on a schedule designed to get you down from the average eleven breaths per minute to a zen-like six breaths per minute. You surrender to the light, breathing in as it intensifies and breathing out as it fades. There are commercial products that bring this technique to the bedroom, but they aren’t cheap and don’t offer much control. Fail to fall asleep in the prescribed window and you’re back to square one with one more thing to think about: buyer’s remorse.

[Youz] was inspired by these devices but dissatisfied with the price tag and lack of options, so he created his own version with a flexible window of operation that appeals to both back- and side-sleepers. It uses an Arduino Nano and two momentaries to control two LEDs, a relay to hold the power after startup, a 9V, and a diode to protect the Nano. One LED projects on the ceiling, and the other radiates through a slice of acrylic which has been shaded blue. One button is for power, and the other lets you add time by two-minute increments. You can see the build video after the break and then tell us how you’d do it with a 555, a coin cell, and a chunk of uranium glass in the comments.

Once you can focus on your breathing without a light, reuse that Nano to measure the quality of all that sleep you’re getting.

Continue reading “Counting Is For Sheep: Use A Light To Fall Asleep”

An Indoor Garden? That’s Arduino-licious

Gardening is a rewarding endeavour, and easily automated for the maker with a green thumb. With simplicity at its focus,  Hackaday.io user [MEGA DAS] has whipped up a automated planter to provide the things plants crave: water, air, and light.

[MEGA DAS] is using a TE215 moisture sensor to keep an eye on how thirsty the plant may be, a DHT11 temperature and humidity sensor to check the airflow around the plant, and a BH1750FVI light sensor for its obvious purpose. To deliver on these needs, a 12V DC water pump and a small reservoir will keep things right as rain, a pair of 12V DC fans mimic a gentle breeze, and a row of white LEDs supplement natural light when required.

The custom board is an Arduino Nano platform, with an ESP01 to enable WiFi capacity and a Bluetooth module to monitor the plant’s status while at home or away. Voltage regulators, MOSFETs, resistors, capacitors, fuses — can’t be too careful — screw header connectors, and a few other assorted parts round out the circuit. The planter is made of laser cut pieces with plenty of space to mount the various components and hide away the rest. You can check out [MEGA DAS]’ tutorial video after the break!

Continue reading “An Indoor Garden? That’s Arduino-licious”