Simple Halloween Skull
Maybe it’s too late to present an Halloween project with a lot of function, so we decide to develope a simple application to show how controll a mandible of a skull.
In this project the skull speaks and moves the mandible according to the sound level.
An Arduino analyzes the level sound of a audio source and drives a servo motor connected to the mandible.
All very simple.
The video show how it works.
The sketch:
/* Skull created 2011 by Boris Landoni This example code is in the public domain. http://www.open-electronics.org http://www.futurashop.it */ #include <Servo.h> Servo myservo; // create servo object to control a servo int potpin = 0; // analog pin used to connect the potentiometer int val; // variable to read the value from the analog pin void setup() { myservo.attach(9); // attaches the servo on pin 9 to the servo object } void loop() { val = (analogRead(potpin)*3); // reads the value of the potentiometer val = map(val, 0, 1023, 50, 0); // scale it to use it with the servo myservo.write(val); // sets the servo position according to the scaled value delay(15); // waits for the servo to get there }
The schemtaics shows how we connect the servo to Arduino.
Download the Fritzing file
Inside the skull we use an old PCB to fix the servo (you can use what you want).
This project wants to be a start point for yours ideas….
Have a good work
[original story: Open Electronics]