In the almost illegible Arduino Projects Book that comes with the Arduino Starter Kit, if you use strong reading glasses, a magnifying glass and a bright light, you should just be able to see at the end of the description of Project 1 (it's on page 30) that one of the suggestions for further experimenting is to make a switch with two pieces of foil and a bit of wire.
Has anybody been able to make a switch like this? I can see a “switch” being made of two pieces of wire – just touch the ends together – but how would one make a switch with wire and silver foil?
I used to make aluminium foil switches to fire a flashgun using a 35mm slide frame with foil taped or glued to each side of the frame and a wire connected by croc-clip to each side.
An air gun pellet shot through the centre would cause a short between two sides and fire the flash.
Thanks for your reply. It sounds very ingenious, and I will definitely bear it in mind for future photographic projects when I want to take some of those high-speed flash pictures that you see from time to time.
However, for the moment I am just thinking of a simple switch (nothing as dramatic as an airgun!) on a breadboard and using Arduino's 5V power from a USB.
then the AVR will supply the pin 5V through a 20+K internal resistor. The pin reads HIGH until grounded, all the switch needs to do is ground the low-current pin.
I found that paper clips are good to hold wire and foil together when I made capacitive sensors.
2 pieces of semi ridged thin plastic (cheap plastic binder) glue foil to one side of each piece of plastic. glue very thin insulators about every 2 inchs on the foil side of one sheet then tape a bare wire end to the foil. Tape a bare wire end to the other sheet in roughly the same place then put the sheets so the foil sides face each other. The sheets should now have a tiny gap between them due to the insulators and the taped wire ends should be separated by the tape. place under door mat and connect to door bell. (arduino in this case).
when someone steps on the mat the plastic will deform causing the foil sheets to make contact thus causing the door bell to ring.
How about make a switch by attaching absolutely nothing to the Arduino?
I sometimes use this when I want to give input to a sketch and don't want to hook up a switch or any wires (am I too lazy?). Just touch the Arduino or ATmega pin. It is fun to experiment with, and useful. You can run a wire to a piece of foil or a coin to make a button. http://playground.arduino.cc/Code/ADCTouch
then the AVR will supply the pin 5V through a 20+K internal resistor. The pin reads HIGH until grounded, all the switch needs to do is ground the low-current pin."
I'll make a note of it for future use. However, for the moment it's beyond the level of skill assumed after only Proect 1 in the Projects Book.
dmjlambert:
How about make a switch by attaching absolutely nothing to the Arduino?
I sometimes use this when I want to give input to a sketch and don't want to hook up a switch or any wires (am I too lazy?). Just touch the Arduino or ATmega pin. It is fun to experiment with, and useful. You can run a wire to a piece of foil or a coin to make a button. Arduino Playground - HomePage
This sounds interesting, but again perhaps not quite for directly after only Project 1 in the book. I'm going to remember the idea about taking wires to some foil or a coin. Thanks.
then the AVR will supply the pin 5V through a 20+K internal resistor. The pin reads HIGH until grounded, all the switch needs to do is ground the low-current pin."
I'll make a note of it for future use. However, for the moment it's beyond the level of skill assumed after only Proect 1 in the Projects Book.
I promise you are ready for this. It will save you a resistor for every button/switch and no need to figure out where the power will come from.
The big important part is that when you read LOW, the button is pressed. And that is all besides less to wire up. Learn the easier way while you're learning anyway, and you will save time and parts.
I don't use buttons to test my button code. I use a jumper that I ground on the USB port housing. The INPUT_PULLUP pin cannot supply enough current to make trouble there.
It's not like I ask you to debounce buttons yet, but remember that word debounce for later when your code gets fast enough to notice contact bounce.
It measures capacitance which does change when yours couples with that of the pin.
Instead of sticking a pin in the hole I have found that a capacitor (10 MF) with one lead in the hole and the other out also works, but it works better with a foil for surface area button on the end.
GoForSmoke:
I promise you are ready for this. It will save you a resistor for every button/switch and no need to figure out where the power will come from.
Don't forget that by page 30 of the book the word "code" hasn't been mentioned yet. When I hear "code" I think of the morse code (which I am in the process of re/learning), however I understand "code" in this context to refer to some kind of computer instruction - I'm getting there!
There is a lot of background to cover for new to all of it people. There's things you know and things you don't and it is best to get filled in before getting ambitious.
GoForSmoke:
There is a lot of background to cover for new to all of it people. There's things you know and things you don't and it is best to get filled in before getting ambitious.