Arduino Animation
Arduino Animation
In this instructable I will show you how you can make a real life
animation with Arduino and little perspex plates. The idea is that if
you illuminate the plates from beneath you can see the engraving
light up. If you loop the lights under the plates, you will see an
animation. Much like a zoetrope. Only this one doesn't spin and the
plates are placed directly behind each other. When you get closer to
the animation, because of the ultrasonic sensor, the animation will
play faster. When you are further away it will play slower.
Arduino UNO
Power cable for the arduino
Breadboard
HC-SR04 Ultrasonic sensor
LED 5mm (any colour you want) X32
Resistor 220Ω X8
Jumper wire X15
Perspex / plexiglass plates (5 cm x 7 cm) X8
Dremel engraver (Or some way to engrave the plates)
Laptop to run arduino software
Cardboard, wood etc (to build the casing)
What you want to do first is connect the breadboard to your arduino.
This is done by connecting the 5V pin on your arduino with a
jumperwire to the + side on your breadboard and connecting ground
(GND) with a jumperwire to the - side of your breadboard.
Next step is adding the LEDs, you want to place 4 LEDS in serie,
this make sure you have enough light intensity to illuminate your
plates. You need to do this 8 times.
You want to connect the longer pins of your LED, which is de +, with
a jumper wire to the output pins of the arduino (11-4).
You need to connect the shorter pin of the LED, which is the -, with
a res to the - side of the arduino.
You need to do those steps 8 times because there are 8 frames you
want to illuminate. See the Scheme.
Connect the GND pin of the sensor to the - side of the breadboard.
Connect the VCC pin of the sensor to the + side of the breadboard.
Connect the Trig pin of the sensor to the 13th output pin of the
arduino.
Connect the Echo pin of the sensor to the 12th output pin of the
arduino.
/*
* trigger pin of the sonic sensor.
*/
/*
*/
/*
*/
/*
* This variable stores the size of the leds array. It is stored in a separate var
iable since
* the (byte) size of the leds array must always be divided by the (byte) size of
an integer.
* THis is because sizeof(variable) returns the amount of BYTES in memory, not the
amount of
*/
/*
* This variable stores the current index of the current pin in the leds array.
*/
int currentPin = 0;
/*
*/
void setup() {
pinMode(leds[c], OUTPUT);
/*
*/
void loop() {
long distance = measureDistance(); // Sets the variable distance eq
ual to measureDistance.
delayMicroseconds(2);
digitalWrite(trigPin, HIGH); // Sets TrigPin on a high voltag
e.
delayMicroseconds(10);
5 cm wide
7 cm long
See through
3 mm thick
Have polished sides
Made of plexiglass, perspex or another type of plastic
Next you have to engrave the animation that you have made in the
plates. You can do this with a dremel engraver. You can also let
someone else do it, like a company for example, however engraving
it with the hand gives a better effect than engraving it with a laser.
This is because laser engraving is very undeep, the illuminating
effect will be a lot less.
You can make the casing from any material that you like. I choose
to make it with cardboard because this was in my case the easiest
way.
In the picture you can see the sketches. You need to make
slids/holes for the plates to go in, so they need to be a little bit less
than 5cm long and a little bit less than 3mm wide. Because of
making it a little bit less than exactly 5cm and 3mm you have to
push the plates in, and they won't directly fall through it. You need to
measure how much space there is in between you leds, and this is
the space that goes between the slids/holes. The slids/holes go on
top of the leds, so that they can directly illuminate the bottom of the
plates.