Prop "Secret agent palm scanner" (Capsense, LEDs, and 6v chime)

Hey guys and gals. I’m very new to the arduino world and am beginning to learn by completing projects. I am setting up a “Palm scanner” that has a sheet of aluminum foil as the capacitive sensor under a thin sheet of plastic. This will be used for kids to act like secret agents. I have the cap sense sketch set up and running well how I would like it but now how do I write the information that I have now to control the LED and 6v chime when a child places their hand on the plastic? Also circuitry set up help would be great. Very new to how electronics work in general. Any assistance with this project would be very appreciated!

Another project I am working on is using an IR emitter and Detector from radio shack. I’m clueless on this as well. Any set up information on how to turn these into an IR “tripwire” that would trigger a random red or green LED and a piezo would be awesome! Thanks again.

datasheet or link for IR stuff ?
Need a schematic of your palm scanner circuit. We don't generally work on high security palm scanners for children so we are fresh out of such schematics. You will have to provide a schematic if you want help with that.

Sorry about that. Attached are the backs of the packaging.

Would I use DigitalRead to read what the Capacitive sensor value is getting then DigitalWrite to set an LED and the buzzer? Or am I not understanding this correctly?

All I see is a photo diode and a piezo. I don't see any capacitive sensor. I don't know where you are getting that from but there is nothing about it in what you posted so I can't answer your question.

I believe he posted pics for the IR stuff? (I didnt check up close though.. was just off top of my head)

digitalRead will give you a 1 or 0.. (ie: on or off).. and not give you any 'range' of a value like an analogRead will..

Using an arduino UNO capacitive sensor is set up as aluminum foil wired from digital pin 8 through 100k resistor to pin 7. using the capsense example sketch I'm getting the serial monitor to show me 0 or 1 when the foil is not being touched and 50+ when I place my palm on it. What I'm trying to get to from there is have the arduino light up a green LED and sound a buzzer when the foil is touched.

raschemmel, I think you may have misunderstood me or I am not understanding you. It's not an actual palm scanner that I took apart and am trying to repurpose to make a prop. It's just aluminum foil, a sheet of plastic, the arduino and a wooden pedestal to encase it all so it looks like on elf those secret agent palm scanners to get access to a secret room sort of thing. So I don't have any other schematics other than those few wires and a resistor plugged into the arduino UNO. Sorry for the limited info

So I'm just going through the learning center checking things out and I just learned about "if else" statements so that solved my LED problem. I know that is extremely basic programming but I have no experience what so ever and I just started messing with this stuff last week so apologies for being such an amateur. So i guess now all I need with the "palm scanner" prop, is how do I set up a piezo like that with the arduino. I'll just use the same if else statement to activate it but I don't know enough about electronics yet to not accidentally draw too much power or something and fry it.

What is the purpose of A0 through A5 ?
What is the purpose of A0 through A5 ?

The Piezo rated voltage is 6V to 18V so it may not work at 5V.
It looks like the red and black go to +5V and gnd respectively and connecting the blue wire to GND turns on the piezo so if you connect the blue wire to a digital output and pull it LOW, it should turn on the piezo. You can test it by just connecting the blue wire to ground for a second. .

The photo diode needs 100 ohm current limiting resistor =>
P= I x E
P= 100 mW = 0.1W,
E = 5V
I = 0.1W/5V= 0.02A = 20mA
V (f) = 1.2V
E = I x R
E = 3.8V
I = 20mA
R =E/I = 5V /20mA = 5V /0.02A=250 ohms

Emitter (IR LED) Rated for 50mA @ 1.2V
5V-1.2V= 3.8V
R = 3.8V/0.05A=76 ohms
R = 75 to 82 ohms (100 ohms might work)

= I x 5V=> I = 0.1W /5V

Yikes. I love capacitive sensors, although my work with them has been done primarily with hardware. I'm working on something for another newbie, so don't lose patience.

You are on the right path. Sounds like you are reading this page:

Now it is just a matter of using that output to light the LED and buzz the buzzer while someone is holding their hand on the faux hand scanner.

The capacitorsensor library will give you a number. Lower if no hand, higher if a hand is there.

