Overview
This is a beginner level sewing and soldering project. This tutorial has detailed photos for each step of circuit assembly and installing the circuit into the toy, and the owl kit comes with detailed printed instructions recommended for slightly experienced stitchers as young as eight.
Page last edited March 08, 2024
Text editor powered by tinymce.
Tools & Supplies
Your GEMMA plush toy guts kit includes:
- Adafruit Gemma M0 or Adafruit GEMMA
- 150mAh lipoly battery
- Micro Lipo charger
- PN2222 transistor
- Tilt ball switch
- 220 ohm resistor
- small speaker
- 24 inches of solid core wire
- three sizes of heat shrink tubing
You will also need the Sew-Your-Own Owl Kit or an existing plush toy to mod.
Upgrading to a higher end soldering iron setup, like the Hakko FX-888 that we stock in our store, will make soldering fun and easy.
Do not use a "ColdHeat" soldering iron! They are not suitable for delicate electronics work and can damage the boards (see here).
Click here to buy our entry level adjustable 30W 110V soldering iron.
Click here to upgrade to a Genuine Hakko FX-888 adjustable temperature soldering iron.
Learn how to solder with tons of tutorials!
You will want rosin core, 60/40 solder. Good solder is a good thing. Bad solder leads to bridging and cold solder joints which can be tough to find.
Click here to buy a spool of leaded solder (recommended for beginners).
Click here to buy a helping third hand tool.
Click here to buy a basic multimeter.
Click here to buy a top of the line multimeter.
Click here to buy a pocket multimeter.
Don't forget to learn how to use your multimeter too!
Page last edited March 08, 2024
Text editor powered by tinymce.
Solder Circuit
Start by preparing the speaker and tilt ball switch.
Cut five pieces of wire about four inches in length each.
Use wire strippers to strip the insulation off the last quarter inch of each end of each wire.
Use a soldering iron to heat up one of the pads of the small speaker.
Apply a small amount of solder to the heated pad to tin it. This will make it easier to attach a wire in the next step.
Repeat to tin the other speaker pad and the two legs of the tilt ball switch.
Repeat to solder wires to the the other speaker pad and both legs of the tilt ball switch.
Snip off any excess wire.
Use a heat gun to shrink the tubing.
Cut a piece of larger heat shrink tubing and slide over the entire tilt ball switch and wire connections; heat to shrink.
Insert one of the legs of the 220 ohm resistor into the pin marked D2 on GEMMA.
Solder in place.
Snip off the extra wire lead and cut the free-hanging wire lead to half its length.
Pay close attention to the orientation of the transistor. The flat side should face the same direction as the front of GEMMA.
Clip the transistor's center lead shorter and set up the component in your helping hand tool.
Tin the lead of the resistor and the center lead of the transistor.
Position the leads next to each other and carefully solder in place.
Heat the tubing to shrink it down.
Twist the wires together and solder.
Snip off any excess and slide a piece of heat shrink tubing over the connection.
Heat to shrink in place.
Clip off any excess wire.
Tin the last remaining lead of the transistor and solder to a piece of wire. Slide on some heat shrink and use a heat gun to shrink it.
Cut the wire to reach to GND on GEMMA, strip a bit of insulation off the end and solder the end to GND on GEMMA.
The tilt ball switch has two leads. Solder one lead to D0 on GEMMA and the other lead to GND on GEMMA.
Solder both of these wires to the pad of the circuit board together.
Clip off any excess wire.
Page last edited March 08, 2024
Text editor powered by tinymce.
Arduino Code
// SPDX-FileCopyrightText: 2018 Becky Stern for Adafruit Industries
// SPDX-FileCopyrightText: 2018 T Main for Adafruit Industries
//
// SPDX-License-Identifier: MIT
/*
Chirp Owl written by Becky Stern and T Main for Adafruit Industries
Tutorial: http://learn.adafruit.com/chirping-plush-owl-toy/
Includes animal sounds by Anne Barela
http://learn.adafruit.com/adafruit-trinket-modded-stuffed-animal/animal-sounds
based in part on Debounce
created 21 November 2006
by David A. Mellis
modified 30 Aug 2011
by Limor Fried
modified 28 Dec 2012
by Mike Walters
This example code is in the public domain.
http://www.arduino.cc/en/Tutorial/Debounce
*/
// constants won't change. They're used here to
// set pin numbers:
const int buttonPin = 0; // the number of the pushbutton pin
const int speakerPin = 2; // the number of the LED pin
const int ledPin = 1;
// Variables will change:
int ledState = HIGH; // the current state of the output pin
int buttonState; // the current reading from the input pin
int lastButtonState = LOW; // the previous reading from the input pin
// the following variables are long's because the time, measured in miliseconds,
// will quickly become a bigger number than can be stored in an int.
long lastDebounceTime = 0; // the last time the output pin was toggled
long debounceDelay = 50; // the debounce time; increase if the output flickers
void setup() {
pinMode(buttonPin, INPUT_PULLUP);
pinMode(speakerPin, OUTPUT);
//digitalWrite(speakerPin, HIGH);
digitalWrite(ledPin, LOW);
//digitalWrite(buttonPin, HIGH);
// set initial LED state
//digitalWrite(speakerPin, ledState);
//Serial.begin(9600);
}
void loop() {
// read the state of the switch into a local variable:
int reading = digitalRead(buttonPin);
// check to see if you just pressed the button
// (i.e. the input went from LOW to HIGH), and you've waited
// long enough since the last press to ignore any noise:
// If the switch changed, due to noise or pressing:
if (reading != lastButtonState) {
// reset the debouncing timer
lastDebounceTime = millis();
}
if ((millis() - lastDebounceTime) > debounceDelay) {
// whatever the reading is at, it's been there for longer
// than the debounce delay, so take it as the actual current state:
// if the button state has changed:
if (reading != buttonState) {
buttonState = reading;
// only toggle the LED if the new button state is HIGH
//Serial.println("chirp");
chirp(); // change this line to change animal sound
//meow();
//meow2();
////mew();
//ruff();
//arf();
}
}
// set the LED:
//digitalWrite(speakerPin, ledState);
// save the reading. Next time through the loop,
// it'll be the lastButtonState:
lastButtonState = reading;
}
// Generate the Bird Chirp sound
void chirp() {
for(uint8_t i=200; i>180; i--)
playTone(i,9);
}
// Play a tone for a specific duration. value is not frequency to save some
// cpu cycles in avoiding a divide.
void playTone(int16_t tonevalue, int duration) {
for (long i = 0; i < duration * 1000L; i += tonevalue * 2) {
digitalWrite(speakerPin, HIGH);
delayMicroseconds(tonevalue);
digitalWrite(speakerPin, LOW);
delayMicroseconds(tonevalue);
}
}
void meow() { // cat meow (emphasis ow "me")
uint16_t i;
playTone(5100,50); // "m" (short)
playTone(394,180); // "eee" (long)
for(i=990; i<1022; i+=2) // vary "ooo" down
playTone(i,8);
playTone(5100,40); // "w" (short)
}
void meow2() { // cat meow (emphasis on "ow")
uint16_t i;
playTone(5100,55); // "m" (short)
playTone(394,170); // "eee" (long)
delay(30); // wait a tiny bit
for(i=330; i<360; i+=2) // vary "ooo" down
playTone(i,10);
playTone(5100,40); // "w" (short)
}
void mew() { // cat mew
uint16_t i;
playTone(5100,55); // "m" (short)
playTone(394,130); // "eee" (long)
playTone(384,35); // "eee" (up a tiny bit on end)
playTone(5100,40); // "w" (short)
}
void ruff() { // dog ruff
uint16_t i;
for(i=890; i<910; i+=2) // "rrr" (vary down)
playTone(i,3);
playTone(1664,150); // "uuu" (hard to do)
playTone(12200,70); // "ff" (long, hard to do)
}
void arf() { // dog arf
uint16_t i;
playTone(890,25); // "a" (short)
for(i=890; i<910; i+=2) // "rrr" (vary down)
playTone(i,5);
playTone(4545,80); // intermediate
playTone(12200,70); // "ff" (shorter, hard to do)
}
Page last edited March 08, 2024
Text editor powered by tinymce.
CircuitPython Code
GEMMA M0 boards can run CircuitPython — a different approach to programming compared to Arduino sketches. In fact, CircuitPython comes factory pre-loaded on GEMMA M0. If you’ve overwritten it with an Arduino sketch, or just want to learn the basics of setting up and using CircuitPython, this is explained in the Adafruit GEMMA M0 guide.
Below is CircuitPython code that works similarly (though not exactly the same) as the Arduino sketch shown on a prior page. To use this, plug the GEMMA M0 into USB…it should show up on your computer as a small flash drive…then edit the file “code.py” with your text editor of choice. Select and copy the code below and paste it into that file, entirely replacing its contents (don’t mix it in with lingering bits of old code). When you save the file, the code should start running almost immediately (if not, see notes at the bottom of this page).
If GEMMA M0 doesn’t show up as a drive, follow the GEMMA M0 guide link above to prepare the board for CircuitPython.
# SPDX-FileCopyrightText: 2018 Becky Stern for Adafruit Industries
# SPDX-FileCopyrightText: 2018 T Main for Adafruit Industries
#
# SPDX-License-Identifier: MIT
# Chirp Owl written by Becky Stern and T Main for Adafruit Industries
# Tutorial: http://learn.adafruit.com/chirping-plush-owl-toy/
# Includes animal sounds by Anne Barela
# http://learn.adafruit.com/adafruit-trinket-modded-stuffed-animal/animal-sounds
# based in part on Debounce
# created 21 November 2006
# by David A. Mellis
# modified 30 Aug 2011
# by Limor Fried
# modified 28 Dec 2012
# by Mike Walters
# CircuitPython Port 2018
# by Mikey Sklar
# This example code is in the public domain.
# http://www.arduino.cc/en/Tutorial/Debounce
import time
import board
import digitalio
# setup for vibration sensor
motion = digitalio.DigitalInOut(board.D0)
motion.direction = digitalio.Direction.INPUT
motion.pull = digitalio.Pull.UP
# setup for speaker output
speaker = digitalio.DigitalInOut(board.D2)
speaker.direction = digitalio.Direction.OUTPUT
def chirp():
for i in range(200,180,-1):
play_tone(i,9)
# emphasis ow "me"
def meow():
play_tone(5100,50) # "m" (short)
play_tone(394,180) # "eee" (long)
for i in range(990,1022,2): # vary "ooo" down
play_tone(i,8)
play_tone(5100,40) # "w" (short)
# cat meow (emphasis on "ow")
def meow2():
play_tone(5100,55) # "m" (short)
play_tone(394,170) # "eee" (long)
time.sleep(0.03) # wait a tiny bit
for i in range(990,1022,2): # vary "ooo" down
play_tone(i,8)
play_tone(5100,40) # "w" (short)
# dog ruff
def ruff():
for i in range(890,910,2): # "rrr" (vary down)
play_tone(i,3)
play_tone(1664,150) # "uuu" (hard to do)
play_tone(12200,70) # "ff" (long, hard to do)
# dog arf
def arf():
play_tone(890,25) # "a" (short)
for i in range(890,910,2): # "rrr" (vary down)
play_tone(i,5)
play_tone(4545,80) # intermediate
play_tone(12200,70) # "ff" (shorter, hard to do)
def play_tone(tone_value, duration):
microseconds = 10 ** 6 # duration divider, convert to microseconds
for i in range(0, duration):
i += tone_value * 2
speaker.value = True
time.sleep(tone_value / microseconds)
speaker.value = False
time.sleep(tone_value / microseconds)
# loop forever...
while True:
# reverse logic for motion pins
if not motion.value:
# bird chirp noise
# comment out chirp and uncomment a different sound below
# for more animal noises
chirp()
# meow()
# meow2()
# ruff()
# arf()
time.sleep(.5) # leave some time to complete rotation
Page last edited March 08, 2024
Text editor powered by tinymce.
Assemble Owl
Tape up the battery to protect it and protect the wire connections.
Cut a slit up the back body piece to make a path for the speaker wires.
Arrange your circuit as shown.
Bend the wires so they route straight out the back of the owl body, at the top of the slit you made in the last step.
Continue and finish stuffing the owl. Plug in the battery to test out the loudness of your circuit. If it's not as loud as you like, make sure the speaker is flush up against the front of the body and not insulated by any stuffing.
Unplug the battery to finish constructing the owl.
Because the GEMMA sits inside the tail of the owl, we needed to cut an additional tail piece from the brown felt included in the owl kit, then sewed it to the original tail piece to make a pocket.
The battery sits inside the cape of the owl, and GEMMA's JST port conveniently faces the opening for convenient disconnection. When the battery runs down you will need to disconnect and remove the battery, and charge it using the MicroLipo charger. (Lithium batteries are not made to be recharged while inside the owl, as the battery may get hot. So that's why you need to remove to recharge). Also the GEMMA v1, v2 and M0 do not support recharging Lithium cells.
Because the wires enter the tail, this mod has an added advantage of allowing the stiffened tail to stabilize the toy when it stands!
Page last edited March 08, 2024
Text editor powered by tinymce.