Browsing Category Open Hardware Advent Calendar

Photobooth Button: Open Hardware Advent Calendar Day 18

Still playing catch up, our next project is for those building a photobooth: a button to trigger it.


Photobooths are incredibly popular for weddings and other events these days, but are also incredibly expensive. Building one yourself is definitely an option, especially if you already have a decent camera and a computer you can dedicate to it. But wiring up a nice button takes some effort.

What we’ve come up with here is just such a button, using the USB Wildcard board. It fades the LED in button on and off to attract attention, and when pressed, simulates hitting the spacebar to trigger photo taking.


This is another one based on the USB Wildcard. It uses that along with a few other components to drive the LED and read the button.

I used a SparkFun Big Dome Button, which needs a modification to work properly. If you try to run the LED in the button on 5V, it will be dim – it’s set up to use 12V, so the resistor is much too large for 5V operation. Refer to the photos above for how to disassemble it, but you basically remove the switch assembly by twisting it, and then pull out the LED assembly from the top of that. Unwind the leads from the plastic frame, and you can pull the LED and resistor out of the assembly. Replace the resistor with a 100 ohm unit, and reassemble.

The following is a very rough schematic of the button:


So you’ve got PD0 of the USB Wildcard to a 1K resistor, and that to the base of a 2N3904 transistor. Emitter of that transistor to Ground, and Collector of it to the cathode side of the LED in the button. Anode of the LED to +5V, and then one side of the button to Ground. The other side of the button goes to PD3, and a 10K pull up resistor from PD3 to +5V.


This requires the same Arduino setup as yesterday’s project, so follow the instructions there. Then, you can download the software from the GitHub project for this project. Load the software and you should be good to go.

Here’s a video of it in action:

For this video, I used Sparkbooth but you can substitute whatever you like.

Future plans

About the only thing I’d like to add to the current version of this project is some debouncing for the button, but given the delays used to lock out the button after pressing it once, it’s probably not a big issue. I’d also like to look at an even cheaper version using one of Microchip’s new USB PICs – that one would require a cheap microcontroller and a couple resistors and capacitors.


This is an easy-to-build photo booth button that’s still easy to customize, thanks to the use of the Arduino software to implement it. I hope someone finds it useful.

Category : Open Hardware Advent Calendar

MouseMover: Open Hardware Advent Calendar Day 17

Due to illness I missed a few days. Now to play catch up…

Today’s project is actually some software for a previous project – the Mouse Mover.


The Mouse Mover uses the USB Wildcard as its hardware. Its basic function is to move the mouse by one pixel once per minute, to keep the screensaver from running.

It’s true that screensavers and display sleep can be disabled by other methods that don’t require extra hardware, but if you need to disable them and either don’t have access to those settings, or don’t want to spend time tracking down the settings, this would be useful.


The Mouse Mover uses the USB Wildcard hardware, as mentioned before. It doesn’t need any additional hardware beyond that. Check out that project’s GitHub for the schematic and PCB.


The software is written in the Arduino environment. The ATmega16U2 used in the USB Wildcard isn’t supported natively by Arduino, so we need to make some changes. First off, you need to be using Arduino 1.6.0, which is in pre-release right now. You need to download the 3rd party support library that we worked on from GitHub. Download it, and do the following:

  1. Find your Sketchbook directory. On a Mac and Linux, it’ll be the Arduino directory in your home directory. On Windows, it’ll be the Arduino directory in your Documents folder.
  2. Create a directory named “hardware” in the sketchbook directory.
  3. Extract the ZIP file from GitHub into a directory called “minimus” in that hardware directory.

The Arduino code is based on another GitHub project made to bring Arduino support to the Minimus32 board. We modified it to work with the latest Arduino release and to add support for the ATmega16U2.

You’ll need to program the AVR in the USB Wildcard with the proper bootloader. This can be done with the Burn Bootloader command in the Arduino software once it’s set up with the Minimus download. Make sure to set your board type to Minimus 16 (for the ATmega16U2) or Minimus 32 (for the ATmega32U2) first.

Once you have that set up, you can download the code from our GitHub, and download it to the USB Wildcard board. From then on, the mouse will rock back and forth by one pixel in both X and Y once per minute.

Future plans

