Category Archives: Electronics

An Easy-to-Build Syringe Pump

This is my attempt at coming up with a better dosing mechanism for my bartending robot (more on that soon). It’s a cheap, easy to build syringe pump using off-the-shelf parts.

What I used:

The only modification I had to make was to cut the plunger ring off the syringe and drill some mounting holes in the plunger top and the grip flange.

You could easily make the metal brackets from aluminum channel. You could also use a cheaper stepper with a threaded rod coupled to the shaft to save on cost.

Here’s a short video of the action:


Using the APDS-9960 RGB, Proximity, and Gesture Sensor with the Raspberry Pi

I’m always excited to get my hands on new sensors, so when I saw the APDS-9960 RGB and gesture sensor breakout board from SparkFun I ordered one immediately. The neat thing about this sensor is that it does a lot for its tiny size and relatively low cost.

The features this sensor offers are:

  • Proximity measurement
  • Ambient light intensity measurement
  • Color detection
  • Simple gesture detection including left, right, up, down, foward, and back
  • More complex gestures are apparently possible, although I haven’t seen evidence of this yet

SparkFun offers an Arduino library for the sensor, but no other platforms are supported yet. I really wanted to use the sensor with the Raspberry Pi so I quickly ported it. The connections I’m using are:

I put the code up on BitBucket at You can clone the repository using:

git clone

In order to get it working you’ll need to install wiringPi for I2C and interrupt support. Just follow the installation instruction at the wiringPi website.

Once you have wiringPi installed you can build any of the examples. So the GestureTest example can be built using the compile string:

g++ -Wall -o GestureTest GestureTest.cpp APDS9960_RPi.cpp -lwiringPi

It’ll be easier to write makefiles for larger projects so you don’t have to keep doing that, but for testing it’s fine. Before you run the program you’ll need to set up I2C and the interrupt with:

gpio load i2c
gpio edge 7 falling

You might get a warning with the i2c load, which you can safely ignore. Run the program with:

sudo ./GestureTest

And wave your hand over the sensor to see what it does. Neat right?? I’ll be digging further into this code to see if I can get more complex gesture sensing to work if someone doesn’t beat me to it. Have fun!

LCD Breadboard Adapter with Backlight Driver

LCD breadboard adapter with display

LCD breadboard adapter with display

This is a breadboard adapter I designed for the CFAF320240F TFT display from Crystalfontz. It breaks out the 0.5mm pitch connector to 0.1″ for use on a breadboard, and has a Fairchild FAN5333 LED driver circuit to power the backlight. All of the components were hand-soldered including the connector (using the flood-and-suck technique). It was designed for my PIC32 3D engine project, shown being used below:

LCD breadboard adapter used in my PIC323D project

This setup also uses the joystick (seen in the lower left) to rotate the 3D object on the screen around.

Crystal Binary Clock

Crystal Binary Clock

Crystal Binary Clock

This is a binary clock I made for my girlfriend’s birthday. It uses 6 jumbo red LEDs which illuminate quartz crystals to display the minutes in binary. Two servo motors are used in the bottom half to display AM/PM and the hour. All of this is controlled with a PIC16F690 microcontroller assembled on a breadboard.

Internals of clock showing circuit, servos, and connections to the LEDs above

The clock does not use any sort of timekeeping chip or even an external crystal for the microcontroller, so it relies on the internal RC oscillator and tends to lose a few minutes each day. There are only two buttons on the clock, an “IM” button (increase minutes) and “DM” (decrease minutes) which allows the time to be set/adjusted as needed.