motion/vibration sensor with piezo

alexthefox

Senior Member
Hi everyone, i need help to do a piezo sensor. i will connect piezo to picaxe to know when some object move. i try to work with different motion sensor (like mercury sensor) but they dont work in every position. i check dog beeper, and they work in every position. i one one of it and i sow piezo. how can i connect to picaxe? is this diagram correct?
 

BeanieBots

Moderator
If that is just a simple piezo element, then you won't be able to simply connect it to a PICAXE. It will require a lot of electronics to convert the small signal produced into something a PICAXE can detect.
 

MFB

Senior Member
A more direct approach to detecting the motion would be to mount a 3-axis accelerometer on the host vehicle. These sensors are now relatively cheap and include all the signal conditioning required to connect directly to the analog inputs of a PICAXE (although it would be as well to include simple RC low-pass filters).

If you do not need to know the direction of movement, you could use an opamp to sum the three accelerometer outputs into one ADC input.
 

BeanieBots

Moderator
More than just a simple amplifier. You'll need a detector circuit as well.
Put your piezo output on a 'scope and have a look at the signal.
After you have determined amplitude and duration under the conditions you want to detect, you will then be a position to determine what circuitry is required to build a motion detector from it.
(assuming it's even possible. I've never heard of it being done).

Rather than spend a lot of time on pioneering new motion detection methods, why not treat yourself to a motion detector (ready built) and interface that to your PICAXE. Have a look at some the many robotics sites, there are many to choose from. I really don't think you will get very far using a peizo element.
 

alexthefox

Senior Member
More than just a simple amplifier. You'll need a detector circuit as well.
Put your piezo output on a 'scope and have a look at the signal.
After you have determined amplitude and duration under the conditions you want to detect, you will then be a position to determine what circuitry is required to build a motion detector from it.
(assuming it's even possible. I've never heard of it being done).

Rather than spend a lot of time on pioneering new motion detection methods, why not treat yourself to a motion detector (ready built) and interface that to your PICAXE. Have a look at some the many robotics sites, there are many to choose from. I really don't think you will get very far using a peizo element.
im looking to connect to scope, but, i you can see in other post, i cant programming 28x1 vA.2.
 

ciseco

Senior Member
Might 2 tilt switches work at 90 degrees to each other, then you detect a change in status?

My silly thought for the day :)

Miles
________
BMW V3 history
 
Last edited:

hippy

Ex-Staff (retired)
I'm not sure how a simple piezo detects motion but I'll accept it does. On top of needing a signal amplifier to detect low voltage changes there's also the problem that a direct strike on a piezo can create quite large voltages. Enough to light a LED ( thanks to Manuka I believe for that information which kept me amused for a while at the time ).

The real question is how to create a sensor which can detect any motion, presumably of any form and in any plane. I'd be interested to see how a piezo can achieve this because my thoughts are that it would require accelerometers or some sort of 'earth magnetic' change detector.

Simple mercury switches, balls in pyramids,etc, would detect some changes, particularly rotational ones, but not all. Maybe the motion is such that there always will be some particular type of motion that can be the trigger. I think we need more details on exacly what we are trying to detect.
 

alexthefox

Senior Member
i sw something i draw for arduino.
but enyway,
i have the sensor, for example on a window. if i tuch the window, with vibration i have the signal on. otherwie no.

i know there are lot of example in internet on arduino, piezo in parallel with resistor, one side on ground, other to adc in of arduino
 

hippy

Ex-Staff (retired)
Okay, a glass vibraton sensor considerably reduces the problem and I expect a piezo can do that job. It may need amplification or there may be piezos which put out enough voltage to not need that ...

http://mlab.taik.fi/paja/?p=24

It now really comes down to what the specification is of the piezo chosen. If it works on an Arduiono it probably works on a PICAXE though you may have to have some RC circuitry to extend signals which the faster Arduino can see but the PICAXE might miss.
 

alexthefox

Senior Member
Okay, a glass vibraton sensor considerably reduces the problem and I expect a piezo can do that job. It may need amplification or there may be piezos which put out enough voltage to not need that ...

http://mlab.taik.fi/paja/?p=24

