Hackaday Prize Entry: Useful Code For Useful Things

The Hackaday Prize isn’t exclusively about building things that will help the planet; you can also build things that will enable others to build things to save the planet. [Eric] isn’t saving the world with his commonCode library, but it will make it vastly easier for other people to build the next great Thing.

The idea behind commonCode is the same as shared libraries you’ll find in any desktop application of reasonable size; it provides a common library for AVR microcontrollers to build just about anything. Bit manipulation, an interface for timers, math functions, graphics, I/O, and peripheral drivers are all available in the commonCode library. This makes it easy for the developmentally challenged among us to create whatever project they want.

The commonCode library wasn’t created just for The Hackaday Prize. [Eric] has been tinkering around with AVRs since well before the Arduino existed, and he has dozens of projects in permanent installations. It’s a great way to give back to the community, and the perfect way to allow people to develop their own things to solve whatever problem they have in mind.


The 2015 Hackaday Prize is sponsored by:

Enigma Machine Wristwatch

We don’t find smartwatches to be supremely usable yet. This one sets a definition for usefulness. The Enigma machine is of course the cipher process used by the Germans during World War II. This Enigma Machine wristwatch is not only functional, but the appearance is modelled after that of the original machine. With the speckled gray/black case and the Enigma badge branding [Asciimation] has done a fine job of mimicking the original feel.

Driving the machine is an Arduino Pro Mini. We’ve seen Arduino Enigma Machines in the past so it’s not surprising to see it again here. The user interface consists of an OLED display at 128×64 resolution, three buttons, with a charging port to the right and on/off switch on the left.

The device is demonstrated after the break. Quite a bit of button presses are used to set up each of the three encoder wheels. But that’s hardly avoidable when you’re not committing to a full keyboard. We’re pretty impressed by the functionality of [Asciimation’s] interface considering it’s hardware simplicity.

This seems perfect for kids that are proving to have an interest in engineering. They learn about ciphers, embedded programming, and mechanical design and crafting (this is a hand-sewn leather wristband). Of course if you build one and start wearing it into the office we won’t judge.

Continue reading “Enigma Machine Wristwatch”

Binary Wristwatch

Open Source Binary Wristwatch Is Professional Quality

If you want to proclaim to the world that you’re a geek, one good way to go about it is to wear a wristwatch that displays the time in binary. [Jordan] designs embedded systems, and he figured that by building this watch he could not only build up his geek cred but also learn a thing or two about working with PIC microcontrollers for low power applications. It seems he was able to accomplish both of these goals.

The wristwatch runs off of a PIC18F24J11 microcontroller. This chip seemed ideal because it included a built in real-time clock and calendar source. It also included enough pins to drive the LEDs without the need of a shift register. The icing on the cake was a deep sleep mode that would decrease the overall power consumption.

The watch contains three sets of LEDs to display the information. Two green LEDs get toggled back and forth to indicate to the user whether the time or date is being displayed. When the time is being displayed, the green LED toggles on or off each second. The top row of red LEDs displays either the current hour or month. The bottom row of blue LEDs displays the minutes or the day of the month. The PCB silk screen has labels that help the user identify what each LED is for.

The unit is controlled via two push buttons. The three primary modes are time, date, and seconds. “Seconds” mode changes the bottom row of LEDs so they update to show how many seconds have passed in the current minute. [Jordan] went so far as to include a sort of animation in between modes. Whenever the mode is changed, the LED values shift in from the left. Small things like that really take this project a step further than most.

The board includes a header to make it easy to reprogram the PIC. [Jordan] seized an opportunity to make extra use out of this header. By placing the header at the top of the board, and an extra header at the bottom, he was able to use a ribbon cable as the watch band. The cable is not used in normal operation, but it adds that extra bit of geekiness to an already geeky project.

[Jordan] got such a big response from the Internet community about this project that he started selling them online. The only problem is he sold out immediately. Luckily for us, he released all of the source code and schematics on GitHub so we can make our own.

The Solution To The 10th Anniversary Code

A few weeks ago, [1o57], a.k.a. [Ryan Clarke] gave a talk about puzzles, DEFCON, and turning crypto puzzles into an art form at our 10th anniversary party. Ever the trickster, [1o57] included a crypto challenge in his talk, and a few days after our little shindig, nobody had yet solved the puzzle. Finally, someone bothered to sit down and figure it out. We don’t know what [tahnok] won, but as [1o57] said, solving it is its own reward.

