This Instructable combines Arduino programming, some simple electronics, carving with hand and power tools, mechanical control and a bit of woodwork. Apart from the Arduino and a few components it is mostly made from reclaimed materials.
I am rather pleased with it.
What's in this instructable
I have included the main circuit and controlling Arduino programme (the sketch), and issues that arose, but I have also tried as much detail of the other (physical) making processes involved, so hopefully some of that stuff may be useful if you are building something in a similar way.
This project includes:
- the Arduino details, such as type of board, file type, the full Arduino sketch that controls the head, etc., and acknowledgement of included code such as the servo.h library.
- how the eyeballs and sockets were developed using prototypes, their construction from roll-on deodorants and the mechanism that controls them
- how the wooden head was developed using crude rapid-prototyping in polystyrene laminate sheets and how they were then used as templates to transfer the 3-d design to MDF boards and create the final casing
- the carving methods using hand and domestic power tools
- some discussion of the use of domestic materials such as garden wire and recycled objects to save on costs
- testing various LEDs for eyeball lamps and overcoming the power limitations of Arduino outputs using a simple transistor amplifier circuit
- more detailed discussion of the Arduino code and how it works to manipulate and translate analog inputs to the positioning servos and eyeball lamps
- details of the construction of the wooden base unit and controls, some simple boxmaking and woodturning without a lathe
- how a plastic power supply was converted into a wooden supply
- handy tips that might be worth considering in similar projects
There is also a lot of further information about this and other things on my blog: "Making weird stuff"
Remove these ads by
Signing UpStep 1: Arduino topics covered in this Instructable (inc. the Arduino Sketch)
http://arduino.cc/en/Main/arduinoBoardUno
I have tried to include the nitty-gritty issues that arose in practice. This project addressed two main Arduino challenges:
- Servo control - how to use Arduino scripts to convert a physical input into something that will mechanically control the position of a physical object in 2 dimensions (eyeballs!)
- A simple lamp circuit - how to get Arduino to convert the signal from an input and make it turn a light on and adjust its brightness (dimming)
The servo scripting is based upon 'Servo.h - interrupt-driven Servo library for Arduino using 16 bit timers- Version 2'
by Michael Margolis. Respect!
http://code.google.com/p/arduino/source/browse/trunk/libraries/Servo/Servo.h?r=1088
The complete Arduino sketch is included here for reference. It went through 10 versions to get to this.
There is nothing very sophisticated. The script comments explain what it's doing.
In later steps in this Instructable, I have added extra expanded comments about the code within the context of specific steps (e.g. for the servo controls for the eyeballs)
This is an ".ino" sketch. This is a later Arduino format. It started out as a ".pde"
/*
Lamp head - arduino sketch to control a remote control reading lamp head
Andrew Lewis January 2012
This code is in the public domain.
The servo scripting is based upon Servo.h - Interrupt driven Servo library for Arduino using 16 bit timers- Version 2 by Michael Margolis. Respect!
// http://code.google.com/p/arduino/source/browse/trunk/libraries/Servo/Servo.h?r=1088
Version 10
This version uses three potentiometers (pots) as inputs wired across the voltage rails (varying from 0 to 5V).
The variable output voltage of each seperately controlling 2 servos and 2 LEDs (operating as a pair)
The voltage is read by the arduino by 3 analog inputs (1 per pot)
The outputs from the Arduino to the servos are from digital pins, which use pulse modulation to control the voltage output.
The power supply is a standard 5V, 2A unit. It needs to have this amount of current to power the servos and high-power LEDs
*/
// @@@@@@@ DEFINE LAMPS @@@@@@@
// set Lamp pin numbers
const int lampPin = 5; // declares the ANALOG INPUT pin number for signal - IN
const int ledPinEyes = 3; // the number of the LED OUTPUT pin for the eyeball LEDs - OUT
int valLamp=0; // variable to read analog input from switch to set off lights
// @@@@@@@ END LAMPS @@@@@@@
// @@@@@@@ DEFINE SERVOS @@@@@@@
#include <Servo.h> // includes standard arduino servo class
int delay_val = 5; // assigns the servo increment lag (delay between applying values) for both servos
// @@@@ SERVO 1 @@@@
Servo myservo; // create servo object to control a servo
const int potPin1 = 0; // declares which analog pin is used to connect the analogue variable voltage output from potentiometer 1 (controls servo 1)
int valPot1; // variable to read the value from the analog pin for servo 1
// @@@@ END SERVO 1 @@@@
// @@@@ SERVO 2 @@@@
Servo myservo2; // create second servo object to control a second servo
const int potPin2 = 1; // declares which analog pin is used to connect the analogue variable voltage output from potentiometer 2 (controls servo 2)
int valPot2; // variable to read the value from the analog pin for servo 2
// @@@@ END SERVO 1 @@@@
// @@@@@@@ SERVOS @@@@@@@
void setup() {
//pinMode (lampPin,INPUT); // sets up digital pin as an input for ON/OFF LED input signal (for eyes)
pinMode (ledPinEyes, OUTPUT);// this is the output that turns the lamps on or off
// attach servos
myservo.attach(5); // attaches the servo on pin 5 to the servo object
myservo2.attach(9); // attaches second servo to pin 9 to second servo object
}
void loop(){
lampCheck();// check lamp INPUT and adjust brightness
servoCheck(); // check for servo inputs and adjust position accordingly
}
void servoCheck() {
// servo controls @@@@@@@@@@@@@@@@@@@@@
// Servo 1 -------------
valPot1 = analogRead(potPin1); // reads the value of the potentiometer (value between 0 and 1023)
// digitalWrite (ledPinJoystick,HIGH);
valPot1 = map(valPot1, 50, 1000, 0, 179); // scale it to use it with the servo (value between 0 and 180)
myservo.write(valPot1); // sets the servo position according to the scaled value
// delay(delay_val);
// ------------ servo 1 end
// servo 2 ------------------------
valPot2 = analogRead(potPin2); // reads the value of the potentiometer (value between 0 and 1023)
// digitalWrite (ledPinJoystick,HIGH);
valPot2 = map(valPot2, 50, 1000, 179, 0); // scale it to use it with the servo (value between 0 and 180)
myservo2.write(valPot2); // sets the servo position according to the scaled value
// delay(delay_val);
// ------------ servo 2 end
// end servo controls @@@@@@@@@@@@@@@@@@@@@@ */
}
// lamp functions @@@@@@@@@@@@@@@@@@@@@@ */
void lampCheck() {
valLamp=analogRead(lampPin);
valLamp = map(valLamp, 20, 1023, 0, 255); // scale it to use it with the servo (value between 0 and 180)
valLamp = constrain (valLamp, 0,255);
analogWrite (ledPinEyes,valLamp);
}



















