This one’s pretty much done – it does what it needs to do. I’d like to get some USB type A to Micro USB type B adapters so that it can be connected without a long cable, but that’s about it.


While only a slightly useful project, this is a good example of how having a flexible, inexpensive platform like the USB Wildcard on hand can make a simple project a quick one. Also, I got Arduino support for the USB Wildcard out of it, which is going to come in handy.

Category : Open Hardware Advent Calendar

Pinbox: Open Hardware Advent Calendar Day 16

This one’s another project in progress – a controller for playing PC-based pinball.


Recently, we started playing Pinball Arcade – a really nice pinball simulator. As some of the people behind DIYPinball, naturally we find virtual pinball games to be lacking, but you can’t always take a pinball machine with you.

Enter the Pinbox: a custom controller for playing pinball on a computer. Rather than using your shift keys and spacebar, you get actual arcade buttons on the sides of a box, and a plunger. Or at least you will when we finish it.


The circuit is basically an Arduino Leonardo on a 5cm x 5cm circuit board. An ATMega32U4 is the brain, and it has five inputs for buttons – two flippers both left and right, and a start button – and an input for a SparkFun photointerrupter board. It also has a header for installing an eventual accelerometer module for tilt detection.


Schematic and PCB files can be downloaded from our GitHub.


The software is still in progress. The basic function is to act as a USB keyboard, activating the shift keys for the flipper buttons, the Return key for the start button, and the spacebar for the plunger. It uses some debouncing using the Bounce library to take care of the button inputs. Eventually the software will be expanded to interface with the accelerometer to allow you to bump and tilt the table. We use the Leonardo’s built-in Keyboard library to handle sending keypresses to the computer.

Before loading the code, the AVR on the Pinbox board needs to be loaded with the Caterina bootloader. This is done by connecting an AVR programmer to JP1 – I use a USBTinyISP – and using Tools -> Burn Bootloader. From then on, the board can be programmed over USB, just like an Arduino Leonardo.

Source code can be downloaded from our GitHub.

Future plans

This one’s still a work in progress. We still need to figure out the plunger mechanism, using the optical sensor and a knob of some sort. After that, we need to mount it in a box – and then, we need to hook up the accelerometer. So there’s plenty to do, but a clear path to the finish.

Category : Open Hardware Advent Calendar

Spherebot Controller: Open Hardware Advent Calendar Day 15

Today’s entry isn’t quite done yet, but that’s only because I completely blanked on getting the rest of the parts when I was at the store on Saturday. Oops.

It’s a controller board for the Spherebot.


The Spherebot is an alternative design to EMSL’s EggBot. It’s meant to be cheaper, maybe a bit more hackable, and perhaps made out of 3D printed parts.

I want to take this opportunity right off the top: if you’ve got the resources, I highly suggest buying one of EMSL’s offerings. They’re open-source, and very well designed and made. EMSL do VERY good work.

We, however, didn’t want to spend a ton for screwing around with drawing on ping pong balls, and wanted something more hackable, so a Spherebot it is. One problem, though, was the lack of a controller board – the “official” site just uses a breadboard. That doesn’t cut it with us, so we came up with our own design.


The design is very basic – an ATMega328P with a couple of Pololu stepper driver modules, a servo output, a crystal, and some connectors. Two stepper connectors, one for +12V and +5V in, and one FTDI-type serial connector.


Power is provided by an ATX power supply, and the serial to USB interface will be done with our USB Wildcard board from earlier. All of this is to keep this board as basic as possible.

Schematic and PCB design files can be found on our GitHub.

Future plans

I’m currently working on building a Spherebot that will use this board.

View this post on Instagram

Spherebot is almost ready.

A post shared by Randy Glenn (@randy_glenn) on

I hope to finish that up over my Christmas break from work. I’ll be posting more details on how we built it, along with a parts list and how to get the thing going, because that information seems to be a bit hard to find. This board might also feature prominently in a planned project for the DIYPinball project – a simple board for controlling two stepper motors is a useful thing to have lying around.


Not an exciting one today, but hopefully something that other people interested in making Spherebots will find useful.

Category : Open Hardware Advent Calendar

WS2812B Breakout Board: Open Hardware Advent Calendar Day 14

Apologies for the delay on this one. I knew that if I missed the schedule one day, it’d just cascade…

This one is another building block for future projects: a breakout board for the WS2812B LED, also known as the NeoPixel.


The WS2812B LED is more commonly known as the NeoPixel, a name popularized by Adafruit. It’s an RGB LED with all the circuitry needed to control its brightness built right into the LED’s package. All you have to do is provide power, connect the data in, and connect the next LED in the chain to the data out. Pretty simple, conceptually.

There are a ton of other breakout boards for this LED available out there – Adafruit, Sparkfun, and a bunch of others all sell them. Ours is different because it copies the form factor of an old Sparkfun breakout for a different, similar module – their WS2801 breakout, to be precise. This one was used on the Project Vending Machine 2.0, and has a lot of nice things going for it. It’s fairly small while not being easy to lose, and has four mounting holes. Mounting holes are incredibly important when attaching stuff to other stuff.


As indicated above, we blatantly ripped off SparkFun’s design for the overall board. We changed the connectors, LED and control chip from 4-pin and an IC+LED combo to 3-pin and a WS2812B. The screw holes and text labels are all in the same place still.


The schematic itself is pretty simple – two connectors, a WS2812B, a bypass capacitor for the power supply, and two series resistors on the serial data lines. These are there primarily to absorb reflections on the serial line – basically, the long wires between modules can cause ringing that causes a large voltage to be present at either pin, which can damage or destroy the LED module. Having a resistor there absorbs that.

Schematic and PCB files are available at our GitHub. Also included is our old WS2812 breakout – for the 6-pin version rather than the current 4-pin WS2812B – as well as the panelized versions. Those fit 4 boards into a space under 5x5cm, so you can get more boards for your buck.

If you want to order some of the boards from DirtyPCBs, using this link gets us a kickback in the form of a discount.

Future plans

This is going to factor into a bunch of future projects, because I love blinking LEDs. One of them is even part of the advent calendar (I hope).


A very useful building block for LED-related projects, even if it isn’t a particularly exciting one on its own. Also, tested and known to work, which is a bonus.

Category : Open Hardware Advent Calendar

Word Clock 1.0: Open Hardware Advent Calendar Day 13

Today’s late posting is brought to you by “unintentional napping”. It’s a project I finished a few years ago: a Word Clock.


A word clock is a clock that is made of a bunch of letters. These letters for the words that spell out the time – “IT IS SIX OCLOCK”, “IT IS A QUARTER TO SEVEN”, etc. The letters each have a light behind them, so that the letters and words that are lit up spell out the time.

Mine, as with many, was inspired by the QLOCKTWO, in addition to others, like my friend James’ Antelope clock.


This version is Arduino-based (using an ATMEGA328 running at 8 MHz), using a Microchip MCP79410 real-time clock chip for timekeeping. The Arduino is connected to four buttons for setting the time and changing the display to show the number of seconds. It also reads from a TEPT4400 ambient light sensor to control the overall brightness of the clock.


The Arduino drives the display control circuit, as well. This is formed of two TPIC6B595 power shift registers (shift registers with MOSFETs on their outputs to act as low-side drives) and a 74HC595 shift register to drive the high side of the LEDs. The schematic and board provide for two 74HC595s, but only one is used in the assembled clock. The display is scanned one column at a time, for each of the 16 columns of 8 LEDs each. The LED array is made with both through-hole and surface mount (3528 package) footprints to allow either kind of LED to be used.

A very basic 7805 circuit provides a stable 5V supply.

The board used was not designed for any particular enclosure. This means that it doesn’t fit any known enclosure all that well. As you can imagine, this became an issue during final assembly.

Schematic and PCB files can be found on our GitHub.


The software is a fairly self-contained Arduino project – RTC code is included, so the only real external dependency is the Wire library included with the Arduino software. A bootloader needs to be flashed onto the ATMega328 to load the firmware – a script to do so and the bootloader HEX file are also provided.

Source code can be found on our GitHub.

The software handles a setup mode for setting the time, displaying the time as words, and displaying the number of seconds on the display (using the letters as pixels to form numbers) when the Seconds button is pressed (S4 on the schematic).

To set the time, S1 is pushed, to put the clock in set mode. The top two letters on the left indicate that you’re adjusting hours, and the Up (S3) and Down (S2) buttons are used to adjust the hours up and down. Pressing S1 again moves to setting Minutes, and then Seconds. Pressing S1 one more time saves the time and returns to display mode. Pressing S4 at any time while setting will cancel set mode. Waiting more than 45 seconds will cancel as well.

RenderTimeMatrixV1BetaGrid.cpp sets up the mapping of words to the LEDs – it contains a number of conditions to determine which words to light up. For moving to different languages, this should be the only file that needs to be edited. The English artwork for the letter grid is included in the source code.

Physical construction

Rather than laser etching and other methods for creating the letter grid overlay (which require tools that we don’t have), we used old-fashioned overhead transparencies. Two were stacked on each clock – one laser-printed (which blocks light better), and one inkjet (which doesn’t block light as well, but looks black rather than gray).

The transparencies are mounted in a photo frame that fits the board – we got one from Dollarama – directly behind the glass. Behind the transparencies is a sheet of kitchen parchment paper, to act as a diffuser. This sandwich is held against the glass with a thick paper frame, and the plastic spacer that came with the frame.

(photos of this stackup will be posted at a later date)

Artwork in English is posted to GitHub.

Future plans

I’ve pretty much given up on this design. A major shortcoming is that it drives only 8 LEDs at a time, in 16 rows. This means that each LED is only on 1/16 of the time – so you need to drive a LOT of current to get acceptable brightness. Switching it around – so that 16 LEDs are driven at a time, 1/8th of the time – would mean we could get an acceptable display brightness without stressing the LEDs as much. I also want to make one that can be mounted in a particular enclosure nicely, rather than hacking apart a dollar store photo frame as I had to do.

Version 2 is already being planned, and will hopefully be done in early 2015.


This design works, but maybe not as well as we’d like. We don’t suggest anyone build it, as we’ve got something better coming – something that had evolved a lot based on the lessons from this project. Some of the parts we played with – the Microchip RTCs, for example – worked really well, and we’ll be using them again. The RTCs especially are far cheaper than the Maxim equivalent. The power shift registers, while nice, aren’t really worth the extra cost.

Stay tuned for Word Clock 2.0.

Category : Open Hardware Advent Calendar

Electric Imp Breakout: Open Hardware Advent Calendar Day 12

Today’s entry is a fairly simple one, but it’s a building block for a future project: a breakout board for the Electric Imp.


The Electric Imp is a development platform for making devices that connect to the Internet. It’s a module containing a fairly fast microcontroller and a WiFi chip, with software that handles the WiFi connection, and connects to Electric Imp’s servers. From there, it determines which software it’s supposed to run, downloads the latest version, and runs it. The really powerful part here is that you – the developer – write that software, and put it on Electric Imp’s servers. This way, you make sure that every device that you ship always has the latest software.

All of the Imp modules that are available are pretty tiny, but the most common one for hobby applications and prototyping is the SD card size. It’s the same physical size as the memory card we all know and love, but instead of flash memory, it’s a microcontroller and WiFi interface.

The Electric Imp people make and sell a breakout board to let you more easily use the card – SD cards need at least a socket to be useful, after all. The April development board contains a power supply, SD card socket, and the serial number chip that the Imp needs to work. It’s a good deal at $12.50 US, but has some limitations:

  • It uses a Mini USB jack for power. Micro USB is preferred these days
  • It has no mounting holes, so it’s hard to permanently mount it in a project
  • It’s cheap for one, but expensive if you need more than that. Which is a problem, because when working with Imp projects, the code that you develop on their server is tied to the serial number on the breakout board / in whatever system you’re developing. Which means you can switch the Imp module between boards and you’ll always have the right code – but it also means messing with things on the server if you only have one development board.

Because of those limitations, and because I have a stack of (now-discontinued) SD card sockets from a previous project, I decided to make my own breakout boad.


The setup is really simple: a 5V to 3.3V power supply using a Microchip LDO, the Atmel serial number chip, some bypass capacitors, and connectors. All this in a board under 5x5cm, with 4 mounting holes for easy attachment.


As always, schematic and PCB layout files can be found on our GitHub.

Future enhancements

There’s not much to be enhanced on this board – it’s pretty complete for what it needs to be, which is to provide the bare minimum needed to getting an Electric Imp running. About the only change I can see making is to replace the discontinued SD card socket with one that’s still made.

It will, however, be used in future projects.


This is a really basic, simple project – not even any software! – that I hope will help someone in the future not have to design their own if they need it. Building these this way let me put together 10 breakouts for about $50 – saving me more than half the cost of buying April boards and getting me a preferable USB connector and mounting holes, at the cost of a couple hours of work.

Since I was also watching TV while I was doing that work, I’m happy with that tradeoff.

Category : Open Hardware Advent Calendar

AVR Pigrammer: Open Hardware Advent Calendar Day 11

Today’s project is a little thing I threw together to put together kits for the Christmas ornaments last year: the AVR Pigrammer, a device for programming lots of AVR microcontrollers quickly.


The AVR Pigrammer is a very basic AVR programmer based around the Raspberry Pi. I put it together because I needed to program 100 AVR microcontrollers, 25 each of 4 different programs. Doing this via the normal command line would have been really annoying. I figured the easiest way to do this was to have an easy-to-use ZIF socket for loading the microcontroller, a button to push to start programming, and some LEDs to show the status. That way, I could absent-mindedly program the chips while watching TV.

Since AVRDUDE on Linux can program chips over the system’s SPI port, that meant a Raspberry Pi could act as an AVR programmer without much extra hardware. Add some LEDs and a button, and you’ve got everything you need.


The schematic is very simple: we wire up the AVR to the SPI port of the Raspberry Pi, a button to GPIO23, and LEDs hooked up to transistors that are driven by some other GPIO lines. These LEDs show if the last write to a chip was good (green), if it’s writing to a chip now (yellow), if the last chip was bad (red), or if you’ve programmed all the chips you need to (blue).


There’s really not much to it – I didn’t even bother with a custom PCB for the first version, just a prototyping board. Schematic and code can be found on our GitHub page.

Software setup

There are a couple of prerequisites for this project. One is that AVRDUDE is compiled with SPI support built in, and configured to use Reset on GPIO25. You also need to add the SPI module to your Raspberry Pi – or at least remove it from the blacklist. Kevin Cuzner’s site goes into detail on all of this.

The software I wrote is a Python script that in turn calls your project’s Makefile, which in turn calls AVRDUDE. The Python script checks the return value of AVRDUDE to see if the chip programmed successfully or not, and keeps track of how many good chips you’ve programmed. The Python script is called as:

sudo python

The Python script passes an environment variable BATCH_MODE and sets it equal to pigrammer. A rule in the Makefile should check if that environment variable is set, and set the AVRDUDE configuration to use the SPI programmer if it is. You can find an example in the setup for the Christmas Ornaments Makefile.

Future plans

I have a lot I’d like to do with this project. I’d like to improve the hardware to work with different AVRs – right now it only works with 8-pin ATTinyx5s. I’d also like to improve the software to not rely on the Makefile, and instead take a HEX file and the fuse settings as parameters. The reason it uses the Makefile now is to allow the Makefile to set fuses in the proper order for programming, and to rebuild the HEX file if it’s out of date.

Eventually, the goal is to make this unit standalone so that it doesn’t need a keyboard or monitor to run, as it does now. On-the-fly updating to the latest code would also be an awesome feature.


This is just the start of this project, but it’s already proven essential – I was able to program 100 AVRs in a little over an hour while watching TV. I definitely want to evolve it to make it even more useful.

Category : Open Hardware Advent Calendar

DigitNet 2: Open Hardware Advent Calendar Day 10

Today’s project is another one that’s been waiting to be released for quite some time: a networkable 7 segment display that I call DigitNet 2.


Way back in 2007, as a final year “prank”, my graduating class made a clock to count down to the Iron Ring ceremony at McMaster University every year. We went with a bunch of discrete LED-based digit boards, each with a microcontroller, and networked together over RS485 with a control board. The final result worked, but I felt the design could be improved. Calling that one DigitNet 1, this project – DigitNet 2 – is an attempt to improve on that design.

There are a bunch of changes, but the major ones are moving to a proper LED driver chip (the STP08DP05 in this case), using 12V rather than 5V to drive the display, better wiring, and adding a configurable address to each board.

The end result of these improvements is a board that has a 4″ 7-segment display unit (sourced from eBay), a proper constant-current LED driver chip, an ATTiny2313 microcontroller, a surface mount DIP switch to set the address for each board, some debug LEDs, and in and out connectors to wire the boards together easily. Having multiple boards makes it easy to do a big countdown clock (as you can see above, pictured on the incredibly messy desk / workbench)


