Very basic resistor/piezo question

Hi,

Sorry if this is too basic, I did some reading on wikipedia and couldn't find an answer that totally answered my question. I'm making a knock sensor and all the schematic show a 1 mOhm resistor in parallel to reduce the current/voltage coming into the pin. My question is: would wiring this in series not reduce the voltage? Is it in parallel in order to reduce the current?

Thanks, and again, sorry for the basic question. If anyone has a good source for beginners electronics help it would be greatly appreciated.

1 Like

1 milliohm (mOhm) or 1 megaohm (MOhm)? They're quite different.

The resistor is there to give a path for some of the energy to go, instead of just straight into an input pin.

Thanks for the quick reply.

MegaOhm, sorry, should have been clearer. Will wiring them in parallel not maintain the same voltage in each path while cutting the current (maybe that's the point)? I may be misunderstanding this...

With the resistor in parallel, you are creating a [u]voltage divider[/u] where one of the "resistors" is the internal resistance of the piezo device. Yes, that will reduce the voltage. Since the piezo (unlike most voltage sources) has high source-impedance, a high-value resistor in parallel will reduce the voltage.

A resistor in series with the Arduino input will also create a 3-way voltage divider where the voltage is divided between the piezo, the resistor, and the Arduino. However, since the Arduino has an input impedance of around 100M, almost all of the voltage will be "dropped" across the Arduino input, and the series resistor will have little effect.

Normally, you'd use two resistors to make a regular voltage divider and you could calculate the voltage drop. With the piezo as one of the "resistors", we don't know the internal impedance of the piezo, so we can't calculate the voltage drop. (I believe it's capacitive, rather than resistive.) But, if you want to experiment, a single parallel-resistor is fine.

BTW - You have an unknown and uncontrolled voltage which will go positive and negative. I'm not sure what voltage you are getting, but the Arduino is limited to 0-5V. Any negative signal, or any signal above 5V can damage the Arduino. So, I recommend that you use a pair of [u]protection diodes[/u].

Thanks very much, that's a really helpful explanation.

One last question: if I have the piezo oriented correctly, my understanding was that the resitor would remove the random variance and negative 'bouncing' voltage from the piezo and protect the arduino. Is this not the case?

With the resistor in parallel, you are creating a voltage divider where one of the "resistors" is the internal resistance of the piezo device. Yes, that will reduce the voltage. Since the piezo (unlike most voltage sources) has high source-impedance, a high-value resistor in parallel will reduce the voltage.

Piezo elements are perhaps more accurately though of as capacitors with a current source built in -
mechanical strain directly moves charges around in the material. They have very high DC
resistance (the value of which isn't really useful - their capacitance is more interesting). Adding
a parallel resistor creates a high-pass filter which eliminates DC offset and drift and creates
a signal that more represents velocity than displacement of the sensor - often more useful.

I have a slightly different take on this. First, 1Mohm is so large that, being in parallel
it's not gonna affect voltage or current very much - ie, almost like nothing there. However,
the purpose of the 1 Mohm is to discharge the piezo after the knock, as the piezo is
essentially a capacitor, and the Arduino pin input impedance is too large for this purpose.

Also, as others mentioned, you should probably add a zener across the piezo to protect
the Arduino pin from overvoltage. A good rap on a piezo can generate quite a few volts.
The 1 Mohm across the piezo isn't gonna protect the pin at all.

Both really helpful answers. Although, now I have more questions:

With the diode, the purpose it to prevent a negative current correct? How will this act to protect the pin in the case of a strong knock? Presumably if I am concerned about overloading the pin I would use a smaller resistor in the voltage divider (as you mentioned, with a 1 M resitor I'm effectively keeping the voltage the same)?

Sorry for the incessant questioning...

With the diode, the purpose it to prevent a negative current correct? How will this act to protect the pin in the case of a strong knock?

A zener will protect against both positive and negative voltages.

A regular diode only allows current to go in one direction, positive to negative. A zener diode behaves the same way, but also allows current to flow in the opposite direction when the voltage approaches its rated breakdown voltage. In the first diagram on DVDDoug's linked page that means that any positive voltage approaching 5V will start to conduct through the zener diode to GND. I use the word "approaches" because the breakdown voltage is not exactly the breakdown voltage, but rather it starts to conduct a little bit when you start getting close and then fully opens up as the voltage gets higher.

Not explicitly explained on that page is that the zener is a 5V zener. Zeners come in a wide array of breakdown voltages.

In the event of a negative voltage on the "in", the zener, behaving as a typical diode, will conduct from GND which has a relatively higher potential to the input. So for example, if the input is -10V and GND is 0V, you could look at it from the perspective of the input as 0V and GND as +10V. The diode conducts from the higher voltage to the lower voltage and zeroes out the input, protecting your analog pin.

So that protects you from a high voltage knock. If it's a high voltage and high current, well, everything blows up -- it's not a lightning rod ;). Fortunately the piezo doesn't generate much current so that's not a concern.

No need for a zener, the pin protection diodes provide adequate protection for the pins against the small current generated by the piezo, unless you plan to drop a 14 ton weight on it.

dc42:
No need for a zener, the pin protection diodes provide adequate protection for the pins against the small current generated by the piezo, unless you plan to drop a 14 ton weight on it.

This is definitely something for investigation. You're probably correct, but the voltages
generated by the piezo can be pretty high - 20V or so - even if the currents are low.
Got any idea acutually how low?

It's not the open-circuit voltage generated by the piezo that matters, what matters is how much current it can drive into the pin protection diodes. There is an Atmel application note that says the pin protection diodes are OK up to 2mA. This is equivalent to the piezo producing 2V when loaded with a 1K resistor.