Hacklet 26 – Arduino Projects

Arduino is one of those boards that has become synonymous with hacking and making. Since its introduction in 2005, over 700,000 official Arduino boards have been sold, along with untold millions of compatible and clone boards. Hackers and makers around the world have found the Arduino platform a cheap and simple way to get their projects off the ground. This weeks Hacket focuses on some of the best Arduino based projects we’ve found on Hackday.io!

drawingbot[Niazangels] gets the ball – or ballpoint pen – rolling with Roboartist, a robot which creates line drawings. Roboartist is more than just a plotter though. [Niazangels] created a custom PC program which creates line drawings from images captured by a webcam. The line drawings are converted to coordinates, and sent to an Arduino, which controls all the motors that move the pen. [Niazangels] went with Dynamixel closed loop servo motors rather than the stepper motors we often see in 3D printers.

tape[Peter Edwards] is preserving the past with Tapuino, the $20 C64 Tape Emulator. Plenty of programs for the Commodore 64, 128, and compatibles were only distributed on tape. Those tapes are slowly degrading, though the classic Commodore herdware is still going strong. Tapuino preserves those tapes by using an Arduino nano to play the files from an SD card into the original Datasette interface. [Peter] also plans to add recording functionality to the Tapuino, which will make it the total package for preserving  your data. All that’s missing is that satisfying clunk when pressing the mechanical Play button!


[Dushyant Ahuja] knows what time it is, thanks to his Infinity Mirror Clock. This clock tells time with the help of some WS2812B RGB LED. [Dushyant] debugged the clock with a regular Arduino, but when it came time to finish the project, he used an ATmega328 to create an Arduino compatible board from scratch. Programming is easy with an on-board Bluetooth module. [Dushyant] plans to add a TFT lcd which will show weather and other information when those power-hungry LEDs are switched off.

alarm2[IngGaro] built an entire home alarm system with his project Arduino anti-theft alarm shield. [IngGaro] needed an alarm system for his home. That’s a lot to ask of a standard ATmega328p powered Arduino Uno. However, the extra I/O lines available on an Arduino Mega2560 were just what the doctor ordered. [IngGaro] performed some amazing point-to-point perfboard wiring to produce a custom shield that looks and works great! The alarm can interface with just about any sensor, and can be controlled via the internet. You can even disarm the system through an RFID keycard.

Want MORE Arduino in your life? Check out our curated Arduino List!

That’s about all the millis()  we have for this weeks Hacklet. As always, see you next week. Same hack time, same hack channel, bringing you the best of Hackaday.io!

Using The Second Microcontroller On An Arduino

While newer Arduinos and Arduino compatibles (including the Hackaday.io Trinket Pro. Superliminal Advertising!) either have a chip capable of USB or rely on a V-USB implementation, the old fogies of the Arduino world, the Uno and Mega, actually have two chips. An ATMega16u2 takes care of the USB connection, while the standard ‘328 or ‘2560 takes care of all ~duino tasks. Wouldn’t it be great is you could also use the ’16u2 on the Uno or Mega for some additional functionality to your Arduino sketch? That’s now a reality. [Nico] has been working on the HoodLoader2 for a while now, and the current version give you the option of reprogramming the ’16u2 with custom sketches, and use seven I/O pins on this previously overlooked chip.

Unlike the previous HoodLoader, this version is a real bootloader for the ’16u2 that replaces the DFU bootloader with a CDC bootloader and USB serial function. This allows for new USB functions like HID keyboard, mouse, media keys, and a gamepad, the addition of extra sensors or LEDs, and anything else you can do with a normal ‘duino.

Setup is simple enough, only requiring a connection between the ‘328 ISP header and the pins on the ’16u2 header. There are already a few samples of what this new firmware for the ’16u2 can do over on [Nico]’s blog, but we’ll expect the number of example projects using this new bootloader to explode over the coming months. If you’re ever in an Arduino Demoscene contest with an Arduino and you’re looking for more pins and code space, now you know where to look.

Ray tracing on an Arduino

[Greg] implemented a simple ray tracer for Arduino as a fun exercise and a way to benchmark the processor. He started out with the Moller-Trumbore algorithm, a common ray-tracing algorithm that calculates the intersection of a ray with a triangular plane without doing any pre-calculation of the planes. His code supports one static light and one static camera, which is enough to render a simple scene.

[Greg] started out with a small scene composed of a few polygons, but just finished up a scene with 505 vertices, 901 faces, and reflective surfaces (shown above). He made the above render on his PC emulator, but estimates that it would take just over 4 days to render on the Arduino. [Greg]’s project supports multiple bounces of light, which differentiates his ray tracer from some we’ve covered before (and which explains why it takes so long to render).

The ray tracer is implemented entirely with double-precision floats. This translates to a ton of software float emulation instructions, since the Arduino doesn’t have a floating-point unit. While this ray tracer can’t render anything near real-time graphics due to the slowness of the microcontroller, it’s still a great proof of concept.

