Introduction: Motion Detection Halloween Talking Skull

In this Instructable I will show you how I made my Motion Sensing Talking Robotic Skull Halloween prop.

I made it using a 3D printer, some common electronics components. A MakerClub Hornet and I programmed it using the MakerClub Workbench (you can register with MakerClub for free).

The robot looks for any motion, then when it detects motion it runs a program to animate the skull potentially scaring your victims. Perfect for Halloween!

Please do share this Instructable with your friends. I want to show everyone how easy it is to create Robots and Animatronics, anyone can do it!

Step 1: What You Will Need

Below is a list of the components you will need to create this project.

  • 1x MakerClub Hornet Microcontroller
  • 2x Tower Pro Micro Servos (SG90)
  • 1x PIR motion sensor component
  • 2x LEDs (Your choice of colour)
  • 2x 100ohm Resisters
  • 4x AA Batteries
  • 4x Female to Female Jumper Wires
  • 4x Male to Female Jumper Wires
  • 2x Male to Male Jumper Wires
  • 1x Battery Holder
  • 4x M3 Nuts and Bolts
  • 1x Small Breadboard
  • 1x PVC Cement

Optional (If you don't own a 3D Printer you can use a service such as 3D Hubs:

  • 3D Printer
  • 3D Printer Filament

Step 2: 3D Printing the Skull

I found the model for the skull on thingiverse here:

http://www.thingiverse.com/thing:194928

the original model was created by http://www.thingiverse.com/death_metal

Download the attached files and print using the following print settings (Not all printers have the same settings so try to use something close to the settings below):

  • Layer Thickness: 0.19mm
  • Speed: High
  • Infill: Low
  • Support: 10 Degrees Light

This is quite a difficult print so take your time setting it up and pay close attention to the support material that the program generates for the 3D Printer. You can always create your own support in a program such as MeshMixer which is often far better. Meshmixer is a free piece of software and I highly recommend you checking it out

Step 3: 3D Printing the Base & Parts

Download the attached files and print using the following print settings (Not all printers have the same settings so try to use something close to the settings below):

Layer Thickness: 0.19mm or similar

Speed: High

Infill: Medium

Support: 10 Degrees Light

Step 4: Cleaning Up the Prints

Take your time cleaning up the prints especially with the skull and even more so with the jaw as these parts can easily snap and will have a lot of support material to clean up.

When I was cleaning up the jaw print I accidently snapped off the hinge. Don't panic if you do this as you can use some super glue or pvc cement to fix it back together.

Another thing to be careful with is mistaking the slot on the jaw for support material. I nearly threw this away and ended up having to glue it back on.

Another thing to note is that the gap that you thread the wires through is very small so I actually cut away some of the 3d printed material to make it easier to thread the LED eye wires through. I also drilled the eye holes as some of the support material was tricky to get out and prevented the LEDs from fitting into the sockets.

Step 5: Assembling the Skull

Warning: Take your time assembling the skull. It can be quite tricky and parts can snap, particularly be careful with the Jaw.

Might be worth reading the whole of this step before attempting it as it can be quite tricky.

Start by using 4 of the female to female jumper cables attached to the LEDs and thread the through the eye sockets and down through the slot under the skull.

Next you will want to push a servo into the slot in the skull. This is quite a tight fit. Look at the pictures above for reference.

Now for the trickiest part of this whole instructable; attaching the jaw to the skull and servo. Take your time, it's very easy to snap the jaw if you force it. Start by putting a servo horn onto the servo motor (use the arm with only one arm). Then gently squeeze the jaw so that the cylinders each end of the jaw slot into the holes on the jaw. You also need to make sure the servo horn slots into the slot on the jaw else the servo won't move the jaw open and closed.

Once everything is assembled. Test the jaw opens and closes by gently opening and closing it with your hands. You should hear the servo motor turning. If its not opening and closing try taking the jaw back off and changing the angle you place the horn onto the servo as a servo only has 180 degrees of motion.

Step 6: Assembling the Rest of the Robot

Now that the hard part is over we can get back to assembling the rest of the robot.

Start by glueing the skull mount to the skull. Be careful using the PVC Cement as this is nasty stuff. Don't breath it in. Alternatively you can use super glue but be careful not to get any on your fingers.

Thread the servo and LED wires through the hole in the mount as this keeps everything nice and tidy.

Next put a servo into the slot in the base and place the base attachment ontop of it with the servo slot facing up. Place a servo horn in the base attachment slot and using a small screw supplied with the servo fix the horn to the servo.

Now you can attach the skull to the base using 4 screws and nuts. Make sure they are tight as they will easily come undone when the skull starts moving.

Take the PIR Motion sensor and fit into the slot at the front of the base with the pins at the bottom.

Lastly, push slide the 3D Printed battery mount onto the base using the click fit system. Then push the battery holder with aa batteries into the mount and then slide the Hornet board ontop.

Step 7: Building the Electronics

The electronics for this project are very simple. I will now explain how to connect all the electronics.

  1. Connect the Jaw Servo to pins 1. Make sure you have it connected the correct way around. Negative is on the inside, positive in the middle and digital on the inside.
  2. Looking at images 1 and 2 push the resistors into the breadboard

  3. Next, connect one of the LEDs negative to the negative on Pin 2 and the positive to a hole on the breadboard that is in line with a resistor then using another jumper wire connect the other end of the resistor to the digital pin 2
  4. Do the same with the other led but connect to Pins 3 and use the other resistor.
  5. As the same with the other servo connect the Base servo to pins 4
  6. Finally, we are going to connect the PIR Sensor. connect the positive wire to the 5v input on the hornet board, connect the negative to the ground input and lastly, connect the digital to input 1. Use the Schematic (image 1) for reference.

Step 8: Create a New MakerClub Project

Head to www.makerclub.org and signup for a free account. After logging in you will be on your makerclub dashboard. Click the projects tab and then the plus button to create a new project.

Important: Before connecting the Hornet board make sure you have installed the Drivers & Chrome plugin from the makerclub site to be able to use the board with the development environment. You can install them from here if you haven't already: https://makerclub.org/install/ Then click the icon circled in image 3. This will switch the screen from the default text edit view to a drag and drop interface.

Connect the Hornet board to your computer via the micro USB it should display in on the MakerClub code editor (See the first pic circled red). It will say something like Hornet1.
If yours doesn't display. Check that you have correctly installed the drivers and plugin. If it's still not showing try restarting your computer.

Step 9: Programming the Robot

Click the button circled in image one to take you from the code editor to the drag and drop code editor.

Recreate image 2 the MakerClub WorkBench.

Explanation:

You will notice that we have Servo 1, LED 2, LED 3 and Servo 4. These numbers correspond to the pins the components are attached to. For example Servo 1 is on pin 1 and LED 3 is on pin 3. Make sure yours are setup the same as mine or adjust the code to match your setup. Also, this is just a guide. It would be really cool for you to experiment with the code and create your own robotic animations.

  1. We start off buying turned the LEDs on in the Setup this is so that we can use them later in the code and instead of turning them on and off we can just adjust the brightness
  2. Next, inside the Loop, we start by setting the onboard LED to off. You can actually just ignore this block as it was only used for testing
  3. The log block shows us in the console at the bottom of the screen what the value of input 1 is each time the loop starts. Input one is the PIR sensor and will show either 0 or 1. 0 means that no movement has been detected and 1 means movement has been detected. This is just for debugging the code and is useful later when adjusting the sensitivity of the PIR sensor.
  4. Next, we do an IF statement.

    If input 1 is = to 1 (if the PIR sensor detects movement we will execute the following code) else we will set the LED brightness to 0 so that they look off.
  5. So if input 1 is equal to one we call a function called "talk". You can see the talk function as the second block of code.
  6. So if the "Talk" function is called we first set the eye LEDs to max brightness which by default is 255 unless you remap the values.
  7. Then we turn Servo 4 to 45 degrees. Servo four if you remember is the base servo rather than the jaw servo
  8. We then wait for a random time between 200 - 300 milliseconds. I decided to use random numbers as I wanted the robot to feel a little more organic rather than it behaving the exact same way each time. It's subtle but I feel it makes a big difference.
  9. We then turn Servo 4 to 135 degrees
  10. Wait another random amount of time between 200 - 300 milliseconds.
  11. Then we turn it back to 90 degrees so that the skull is facing straight on for the next part.
  12. Now for my favourite bit. For the jaw animation, we are going to use a loop. That means we will repeat the loop X amounts of times before we continue. In this case, I have decided to use a random number between 4 and 8 times.
  13. Within the loop we set Servo 1 to 10 degrees (Note: you will likely have to play around with these numbers as it's unlikely that you put your servo horn on at the same angle as me. I played around for a little while before I got the numbers to where I wanted them.)
  14. we then wait between 75 - 150 milliseconds
  15. Then move servo 1 to 50 degrees.
  16. Then we wait again
  17. This repeats until it's reached the int specified in the loop
  18. Finally, we return servo 4 back to 90 degrees (This is actually not required as its already at 90 degrees).
  19. Then we return to the main loop and wait for the PIR sensor to sense some motion again.

It's that simple! As I said before this is just a guide. I would recommend following it to begin with just to make sure your robot is working but then experiment as much as you like! Please do send me videos of your creations in the comments below

Step 10: Testing the Robot

Once the code has been uploaded to the board you can plug in the batteries giving the board the power required to run the motors properly.

If all is working fine and correctly then the skull should turn its head from side to side and then open and close its mouth multiple times each time it senses movement. You can test this by waving your hand or moving in front of the PIR motion sensor.

If the skull isn't opening its mouth correctly this could be down to what angle you put the horn on the servo. Try adjusting the numbers in the code to fix this.

You will most likely have some initial teething issues with the motion sensor. Either constantly going off or not going off at all. If this happens then try adjusting the screws on the motion sensor component to adjust the sensitivity until it's correct. You may need to reset the hornet board for the changes to take effect. There is a little push button on the board for this.

Step 11: Tidying Up the Wires

Now that everything has been setup and you know it's working. It's probably worth spending a bit of time tidying up all those loose wires. That way the robot won't get tangled up in them when moving about.

I started by drilling a small hole in the back of the base to thread the servo and PIR wires through. You could modify the 3D print file to have the hole as part of the print but i decided it was quicker just to drill a hole.

Next use some cable ties to tidy up the cables and keep the secure. Make sure that robot still has full free movement and that the cables wont snag or catch on anything.

Step 12: Congratulations!

Congratulations on completing your Talking Robot Skull!

I really hope you enjoyed building it and learned something along the way.

Please share your opinions and creations below in the comments. I would love to see some videos of you scaring people for Halloween with your creations. Post links to videos in the comments below.

Like and vote for my instructable so I can reach more people with this guide. I really want to show how easy it is to create robots and animatronics with basic components. Anyone can do it!

You can check out another one of my Instructables here: https://www.instructables.com/id/Darth-Vader-Robot/ This one will teach you how to control your robots with the MakerClub mobile phone app the connects directly to the MakerClub Hornet board.

Halloween Decor Contest 2016

Participated in the
Halloween Decor Contest 2016

Circuits Contest 2016

Participated in the
Circuits Contest 2016