The Arduino and electronics:


1x potentiometer (variable resistor/pot) 1x LED

The code:

Control LED fading with potentiometer

The circuit:
Potentiometer attached to analog input 0
* center pin of the potentiometer to the analog pin
* one side pin (either one) to ground
* the other side pin to +5V
* LED anode (long leg) attached to digital output 9
* LED cathode (short leg) attached to ground

Created by Luke Woodbury
6 Jan 2016


int sensorPin = A0;    // select the input pin for the potentiometer
int ledPin = 9;      // select the pin for the LED
int sensorValue = 0;  // variable to store the value coming from the sensor

void setup() {
   // initialize serial:
 // declare the ledPin as an OUTPUT:
 pinMode(ledPin, OUTPUT);

void loop() {
 // read the value from the sensor:
 sensorValue = analogRead(sensorPin);
 //remap the sensor value from 0-1023 to 0-255 for LED PWM fading
 sensorValue = map(sensorValue, 0, 1023, 0, 255);
 //print sensorVal to serial monitor
 //write value to LED pin as PWM
 analogWrite(ledPin, sensorValue);


How does it work? 

Input = analogue measurement of voltage (ranging from 0 - 5V) converted to value between 0 - 1023

Output = digital 5V OR ground (GND) = on or off = 0 or 1 

PWM Output  = turning on and off very fast (pulse width modulation) as a way to simulate analogue output = 0 - 255

Gears and drive mechanisms:

Simple mechanisms with animation -

Design your drive train gears and get the SVGs! -

Great resource for making wooden gears including template maker -

Good gear ‘ible -

Good mechanism resources from mechanical design company -

Kinematic models for design -

Digital Mechanism and Gear Library (crappy website!) -

Can always search Youtube for good video examples of Kinetic art and mechanisms:

Living hinges/kerfing: