gabriel stacey-chartrand

Week 12: mechanical design

For this week our group built a machine called "Creature of the Night", a robot that dances when it's dark and stops when the lights come on. It uses a Barduino with a built-in phototransistor, a relay, and a DC motor. I designed and built the mechanical system and wrote the firmware.

Fusion 360 render of the creature of the night robot
Fusion 360 render

Firmware

The Barduino reads its built-in phototransistor and uses a relay to switch the motor on when dark and off when light. The relay is a Seeed Studio Grove Relay v1.3, which accepts a 3.3V input signal (earlier driver modules required higher gate voltage and didn't work with the Barduino's 3.3V output).

Barduino connected to a Grove relay and DC motor on a breadboard
testing Barduino, relay, and DC motor
testing the firmware and phototransistor

The firmware reads the phototransistor, prints the light level to serial at 115200 baud, and drives the motor with PWM when dark.

// ============================================
//  Barduino Motor Control via Phototransistor
//  Motor ON when dark, Motor OFF when light
// ============================================

const int MOTOR_PIN        = 1;   // GPIO01 -> relay signal pin
const int PHOTOTRANSISTOR  = 3;   // GPIO03 -> built-in phototransistor

const int LIGHT_THRESHOLD  = 150; // 0-4095; adjust per environment

void setup() {
  pinMode(MOTOR_PIN, OUTPUT);
  digitalWrite(MOTOR_PIN, LOW);
  Serial.begin(115200);
}

void loop() {
  int lightLevel = analogRead(PHOTOTRANSISTOR);
  Serial.print("Light level: ");
  Serial.println(lightLevel);

  if (lightLevel > LIGHT_THRESHOLD) {
    digitalWrite(MOTOR_PIN, LOW);
    Serial.println("Light detected -> Motor OFF");
  } else {
    analogWriteFrequency(MOTOR_PIN, 20);
    analogWrite(MOTOR_PIN, 25);
    Serial.println("Dark detected -> Motor ON");
  }

  delay(100);
}
download firmware (.ino)

Mechanism design: leg prototype

I wanted the legs to go up and down rather than walk, so the robot would dance in place. I designed a crank-and-slider mechanism in Fusion 360 to convert rotation into vertical leg movement, with offset cranks so legs move at different times.

Fusion 360 model of a single leg crank-and-slider mechanism
single leg mechanism in Fusion 360
3D printed single leg crank-and-slider test mechanism on a table
3D printed single leg test mechanism
Fusion 360 animation of the test mechanism

Mechanism design: antenna prototype

I added a secondary antenna mechanism driven from the same axle. I animated the joint relationships in Fusion to verify the motion before printing, then printed and assembled the combined leg and antenna mechanism.

3D printed test mechanism with one leg and two antennas
combined leg and antenna test mechanism
3D printed connecting rod with a broken snap-fit pin tab
snap-fit pin on the connecting rod broke easily; linkages in the final version use steel screws instead

Final CAD

I redesigned everything from scratch in Fusion 360, based on the tested mechanisms. The body was sized just under the maximum print area of the Bambu A1/X1. The motor is geared down using bevel gears and mounted under the main axle inside the body. Aluminum rods from a local hardware store (Servei Estació) serve as axles. The Barduino sits under a laser-cut acrylic lid so the phototransistor can read ambient light while the board is enclosed.

CAD work in Fusion 360
full Fusion 360 design sequence
Fusion 360 animation of the final mechanism
Fusion 360 model of two meshing bevel gears
bevel gears in Fusion 360
Fusion 360 model of a bevel gear with a heat-set nut insert for tightening
heat-set nut insert detail on bevel gear
download final model (.f3d) download test model (.f3d)

3D printing

Parts printed in PLA on Bambu A1/X1 printers. The body was printed as a single piece. The sides had some delamination issues. I also forgot to add holes for the lid fixtures in the first print and had to add them in CAD and reprint.

Bambu slicer showing the creature body positioned for printing
body in slicer
Freshly printed creature body viewed from above, showing internal mounting features
body after printing
adding lid holder holes in Fusion after forgetting them in the first print
Slicer showing motor mount, antenna parts, and lid mounts on the print bed
motor mount, antenna parts, and lid holders in slicer

Lid

The lid was laser-cut from amber translucent acrylic so the phototransistor can read light through it. The lid mounts to the body using heat-set inserts and screws.

Soldering iron pressing heat-set threaded inserts into 3D printed lid mounts
pressing heat-set inserts into the lid mounts
Assembled creature body with amber acrylic laser-cut lid fitted on top
laser-cut acrylic lid fitted on the body

Assembly

Creature body with motor and axle supports installed, gears and other parts laid out beside it
motor and axle supports installed, parts ready for assembly
Motor and belt drive system mounted inside the creature body
motor and belt drive mounted in the body
Looking down into the body from above with axle supports and motor installed
axles and motor installed
Hands installing bevel gears and linkages inside the body
installing gears and linkages
Gabriel assembling the creature at the lab bench
assembling at the lab
Gabriel holding the assembled creature body with red gears visible inside, yellow acrylic lid in other hand
assembled body

Testing

The mechanism ran but had significant issues: gears binding, too much torque from the motor, too much play on some joints and not enough on others. PWM was added to reduce motor speed and torque. The robot worked in the end but was rough. Some of the axle supports eventually snapped off.

mechanism running

Final result

Creature of the Night robot, front view
creature of the night
Creature of the Night robot
Creature of the Night robot
Creature of the Night robot
Creature of the Night robot
group page
Country roads...