Skip to content
My Account

3D printing

Building a 3D Printed Pit Droid, Part 7: Eyes, Ears and a Voice

A progress report on the Pit Droid: how far the printing is, what the new board can see, hear and say, and what I have not tested yet.

  • 3D printing
  • 8 min read
Building a 3D Printed Pit Droid, Part 7: Eyes, Ears and a Voice
No ratings yet, be the first.

Hi, it’s Achim again. In Part 6 the droid got a brain that I can set up, log in to and update from my phone. This part is an update on the whole project: how far the printing is, what the electronics can do now, and what I have not tested yet.

No servo moves in this part. The droid can see a little, hear a little and make noise, but I have not connected a servo to the new board.

Test bench with the Waveshare board, the PCA9685 and a speaker

The test bench: the Waveshare board on the left, the servo driver on the right, a speaker clamped in between. The servo driver has no servo and no servo power connected, so nothing can move or burn.

Where the Printing Stands

Head set (25 files)Printed, filled, sanded and primed
Neck and animatronic head partsPrinted, put together on the tube, spring works
Chassis plate with mechanismPrinted and prepared
Legs with hip cylinder, knees and feetPrinted and put together
TorsoPrinted (more in the next part)
Arms, backpackStill to do

The head set took about a week on my Ender 3 V2 with a 0.4 mm nozzle and light grey PLA, roughly 1 kg of filament. I spent a lot of time calibrating first, then found a sweet spot and printed on from there. To be honest, I have printed less than I hoped by now: my printing is behind my electronics.

Head shell after filler, sanding and primer

A head shell after filler, sanding and primer. The light patches are where the filler is still showing through. It is not painted.

The neck is the part I am happiest with. The upper neck turns on a metal tube with two 6800-2RS bearings and tilts on two pins. The head is held up by a spring. My calculation said a 6×38 spring with a 0.6 mm wire would be too stiff. In practice it held the head well, so measuring and trying beat guessing, even for my own maths.

Lower neck with the metal tube

The lower neck with the metal tube in it.

The chassis plate is covered in mechanism.

Printed chassis plate with mechanism

The legs are printed too, and they are the part that looks most like a droid so far. The hip cylinder sits between two legs, each with a knee joint and a foot with two toes.

The printed legs with the hip cylinder

The printed legs, with the hip cylinder between them.

Waiting for a Part

To move the torso and the arms I am waiting for one more part: a goBILDA 1309 Series Sonic Hub. It is a metal hub that clamps onto a shaft. I will show how I use it, and why I chose it, when it arrives and I have tried it. The torso is already printed, and I will cover it in the next part.

goBILDA 1309 Series Sonic Hub

The goBILDA 1309 Series Sonic Hub.

Servos and Power

All five MG996R servos moved correctly on a servo tester. I measured 5.04 V while they moved, well above the 4.8 V minimum of these servos. That was without load, no arm and no head on them, so it says nothing yet about the real thing.

Servo test with the servo tester and the 5 V supply

An MG996R on the servo tester, powered from the 5 V supply.

The Brain: One Board for Everything

The first plan used two boards: an ESP32-S3 DevKit and an ESP32-CAM. I dropped that for one Waveshare ESP32-S3 board with camera, two microphones, a speaker amplifier and an I2C header. One board also means no serial link between a camera board and a brain board. The servo driver, a PCA9685, hangs on that I2C header. Part 6 tells how the board gets set up from a phone.

The Cable That Made the Bench Possible

The I2C header on the Waveshare board is a tiny white connector, not a normal pin header. I could not plug a servo driver into it until a cable arrived: a small connector on one end and four Dupont sockets on the other. With it, the PCA9685 hangs on the board with four wires: ground, 3.3 V, SDA and SCL. That is the link you see on the bench in the photo at the top.

I2C cable with a small white connector and four Dupont sockets

The cable: a small white connector on one end, four Dupont sockets on the other.

Check the order of the wires against the board’s own documentation before you power anything. The colours differ per cable, and the header has no 5 V pin, so the servo supply always goes straight to the PCA9685.

Advertisement

The Servo Driver Was Not Dead, the Plug Was Loose