The title image for this post was rendered on a modern PC, taking 263 seconds to complete. The same scene, at 64×64 resolution, was rendered on the Arduino, taking 4008 seconds to complete. That render is below.


Solving Arduino’s stk500_getsync() error

[psgarcha] took a year-old Arduino Uno on an international trip and upon returning found something was wrong. Every time he would try to upload, he would get the dreaded avrdude error, ‘stk500_getsync(): not in sync resp=0x00′. The Rx light would blink a few times during the attempted upload, but the tx light did not. Somehow, something was terribly wrong with the ‘duino, and [psgarcha] dug deep to figure out why.

To test the quality of the Arduino’s serial connection, [psgarcha] performed a loopback test; basically a wire plugged into the Tx and Rx pins of the Arduino. Sending a short message through the serial port showed the problem wasn’t the USB cable, the ATmega16u2 on the ‘duino, or any traces on the board. This would require more thought.

The main reason for the error would then be no communication between the computer and the ‘duino, the wrong COM port selected, the wrong board selected in the Arduino text editor, or timing errors or a corrupt bootloader. The first three errors were now out of the question, leaving timing errors and a corrupt bootloader. Troubleshooting then moved on to ordering a new programmer, and still this didn’t work with the broken Uno.

Frustrated with one of the greatest failures to become an Arduino tinkerer, [psgarcha] took a good, long look at the Uno board. He glanced over to an Arduino Mega board. Something looked different. On the Uno, the resonator had blown off. Problem found, at least.

Replacing the blown part with a hilariously large can crystal oscillator, [psgarcha] was back in business. This isn’t how you would fix 99% of getsync() errors, and it’s difficult imagining a situation where a this part would randomly blow, but if you’re ever looking at a nearly intractable problem, you need to start looking at what really shouldn’t fail.

Resonator my fix (1)

Awesome rework, though.


Programmable Lithium Charger Shield for Arduino

Surely you need yet another way to charge your lithium batteries—perhaps you can sate your desperation with this programmable multi (or single) cell lithium charger shield for the Arduino?! Okay, so you’re not hurting for another method of juicing up your batteries. If you’re a regular around these parts of the interwebs, you’ll recall the lithium charging guide and that rather incredible, near-encyclopedic rundown of both batteries and chargers, which likely kept your charging needs under control.

That said, this shield by Electro-Labs might be the perfect transition for the die-hard-‘duino fanatic looking to migrate to tougher projects. The build features an LCD and four-button interface to fiddle with settings, and is based around an LT1510 constant current/constant voltage charger IC. You can find the schematic, bill of materials, code, and PCB design on the Electro-Labs webpage, as well as a brief rundown explaining how the circuit works. Still want to add on the design? Throw in one of these Li-ion holders for quick battery swapping action.

[via Embedded Lab]

Powering Your F-16 With An Arduino

What do you do when you have an F-16 sitting around, and want to have some blinking navigation lights? We know of exactly one way to blink a light, and apparently so does [Dr. Craig Hollabaugh]. When asked to help restore an F-16 for the National Museum of Nuclear Science and History in New Mexico, [Craig] pulled out the only tool that should ever be used to blink navigation lights on an air superiority fighter.

[Craig]’s friend was working on getting an F-16 restored for the Nuclear Museum, and like anyone with sufficient curiosity, asked how hard it would be to get the navigation lights working again. [Craig] figured an Arduino would do the trick, and with the addition of a shield loaded up with a few mosfets, the nav lights on an old F-16 would come to life once again.

The board doesn’t just blink lights on and off. Since [Craig] is using LEDs, the isn’t the nice dimming glow you’d see turning a normal incandescent light off and on repeatedly. To emulate that, [Craig] is copying Newton’s law of cooling with a PWM pin. The results are fantastic – at the unveiling with both New Mexico senators and a Brigadier General, everything went off without a hitch. You can see the unveiling video below, along with a few videos from [Craig]’s build log.

Continue reading “Powering Your F-16 With An Arduino”

Programming an Arduino over WiFi with the ESP8266

A lot of people have used ESP8266 to add inexpensive WiFi connectivity to their projects, but [Oscar] decided to take it one step further and program an Arduino over WiFi with the ESP8266. [Oscar] wrote a server script in Python that communicates with firmware running on the Arduino. The Arduino connects to the server on startup and listens for a “reboot” command.

When the command is received, the processor resets and enters the bootloader. The python script begins streaming a hex file over WiFi to the ESP8226, which relays it to the Arduino’s bootloader. Once the hex file is streamed, the microcontroller seamlessly starts executing the firmware. This method can be used with any AVR running a stk500-compatible bootloader.

[Oscar]’s writeup is in Spanish, but fortunately the comments in his Python and Arduino code are in English. Check out the video (in English) after the break where [Oscar] demonstrates his bootloading setup.

Continue reading “Programming an Arduino over WiFi with the ESP8266″