Visit Our Store »
Go Pro Today »




great project:]]]
What is your concern about the power adapter being dangerous?
your right to think about the risks when hacking kit, but I think we're safe here.
I'm pretty relaxed that the wood won't catch fire. The plug is oak, and that wouldn't easily catch from a lit match, let alone a spark.
The sawdust on the cable might appear more risky - sawdust can smoulder and catch if it gets a decent spark on it. However, here it is encased in latex, and is not actually exposed to the air, nor any spark diectly, so it is protected.
Effectively, the sawdust is sealed off from the risk of any spark and latex doesn't catch fire from a spark.
So, I think there is no more risk of this catching from a spark than the original plastic (which actually can burn but doesn't catch from a spark).
Having said all that, you are right to check and glad you liked it. I had such a laugh making it!
It doesn't look like you're using a switching step-down converter to power your LED, so the voltage across the LED should be around 3.3v rather than 5v in your power/current calculations.
you state resistance = voltage/power, should be resistance = voltage/current
then your units are wrong in the next line. Should be 5V/0.6A not 5V/0.6V.
Thanks for spotting this.
You are undoubtedly right about the LED. I have to say, it's 25 years since I studied electronics. I have also not accounted for the small voltage drop across an LED either.
I have to say, I generally go for as close as I can to accurate, and if it works, just get happy like a dog with a bone. Not very scientific I concede :)
Anyway, thanks again for this. I have amended the unit typo accordingly
Also, specifically when dealing with LED's (especially power,) you should run each of them with a series resistor, rather than one for the pair. Running well below their rated current it doesn't matter so much, but if you wanted to push these, you'd be best off using a power transistor or FET with the emitter/source tied to ground, then two resistors (about 2 ohms each) to the collector/drain, then connect one LED cathode to each resistor and the anodes to +5v. The LED's would need sizeable heatsinks, and you'd need to use 2+ watt resistors in this configuration though.
It seems to be perfect for this...
I toyed with doing thinner layers, but didn't have the laser cutting kit, so it would have had to have been by hand. I also like the carving process so I deliberately only used the layer sample as a general aide/guide, not a definitive copy. I like the idea that in theory I could make anothercopy from the original templates, but it would be subtly different, because it is then hand finished.
I'm off now to patch them for that. It's really great. It deserves credit
Thanks for sending the link
glad it was helpful. I struggled with this in a few prototypes, so if you don't have too, then that's a bonus.
The make of deodorant probably doesn't matter too much. i suspect they are all made by one big factory with different labels. I tried several (just because I had a few I had collected over time) and they all worked the same. I suspect, just cheapest supermarket own brand is fine. Just use two of the same make, so they match.
Photos are here:
http://www.flickr.com/photos/rosemarybeetle/sets/72157627007433214/
some are already in Step 8 of this instructable but there are a few extra ones. For the wire and servo, think of an old steam train wheel with the drive rod, but in reverse - It needs to transfer the rotary action to up/down:
http://www.flickr.com/photos/rosemarybeetle/6133065281/in/set-72157627007433214
Hope it all goes well
The eyes would go well in something like this http://www.youtube.com/watch?NR=1&feature=endscreen&v=Q0lecWPcMU4
Maybe next time.
I guess that's a fair point! Sorry to dissapoint. This was a first attempt, so I deliberately tried not to push it to far.
Since completing this one, I have had been pondering mouth controls - some sort of sound to motion controls which move the lips etc based on sound. I've done it with Flash before, but not physically.
. For outputs, it would need the basic mouth shapes to be worked out and then made possible with controls, and for the inputs, I was wondering if it could be driven by the audio out from any iPod/mp3 player, etc. It would be funny to have a head that detected the voice part of a song, and "sang along". It would, of course need to do so in a slightly bizarre and unsettling way :)
I need to lie down and rest before I start that one though!
http://www.flickr.com/photos/rosemarybeetle/3293092574/
Yes I did. The chips tasted even better than they look - yum
and, yes - that is me with long hair sticking out of half a very large bird. It was the nineties though, not seventies
A shot of how that was set up showing retro-tech (even in the 1990s, this was way old kit!!)
it's an alien invasion.
nice build!
personally, I have one eye which is almost blind and the other compensates it by being close to perfect. If I would only be able to see with my bad eye, I could still defy a talking head with glowing eyes (and a talking mouth), which is always fun to watch, so I would buy it ;-)
http://en.wikipedia.org/wiki/Vladimir_Putin
Thanks
I'm glad you like the vid. I thought it was the fastest to give an idea of the entire process (even though I does miss out a few bits!)
Tweeting very much appreciated. Thanks you
If anyone goes off and enjoys making weird heads or anything else after reading it, then I'm happy!!
Good luck with any you build!
I wish you luck
I appreciate the very kind words. It did take a long time, but it was great fun to make.
I tried to make it as easy as possible to follow what I did, and highlight the challenges it raised and any solutions I managed to find, so I am really glad you liked it. Makes it all worthwhile!
Thanks very much
Next you need to add ultrasonic range finders so that the eyes automatically follow close or moving objects!
Best Wishes.
Great idea though!
you worked so hard on it, so much of work, hell amount of work man.
Great ! you must be very Energetic person.
now all you need is to build a small Egyptian Pyramid and leave your Ancient Robot beside it :)
Quite a few very enjoyable challenges in this project, which have indeed kept me busy. Hmm, pyramid...interesting...
Cheers