Time-lapse project, part III: a new circuit board

Blognosticator Head

My time-lapse camera has been running now for 25 days. It snaps a photo of Bishop Peak (elev. 1559 ft.) every five minutes. I have over 2,300 photos so far.

Bishop Peak portrait 01247

This is a sample of the photos being taken by my time-lapse camera. My plan is to assemble a montage of 374 of the best photos in a large frame mounted in the Baker Center on the Cal Poly campus.

The project has not gone perfectly. The first week we had rain and cloudy skies for five days in a row (a nearly impossible weather event here – front page news!). My solar panels didn’t get enough sunlight, and on the sixth day the Raspberry Pi computer inside the box gave out. My 9Ah battery just couldn’t hold out that long. I revived it two days later with a freshly-charged battery, and I added a third solar panel. Under normal circumstances the solar panels will generate over three times the power consumption of the camera system, so it should go for a long time (over a year) without running out of power. You can read about the project in my earlier blogs here.

Two weeks later I added a second battery so now I have a total of 19 Ah of power, which should run the camera for nine days with no sunlight. Now it’s all working fine.

The program running on the Raspi instructs the camera to start shooting at 5:00 a.m. and stop at 9:00 p.m. Linux knows about Daylight Saving time, so it automatically changed to Pacific Daylight Time on March 13th. My problem since is that the camera still thinks it’s on Standard time, so I have to make mental adjustments as I process the images. I can’t move the camera, and I can’t see the LCD viewfinder in the box, so it will just have to stay in the wrong time for the duration.

At 9:00, the Raspi goes into a sleep mode, cruising along on less power, which makes it possible to run for longer. At 5:00 a.m. it wakes up and starts its daylight cycle.

I’m shooting in Camera Raw, so each photo is full-resolution. I can make big prints of the photos as a result, and I can convert them into smaller photos if I need to.

I was in a bit of a rush when I installed the camera on the roof of the Kennedy Library, and I hadn’t satisfied myself that the program and the computer would work without failing for an entire year. I decided to build a second one as a back-up. This would be a complete circuit board and battery that I could test on my desk at home while the other one is clicking away on the roof. I ordered the parts, buying some slightly different versions that use less power. I redesigned the layout of the parts on the board, and then had the idea of making a “printed” circuit board of my system.

I ordered some copper-clad phenolic board from Amazon in a size large enough to make the circuit board. While waiting for its arrival I designed the traces for the components I would later mount on the board. I have never made a circuit board before.

Circuit board fabrication 49

This is my CNC router working its way around the traces of my “printed” circuit board. The cut-out in the foreground is to provide access to the microSD card on the Raspberry Pi (in case I need to change the program on the computer). In this photo you will see that the holes were drilled first, then the traces cut. It was slow, but it worked beautifully.

To make the traces, I used my CNC router with a small cutter. I laid-out the traces in Adobe Illustrator as positive lines with round pads for the connection points. Then, on a separate layer I prepared the holes where the components would go through the board to be soldered onto the board.

When the phenolic board arrived, I took it to the CNC machine and I made a practice run on a corner of the board. By cutting only a few thousandths of an inch deep, I was able to remove the copper from the non-conductive areas of the board, leaving the conductors behind. The CNC machine did a stellar job of cutting the traces. I had to run emery paper across the traces when it was finished to clean off some small burrs that the cutter left behind.

Finished circuit board 07

This is the bottom side of the finished circuit board after mounting the components and soldering all the connections. The large areas of copper are “ground” – but I didn’t use it for that purpose. You can see the MicroSD card in the top of the cut-away area on the lower-left. Some of my mounting hardware came dangerously close to the live traces, but not close enough to short any of the wires.

When it was finished I examined it carefully, then soldered the components to the board. It makes a very clean layout, and it’s very solid. I put the transistor, the diode and the resistor into their positions, and soldered them in place, and I mounted the Raspberry Pi and soldered its output pins to the circuit board.

This circuit is so simple that I only needed copper on the backside of the board. Had it been any more complicated I could have designed a two-sided board.

Finished circuit board 03

This is the top of the circuit board with all components and wires in place. I am very happy with the layout and the appearance of the board. And, best of all – it works! The wires leaving the board on the left connect power to the camera, the camera trigger line, and two 12VDC power inputs (upper-left). One is coming from the batteries, the other from the solar panels.

Once I had it all wired, I applied battery power and the computer started up, but the circuit didn’t work. (My friend Eric told me recently, “It’s ALWAYS the hardware.”) The software was running fine; the control circuit on the Raspberry Pi was “going high” once every five minutes. But the relay was not closing, and therefore the camera will not take a photo. I was dumbfounded. I double-checked the wiring; I triple-checked the circuit to be sure I had designed it correctly, and put the parts on the board with correct polarities. Everything checked out. But it didn’t work.

I let it sit for a week while I traveled to Memphis for the TAGA conference, then stopped in Phoenix on the way home for three days of Spring Training (and some mighty good food!). When I got home again I took out a lighted magnifying glass and followed every trace for its entire path. Up where the signal voltage from the transistor reaches the relay I found a microscopic sliver of copper shorting-out the two pads at the relay, grounding-out my transistor circuit. I scratched it off with a sharp jeweler’s screwdriver.

Then I powered-up the board again and the whole thing started working! Hurrah! Now it’s sitting on the desk to my right, clicking every five minutes as it is supposed to be.

I might substitute this board for the one in the box on the roof of the library. Or I might just let that one keep running, and keep this one available as a back-up if I need it.

The entire process has been educational and fun. I have learned a little bit of Python coding (very little), have observed my friend Eric enter the “cron” code necessary for the Linux OS in the Raspberry Pi to control my program, and I have learned how to make a simple electronic switch using an NPN transistor, a diode and a resistor. This is the stuff that makes these projects so interesting.

Read the next installment here: This is turning out better than I had imagined!

About Brian Lawler

Brian Lawler is an Emeritus Professor of Graphic Communication at California Polytechnic State University, San Luis Obispo. He writes about graphic arts processes and technologies for various industry publications, and on his blog, The Blognosticator.
This entry was posted in Adventures, Gadgets, New technology, Photography, Technology and tagged , , , , . Bookmark the permalink.

2 Responses to Time-lapse project, part III: a new circuit board

  1. Bert says:

    Welcome to MIT course 6.01 lab 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.