The PCA9685 uses address 0x40 by default, the same as a chip on the Waveshare board (most likely the microphone chip). So I bridged the A0 pad, which moves it to 0x41. Then the I2C scan showed nothing, and for a few days I thought I had a soldering or wiring problem.

A working PCA9685 also answers on 0x70, the “all call” address. If 0x70 is missing, the chip is not on the bus at all. The cause was the small connector, which did not click into the header. After pushing it in the scan showed 0x41 and 0x70, and the 50 Hz setting read back correctly.

Lesson: when a scan finds nothing, check the plug before the solder. I did this without servo power, with only the 3.3 V from the board. I have not tested servos, the V+ supply or the capacitor voltage on this setup yet.

The Camera in a Browser

To see what the droid sees, I wrote a small test firmware. The board opens its own WiFi network and streams the camera to a browser, with buttons for the settings.

It worked first time, except the buttons did nothing. The default ESP-IDF web server handles one request at a time, and an endless video stream blocks everything else. The fix: a second server on another port, only for the stream.

The picture was poor in my room and much better with more light. On a small sensor, fix the light before you touch any setting. I did not measure which setting helped most, so I will not claim one.

A Speaker Lab

I did not want to guess whether the small speaker is good enough, so I built a “speaker lab” page: a tone generator, a sweep, noise, and a microphone level in dBFS. At start-up the board plays a tone and checks that its microphone hears it. In a noisy room it measured 10.4 dB above the noise, so the speaker and microphone work together. I heard the sweep.

Two things bit me:

  • After a restart my Mac dropped off the board’s WiFi. “I hear nothing” was sometimes just a lost connection.
  • My sound clips lived in a flash partition that a larger app later overwrote without a warning. If you keep data in flash, check where the other partitions end.

Not measured yet: the lowest bass the speaker reproduces, maximum volume and distortion. The clips I use in tests are not going into the firmware or any repository.

Finding Faces

Face detection runs on the board itself, no internet needed. On 22 November it reached about 7 frames per second at QVGA with one person in view and the image flipped the right way up. That is slow enough to matter. If the head turns faster than the camera can follow, it will overshoot and wobble, so the head will have to move gently.

Advertisement

What the Droid Should Do

I decided that the first version lives without internet. No voice commands and no AI yet. It should:

  • follow a face with its head,
  • react to movement or a change in light,
  • play sound clips I make myself,
  • start by itself as soon as it has power.

I sketched this as a small state machine with an idle layer that always runs (breathing, blinking, small head movements). The states are Sleep, Idle, Notice, Follow, Startle, Bored and Quiet. This is a design, not code: nothing of it runs on the droid yet.

Not Tested Yet

  • Any servo on the PCA9685, the V+ supply, and what the head does under load.
  • Speaker bass, maximum volume and distortion.
  • Detecting a clap or a sudden noise.
  • Camera, audio and WiFi all running at once.
  • The behaviour itself.

Mistakes I Want You to Avoid

  • Pushing a connector in half. Listen for the click.
  • Trusting a scan that finds nothing without looking for both 0x41 and 0x70.
  • Putting a blocking video stream and your controls on one web server.
  • Storing data in a flash partition without checking what overlaps it.
  • Trusting your spring calculation over a test.

Conclusion: Next Come the Servos

The printing is behind, the electronics are ahead. The droid can see, hear and speak in small tests. I also have a flat USB-C cable for later, to power the board from the 5 V supply. I have not measured or connected it yet. The next steps are the distance test, the first servo on the PCA9685 with the proper 5 V supply, and then a head that follows a face. In the meantime I keep printing, with the arms and the backpack next, while I wait for the part that moves the torso and arms.

Previous: Part 6: The Brain Wakes Up

Next up: Part 8, the torso, and hopefully the first movement.

Unofficial fan project

Pit Droid and Star Wars are trademarks of Disney/Lucasfilm. This site is not affiliated with, endorsed by or sponsored by Disney. The droid in this series is based on the PD-23 files by DroidDivision (Dave Moog), which are used under a single-person licence.

Advertisement
All projects

More projects

Keep building.

Electronics, 3D printing and CNC builds, documented from the first idea to the last screw.

All projects