Author Archives: Collin

Circuit_macros preview app for Mac OS X

This is a little python app I wrote up to provide a sort of GUI for the circuit_macros package. Circuit_macros is an excellent way to draw professional-looking electrical circuit diagrams, but it takes a series of steps to compile the code describing a circuit into a finished image. This app will call the right commands and show the image with a single click.

Continue reading

Splashing Photography with Raspberry Pi

These are splash pictures taken using Raspberry Pi as a controller. These aren’t your typical water-dripping-into-a-pool photos, they’re actually made by placing a drop of liquid on a speaker and blasting it with sound! Sure, you could control everything pretty easily with discrete electronics, but this sounds like a good use for a Raspberry Pi. Continue reading

Winter storm time lapse

Time-lapse video of winter storm Virgil on 24 March, 2013.

Make sure to click-through if you want to see the full-resolution version. The video was made using a Nikon point-n-shoot camera tethered to my laptop, and gphoto2 to capture and download one image every minute. Entire time was about 4.5 hours until I stopped it after getting dark. To get gphoto to do a timelapse, I used this command:

gphoto2 --set-config flashmode=0 -I 60 -F 400 --capture-image-and-download --filename "img_%H%M%S.jpg"

This kept the flash off, took a picture every 60 seconds (-l 60) and captured 400 frames (-F 400). It downloads them to the current folder and names them with the current time stamp, then removes from the camera. Images can then be compiled into video using ffmpeg or something like Time Lapse Assembler.

x10 Firecracker on Raspberry Pi GPIO

I had previously developed a script to control the x10 firecracker (CM17A) module using python. Of course, my new Raspberry Pi would make a perfect home monitoring server to control the lights. The script works fine on the Pi using a USB-to-serial converter, but when there’s only 2 precious USB ports, why not use the serial pins on the GPIO bus to drive the x10?

Continue reading

Raspberry Pi temperature sensor with plot to web

My Raspberry Pi arrived a few weeks ago, and has been a great way to pass these cold snowy winter days. I have a number of projects in mind, but one was to interface with a temperature sensor and serve the results to a web page. I had a couple of the DS18B20 temperature sensors lying around from some undergrad EE project from long ago, so why not put them to use. There’s a great tutorial by Adafruit on how to set up the sensor itself and use a simple python script to print the temperature to the terminal. The rest of this post assumes that the sensor has been set up as in the guide, and the python script prints valid numbers to the terminal. Basically, the data pin of the sensor is connected to the Pi’s GPIO #4 with a 4.7K pull-up resistor, and the other two pins are power and ground. Continue reading

64-bit Python/Scipy/Matplotlib on Mac

It used to be a rather difficult process to get python with scipy, numpy, matplotlib, and ipython all running in 64-bit on Mac OSX. Now it seems it can all be installed via Macports. I prefer the Macports over other options such as the Scipy Superpack because Macports installs everything to /opt/local/ to make it nicely self-contained. The Superpack has also moved on to Mountain Lion, and since I’m not yet in the Mountains, it’s not the most up to date for me.

So partly to archive my process in case I need it again, here’s how I got everything installed  and running (tested on Mac 10.7.5). Note some of the steps can take a while to download, compile, and install.

Continue reading

Using todonotes with puthesis LaTeX class

The LaTeX package todonotes provides a useful set of commands for marking todo items, including notes and missing figures. However, it doesn’t work with the puthesis class used for writing theses and dissertations in the Purdue format. The todonotes work fine for adding notes, but the compiling breaks when using the \listoftodos command.

I found the workaround, however. It seems the puthesis class redefines the table of contents lines for chapter, section, subsection, etc. But of course it does not redefine a “todo” table of contents line. Adding the following definition right after the todonotes package is loaded does the trick:

\usepackage{todonotes}
\makeatletter
 \if@todonotes@disabled
 \else
 \renewcommand*\l@todo{\@dottedtocline{1}{\smalltocskip}{0em}{2.3em}}
 \fi
\makeatother

It also works when using the hyperref package, so the list of todos links back to the original todo items.

Circuit_macros vs. circuitikz

While there’s a number of software applications for building circuit diagrams, they tend to focus on running fancy simulations, while the schematics themselves are ugly to look at. So when writing papers (and ECE201 exam problems) where nice looking diagrams are important, something specifically made for quality drawings is required. I use LaTeX for writing research papers (and hopefully soon a PhD dissertation), so a LaTeX extension would be perfect.

After some searching around, it appears there are really two viable options for incorporating schematics into LaTeX documents: the circuit_macros package, or circuitikz package. Which one to use? After a few tests, here’s what I found. Continue reading