Good day everyone. I am quite new to the Arduino community and I was wondering if anyone would be able to assist me in a project that I am busy with.
What I have:
Arduino Uno R3,
Breadboard and a large range of resistors,
Piezo sensors (20mm)
Query:
I want to stick two piezo sensors to opposite sides of a concrete cube. After this an impact is imposed on one side of the cube and I want to determine the difference in arrival times for the two sensors ( If I impose impact on one side near the first sensor how long will it take to reach the sensor on the opposite side?)
I hooked up the leads from the sensors to the Arduino digital pins (the 1st sensor on the face of impact I connected to pin 5 and the sensor on the opposite side I connected to pin 3)
This will be tricky for a beginner! It will not be easy for an expert!
The vibration will travel through the concrete at a speed of around 3 to 4 kilometers per second, much faster than the speed of sound in air. The time difference between the signals from your two sensors will only be perhaps 20 or 30 microseconds. Getting an Uno to measure that time accurately would be very difficult. The standard micros() function is only accurate to around 4us, so that may not be good enough. Some use of the atmega328's timers and interrupt pins may be needed to get more accuracy.
Have you thought what accuracy you need, as a minimum?
Hi. Yes I get good readings from both sensors. Although the values are still in bits.
I attached a sample of the serial plotter. The blue line is for the sensor on the opposite face and the Red line for the sensor on the face where the impact is applied (I just tapped it with a hammer)
Hi. I am looking for an accuracy of about 0.5ųs
I know what might be stretching it a little!
My goal is to find a cheaper way of doing the UPV (Ultrasonic pulse Velocity) test. So, if I can get the time difference then I can work out the Velocity as V=0.1/t, where 0.1m is the distance travelled and t is the time in seconds. This will then give an indication of the Elastic Modulus of the Concrete. Thank you for your Reply PaulRB!
Hi. I can get access to an oscilloscope, but I would like to try and code it first, and as a last resort use the oscilloscope. The goal is to work out the Velocity at which the wave (due to a constant impact) would travel throught concrete. So, V=0.1/t , because the distance the wave travels is 0.1 m and then I just need the time. The time square and velocity then gives an indication of the Elastic modulus and Strength of the concrete sample. It is a modified UPV (Ultrasonic pulse Velocity) test
The very shortest time an Uno could possibly measure, by itself, would be 1/16M = 0.0625us, because of its 16MHz clock. So perhaps 0.5us is possible, but it is only 8 clock cycles! It will take some expert knowledge of the atmega328's timers and interrupts, beyond my expertise, but there are some forum members who know much more than me.
Uno/atmega328 has 2 hardware interrupt pins (2 & 3) so I would look at attaching your sensors to those to see if you can trigger them with the sensor.
Maybe try something like this to begin. It won't be good enough and may not even work at all!