It now really comes down to what the specification is of the piezo chosen. If it works on an Arduiono it probably works on a PICAXE though you may have to have some RC circuitry to extend signals which the faster Arduino can see but the PICAXE might miss.
thank for the link.
wht do you mean with "glss vibration ensor"? mercury switch?
 

alexthefox

Senior Member
ok sorry i understand about glss vibration ensor, but it will work only in some position. i try one of it, and it i with mechanical prt inside, and if you put in reverse poition it not work.
For this reson i ask bout piezo....
 

hippy

Ex-Staff (retired)
Can you explain exactly what it is you are trying to achieve, what it is you are trying to sense an occurrence of ?
 

alexthefox

Senior Member
Can you explain exactly what it is you are trying to achieve, what it is you are trying to sense an occurrence of ?
friend of mine ask if i can do dog beeper collar.
i did one of that with mechanic glass sensor, but it will work only in some position.
i open one of commercial dog beeper collar and saw the piezo, and it work in every position!
 

Rickharris

Senior Member
friend of mine ask if i can do dog beeper collar.
i did one of that with mechanic glass sensor, but it will work only in some position.
i open one of commercial dog beeper collar and saw the piezo, and it work in every position!
Are you sure it isn't an accelerometer
 

hippy

Ex-Staff (retired)
Is the piezo not an output device to beep when the dog moves off rather then the detector that it is doing ?
 

Rickharris

Senior Member
The problem I think we have is that the piezo is a very simple device - It can produce sound from an applied electrical signal and can produce a spike of electricity from a sharp shock - Gentle movement doesn't effect them

- There are many products that are packaged in a similiar round package - a gyro for model helicopters for example.
 

boriz

Senior Member
This circuit should get you moving in the right direction:


A piezo is very much like a capacitor. In the above circuit, R1 should be a preset POT included on the circuit board and should be adjusted to the point where the transistor just starts to conduct (the collector voltage just starts to drop from the +V rail voltage). A fixed resistor would be better, but that would require a particular transistor. Using the POT, you can adjust it for any transistor you have handy. C1 is a negative feedback capacitor, there to ‘roll off’ the frequency response, so that the sensor is less sensitive to higher frequencies. You don’t want it to respond to sounds do you? The value of C1 shown here is just a quick guess. Try different values until your sensor responds to vibration but not to sound.

The piezo disk will need a little mod. Glue one edge to your project (or window frame or dog), fix a bolt to the other edge like this:


The weight on the head of the bolt will cause a twisting or bending force depending on the direction of movement, but it will respond to movements in any direction.

Make sure that:
A) The edge you glue to the project is opposite from the bolt. In the above diagram, that would be near the point where the leads meet the piezo disk.
B) The rest of the disk (and the bolt) are not touching anything and are free to move/flex.
 
Last edited:

alexthefox

Senior Member
This circuit should get you moving in the right direction:


A piezo is very much like a capacitor. In the above circuit, R1 should be a preset POT included on the circuit board and should be adjusted to the point where the transistor just starts to conduct (the collector voltage just starts to drop from the +V rail voltage). A fixed resistor would be better, but that would require a particular transistor. Using the POT, you can adjust it for any transistor you have handy. C1 is a negative feedback capacitor, there to ‘roll off’ the frequency response, so that the sensor is less sensitive to higher frequencies. You don’t want it to respond to sounds do you? The value of C1 shown here is just a quick guess. Try different values until your sensor responds to vibration but not to sound.

The piezo disk will need a little mod. Glue one edge to your project (or window frame or dog), fix a bolt to the other edge like this:


The weight on the head of the bolt will cause a twisting or bending force depending on the direction of movement, but it will respond to movements in any direction.

Make sure that:
A) The edge you glue to the project is opposite from the bolt. In the above diagram, that would be near the point where the leads meet the piezo disk.
B) The rest of the disk (and the bolt) are not touching anything and are free to move/flex.
thank you. i will try to do what you show.
 

boriz

Senior Member
Ok. Try this:


I just tried it and it works for me. And it seems to need no roll-off. Prolly coz direct physical distortion of the transducer creates much more output than any sound could.

If you can’t get enough output from this for your project, use another transistor stage or an op-amp.