Pretty simple with If/Else, or maybe even just some true/false operations. Simpler with If/Then, if you are not familiar with boolean operations.


The physical setup includes a medium to high value (100 kilohm - 50 megohm) resistor between the send pin and the receive (sensor) pin. The receive pin is the sensor terminal. A wire connected to this pin with a piece of foil at the end makes a good sensor. For many applications, a more useful range of values is obtained if the sensor is covered with paper, plastic, or another insulating material, so that users do not actually touch the metal foil. Research has shown that a small capacitor (100 pF) or so from sensor pin to ground improves stability and repeatability.

When the send pin changes state, it will eventually change the state of the receive pin. The delay between the send pin changing and the receive pin changing is determined by an RC time constant, defined by R * C, where R is the value of the resistor and C is the capacitance at the receive pin, plus any other capacitance (e.g. human body interaction) present at the sensor (receive) pin. Adding small capacitor (20 - 400 pF) in parallel with the body capacitance, is highly desirable too, as it stabilizes the sensed readings.


Library Methods

The library contains three main methods and some utility methods:

CapacitiveSensor CapacitiveSensor(byte sendPin, byte receivePin)

CapacitiveSensor creates an instance of the library (please note the capital letters, this is not the same method as below)

long capacitiveSensorRaw(byte samples)

capacitiveSensorRaw requires one parameter, samples, and returns a long integer containing the absolute capacitance, in arbitrary units. The samples parameter can be used to increase the returned resolution, at the expense of slower performance. The returned value is not averaged over the number of samples, and the total value is reported.

capacitiveSensorRaw will return -2 if the capacitance value exceeds the value of CS_Timeout_Millis (in milliseconds). The default value for CS_Timeout_Millis 2000 milliseconds (2 seconds).

long capacitiveSensor(byte samples)

capacitiveSensor requires one parameter, samples, and returns a long containing the added (sensed) capacitance, in arbitrary units. capacitiveSensor keeps track of the lowest baseline (unsensed) capacitance, and subtracts that from the sensed capacitance, so it should report a low value in the unsensed condition.

The baseline is value is re-calibrated at intervals determined by CS_Autocal_Millis. The default value is 200000 milliseconds (20 seconds). This re-calibration may be turned off by setting CS_Autocal_Millis to a high value with the set_CS_AutocaL_Millis() method.

void set_CS_Timeout_Millis(unsigned long timeout_millis);

The set_CS_Timeout_Millis method may be used to set the CS_Timeout_Millis value, which determines how long the method will take to timeout, if the receive (sense) pin fails to toggle in the same direction as the send pin. A timeout is neccessary because a while loop will lock-up a sketch unless a timeout is provided. CS_Timeout_Millis' default value is 2000 milliseconds (2 seconds).

void reset_CS_AutoCal()

reset_CS_AutoCal may be used to force an immediate calibration of capacitiveSensor function.

void set_CS_AutocaL_Millis(unsigned long autoCal_millis)

The method set_CS_AutocaL_Millis(unsigned long autoCal_millis) may be used to set the timeout interval of the capacitiveSensor function. Re-calibration may be turned off by using set_CS_AutocaL_Millis to set CS_AutocaL_Millis to "0xFFFFFFFF".


Resistor Choice

Here are some guidelines for resistors but be sure to experiment for a desired response.

Use a 1 megohm resistor (or less maybe) for absolute touch to activate.
With a 10 megohm resistor the sensor will start to respond 4-6 inches away.
With a 40 megohm resistor the sensor will start to respond 12-24 inches away (dependent on the foil size). Common resistor sizes usually end at 10 megohm so you may have to solder four 10 megohm resistors end to end.
One tradeoff with larger resistors is that the sensor's increased sensitivity means that it is slower. Also if the sensor is exposed metal, it is possible that the send pin will never be able to force a change in the receive (sensor) pin, and the sensor will timeout.
Also experiment with small capacitors (100 pF - .01 uF) to ground, on the sense pin. They improve stability of the sensor.
Note that the hardware can be set up with one sPin and several resistors and rPin's for calls to various capacitive sensors. See the example sketch.