The small weatherproof enclosure is an economical enclosure for the project. The layout will be a bit tight (things are layered in the enclosure). If you need additional room, the large enclosure or an Otter Box is plenty big. The 1/4 sized Perma Proto Board is a great way to lay out circuit components after breadboarding.

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 large cable gland is used to run sensor/signal wires through the enclosure keeping things weathertight. Drill a 5/8 inch hole 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.

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/4 Perma Proto is nearly perfect. The corners should be cut just a bit and the left hole expanded slightly to allow it to fit snug screwed on the left brass mounting hole. A small 8-32 screw is fitted on the left and I used an optional standoff through the right hole.

Populating the Board

You can refer to the Fritzing diagram 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. Single male pins are placed on the - line, the Trinket BAT+, and Trinket Pin 0 for connecting Bluefruit later although you can use hook-up wire if you like.

Four resistors provide the analog divider to multiplex three sensors. The 1500 ohm resistor (the large one in the pictures, your size is probably smaller, I used what was on hand) goes between the trinket 3.3 volt regulated pin to the common resistor junction. Each of the other resistors is connected to this common area and connected to Trinket Pin 3 (Analog pin 3). Four wires are run off-board to connect the sensors.

The black and red wires connect the power ground. The board is powered via a JST connector with attached wires that comes with the Adafruit LiPo charger board (near the top of the photos). The red wire goes to the Trinket BAT+ pin, the other to the pin labeled Gnd. Other parts of the circuit draw regulated power from the pin marked 3V (which is regulated by the Trinket to 3.3 volts and provides up to 150 milliamps).

The connector for the PIR (infrared sensor) is connected to regulated power also (bottom of pictures).

Double check your connections.
The battery is placed in the case and the LiPo charger board placed on top near the power connector. Solder or plug in the wires from the power connector to the DC in connections on the charger (near the USB connector).

At this point it may be best to plug in the 5 volt power supply and charge the LiPo battery.
Screw the wired Perma Proto board into the threaded connector with an 8-32 screw (not provided) or otherwise secure. A standoff on the free end is helpful as a counterpoint.

Wire the three sensor wires to a terminal strip for ease of connection. Below shows the bottom common (ground) connection, then the PIR switch wire (yellow), then magnetic sensor #2 and magnetic sensor #3 towards the top of the picture. You can solder wires instead or use a spring terminal block on the board itself although some of the wires may not fit well as the magnetic contacts have large stranded wires.
Ensure you have set up the Arduino IDE according to the Introduction to Trinket tutorial so the programming will work well. Programming Trinket is a bit different than other boards.
Program the Trinket 3V off board with the code in the next section or with your custom code.

Insert the Trinket into the pins.
Plug the circuit board power connector into the LOAD connector on the LiPo charger. Layer the LiPo charger board on top of the battery.
Next add the PIR sensor. Connect the PIR ensuring the red wire is to +5, black to GND. The PIR has two orange variable resistors, one to adjust sensitivity, one for latch time. The latch time can be fairly short (we are sensing any change). The sensitivity should be turned down at first and may be adjusted when making the final installation.

The PIR can be placed outside the enclosure but the nice clear case begged to inside mounting. There is enough clearance, but just. For best sensitivity, a round hole for the lens to come out (with some sealant) may be better.

The Bluefruit is connected to the circuit board as follows:
  • BAT+ (line into Trinket) goes to Bluefruit Vin
  • Ground (-) goes to Bluefruit GND
  • Trinket Pin 0 goes to Bluefruit RX
Tuck the Bluefruit in the case upright in what is shown as the side of the case at the bottom of the picture.
With the clear weatherproof case cover attached below.

Do a final test of the sensor function.

It is now ready to take the magnetic sensors off and perform the final install.

This guide was first published on Dec 31, 2013. It was last updated on Nov 30, 2013.

This page (Build) was last updated on Nov 29, 2013.

Text editor powered by tinymce.