University of Cincinnati CCM Mechatronics Spring 2026 — Baby 3nd3rman - Val M. & Moira S.
by vallovesvampires in Circuits > Arduino
405 Views, 0 Favorites, 0 Comments
University of Cincinnati CCM Mechatronics Spring 2026 — Baby 3nd3rman - Val M. & Moira S.
For this project, we made an animatronic DJing enderman from Minecraft, which we named Baby 3nd3rman. We chose to make him because he had some cool mechanical challenges to problem solve, such as his jaw mechanism. Also, we thought he would be fun and silly to make.
Downloads
Supplies
Materials List
- 2 24”x36” black foamcore boards
- Hot glue
- Shellac
- Purple leather dye
- Acetate sheet
- Toy DJ Turntable
- Clear storage bin
- Dremel
- IEC cable
- Bat switch
- Ceramic light bulb socket
- Small light bulb
- Power outlet
- Power supply
- Relay
- Blue square switch
- Round orange switch
- Red LED
- Yellow LED
- Green LED
- Blue LED
- White LED
- Circuit breaker
- 2 Arduinos
- 2 small pushbutton switches
- 2 LCD screens
- 2 large servo motors
- 2 small servo motors
- 150 ohm resistors
- 100 ohm resistors
- Extra wire
- 2 breadboards
- Solder
- Soldering iron
- Screw terminal strip
- Bass wood
- Oven switch
Create a Schematic
Determine whether each component needs AC or DC voltage and how much voltage they need. From there, create a schematic detailing how each component will connect to create the greater circuit.
We chose to first do a schematic with the elements we needed to incorporate into our clear storage bin and later figure out how to incorporate the other elements that would be housed within Baby 3nd3rman.
Plan Out the Box Layout
Determine how and where each component will be mounted within the box.
Use a dremel to create holes for each piece and label these spots so they are easy to find later when it is time to mount the components.
Cut Out Pieces of Black Foamcore
Here is the dimensions needed for each piece and their number:
- 3 12”x12” (Head and Jaw)
- 4 12”x10” (Head)
- 4 2”x12” (Jaw)
- 2 8”x8” (Body)
- 2 8”x6” (Body)
- 4 2”x2” (Arms)
- 3 2”x8” (Arm)
- 4 2”x12” (Arm)
Cut each piece with a 45 degree inward angle to make the pieces fit together and create clean seams
Cut Out Eye Holes and Eyebrow Holes in Face Piece
We cut our eye holes to the size of our LCD screens, which was about ⅞”x2 ¾”
We made our eyebrow holes about a ¼” in diameter to fit our small servo motors
Additionally, we added a piece of horizontal foamcore below each eyebrow hole on the inside to later hold the servo motors in place
Mix Purple Leather Dye and Shellac and Pour It Onto a Sheet of Acetate
We used about 1 tbsp of shellac and one drop of purple leather dye.
Cut Out Rectangles of Purple Acetate for the Eyes
We cut ours to be slightly larger than the eye openings so the extra could be glued to the foamcore inside the face
Glue the Black Foamcore Pieces Together, Leaving the Face Open
Wire and Install the IEC, Oven Switch, Breaker, Bat Switch, and Lightbulb
Start by wiring the IEC, which provides the AC positive, AC neutral, and ground which serves as the power source for the whole box.
Then wire the oven switch, which comes directly after the IEC in the circuit. It has one AC positive wire in from the IEC and one AC positive wire out, going to the breaker.
Then wire the breaker, which follows the oven switch in the circuit. It has one AC positive wire in from the oven switch and one AC positive wire out, going to the bat switch.
Next wire the bat switch, which follows the breaker in the circuit. It has one AC positive wire in from the breaker and one AC positive wire out, going to the lightbulb.
Then wired the lightbulb. It has one AC positive wire in from the bat switch, and one AC neutral wire from the IEC, connected through a screw terminal.
Test Everything!
Plug in the IEC to power the box.
Switch each switch sequentially, starting with the oven switch, then breaker, then bat switch. The lightbulb should only turn on when the breaker, oven switch, and bat switch are all turned on.
Once everything is proven to work, it's time to move on to the DC components of the system!
Wire and Install the 5 Volt Power Supply
This power supply requires one AC positive wire in from the oven switch, one AC neutral wire in from the IEC, through the same screw terminal as the lightbulb, and one ground wire in from the IEC.
It outputs 5V of DC positive and has DC negative.
Wire and Install the Green LED and Outlet
Wire the outlet, which has one AC positive wire in from the breaker through the "in" screw terminal on the bat switch, one AC neutral in from the IEC through the same screw terminal as the lightbulb and the 5V power supply, and one ground wire from the IEC through the screw terminal on the 5V power supply.
Then wire the green LED, which will serve as an indicator that power is flowing through the whole box. It needs one DC positive wire from the 5V power supply, which has to flow through a 100Ω resistor before reaching the LED, and one DC negative wire connecting to the 5V power supply through a screw terminal.
Set Up the Arduino
We then place the Arduino in the box and give it power.decided to power it with its power supply directly plugged into one of the two outlets on the box.
Wire and Install the Blue, White, Yellow, and Red LEDs.
These LEDs get their DC positive in from the Arduino, which flows into a resistor before reaching the light.
- The blue LED connects to pin 25 and has a 100Ω resistor.
- The white LED connects to pin 27 and has a 100Ω resistor.
- The yellow LED connects to pin 29 and has a 150Ω resistor.
- The red LED connects to pin 31 and has a 150Ω resistor.
Each LED also has a DC negative wire out which connects to the same screw terminal as the green LED, and connects back into the 5V DC negative.
Wire and Install the Orange Circle Switch
The orange circle switch has two components: the light inside and the switch itself.
The light requires 120v AC, getting an AC positive and neutral in from the the screw terminals on the 5V power supply.
The switch mechanism connects to the Arduino. The DC positive connects to pin 23 on the Arduino, and the DC negative wire out flows to the same screw terminal as the previous LEDs.
Write Code to Make the LEDs Scan Back and Forth When the Orange Button Is Pressed.
Here is our code:
int blueLED = 25;
int whiteLED = 27;
int yellowLED = 29;
int redLED = 31;
// create variables for the LED pin #s
int LEDbutton = 23; //create variable for the LED button pin #
int lxFOR[] = {blueLED, whiteLED, yellowLED, redLED}; // array - forward LEDs
int lxBACK[] = {redLED, yellowLED, whiteLED, blueLED}; // array - backwards LEDs
int pinsNumb = 4; // define variable for # of LED pins
void setup() {
for (int x = 0; x < pinsNumb; x++) {
pinMode (lxFOR[x], OUTPUT);
} //for loop for defining LED pins
pinMode (LEDbutton, INPUT_PULLUP); // define button for turning on LEDs
}
void loop() {
int LEDbuttonState = digitalRead (LEDbutton); //create int for state of LED button
digitalRead (LEDbutton); //read state of the LED button
if (LEDbuttonState == LOW) {
for (int SLAY = 1; SLAY < pinsNumb; SLAY++) {
digitalWrite (lxFOR[SLAY], HIGH);
delay (100);
digitalWrite (lxFOR[SLAY], LOW);
delay (100);
}
for (int SLAY = 2; SLAY < pinsNumb; SLAY++) {
digitalWrite (lxBACK[SLAY], HIGH);
delay (100);
digitalWrite (lxBACK[SLAY], LOW);
delay (100);
} //larson scanner code
}
Upload this to the Arduino!
Test Everything!
Start by plugging in the IEC to power the box and plug something into the outlet to make sure it works (we used a phone charger, but if you have the Ardunio plugged in there that will work as well).
Switch each switch sequentially (oven switch, then breaker, then bat switch, then orange button).
The green LED should turn on when the oven switch is on.
The outlet should be on when the oven switch is on.
The lightbulb should be on when the oven switch, breaker, and bat switch are on.
The light in the orange button should be on when the oven switch is on.
The blue, white, yellow, and red LEDs should scan across when the orange button is pressed and the oven switch is on.
Once everything is working as intended it's time to move on to the Servos!
Wire the Servos for Baby 3nd3rman's Mouth
Wire the large servo motors for the mouth.
Each servo needs:
- 5V DC positive
- We wired this from the Arduino through a breadboard we placed in our box to make it easier to connect our components to 5V and ground
- DC negative
- We connected this to the Arduino through the same breadboard
- Signal pin from the Ardunio
- We used pins 10 and 11
The wires for these servos need come outside of the box through the strain relief.
Connect Two 5” Pieces of Basswood Together With a Chicago Screw
Then repeat this step so that you have two of these.
These will serve as hinge mechanisms to open the mouth.
Connect the Hinge Mechanisms to the Big Servos and the Underside of the Head
Connect one end of the Basswood pieces to a big servo motor and the other to the underside of the head
Make sure to position these in opposite corners from each other and to have the hinges bend inward to the center of each side
Repeat this step with the other big servo motor and hinge mechanism.
Wire and Install the Variable Voltage Power Supply
This power supply has one AC positive wire in and one AC neutral wire in, both coming from screw terminals on the 5V power supply.
It has a DC positive and DC negative out.
Set the voltage output to 12V, which is required for a later component of the system (the blue square button).
Wire and Install the Blue Square Switch
The blue square switch has two components: the light inside and the switch itself.
The light requires 12V DC, with a DC positive wire and DC negative wire both coming from the variable voltage power supply.
The switch mechanism connects to the Arduino. The DC positive connects to pin 12 on the Arduino, and the DC negative wire out connects to the ground on the Arduino.
Write Code to Move the Big Servos When the Blue Square Button Is Pressed.
Here is our code:
#include <Servo.h>
int blueLED = 25;
int whiteLED = 27;
int yellowLED = 29;
int redLED = 31;
// create variables for the LED pin #s
int LEDbutton = 23; //create variable for the LED button pin #
int ServoButton = 12; //create variable for the servo button pin #
int lxFOR[] = {blueLED, whiteLED, yellowLED, redLED}; // array - forward LEDs
int lxBACK[] = {redLED, yellowLED, whiteLED, blueLED}; // array - backwards LEDs
int pinsNumb = 4; // define variable for # of LED pins
Servo Servo1;
Servo Servo2;
// create the names for the mouth servos
void setup() {
for (int x = 0; x < pinsNumb; x++) {
pinMode (lxFOR[x], OUTPUT);
} //for loop for defining LED pins
pinMode (LEDbutton, INPUT_PULLUP); // define button for turning on LEDs
pinMode (ServoButton, INPUT_PULLUP); // define button for turning on Servos
Servo1.attach (10); // attach Servo 1
Servo2.attach (11); // attach Servo 2
}
void loop() {
int LEDbuttonState = digitalRead (LEDbutton); //create int for state of LED button
int ServoButtonState = digitalRead (ServoButton); // create int for state of Servo Button
digitalRead (LEDbutton); //read state of the LED button
digitalRead (ServoButton); // read state of the Servo button
int pos = 0; //create variable for the position of the servos
if (LEDbuttonState == LOW) {
for (int SLAY = 1; SLAY < pinsNumb; SLAY++) {
digitalWrite (lxFOR[SLAY], HIGH);
delay (100);
digitalWrite (lxFOR[SLAY], LOW);
delay (100);
}
for (int SLAY = 2; SLAY < pinsNumb; SLAY++) {
digitalWrite (lxBACK[SLAY], HIGH);
delay (100);
digitalWrite (lxBACK[SLAY], LOW);
delay (100);
} //larson scanner code
}
else {
if(ServoButtonState == LOW) {
for (pos = 0; pos <= 90; pos += 1) {
Servo1.write (pos);
Servo2.write (pos);
delay (20);
}
for (pos = 90; pos >= 0; pos -= 1) {
Servo1.write (pos);
Servo2.write (pos);
delay (20);
}
} // code to move the servos
}
}
Upload this to the Arduino!
Attach Hinge Mechanisms and Servos to the Lower Part of the Head
The two servos connected to the hinge mechanisms should sit on opposite corners from each other. Hot glue them down in their positions.
Test Everything!
Start by plugging in the IEC to power the box.
Switch each switch sequentially (oven switch, then breaker, then bat switch, then orange button, then blue square switch).
The green LED should turn on when the oven switch is on.
The outlet should be on when the oven switch is on.
The lightbulb should be on when the oven switch, breaker, and bat switch are on.
The light in the orange button should be on when the oven switch is on.
The blue, white, yellow, and red LEDs should scan across when the orange button is pressed and the oven switch is on.
The light in the blue square button should light up when the oven switch is on.
The two big servos should move when the blue button is pressed. This should lift the upper part of the head.
Once everything is working as intended it's time to move on to the LCDs!
Wire Two LCD Screens for Baby 3nd3rman’s Eyes.
Wire two LCD screens (Right LCD and Left LCD) to serve as Baby 3nd3rman's eyes.
Each LCD screen has 12 pins which need to be wired. All of these wires need to exit the box. We drilled out another hold for these 24 wires to go through, as they did not fit through the strain relief.
The wiring for each LCD is as follows:
- Right LCD
- pin 1 - VSS - Ground/DC negative through the breadboard connected to the Arduino
- pin 2 - VDD - DC +5V through the breadboard connected to the Arduino
- pin 3 - V0 - middle pin of a potentiometer connected to ground
- we placed this potentiometer on a breadboard on top of the box, which was connected to the ground/DC negative on the Arduino
- pin 4 - RS - Arduino pin 50
- pin 5 - RW - Ground/DC negative through the breadboard connected to the Arduino
- pin 6 - E - Arduino pin 48
- pins 7, 8, 9, and 10 - NOT CONNECTED ANYWHERE
- pin 11 - DB4 - Arduino pin 46
- pin 12 - DB5 - Arduino pin 44
- pin 13 - DB6 - Arduino pin 42
- pin 14 - DB7 - Arduino pin 40
- pin 15 - DC +5V through the breadboard connected to the Arduino
- pin 16 - Ground/DC negative through the breadboard connected to the Arduino
- Left LCD
- pin 1 - VSS - Ground/DC negative through the breadboard connected to the Arduino
- pin 2 - VDD - DC +5V through the breadboard connected to the Arduino
- pin 3 - V0 - middle pin of a potentiometer connected to ground
- this is the same potentiometer used for the Right LCD screen
- pin 4 - RS - Arduino pin 51
- pin 5 - RW - Ground/DC negative through the breadboard connected to the Arduino
- pin 6 - E - Arduino pin 49
- pins 7, 8, 9, and 10 - NOT CONNECTED ANYWHERE
- pin 11 - DB4 - Arduino pin 47
- pin 12 - DB5 - Arduino pin 45
- pin 13 - DB6 - Arduino pin 43
- pin 14 - DB7 - Arduino pin 41
- pin 15 - DC +5V through the breadboard connected to the Arduino
- pin 16 - Ground/DC negative through the breadboard connected to the Arduino
Write Code to Create “pupils” for the LCD Screens.
Here's our code:
#include <LiquidCrystal.h>
#include <Servo.h>
//create LCDs
const int Rrs = 50, Ren = 48, Rdb4 = 46, Rdb5 = 44, Rdb6 = 42, Rdb7 = 40;
const int Lrs = 51, Len = 49, Ldb4 = 47, Ldb5 = 45, Ldb6 = 43, Ldb7 = 41;
LiquidCrystal LCDright (Rrs, Ren, Rdb4, Rdb5, Rdb6, Rdb7);
LiquidCrystal LCDleft (Lrs, Len, Ldb4, Ldb5, Ldb6, Ldb7);
//create custom characer for LCDs
byte Square[8] =
{
0b11111,
0b11111,
0b11111,
0b11111,
0b11111,
0b11111,
0b11111,
0b11111
};
//create ints for LCD code
int t = 250;
int buttonL = 6;
int buttonR = 4;
int blueLED = 25;
int whiteLED = 27;
int yellowLED = 29;
int redLED = 31;
// create variables for the LED pin #s
int LEDbutton = 23; //create variable for the LED button pin #
int ServoButton = 12; //create variable for the servo button pin #
int lxFOR[] = {blueLED, whiteLED, yellowLED, redLED}; // array - forward LEDs
int lxBACK[] = {redLED, yellowLED, whiteLED, blueLED}; // array - backwards LEDs
int pinsNumb = 4; // define variable for # of LED pins
Servo Servo1;
Servo Servo2;
// create the names for the mouth servos
void setup() {
LCDright.begin (16,2);
LCDleft.begin (16,2);
LCDright.createChar (0, Square);
LCDright.clear();
LCDright.noCursor();
LCDleft.clear();
LCDleft.noCursor();
for (int x = 0; x < pinsNumb; x++) {
pinMode (lxFOR[x], OUTPUT);
} //for loop for defining LED pins
pinMode (LEDbutton, INPUT_PULLUP); // define button for turning on LEDs
pinMode (ServoButton, INPUT_PULLUP); // define button for turning on Servos
Servo1.attach (10); // attach Servo 1
Servo2.attach (11); // attach Servo 2
}
void loop() {
int LEDbuttonState = digitalRead (LEDbutton); //create int for state of LED button
int ServoButtonState = digitalRead (ServoButton); // create int for state of Servo Button
digitalRead (LEDbutton); //read state of the LED button
digitalRead (ServoButton); // read state of the Servo button
LCDright.setCursor (7,0);
LCDleft.setCursor (7,0);
LCDright.write (byte (0));
LCDright.write (byte (0));
LCDleft.write (byte (0));
LCDleft.write (byte (0));
LCDright.setCursor (7,1);
LCDleft.setCursor (7,1);
LCDright.write (byte (0));
LCDright.write (byte (0));
LCDleft.write (byte (0));
LCDleft.write (byte (0));
delay (t); //create pupil
int pos = 0; //create variable for the position of the servos
if (LEDbuttonState == LOW) {
for (int SLAY = 1; SLAY < pinsNumb; SLAY++) {
digitalWrite (lxFOR[SLAY], HIGH);
delay (100);
digitalWrite (lxFOR[SLAY], LOW);
delay (100);
}
for (int SLAY = 2; SLAY < pinsNumb; SLAY++) {
digitalWrite (lxBACK[SLAY], HIGH);
delay (100);
digitalWrite (lxBACK[SLAY], LOW);
delay (100);
} //larson scanner code
}
else {
if(ServoButtonState == LOW) {
for (pos = 0; pos <= 90; pos += 1) {
Servo1.write (pos);
Servo2.write (pos);
delay (20);
}
for (pos = 90; pos >= 0; pos -= 1) {
Servo1.write (pos);
Servo2.write (pos);
delay (20);
}
} // code to move the servos
}
}
Upload this to the Arduino!
There should now be two squares in the middle of both LCD screens.
Wire Two Small Square Buttons
These buttons sit on the same breadboard as the potentiometer and connect to the Arduino.
The first button (buttonR) gets DC positive in from Arduino pin 4 and connects to the DC negative through the breadboard.
The second button (buttonL) gets DC positive in from Arduino pin 6 and connects to the DC negative through the breadboard.
Write Code to Scroll the LCD “pupils” Left and Right When the Small Square Buttons Are Pressed
Here's our code:
#include <LiquidCrystal.h>
#include <Servo.h>
//create LCDs
const int Rrs = 50, Ren = 48, Rdb4 = 46, Rdb5 = 44, Rdb6 = 42, Rdb7 = 40;
const int Lrs = 51, Len = 49, Ldb4 = 47, Ldb5 = 45, Ldb6 = 43, Ldb7 = 41;
LiquidCrystal LCDright (Rrs, Ren, Rdb4, Rdb5, Rdb6, Rdb7);
LiquidCrystal LCDleft (Lrs, Len, Ldb4, Ldb5, Ldb6, Ldb7);
//create custom characer for LCDs
byte Square[8] =
{
0b11111,
0b11111,
0b11111,
0b11111,
0b11111,
0b11111,
0b11111,
0b11111
};
//create ints for LCD code
int t = 250;
int buttonL = 6;
int buttonR = 4;
int blueLED = 25;
int whiteLED = 27;
int yellowLED = 29;
int redLED = 31;
// create variables for the LED pin #s
int LEDbutton = 23; //create variable for the LED button pin #
int ServoButton = 12; //create variable for the servo button pin #
int lxFOR[] = {blueLED, whiteLED, yellowLED, redLED}; // array - forward LEDs
int lxBACK[] = {redLED, yellowLED, whiteLED, blueLED}; // array - backwards LEDs
int pinsNumb = 4; // define variable for # of LED pins
Servo Servo1;
Servo Servo2;
// create the names for the mouth servos
void setup() {
// start the LCDs
LCDright.begin (16,2);
LCDleft.begin (16,2);
LCDright.createChar (0, Square); //create the custom character for the pupils
//clear both LCDs
LCDright.clear();
LCDright.noCursor();
LCDleft.clear();
LCDleft.noCursor();
//define buttons for LCD code
pinMode (buttonL, INPUT_PULLUP);
pinMode (buttonR, INPUT_PULLUP);
for (int x = 0; x < pinsNumb; x++) {
pinMode (lxFOR[x], OUTPUT);
} //for loop for defining LED pins
pinMode (LEDbutton, INPUT_PULLUP); // define button for turning on LEDs
pinMode (ServoButton, INPUT_PULLUP); // define button for turning on Servos
Servo1.attach (10); // attach Servo 1
Servo2.attach (11); // attach Servo 2
}
void loop() {
int buttonLstate = digitalRead (buttonL); //create int for state of buttonL
int buttonRstate = digitalRead (buttonR); //create int for state of buttonR
int LEDbuttonState = digitalRead (LEDbutton); //create int for state of LED button
int ServoButtonState = digitalRead (ServoButton); // create int for state of Servo Button
digitalRead (LEDbutton); //read state of the LED button
digitalRead (ServoButton); // read state of the Servo button
LCDright.setCursor (7,0);
LCDleft.setCursor (7,0);
LCDright.write (byte (0));
LCDright.write (byte (0));
LCDleft.write (byte (0));
LCDleft.write (byte (0));
LCDright.setCursor (7,1);
LCDleft.setCursor (7,1);
LCDright.write (byte (0));
LCDright.write (byte (0));
LCDleft.write (byte (0));
LCDleft.write (byte (0));
delay (t); //create pupil
if (buttonLstate == LOW) { // move pupil left
LCDright.scrollDisplayLeft ();
LCDleft.scrollDisplayLeft ();
delay (t); // move pupil left
}
else {
if (buttonRstate == LOW) { // move pupil right
LCDright.scrollDisplayRight ();
LCDleft.scrollDisplayRight ();
delay (t); // move pupil right
}
}
int pos = 0;//create variable for the position of the servos
if (LEDbuttonState == LOW) {
for (int SLAY = 1; SLAY < pinsNumb; SLAY++) {
digitalWrite (lxFOR[SLAY], HIGH);
delay (100);
digitalWrite (lxFOR[SLAY], LOW);
delay (100);
}
for (int SLAY = 2; SLAY < pinsNumb; SLAY++) {
digitalWrite (lxBACK[SLAY], HIGH);
delay (100);
digitalWrite (lxBACK[SLAY], LOW);
delay (100);
} //larson scanner code
}
else {
if(ServoButtonState == LOW) {
for (pos = 0; pos <= 90; pos += 1) {
Servo1.write (pos);
Servo2.write (pos);
delay (20);
}
for (pos = 90; pos >= 0; pos -= 1) {
Servo1.write (pos);
Servo2.write (pos);
delay (20);
}
} // code to move the servos
}
}
Upload this to the Arduino!
Test Everything!
Start by plugging in the IEC to power the box.
Switch each switch sequentially (oven switch, then breaker, then bat switch, then orange button, then blue square switch, then buttonR, then buttonL).
The green LED should turn on when the oven switch is on.
The outlet should be on when the oven switch is on.
The lightbulb should be on when the oven switch, breaker, and bat switch are on.
The light in the orange button should be on when the oven switch is on.
The blue, white, yellow, and red LEDs should scan across when the orange button is pressed and the oven switch is on.
The light in the blue square button should light up when the oven switch is on.
The two big servos should move when the blue button is pressed. This should lift the upper part of the head.
The two LCD screens should turn on and show the "pupils" when the oven switch is on.
The pupils on the LCD screens should move right when buttonR is pushed while the oven switch is on.
The pupils on the LCD screens should move left when buttonL is pushed while the oven switch is on.
Once everything is working as intended it's time to move on to the small servos!
Wire Two Small Servo Motors for Baby 3nd3rman’s Eyebrows.
Wire the small servo motors to be the eyebrows.
Each servo needs:
- 5V DC positive
- We wired this from the Arduino through a breadboard we placed in our box to make it easier to connect our components to 5V and ground
- DC negative
- We connected this to the Arduino through the same breadboard
- Signal pin from the Ardunio
- We used pins 8 and 9
The wires for these servos need come outside of the box through the strain relief.
Write Code to Move the Small Servo Motors When the Blue Square Button Is Pressed.
Here's our code:
#include <LiquidCrystal.h>
#include <Servo.h>
//create LCDs
const int Rrs = 50, Ren = 48, Rdb4 = 46, Rdb5 = 44, Rdb6 = 42, Rdb7 = 40;
const int Lrs = 51, Len = 49, Ldb4 = 47, Ldb5 = 45, Ldb6 = 43, Ldb7 = 41;
LiquidCrystal LCDright (Rrs, Ren, Rdb4, Rdb5, Rdb6, Rdb7);
LiquidCrystal LCDleft (Lrs, Len, Ldb4, Ldb5, Ldb6, Ldb7);
//create custom characters for LCDs
byte Square[8] =
{
0b11111,
0b11111,
0b11111,
0b11111,
0b11111,
0b11111,
0b11111,
0b11111
};
//create ints for LCD code
int t = 250;
int buttonL = 6;
int buttonR = 4;
//create ints for eyebrow servos
int FlintServoPin = 9;
int SteelServoPin = 8;
//create names for the eyebrow servos
Servo FlintServo;
Servo SteelServo;
//create names for the mouth servos
Servo Lava;
Servo Chicken;
// create ints for the LED pins
int blueLED = 25;
int whiteLED = 27;
int yellowLED = 29;
int redLED = 31;
//create ints for the LED & Servo buttons
int LEDbutton = 23;
int ServoButton = 12;
int lxFOR[] = {blueLED, whiteLED, yellowLED, redLED}; // array - forward LEDs
int lxBACK[] = {redLED, yellowLED, whiteLED, blueLED}; // array - backwards LEDs
int pinsNumb = 4; // define variable for # of LED pins
void setup() {
// start LCDs
LCDright.begin (16,2);
LCDleft.begin (16,2);
LCDright.createChar (0, Square); //create custom character for the "pupil"
//clear both LCD screens
LCDright.clear();
LCDright.noCursor();
LCDleft.clear();
LCDleft.noCursor();
//define buttons for LCD code
pinMode (buttonL, INPUT_PULLUP);
pinMode (buttonR, INPUT_PULLUP);
//start eyebrow Servos
FlintServo.attach (FlintServoPin);
SteelServo.attach (SteelServoPin);
//move eyebrows to default position
FlintServo.write (90);
SteelServo.write (90);
//for loop for defining LED pins
for (int x = 0; x < pinsNumb; x++) {
pinMode (lxFOR[x], OUTPUT);
}
pinMode (LEDbutton, INPUT_PULLUP); // define button for turning on LEDs
pinMode (ServoButton, INPUT_PULLUP); // define button for turning on Servos
Lava.attach (10); // attach Servo 1
Chicken.attach (11); // attach Servo 2
Lava.write (0);
Chicken.write (0); //move Servo positions to 90 degrees
}
void loop() {
//create ints for the states of all of the buttons
int buttonLstate = digitalRead (buttonL);
int buttonRstate = digitalRead (buttonR);
int LEDbuttonState = digitalRead (LEDbutton);
int ServoButtonState = digitalRead (ServoButton);
//read states of all of the buttons
digitalRead (buttonL);
digitalRead (buttonR);
digitalRead (LEDbutton);
digitalRead (ServoButton);
//print pupil on both LCD screens
LCDright.setCursor (7,0);
LCDleft.setCursor (7,0);
LCDright.write (byte (0));
LCDright.write (byte (0));
LCDleft.write (byte (0));
LCDleft.write (byte (0));
LCDright.setCursor (7,1);
LCDleft.setCursor (7,1);
LCDright.write (byte (0));
LCDright.write (byte (0));
LCDleft.write (byte (0));
LCDleft.write (byte (0));
delay (t);
// move pupil left or right
if (buttonLstate == LOW) {
LCDright.scrollDisplayLeft ();
LCDleft.scrollDisplayLeft ();
delay (t); // move pupil left
}
else {
if (buttonRstate == LOW) {
LCDright.scrollDisplayRight ();
LCDleft.scrollDisplayRight ();
delay (t); // move pupil right
}
}
int pos = 0; //create int for position of servos
if (LEDbuttonState == LOW) {
for (int SLAY = 1; SLAY < pinsNumb; SLAY++) {
digitalWrite (lxFOR[SLAY], HIGH);
delay (100);
digitalWrite (lxFOR[SLAY], LOW);
delay (100);
}
for (int SLAY = 2; SLAY < pinsNumb; SLAY++) {
digitalWrite (lxBACK[SLAY], HIGH);
delay (100);
digitalWrite (lxBACK[SLAY], LOW);
delay (100);
}
} //larson scanner code
else {
if(ServoButtonState == LOW) {
FlintServo.write (135);
SteelServo.write (45);
for (pos = 0; pos <= 90; pos += 1) {
Lava.write (pos);
Chicken.write (pos);
delay (20);
}
for (pos = 90; pos >= 0; pos -= 1) {
Lava.write (pos);
Chicken.write (pos);
delay (20);
}
FlintServo.write (90);
SteelServo.write (90);
}
}
} // code to sweep the Servos
Upload this to the Arduino!
Mount the LCD Screens and Eyebrow Servos Into the Face
The LCD screens should attach behind the holes cut for the eyes. We taped these on using Gaff tape.
The eyebrow servos should be hot glued on the foamcore above the eyeholes. The eyebrow pieces should be glued onto wire which connects through the eyebrow holes to he servos, so that the eyebrow pieces are horizontal.
Test Everything!
Start by plugging in the IEC to power the box.
Switch each switch sequentially (oven switch, then breaker, then bat switch, then orange button, then blue square switch, then buttonR, then buttonL).
The green LED should turn on when the oven switch is on.
The outlet should be on when the oven switch is on.
The lightbulb should be on when the oven switch, breaker, and bat switch are on.
The light in the orange button should be on when the oven switch is on.
The blue, white, yellow, and red LEDs should scan across when the orange button is pressed and the oven switch is on.
The light in the blue square button should light up when the oven switch is on.
The two big servos should move when the blue button is pressed. This should lift the upper part of the head.
The two small servos should move when the blue button is pressed. This should make the eyebrows make an angry expression.
The two LCD screens should turn on and show the "pupils" when the oven switch is on.
The pupils on the LCD screens should move right when buttonR is pushed while the oven switch is on.
The pupils on the LCD screens should move left when buttonL is pushed while the oven switch is on.
Once everything is working as intended it's for the finishing touches!
Glue Baby 3nd3rman's Face On
Line up the face with the rest of the upper head and use hot glue to attach this piece.
Place Baby 3nd3rman in Front of the DJ Turntable
Put DJ 3nd3rman in front of the DJ turntable. Hot glue two rectangular tubes onto his sides, with one resting on the turntable.
We had a toy turntable that was bluetooth compatible, allowing us to play music through it. We ended up creating a QLab playlist of Minecraft parody songs which could be played through the turntable, just for fun.
Test Everything One Last Time!
Follow the same process as last time there was a test!
If everything works, then congratulations! You've made a beautiful Baby 3nd3rman!