Fidgetμ

In the fall of 2017 I was trying to learn how to program and use Microchip’s PIC series of microcontrollers. I had ordered a few ICs and a programmer, but with this I had to build the microcontroller onto a breadboard every time I wanted to test something. I decided a wanted a portable platform where I could test code anywhere.

The Idea

I had the idea for this device one morning while on my way to school. When I got back home that day I had some time so I decided to draw a schematic for it. About three hours later I had built and tested the whole thing. The name comes from the (at the time) trend of “fidget spinners.” I thought it would be cool to have a fidget device that was also an educational tool.

Parts

To build this little test platform, all I would need would be some basic inputs and outputs, the microcontroller, and a programming header. Here’s what I used:

  • p12f683 in an 8 pin DIP package
  • 2 LEDs
  • 4 Buttons
  • 1 Switch
  • 5 Pin BERG header
  • 11×11 piece of perf board
  • 2 Pin terminal block

The Schematic

Schematic

I do not have the original schematic I drew for the device but I recreated the schematic in EAGLE. I used all of the I/O on the board that I could, including reusing the programming and MCLR pins. The microcontroller has internal pullups so I did not need to put pullup resistors on the switches.

The Layout

I tried to layout the components as tightly as possible and managed to make the whole device not much larger than a quarter. The device does not have a battery, but there is a terminal block on the top right that will accept any 5v power source. I generally used a USB battery bank.

The bottom of the device coated in hot glue

To protect the bottom of the device, I coated it in hot glue. You can still see wires and resistors through the glue. This was very effective as the device still works to this day (more than 2 years). There is also a hole which allows you to hang the device from a keychain. Microchip’s pickit programmer also has a keychain loop so I actually used to keep the two together on a keychain.

Software

I did write quite a few programs for the device, most of which were just to tinker with the workings of the PIC architecture. The most advanced program I wrote was a reaction game. The point of the game was to click a button during a short, random interval of LED flashes. Every time the user succeeded, it would speed up on the next level. I implemented leveling with a high score system which indicated when the player reached a new high score by flashing the LEDs in a certain way. The high score was kept in the EEPROM so it was persistent even if you disconnected the device.