The hardware is fairly basic: an ATTiny2313 is connected to an SN75176 RS485 transceiver. Its address is configured by a surface-mount DIP switch. There’s a basic power supply to give 5V for the digital parts, and 12V powers the LED display. This display has multiple diodes in series in each segment, so a larger voltage than normal is required to drive it.


The board is designed to use as many surface mount parts as practical, and to mount to the back of the 4 inch 7 segment display module. It was also designed to fit in a 5cm x 10cm Seeedstudio prototype board order, and provide mounting holes to secure the module to whatever frame it needs to attach to.

To wire together a bunch of boards, the power and network connections are daisy-chained between boards, with a controller of some sort at one end.

Schematic, PCB and Gerber files can be downloaded from our GitHub.


The software was written in C for the AVR using the standard AVR-GCC toolchain. An ISP connector is provided on the board to load the firmware onto the chip. The software basically sits waiting to hear one of three commands, and then listens for an address (for some commands) and then a byte of data. That data is either the segments to turn on (7 segments plus one decimal point = 8 bits), or the brightness. Brightness is controlled using the PWM output of the microcontroller.

Software can be downloaded from our GitHub.


There are three commands:

  1. 0x99 is Global Brightness Change. Every node on the network acts on this message regardless of address, and sets the PWM duty cycle to the next byte received.
  2. 0xAA is a Data command. The next byte specifies which board the message is meant for. The protocol supports up to 256 units, but only 4 bits are implemented in this version – the DIP switch drives the lower 4 bits, and the upper 4 are set to 0. The last byte specifies which segments to turn on. I don’t have which bits map to which segments available at this time.
  3. 0xBB is a Brightness command. The next byte specifies which board the message is meant for. The last byte specifies the brightness for that digit.

Data is transmitted over RS485 at 9600bps, 8 data bits, 1 stop bit, no parity.

Future enhancements

These work fairly well for making a big-digit display – I easily made a countdown clock with them – but the protocol could do with a checksum of some sort for integrity. I also need to document said countdown clock.


This was a successful project, as far as making an enhanced version of the original at McMaster – it was far easier to configure, assemble and maintain than the original.

Category : Open Hardware Advent Calendar

Black Magic Probe PCB: Open Hardware Advent Calendar Day 9

Today’s project is a rushed one, and part of our development effort for DIYPinball: our own PCB for the Black Magic Probe.


The Black Magic Probe is a debugging and programming tool for working with microcontrollers – more specifically, ARM Cortex-M series microcontrollers. It allows you to download code to the chips from your computer, and control the execution of that code, so you can develop and debug your projects more easily. We’re looking at using it for the next series of DIYPinball boards as we try and move to a more Open Source-friendly development environment.

The design is open source, and is available for sale, but the Black Magic Probe Minis that are currently sold don’t seem have level shifting functionality – so they only work at 3.3V – and they only have one style of connector. Further, we needed a bunch, and shipping to Canada costs almost as much as the device itself. Since the design is open source, we decided to try doing our own design for the board, and make them ourselves.


This is an advanced project – lots of tiny parts – so I’m not going to go into a ton of detail on this. The intended audience should be able to figure out the parts list and how to assemble it from the schematic and board layout. Also, I’m writing this on a deadline, and want to get this up on time, and that’s really more of a factor at this point.


Basically, we’ve combined some of the alternative designs of the Black Magic Probe from their GitHub, and added a connector for the LPCXpresso LPC-Link to the board, so we can use some of our existing boards with the probe.

The schematic, layout and CAM files can all be downloaded from our GitHub.

Future plans

We have tons of future plans for this project – mostly because it hasn’t been tested yet. I’ve got a stack of 4 of them on my desk to be tested, and to be loaded with the USB bootloader, followed by the Black Magic Probe firmware itself. I intend to document the process for that when we get there (hopefully soon). I’ll also write up the actual parts list, and we’re hoping to put together a 3D printed case to protect the probe as well.


This one isn’t actually done yet, but I needed to get something up before midnight, and I’ve been meaning to release this design anyways. So, loss-win-win, I guess.

Category : Open Hardware Advent Calendar