My electronic drum kit's pads have the same type of piezo in an airtight cylinder. When the pad is hit, the pressure inside the cylinder increases and triggers the piezo, the "brains" then plays the sound associated with that sensor.
@davidbean58072 жыл бұрын
To increase sensitivity you can add a small neodymium to each side of the piezoelectric element. I have found it greatly improved the sensitivity.
@MarcdeVinck2 жыл бұрын
I did not know that. Thanks for the tip!
@davidbean58072 жыл бұрын
@@MarcdeVinck I may have missed you a bit. At the time I was trying this I was using the piezoelectric with the vibration sensor sketch and wiring. I am sorry. I didn't realize the two sketches and wiring were using different signal pins ex. Vibration sensor using pin 9 and Knock sensor using pin A0. Originally was working with vibration sensor module SW420 and wanted to try using a piezo instead to see if sensitivity would increase it didn't until I added the magnets on either side. I then decided to use the knock sketch and realized the difference in wiring and sketch's and realized it is not as effective using it as a knock sensor. Even playing with program sensitivity values didn't make much difference. Anyway I just wanted to clarify that I did make an error in my comment. Sorry.
@MarcdeVinck2 жыл бұрын
@@davidbean5807 No worries. I appreciate the explanation!
@mohgujai3 ай бұрын
Why do you need resistor across Ground and A0? I thought the Piezo just generates a voltage (no more than 5v) and then the aruidno should just read it?
@MarcdeVinck3 ай бұрын
To stop the pin from floating and giving random numbers.
@samidudigital275311 ай бұрын
So helpful , thank you very much
@CanalRenaultClio2 жыл бұрын
how about automotive knock sensor?
@MarcdeVinck2 жыл бұрын
Sadly I think I need that for my car! But in all seriousness, you could grab audio waveforms of your engine running and potentially find a "knock" in the audio spectrum.
@downeastlife64418 ай бұрын
Can anyone help me create something that detects hits but have it be about .5 inches and wireless and connect it to a phone app with flutter
@mindstormsnxtbuilder10 ай бұрын
Can i measure the amplitude using this element? Lets say im placing multiple piezo elements on a surface and hitting a certian point. Is there a way to tell which element gave the input with the highest amplitude?
@MarcdeVinck10 ай бұрын
Yes, that is possible. Just make sure your micro is fast and you can compare response times and amplitude.
@punkin3141594 жыл бұрын
Hi Marc, I followed your wiring and code, but I'm having trouble with the sensitivity. As I change the sensitivity it seems to go from not being able to sense, to being oversensitive and repeating "knock!" without interruption (no new input on the sensor). What could be going on?
@MarcdeVinck4 жыл бұрын
Sounds like you have a floating pin. Double check your resistor is wired properly and the correct value.
@punkin3141594 жыл бұрын
That was IT! Thank you. I should probably figure out how to solder so those tiny wires.
@pedrohenriqueborges50893 жыл бұрын
can i put it behind a door and receive its vibration? and why connect the resistor in parallel with the piezo?
@MarcdeVinck3 жыл бұрын
You could, bu it it would have to be hit to register a signal. If you want higher resolution you might want to consider an inexpensive accelerometer or IMU. For the resistor? The reason is to be able to filter out false positives by always having a path for the electricity to go instead of the analog pin floating when not in use.
@okekejeff1614 Жыл бұрын
Would there be any change when you add the piezoelectric vibration module to the sensor?
@MarcdeVinck Жыл бұрын
The sensor is a piezo? Not sure what you are asking?
@selinacervantes74074 жыл бұрын
Would someone be able to explain to me how the sensitivity works? I think I understand but I am not 100% sure? I understand that the lower the number on the code, the higher the sensitivity. From what I can understand from the code: when I hit the piezo it generates a voltage. The arduino detects that voltage. The sensitivity changes ONLY the response of the arduino? For example, if it is closer to 0, then the arduino will displace “knock” at a lower piezo voltage (assuming 0.1) compared to being set to 300 which requires the arduino to respond to a much higher voltage (assuming 5)? So the sensitivity does nothing to the piezo itself, just the reaction of the arduino to the amount of voltage released by the piezo?
@selinacervantes74074 жыл бұрын
I would also like to add a little note: when only using the LED pin and ground (red wire connected directly to LED) when the sensitivity was set to 0, the piezo would click at constant intervals and when it was set to 300 the clicking would stop. This is why I asked the question, is the arduino sending a base voltage through the piezo, and does that voltage change/have anything to do with the sensitivity?
@MarcdeVinck4 жыл бұрын
Yes, you have the basic concept correct. The piezo generates electricity (the piezo effect) when a mechanical force is applied. No power to the piezo is necessary. The sensitivity is the Arduino reacting via code to the amount of energy created by the force that is applied to the piezo.
@selinacervantes74074 жыл бұрын
@@MarcdeVinck ok, thank you so much for your reply!
@MarcdeVinck4 жыл бұрын
@@selinacervantes7407 No problem, glad I could help!
@4uidrum Жыл бұрын
Thank you for the video! Quick question: Sorry I'm new to electronics... what is the wattage and tolerance of the 1M resistor?
@MarcdeVinck Жыл бұрын
1/4W 1%, but any generic resistor should be fine.
@4uidrum Жыл бұрын
@@MarcdeVinck Thank you very much!
@jeffbowyer45763 жыл бұрын
In Arduino's IDE, "Examples 02. Digital toneKeyboard" requires 3x force sensing resistors. Can I use one of those force sensing resistors for this Knock Sensor project? If not, why not? Thanks for your guidance.
@MarcdeVinck3 жыл бұрын
That example uses a force sensing resistor (FSR). You could use it, but you would have to hit the actual sensor to get a signal, which is analog. A piezo can sense vibration from further away. They are are also less expensive. So, yes you can, but it's not ideal.
@fazrulislam50533 жыл бұрын
Can this sensor measure the vibration of machine? Like textile weaving,knitting machine..
@MarcdeVinck3 жыл бұрын
Possibly, but it depends on the amplitude and frequency. You can also use an accelerometer for higher frequency and lower amplitude situations, but again, it depends on a lot of factors, including the sensors durability in a high stress situation.
@fazrulislam50533 жыл бұрын
@@MarcdeVinck thanks for your kind reply! Bt i have question regarding this,' if we use piezoelectric vibration sensor then as controller which one we should use arduino or plc..which one more impactful and why?
@MarcdeVinck3 жыл бұрын
@@fazrulislam5053 It depends. Which Arduino? Which PIC? They run at different speeds depending on the board. Didn't use to be that way, but a lot has changed in the last 15+ years. I would choose the board that runs fast enough and you are familiar with programming.
@fazrulislam50533 жыл бұрын
@@MarcdeVinck arduino like arduino mega 2560 and PLC like ladder diagram(LD)/ladder logic!
@MarcdeVinck3 жыл бұрын
@@fazrulislam5053 Again, depends on what you are specifically measuring. You can use board, but I would try to connect with someone locally that can get you a better answer and see your specific needs.
@Masiyamusic2 жыл бұрын
can the arduino be set to switch the led off after a set time
@MarcdeVinck2 жыл бұрын
Yes! You can easily add a delay and then turn an LED on/off.
@Masiyamusic2 жыл бұрын
@@MarcdeVinck ok thanks i actually want to switch a siren or buzzer on for a set period , is there a way of doing that please?
@MarcdeVinck2 жыл бұрын
@@Masiyamusic You can easily do that by using a buzzer or speaker. Turn on (or play a tone) through the speaker when a knock is sensed, add a delay for as long as you want, then turn it off. It's an easy project! Good luck and have fun!
@ryanchan1835 Жыл бұрын
Does the piezos analogue output vary by how hard you knock it? Like would a harder knock cause a stronger electric pulse?
@MarcdeVinck Жыл бұрын
Yes! As a fun test you can hold a through hole LED to the (+) & (-) parts of the piezo and "flick" it with your finger. You will see a difference in the LEDs brightness based on how hard you "flick" it. And you will also most likely kill the LED, so use a spare one that you don't mind burning out.
@aarontaylor71503 жыл бұрын
Hi great video btw I have a question is there a way to program the Piezo with the Arduino to make direct contact with the Piezo not just vibration?
@MarcdeVinck3 жыл бұрын
The piezo is not programmed, it is just a "dumb"sensor, no specific electronics. You can make a capacitive touch sensor with Arduino. That would sense whenever a wire (or anything conductive) is touched. I have a video on that here - kzbin.info/www/bejne/kKLIcmR5hth0h68
@surendrajain67135 жыл бұрын
thanks very nice video
@MarcdeVinck5 жыл бұрын
Thank you!
@omarkhalaf97234 жыл бұрын
Can this knock sensor detect vibrations in the air or does it only detect sound waves through solid material?
@MarcdeVinck4 жыл бұрын
No, it won't detect vibrations in the air. For that I would recommend something similar to a speaker. When the speaker diaphragm moves it would generate and electrical current. You could also bounce a UV led off a very flexible surface and measure the movement (or reflectance), and that could give you an idea about air movment.
@omarkhalaf97234 жыл бұрын
@@MarcdeVinck thank you, that is actually a smart idea. I also found some sort of an intensity meter which I can use, along with some calculations, to detect the loudness of a sound in dB.
@MarcdeVinck4 жыл бұрын
@@omarkhalaf9723 Look up Arduino Decibel Meter, there are tons of resources. Also know that a microphone measures air movement. (basically what I was explaining by using a speaker)
@pavansachi81933 жыл бұрын
Great informative video. Hope you can help me. I have a sensitivity of 15 and tried upto 20. But output from piezo is very inconsistent. It registers a value above 20 after 3 to 4 clicks. So I can't get the toggle behavior. What's wrong?
@MarcdeVinck3 жыл бұрын
Not sure how you are calculating sensitivity. Might want to try something more binary. Piezo generate an analog electrical signal, you could sense any voltage over 0...or close to zero.
@jojolubid8217 Жыл бұрын
what are your codes
@MarcdeVinck Жыл бұрын
Watch the video! :) I go over it in detail, including where to find it.
@Sick19823 жыл бұрын
Nobody explains the 1M resistor and it's function in the circuit .. like what does it do .. why 1M .. what if we take another value ...
@MarcdeVinck3 жыл бұрын
The 1 mega ohm resistor limits the travel of almost all the electricity on the pin. It makes the pin very stable, with no fluctuating voltages, and therefore very sensitive to variations you can leverage via code.
@RicoNNect82nd4 жыл бұрын
Never get 0 out of it. Its always abput 70. after one knock, it holds about 200 for a certain time and slowly reduce itself back to 70
@MarcdeVinck4 жыл бұрын
Same piezo? And nothing else wired up? Sounds like a capacitor and/or a floating pin issue? What pin are you using? Same as the video example?
@RicoNNect82nd4 жыл бұрын
@@MarcdeVinck Already switched all components, same behavior. You think it's not soldered alright? Maybe some loose Parts? Yes, I use nearly the same build.
@MarcdeVinck4 жыл бұрын
@@RicoNNect82nd I can't say if it's a solder issue without seeing it. Not sure where you even have solder if you built it the same way?
@RicoNNect82nd4 жыл бұрын
@@MarcdeVinck I solderd it in the first place, without jumpwire before. The soldered places look clean so far. Want to try another input. Already swapped Arduino and Piezo and Inbetriebnahme resistors, same issue :/
@sumbo84524 жыл бұрын
Where is the code
@MarcdeVinck4 жыл бұрын
I go over where to find the code in the video -- kzbin.info/www/bejne/jmS7iYWQgqeDhZI
@richachauhan33193 жыл бұрын
can you please tell that If I want to connect more then 1 piezoelectric sensor to Arduino ..then How can I do it??
@MarcdeVinck3 жыл бұрын
You can connect as many sensors as you have available pins. But be aware that vibrations from one sensor could be read by other sensors. All you have to do is change the code to another pin and wire it up. Google it, there is code available online.