2 minute read Published:

The Embedded Idea That Turned Into a Perl Script

My first purchase from SparkFun was a camera module¬†(which they have since discontinued). The idea was to embedded it into a project. ¬†When the device arrived, I thought, “Why don’t I just whip out a quick Perl module to test the device”. I already had the hardware to hook it to a computer and thought it would be an easy way to prove the device worked and find out what the quality of the photos would be. So I¬†kludged¬†together the hardware that I needed and got to writing some Perl.

The Hardware

  • USB to RS-232 convert (Cause, who really has a COMM port still on their computer)
  • RS232 to TTL
  • C328-7640

On my old computer I actually had RS232 ports due to all of the times I worked on projects that had debug serial signals but there are lots of options out there that are inexpensive and easy to use. Level converter, I have several lying around but again, choices, cheap, and easy. Now, you have to cut me some slack for the way the hardware looks, remember I was just trying for a quick proof.

And even though it looks ‘spagatti-ish’, the zip tie and duck tape have held well and I haven’t had to scope the signals or debug connection issues.

The Software

It took about a couple of days to get my first full image. The module requires you to set the parameters (eg color type, resolution), set the package size, take the picture, ask for the picture (which returns the number of packages) and then read an acknowledge each data package. See the datasheet.

After getting a good picture, I didn’t stop with the Perl. This pushed the work on well over the time I should have spent. ¬†I kept saying things like, “let me make it easier to change the parameters on the fly”, “maybe I should make this more OO using the Moose module”, and so on so forth. So it took ~2-3 days to get an image and one year to move past.

The Video

I got the idea to take some time laps photography with this. So I set up my computer in the  shed about back and took a video from sun up to sun set.

And here is the video. You can see there some data issues. Maybe in a year I’ll get around to debugging those.