Last time we made a clay figure with electronics embedded. This post includes the wiring layout to animate the figure with an Arduino + code.
So since the skull I made in part 1 had electronics inside but without any means of actual control, I had to do something about that. Needless to say, this skull needs some effects. Let’s see what we can cook with:
Outputs: left eye LED, right eye LED
Inputs: micro pushbutton, potentiometer
What should this skull do?
- LEDs glow with fixed intensity (intensity should be configurable)
- LEDs fade in and out (speed and max intensity should be configurable)
- LEDs blink in an alternating fashion (speed and max intensity should be configurable)
The wiring here is pretty simple. An important note that I tried to mark on the figure itself too is that the top small breadboard represents the embedded electronics of the skull. The female header on the bottom of it is the exposed header we can work with, the rest of the cables are one with in the clay.
So what is here?
- LEDs connected to PWM pins, and ground through resistors.
- A button connected to 5V and a digital pin + to ground through a resistor.
- A potentiometer connected to 5V, an analog pin and ground.
The figure was created with the pretty cool Fritzing software.
Since it is a bit long, I prefer to only put a link to it here, check it for yourself on github:
Both the software and the electronics used in this project are a subtle mix of 3 official tutorials from Arduino:
The wiring is almost pin to pin, basically summing up the wiring of the tutorials.
The software uses some chunks of the tutorials enclosed in a sort of state machine.
A longer video of me trying to demonstrate the effects: