G@I;j\ejfi
L TX RX USB EXT PWR ICSP 31 21 1 01 9 8 DIGITAL7 6 5 4 3 2 1 0 Arduino
1
5
10
15
20
25
30
1
5
10
15
20
25
30 ABC D EFG HIJ
AREF
GND
PWM
PWM
PWM
PWRSEL
PWM
PWM
RESET
3V3
Gfn\i;jn`kZ_
Gfk\ek`fd\k\i
0M;YXkk\ip
A
B
Figure C:
3
4
IR receiver
Lens
1
5
IR LED (on back of box)
sends signal to camera
to take photo.
2
6
PIR sensor detects motion
for motion detector mode.
7
Motion detector mode switch
8
Knob (potentiometer) sets trigger
rate for intervalometer mode.
Intervalometer mode switch
C
Power switch
fine on paper, but they didn’t come out well on the
cutter. Another round of adjustments, and we were
ready to cut the actual project box top.
Despite all the careful preparation, I still messed
up. We didn’t delete the outline of the box top that
we included when cutting the plastic scrap. So when
we cut the actual box top, we shaved a bit off the
edge (Figure D). I decided I’d live with this.
ground bus through all the components so I’d need
only 2 wires to power the front. Connecting to the
Arduino were 3 digital inputs ( 2 switches and the
motion sensor), 3 digital outputs (the 3 visible
LEDs), and an analog output (the potentiometer).
I wired the power switch directly to the battery and
put each group of connectors (digital in, digital out,
analog in, power) on a separate row of male headers
(Figure E) to plug into the Arduino, so they would be
easy to plug and unplug. This turned out to be
a good decision.
Design for Debugging Without
Disassembly
I mounted the camera-triggering IR LED on the back
of the box, so the PIR sensor and camera could face
the same direction. The Arduino mounted to the
inside back, and I decided to power it with a battery,
and enclose it entirely. This turned out to be unwise,
as it meant I had to take the box apart about 20
times to get to the USB port for debugging and
reprogramming.
The components fit nicely in the box, but didn’t
leave much space for wiring. I ran a power and
Test Your Inputs Before Writing
the Actual Code
It’s important to know what your inputs’ readings
are before you write the microcontroller program.
A short program printing them out did the job:
void setup() {
Serial.begin(9600);
}
Photography by Tom Igoe
62 Make: Volume 22