So the only option I see is to make the switch closure cause an interrupt on your processor.
I believe that @steve_ra tested the interrupt approach in an earlier posting, and it did not solve the high press force issue.
This was in post #6.
So the only option I see is to make the switch closure cause an interrupt on your processor.
I believe that @steve_ra tested the interrupt approach in an earlier posting, and it did not solve the high press force issue.
This was in post #6.
I see that now. Thanks. But his mucking about with millis, etc. may have distorted the test.
Maybe it's faulty and OP should ask for a new one.
Leo..
I agree.
Paul, a diode will quash a spike into bump, been there done that and used the bump to gate NPN BJT with 5V 10mA to the emitter to fill a wire to an IO pin (prolly 2) and count the number of reads it takes to bleed the wire down to LOW.
Running 1 usec per loop eating 1 uAmp current per read (chip samples the hardware pin to binary with hysteresis pin state readable through the PINx register of the core.
Depending on how hard the tap, I was getting 1000's of loops when I hit the disk hard with a screwdriver handle hard enough to make the table jump. But generally less than 100 with a tap. I could have used a bigger resistance.
Beginners: Note the relation of real to data where HIGH stays HIGH until the pin goes LOW. Then LOW stays LOW until the pin goes HIGH. Voltage level between LOW and HIGH makes no change as to pin State. Only when V < 1.1 && V >= 2.8 (on Uno Rev 3) does the State change either way. 2V could be either depending on what limit was last set.
Arduino digitalRead() samples 1 uAmp of pin current per read. AFAIK it's the same with the ADC.
Arduino at startup modes IO pins INPUT LOW.
Hi,
Replace the Piezo switch with a normal switch/press button and see if the fault is still there.
Tom..
![]()
Thanks Tom,
I tried that and the code works fine.
That switch seems to be a product looking for a home. I wonder why it was ever produced and for what application.
They are used in wet environments because they have no moving parts and they are totally sealed. They can even work under water. They are also used where tamperproof is important. They work totally different from normal switches. I searched the internet for hours and I can't find anything on how to use them. Maybe the one I have is defective? I ordered a couple more from different suppliers. I want to use them just because I think it will make my project cool and different. However, I may have to just use normal push button switches.
I bought these almost two years ago. Use one to open my driveway gate. Has been exposed to rain, snow, hot sun and still works perfectly.
Okay, I broke down and ordered some of those.
Learn how the piezo disk which is used on acoustic musical instruments to get analog signal works. It will react to vibration.
This is the fidelity of piezo disk audio holds up under extreme amplification!
With hot glue, you can pot a circuit waterproof, or wire junctions waterproof. Just be sure to sink any heat outside of the glue. The disk attaches to whatever gets knocked on, inside ox the box, and turns that into AC on the leads.
But with 4 diodes that AC gets rectified to pulsing DC readable by 1 pin. Each knock will have bounce to it.
With Arduino a finger tap on a bare disk sets pinstate to 1.
I dunno about what that sensor vibrates, it could be why the OP has to hit it so hard. A DIY sensor might come in a small plastic or metal box that detects the slightest tap whether in atmosphere or hydrosphere.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.