Circuit

The electronics are fairly straightforward, using a Trinket 3V. The circuit uses pins #0, #1, and #2 making it compatible with Gemma as well. Solder the included male header pins to the Trinket pins.

A Quarter-size Adafruit Perma Proto board is used as the base. Hook-up wire connects various pads to route signal and power. A 1000 ohm (1K Ohm) resistor is needed in addition to the parts listed for the photocell circuit.

Optionally, female headers may be used to make the Trinket removable from the Proto board - cut two 5 pin sections. Male headers may be used to connect off-board components: 2 two-pin and 1 three-pin section connect the servo, piezo, and photocell. Connections are via strips of female-female jumper wires, although any flexible wire may be used. Using headers allows for easy removal of the board from the project if needed.

The Perma Proto may be cut at row B to make the board smaller if your Animal is smaller than can be accommodated by the full board.
This diagram uses the Trinket 3v but you can also use the Trinket M0. The wiring is identical.
I mounted the servo onto the Perma Proto board to provide a base for moving the servo (it needs something to push against). You can mount it in many ways but it generally needs a firm mount to achieve the movement you may want. The proto mounting hole was enlarged slightly with a drill bit to allow a small screw to pass through at the correct place.

Circuit Variations

Trinket: You can use a 5 volt Trinket with a 5 volt supply, perhaps 4 AAA or AA batteries. The servo is generally 5 volt so be careful at running at 6 volts (check the servo data sheet). You can put a diode in series with a 6 volt supply to drop the voltage about 0.7 volts. Gemma would also work well especially if you want to use a LiPo battery, but Proto mounting would be more of a challenge.

Photocell: If you want the circuit to always run when on, you can eliminate the photocell and 1000 ohm resistor. You will need to remove the analogRead and if statement in the code that acts on the reading.

Speaker: If you want better sounds, you can feed the pin 1 sounds to a transistor to switch a more conventional speaker - you may need some appropriate resistors to bias the transistor correctly.

Servo: If you use a larger servo, you may need more battery capacity. If you do not need your Animal to move, you can eliminate the servo and the wire from Pin 0, power and ground. You could then trim the amount of Proto board used by cutting at line 12.

Battery: The 3 volt Trinket runs well on LiPo batteries stocked by Adafruit. The 3.7 volt 1200 mAh is a good size and capacity. If you use a LiPo, you may want some type of on/off switch. AA and AAA battery packs may have the switch built in. You can see on the actual picture, I used two of the gold pins from the female headers to make an ad-hoc JST male connector for a LiPo in the upper left corner. A Gemma would already have the JST battery connection if you want to consider that as an option.
This guide was first published on Nov 21, 2013. It was last updated on Nov 21, 2013. This page (Circuit) was last updated on Jul 18, 2019.