I’m not going to design this project for you. I’m just trying to help you get started.
 

Dippy

Moderator
I did a very similar circuit to Boriz's years ago, except I used an N chan MOSFET (ZVN something) and biased the gate with an LED+1M res. (Not all LEDs are sutiable, experimatation needed). The LED+1M povided a 'floppy' bias voltage so that the feeble piezo output comforatbaly took it over the gate threshold.
It worked well, and was very sensitive from 0oC to 50oC.
I may have included a zener I can't remember.

I used a different set up with the disk piezo as I needed a vertically biased vibration sensor to use on wooded steps. Overall it was pretty good and even a gentle step-up onto step triggered it, whereas sideways taps on edge of step (unless vigorous) were usually ignored.

PS: Boriz, do you say "prolly" when speaking to people? Do they roll their eyes when you say it? Are you hoping it will be put in the Dictionary?
 

alexthefox

Senior Member
Ok. Try this:


I just tried it and it works for me. And it seems to need no roll-off. Prolly coz direct physical distortion of the transducer creates much more output than any sound could.

If you can’t get enough output from this for your project, use another transistor stage or an op-amp.

I’m not going to design this project for you. I’m just trying to help you get started.
and i will to thank you for your help. i try to test it and write here the result asap.
 

Dippy

Moderator
Boriz: no bother at all. It just reminds me of a schoolfriend of mine who's Mum would roll her eyes when he said things like that.
He'd also say "skwill" for squirrel and "dorshter" for the town Dorchester.
We were 8 years old.
 

Rickharris

Senior Member
You can make a omni directional vibration sensor with very few componants as in the attached diagram.

The wire ring can be replaced by a metal tube and for very sensitive detection I have used guitar strings for the trembeler wire.
Code:
               |
weight o---------------------------------------
               |                                Trembeler wire
 
               Wire ring
 
Last edited:

lbenson

Senior Member
Is the point of the wire ring that a circuit is closed when the trembler wire touches it when vibration occurs?
 

hippy

Ex-Staff (retired)
Is the point of the wire ring that a circuit is closed when the trembler wire touches it when vibration occurs?
Exactly that. It's just a normally open switch. Movement of the wire makes it contact the ring which surrounds it thus closing the switch.

Hang a house brick on a bit of string from your hand and move your hand, the brick has a tendency to stay where it is, the string then becomes tilted and if you had a ring around it the string would touch the ring, switch closed. The further the ring is to the brick the more sensitive the switch becomes.

Note that you are detecting motion of the object at the opposite end of the weight and that's very sensitive with a small ring, you need a lot more force to move the weight itself. Also note there's no ring contact, 'switch closure' if you simply raise and lower your hand; it doesn't work in all planes.

The blinkybug and other whisker detectors are slightly different; they translate a touch at the extremity into an angular change at the bug end, equivalent to keeping your hand still and moving the brick in our example. The design to achieve the detection is the same. For blinkybug style robots not always a ring but two posts ( or an upside down U ) so it can detect if the wire is pushed left or right.
 
Last edited:

Mycroft2152

Senior Member
Hippy,

It is all the same basic normally open switch function. Whether a loop or a "U" shape is used for a contact, or the the long whisker moves due vibration or touch.

As I said in an earlier post, using a DC power jack make a good looking sensor.

Myc
 

eclectic

Moderator
Another possibility?

I've just “found” one of these in my junkbox:
http://www.rapidonline.com/Electronic-Components/Sensors/Tilt-Tip-Switches/Non-mercury-vibration-sensors/72379/kw/vibration


And remembered this thread:
http://www.picaxeforum.co.uk/showthread.php?t=2262&highlight=vibration+sensor

Use the sensor like the switch in manual 3, p25.

I've just modified Ylp's original program slightly
Code:
ContactOpen:
if pin0 = 1 then OPToggle
goto ContactOpen

ContactClosed:
if pin0 = 0 then OPToggle
goto ContactClosed

OPToggle:

high 1
pause 1000
low 1 
pause 1000

if pin0 = 1 then ContactClosed
goto ContactOpen
It works very well on breadboard.

e
 

Attachments

Top