Some of the slides in the presentation had a few characters sitting off to the side for no apparent reason. [tahnok] put these together and came up with:

DOXIYLDCYVDKIKNKUMKRYDNBYGONYMNXOC

In cases like this, you might try a Caesar cipher, or just shifting characters to the left or right a certain number of places. Since [1o57] noted this was the tenth anniversary of Hackaday, [tahnok] tried that first:

TENYOBTSOLTAYADAKCAHOTDROWEDOCDNES

It doesn’t look like much, but that’s only because the string is backwards. Tricky, tricky. tricky. With instructions to send a codeword to an email address, [tahnok] now needed to find a code word. There was one picture [1o57] put up on twitter that was still an unsolved part of the puzzle:

men

With no idea what these little stickmen are, he scoured google with variants of ‘stickmen code’ and ‘semaphore’ until he hit upon the Sherlock Holmes story, The Adventure of the Dancing Men. It’s a simple substitution cypher, translated to, “codeword psychobilly ciphers”

And that’s the entire puzzle. As far as we know, this took about a month to solve, and compared to the DEFCON challenges, was fairly simple. [1o57] will probably chime in down in the comments to tell everyone how many people have picked up on the clues and sent an email.

Ultrasonic Combo Lock

[John Boxall] took a different route for a single-input combination lock. This unit uses a Ping ultrasonic range finder to input a four digit code. It’s a hardware upgrade, but uses the same basic concept as his button-based combo lock. That design used an Arduino to measure how long you hold down a single button, with a one second pause between inputs, to enter the code. This one also uses timing to establish when each digit is read, but that digit is grabbed as the distance between your hand and the sensor.

There are things we like and dislike about the redesign. This is obviously much more expensive than other button-based locks like this garage door opener we built. If we were to run with [John’s] design, we might spring for the Ping sensor (because it’s a pretty cool input) and replace he character LCD with an LED or two. The other drawback that we see here is that it may be easy for someone to steal your code by watching from afar. Still, we love the project and think you will too after seeing the demo clip below.

Continue reading “Ultrasonic Combo Lock”

Optimizing Code For PWM Efficiency

For some projects, it’s okay to have a microcontroller twiddling it’s thumbs most of the time. When a project requires the cpu to do just one thing over and over, there’s no loss with inefficient code – it either works or it doesn’t. However, if a project requires a microcontroller to do several things at once, like reading sensors, dimming LEDs, and writing serial data out, cpu utilization can become an issue. [Robert] wasn’t happy with the code he used to control a string of LEDs, so he rewrote his code. With the old implementation, [Robert]’s code used 60% of the cpu time. With the new and improved code, the cpu was only busy 8% of the time.

The code works by using a hardware timer to trigger an interrupt. After calculating the next time it should run again, and changing the state of the data line, the code just sits quietly until it’s needed again.

It’s not a pretty hack, or even one you can hold in your hands, but [Robert]’s determination in getting a μC to do what he wants is admirable.

minibloq

Drag And Drop Programming Gets Kids Started Early

While programming an Arduino is a piece of cake for EEs who have been around the block a few times, there are some groups who would still find it difficult to get started with the IDE. It is touted for its ease of use, but there is a steep learning curve if say, you are 5 or 6 years old. [Julián da Silva] has been hard at work for a while now, to make the Arduino more accessible than ever.

Earlier today, we posted a story about moldable putty which can be used by children to build rudimentary circuits, enabling them to enter the fun world of hobby electronics at a young age. [Julián’s] project “Minibloq” aims to do the same thing with the Arduino. A work in progress, Minibloq uses a graphical interface to “build” Arduino code a block at a time. The code components are dragged and dropped into place on one side of the screen, while the source code is generated on the other half. This helps gently introduce those people new to the Arduino how to write actual code, a little bit at a time.

[Julián] is working hard to ensure that his application works well on OLPC and other classroom-oriented computers to ensure it can reach as wide an audience as possible. We think this would be a great introduction to the world of micro controllers for children as well as those who have never tinkered with electronics at any point in their lives.

Keep reading to see a quick demo of the software in action.

Continue reading “Drag And Drop Programming Gets Kids Started Early”