Introduction: Light Painting Bot
One paints with a brush, with pigments. And of course with one's imagination. But what about painting with knobs, gloves, and light?
Who says art is only for those who can hold a pencil and wield it with skill? Art, like light, is available to anyone who wishes to embrace it.
The Light Painting Bot enables you to play with light to create a uniquely captured shot, merging painting and photography with technology. The bot translating the inputs from the potentiometers and accelerometer into movement and colour in a manner not entirely predictable, and the product being a collaboration between two people, the painting is spontaneous and unique.
Step 1: Tools and Materials
- Arduino Uno
- 2 Servo Motors (I used these - http://robokits.co.in/motors/standard-dual-ball-b... but you can use any other as long as it is has similar torque)
- At least one RGB LED
- A variable power supply (depending on the motors specifications; variable because I found it worked smoothly only at a particular voltage)
- Jumper wire and single stranded wire (loads and long)
- 2 1k Resistors
- 2 10k Potentiometers ( the value doesn't really matter here as long as its much bigger than the fixed resistors)
- 1 Accelerometer (I used adxl345 - https://learn.adafruit.com/adxl345-digital-accele... )
Tools and supplies
Soldering tools (if using a PCB)
Chisel and mallet
Wood screws and screwdrivers (not specifying any size as it doesn't matter as long as they are strong, you will need 7 screws excluding the ones provided with the motor)
Nails and hammer
Red Cedar (you need to keep everything apart from the base light depending on the servo motors)
Keep in mind the direction of the grain depending on the use of the wood and the direction they are screwed.
- Block of 15cm x 15cm x 4cm(height); to be shaped into a cylinder of 14cm diameter
- Block of 17cm x 10cm x 4.5cm(height)
- Board of 1cm(height) x 16cm x 16cm
- Reaper of 1cm(height) x 30cm x 2.5cm ( I used pine as red cedar wasn't available, which is as light)
Camera (any that allows long exposure shots)
Gloves to attach the accelerometer on.
Step 2: Woodworking: Cutting, Shaping, Grooving (Part I)
On the lathe, shape the 15cm x 15cm x 4cm block into a cylinder with 14cm diameter and 4cm height. To do this you may need to attach a holder onto the wood to be able to hold the block in the lathe. Attach with glue, and let it dry under compression over four to six hours.
After shaping, sand paper the sides to give it a smooth finish, apply polish if you like.
Cut the cylinder diametrically into half. Further cut 1/2 an inch along the diameter (straight edge) of each half. Sand to make even.
Cut only one half horizontally to obtain two 2cm high semicircles.
Now for fitting a servo motor between these two semicircles. To do this make a groove, as shown, that will hold half the motor in each semicircle.
First draw the outline of the motor with the wire (refer to the image) on each semicircle (keep in mind that they go one on top of the other and thus have to be mirror images of each other). Then draw a line on the straight edge to mark the depth of the groove (half the depth of the motor). The fastest way to remove the wood is to drill, so depending on the drill bits available try and cover maximum surface. Keep in mind not to drill the full depth and keep around 2-3mm extra on both the sides and the depth to be safe. (If you do not have small enough drill bits for the slits, you can use a nail as a drill bit; it will be a bit time taking though). Next, you will need to chisel out the rest of the wood. (If you don't have a chisel you can try drilling more, but be very careful and steady as the bit tends to jump about, then sand paper to make even.) It doesn't have to be perfect as long as half the motor fits in snuggly. If the groove becomes too big then you can add some packing. Keep checking for a snug fit with motor.
To join the two semicircles, you will need to screw them together. To do this drill three holes (like shown, making sure the motor doesn't come in the way) in one semicircle through and through of a diameter slightly bigger than that of the screw. Drill a bigger hole (screw head) to counter sink the screw. On the other semicircle, drill a hole half way through (make sure to align the three holes two by two) of a diameter slightly smaller than that of the screw so that the screw self threads the wood. (To be safe try the drill on a waste piece of wood first.) Fit the two pieces together with the motor in between.
Step 3: Woodworking: Cutting, Shaping, Grooving (Part II)
Similarly the second motor has to be fitted into the base, but instead of concealing the entire motor only the bottom of the body will enter ( as shown in the picture).
Cut the block of wood along the width, 3.5 cm in from the length; sand to make even. Like before, outline the motor on both sides, but this time don't include the 'screw holders' on either sides. Again cover maximum surface with drilling, and continue to chiseling out the wood. Once you make sure that the motor fits in properly, using the screws provided with the motor, screw the motor in, joining the two pieces.
Grind the reaper to make a semicircle on one end with its width as its diameter.
Step 4: Woodworking: Assembly
Nail one of the horns (either six or four points, provided with the motors) onto the reaper, as shown. Then drill a hole of a diameter slightly bigger than that of the screw HEAD through the reaper for the screw (provided with the motor) that attaches the horn to the motor, so that the whole screw goes through the hole. Be careful not to drill the horn.
Do the same on the board. Nail the horn to the centre of the board and drill a hole for the screw.
Draw a 14cm diameter concentric circle on the board with a pencil. This marks the circle that the two cylinder halves have to cover. Outline their positions on the board, and mark two points where you will drill holes to screw the halves to the board. Mark the points first for the half with the motor keeping in mind that they should not interfere with the motor nor with the previous screws.
On the board drill the four holes through and through of a diameter slightly bigger than that of the screw. Using these holes as a guide, mark points on the halves where you will drill two holes halfway through of a diameter slightly smaller than that of the screw. On the half with the motors, drill the holes on the same side as the other screws so that none of the screws are visible from top (purely for aesthetics).
Screw the board to the motor in the base via the horn.
Next, screw the reaper on to the other motor (fitted in one half of the cylinder) via the horn. Attach it so that the 180 degrees motion of the servo is on the upper half, so that the reaper doesn't go below the horizontal plane.
Then screw the two halves onto the board.
Make sure you have fastened all the screws properly.
Step 5: Electronics: Wiring and Testing
Before wiring the components make sure the Arduino nor the power supply are powered. And before powering the servo motors, measure the power supply output voltage and check that it falls in the specified voltage range; crossing the range risks the motor's functionality.
Use long wires for the connections to the servos and LED as they will be moving around. I would recommend soldering so that the contact is solid.
Because you will be connecting multiple things to the 5V and ground, you might find it useful to use a breadboard/PCB to short multiple pins.
Now for connecting the motors to the Arduino board. Pair up the ground and power pins of both the motors using jumper wires and a breadboard/PCB. Connect the ground pin to the ground of the Arduino which should be connected to the negative of the power supply output. Connect the power pins to the positive of the power supply. Connect the signal pins of the motors to pins D9 and D10 respectively.
Test the motors individually using the sweep example in the servo library in Arduino, don't forget to change the signal pins. Again, before powering the motors check that the power supply is outputting an acceptable voltage. Clear your workspace before testing it as it may rotate violently.
Connect next the RGB LED to the Arduino with the following connections (if soldering make sure none of the legs are shorting):
Anode -> 5v
R -> D3
G -> D5
B -> D6
Test the LED's colours one by one using the fade example and replacing the pins in the code.
To control the motors, you need to use potentiometers as knobs. Connect one end of each potentiometer to the 5V of the board. Then connect both middle pins to an analog pin on the Arduino board (A0 and A1, do not use A4 and A5 as they will be used to read the accelerometer). And connect the other two pins to ground via the resistors. To make it convenient you can superglue them to a piece of wood to look like a small remote control.
Test that the knobs work by using the analogInput example. Take a note of the minimum and maximum values for both the potentiometers; in the final code replace 0 and 1023 (in the map function) with these values respectively.
Connect the accelerometer to the Arduino with the following connections (you can either solder it directly or connect via a breadboard) :
VCC -> 5V
GND -> Ground
SDA -> Analog 4 (or the SDA pin)
SCL -> Analog 5 (or the SCL pin)
For reference - https://learn.adafruit.com/adxl345-digital-acceler...
To test the accelerometer download the two libraries provided, unzip them in the libraries folder of Arduino folder (usually in Documents). Run the sensortest provide under Adafruit ADXL345 Library. Check the values in the serial monitor. (for any problems go through this https://learn.adafruit.com/adxl345-digital-accele... ) Again take a note of the minimum and maximum values for all three axes. If you have never worked with an accelerometer, it might take some time getting used. In the final code replace -1 and 1 (in the map function) with these values respectively.
You can later glue the accelerometer to a glove which you can wear to control the LED, so keep the necessary length of wire.
Verify that your circuit matches with the one provided in the picture above.
Stick the RGB LED to the end of the reaper, with any adhesive.
Step 6: Programming
These are the following relations between the interface and the bot.
Pot 1 -> Servo 1
Pot 2 -> Servo 2
Accelerometer X-axis -> R of LED
Accelerometer Y-axis -> G of LED
Accelerometer Z-axis -> B of LED
Download the code provided and make the necessary min/max changes.
If there are any problems isolate the components and test them individually to find the fault.
Step 7: Setup
Place the bot in a darkened setting, so that the only source of light will be the LED. Fasten the camera on to the tripod and make sure that it frames the entire range of motion of the bot. Start your long exposure shot when you're ready.
Unfortunately I do not have any pictures available as of now, once I get them I'll post them up.
We have a be nice policy.
Please be positive and constructive.