Building Stuff - Cardboard Proud Parent Robot

I really love Simone Giertz's YouTube channel. And I particularly love her Proud Parent Machine:

I was at MicroCenter recently, and I saw that they had the "Adafruit Industries Dial Safe Pack for Circuit Playground Express" marked down to only $17. The Circuit Playground Express itself is normally $25, and this included not only the board, but also alligator clips, a battery power pack, and a servo motor - everything one would need for the Combo Dial Safe project posted on Adafruit's website. I snapped it up, but rather than make the project it was all packaged for, I used all of the pieces to make my own super-budget version of the Proud Parent Machine! I have an abundance of cardboard right now, as due to the state of the world I ended up doing the majority of my Christmas shopping online - might as well make use of it.

Most of my time on this project was spent preparing the cardboard parent. The box I used had a lot of tape on it, which meant I couldn't paint directly on it (I tried and I failed), so I essentially did what Simone did with her beautiful laser wood cutouts, only with cardboard, acrylic paint, and terrible scissors. The shirt, tie, and suit are individual pieces cut out, painted, and then glued on top of my Priority Mail base. Here is my painted and assembled robot-parent:

Robot-parent is waving.

The Circuit Playground Express is held on to the left side of the box with magnets. The alligator clips for the servo motor are attached and kind of hang down below the box, and I have the battery box duct-taped inside the Priority Mail box. I used a decent amount of duct-tape in this project.

Circuit Playground Express

Priority Mail Box Innards

The only part of the build I'm not happy with is the arm attachment. I used the small screw that came with the servo motor to attach a popsicle stick to the motor arm, but on the upward motion of the patting, the weight of the arm causes it to pivot on that screw. I really need a second small screw. Not having one of those, I applied more duct-tape around the popsicle stick, and even added a second stick to form a popsicle stick sandwich around the servo motor arm, but a small amount of pivoting is still happening. The arm has to be slightly reset after each activation.

Arm Attachment

After assembling the cardboard robot, I programmed the Circuit Playground Express. There are a number of touch-sensitive spots on the Circuit Playground Express, so I wrote the code to execute whenever circle A4 (closest to the front of the robot parent - rather easy to access) is touched. It plays a sound file where I say "Way to go, kiddo!" and then the arm lowers and raises back up twice.

Note: If you want to use the code, I recommend viewing it on GitHub.

import time
import random
import microcontroller
import pulseio
import board
from adafruit_circuitplayground.express import cpx
from adafruit_motor import servo
import touchio

# A4 is touch sensitive
touch_A4 = touchio.TouchIn(board.A4)

# create a PWMOut object on Pin A1
pwm = pulseio.PWMOut(board.A1, frequency=50)

# Create a servo object, my_servo
my_servo = servo.Servo(pwm)

while True:
    if touch_A4.value:
        time.sleep(2)
        cpx.play_file("waytogo.wav")
        for angle in range(25,85): # 0 to 49 degrees in 1 deg steps
            my_servo.angle = angle
            time.sleep(0.01)  # Tiny delay each step
        time.sleep(1)
        for angle in range(85, 25, -1):
            my_servo.angle = angle
            time.sleep(0.01)
        time.sleep(1)
        for angle in range(25,85): # 0 to 49 degrees in 1 deg steps
            my_servo.angle = angle
            time.sleep(0.01)  # Tiny delay each step
        time.sleep(1)
        for angle in range(85, 25, -1):
            my_servo.angle = angle
            time.sleep(0.01)
        time.sleep(1)

Here's video of my Cardboard Proud Parent Robot in action, patting my kid's head: