maybe this is common knowledge but I learned/saw something interesting today. I still don't fully understand it, but here is what I did:
I'd bought a 2N2222 transistor, and was unsure which end was emitter and which the collector. I don't know much about transistors, so I decided to just play with both options. So I set things up like this on my breadboard first:
battery + -> 200 Ohm R -> LED -> one random end of 2N2222 -> other end of 2N2222 -> battery GND
and from the base of 2N2222, I put a resistor (100 kiloOhm, thinking to limit the current)
from there I was ABOUT to connect a wire from this resistor's end when my finger accidentally touched the resistor (which at this point only had one end connected to the base of the transistor; the other end was just floating).
And every time I touched the resistor, the LED lit up!
it was pretty cool to see it. now trying to read up some theory, but wanted to report here first!
here are doubts that I hope to clarify:
1) why did this touch thing happen? it was like an Iphone screen-touch effect when it first happened... although I know iphone displays use capacitor-related stuff. it can't be magic/mistakes; human body conduction maybe, but current needs TWO endpoints to flow... can't put a full story together..
2) when I exactly reversed the transistor's collector-emitter order from the above test, the same effect still happened but the LED was lit much more dimly when I touched the floating resistor. assuming the other collector-emitter order was correct, why did the LED still light up at all in this reversed order case? and why dimmer?
3) and finally, is there a quick(er) way of knowing (without datasheet) which end is emitter, which the collector of a transistor like this? I believe there is supposed to be a diode effect happening between each end and the base, so perhaps I could test something related to the current direction?
Well done on spotting what happened and thinking about it, mainly correctly.
why did this touch thing happen?
You act as an antenna and inject a signal into the transistor. It's well known read this:-
when I exactly reversed the transistor's collector-emitter order
The transistor is a sandwich of an N layer of silicon then a P layer and finally another N layer (NPN transistor) so from a structure point of view it is symmetrical. However the geometry maximises the gain for one direction. That is why it worked but with lower gain.
is there a quick(er) way of knowing (without datasheet) which end is emitter, which the collector of a transistor like this?
From measuring the diodes in a junction you can't distinguish between collector and emitter. I built a transistor tester http://www.thebox.myzen.co.uk/Hardware/Transistor_Tester.html but you can get multi meters that do the same sort of thing.
Mike, just read your webpage. So it seems, as do Arduino inputs unless pulled-down or pulled-up, the human body is acting like an antenna and picking up signals from the air, but scientifically, what exactly is happening? What does "signals" mean... electrical interference but how exactly is that completing the circuit here? I'm only touching one end of the resistor (with my body closing that circuit to neither + nor GND), meaning the circuit is still floating, so what exactly is activating the transistor base to let current flow through the LED?
maybe I can use this technique for some interesting applications:
-as a very neat and comfortable pushbutton/sensing device
-a rough way to indicate/measure the presence/strength of signals in the environment
-maybe to measure some property (?) of the object touching the resistor
I used to test (reasonably high gain) transistors just using an old analog multimeter on a low resistance setting across the collector and emitter and then making a connection between the relevant connection and base with a damp finger. In this case my finger was the 100K resistor…
So it seems, as do Arduino inputs unless pulled-down or pulled-up, the human body is acting like an antenna and picking up signals from the air, but scientifically, what exactly is happening?
Scientifically, electromagnetic radiation is being converted to the flow of electrons by your body, the antenna in this case. The exact same thing happens in your cell phone, both in reception (electromagnetic radiation-->flow of electrons) and transmission (flow of electrons-->electromagnetic radiation).
I'm only touching one end of the resistor (with my body closing that circuit to neither + nor GND), meaning the circuit is still floating, so what exactly is activating the transistor base to let current flow through the LED?
Your cell phone is floating too! The electrons are activating the transistor base, and they are coming from your body, and they are coming from your body because of the electromagnetic radiation that is reaching you. In a purely electron-based circuit the concept of "floating" is important because it means there is no well-defined path for electrons to follow, but this is something else, it is a circuit with both an electron flow component and an electromagnetic radiation component. Basically, 3rd/4th year stuff in an Electrical Engineering university program, not something to be explained simply :) Look up "Maxwell's Laws" if you have a few weeks of free time for study.
The Gadget Shield: accelerometer, RGB LED, IR transmit/receive, speaker, microphone, light sensor, potentiometer, pushbuttons
I've been meaning to try this out but haven't yet...
Capacitive Sensing Library
The capSense library turns two or more Arduino pins into a capacitive sensor, which can sense the electrical capacitance of the human body. All the sensor setup requires is a medium to high value resistor and a piece of wire and a small (to large) piece of aluminum foil on the end. At its most sensitive, the sensor will start to sense a hand or body inches away from the sensor.
Scientifically, electromagnetic radiation is being converted to the flow of electrons by your body
A little experiment: If you have some way of connecting yourself to earth, hold onto the red probe of a multimeter, and attatch the other one to your earth connection. Set the multimeter to an AC range, and read the voltage!
I wrapped a legnth of wire around the cord for a lamp once, plugged the lamp in, and held onto the wire. (The cord was on the outside of the insulation - I wasn't trying to kill myself). When I turned the lamp on, held the red probe of the multimeter, and connected the black probe to earth, I managed to get 40V (AC) out of it!
In theory, you can put the probes any way round for this, without effecting the reading. This is because it is AC. If you have an oscilloscope, you can see that it is AC by connecting the scope where the meter was. You should see an imperfect sine wave.
Biocow, I have not tried the capacitive sensing library, but there is some fantastic code that I have tried out here: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1171076259. It will output a value to the serial monitor depending on the charging time for the capacitive sensor, which changes with distance.