The small weatherproof enclosure is a good sized enclosure for the project. The 1/2 sized Perma Proto Board fits inside the box and clears the rounded divots with a bit of modding..

The 2.1mm panel mount barrel jack is used for power - solder power wires on prior to installation (large lug is positive). Drill a 1/2 inch hole just past the cover hole. The plastic dimple was chisled to fit it in that location. Thread the jack in securing with the included plastic screw ring. A cable gland is used to run the PIR sensor wires through the enclosure keeping things weathertight. Drill a 5/8 inch hole (for the large gland, a smaller if you use the small gland) between the power jack and the other case cover hole. There is a small lip on the case - I dremeled it down a bit to have the gland fit snug. You can run penetrations through the back as an alternative if you want the look to be "cable free".

Best to make mounting holes in the back of the case if needed to screw the case into the wall. This would probably be harder later in the build given the amount of items we are putting in.

The 1/2 Perma Proto is nearly perfect. The corners should be cut just a bit on one side and the hole on that side slightly enlarged to allow it to fit snug screwed on the brass mounting hole. A short M4 screw is fitted in the enlarged hole. The board should be mounted so the screw is in the standoff furthest from the penetrations.

Wiring Diagrams

A passive-infrared sensor (PIR) is the gold standard for tracking movement in a general area. It does not provide distance like ultrasonic or other sensors but can have a wide field of view and good sensitivity to warm bodies.

A Trinket receives the signal from the PIR. When the room is occupied, the sensor tripped, Trinket will display a red X on an Adafruit 8x8 bi-color LED matrix. If there is no movement, a green square is displayed.

The function of a PIR can be found in this older tutorial by LadyAda. Also Learning Arduino Lesson 17 features this sensor.

Populating the Board

You can refer to the Fritzing diagrams on the Overview Page for the parts placement.

I used two pieces of female header, 5 pins each, to mount the Trinket to the board. This allows the Trinket to easily be removed for programming. A 4 position header mounts the display. Another couple pieces of header from the scrap box are used to steady the top end for an even mount. Socket headers are not required but make it very easy to change out components and wire underneath.
The wiring is straightforward:
  • Pin 0 on Trinket to the display I2C data line
  • Pin 2 on Trinket to the display I2C clock line
  • BAT on Trinket to the + line on the protoboard which is connected to 5 volts
  • GND on Trinket to the - line on the protoboard which is connected to power ground
  • Pin 1 on Trinket is connected to a 1500 ohm resistor to +5 volts (available at Radio Shack, Maker Shed, and other electronics outlets)
  • Pin 1 on Trinket is also connected to the PIR data line (center)
The red power line on the PIR and display goes to 5 volt + line on the protoboard
The black ground line on the PIR and display goes to the ground - line on the protoboard

Be sure you interconnect the top and bottom power busses with interconnect wires (towards the left).

I mounted pins to the power lines to plug in the power jack (upper left). I also put pins on power and Trinket Pin 1 to easily connect the PIR wire.

Double check your wiring to the diagrams and pictures.
Mount the board inside the enclosure with the screw. If it does not fit, you must take some material off the right ends and enlarge the hole for the screw.

Plug in the power from the power panel mount jack to the + and - on the board. Run a cable from the PIR to the +, -, and Pin 1 on Trinket per the Fritzing diagram. You can now plug the display in.

Leave the Trinket out as we are going to program that next.

This guide was first published on Dec 18, 2013. It was last updated on Mar 08, 2024.

This page (Build) was last updated on Dec 10, 2013.

Text editor powered by tinymce.