Page 1 of 1

Piezo Sensor + Wifi + Database

Posted: Sun Dec 02, 2018 6:25 pm
by dewildequinten
Hi,

I'm starting a project where I want to
1: Read the analog input of vibrations of a Piezo Sensor almost continuously or at least every time the pressure is relevant (from a certain range), I have a voltage divider board and a resistor setup to avoid damaging the board. Though the code I'm using isn't working as expected...

[code]
from machine import ADC

adc = ADC(0) # create ADC object on ADC pin
adc.read() # read value, 0-1024
[/code]

I get [code]>>> 3[/code] all the times even with an other sensor (rain sensor)

2. I want that data send to a local network computer that can store the data that's been read. And I have no idea to approach this, php, firebase?? And having hard time finding stuff about this for micropython online. Our I'm not using the right search terms.

Any help would be kindly appreciated.

Re: Piezo Sensor + Wifi + Database

Posted: Sun Dec 02, 2018 7:39 pm
by Roberthh
We need a little bit more "flesh to the bones" to understand.
What do you expect and what do you get (You mention: 3)? How fast are the transitions you want to catch?
Which sensor are you using and how do you interface it to the board.
Which board are you using?
And, even it may not be important here, which version of the firmware are you using.

Re: Piezo Sensor + Wifi + Database

Posted: Sun Dec 02, 2018 7:45 pm
by kevinkk525
Can we remove the other duplicate thread?

Re: Piezo Sensor + Wifi + Database

Posted: Mon Dec 03, 2018 6:44 pm
by pythoncoder
Done.

Re: Piezo Sensor + Wifi + Database

Posted: Wed Dec 05, 2018 9:18 pm
by dewildequinten
<r><QUOTE author="Roberthh" post_id="32366" time="1543779551" user_id="601"><s>
Roberthh wrote:
Sun Dec 02, 2018 7:39 pm
</s>
We need a little bit more "flesh to the bones" to understand.<br/>
What do you expect and what do you get (You mention: 3)? How fast are the transitions you want to catch?<br/>
Which sensor are you using and how do you interface it to the board.<br/>
Which board are you using?<br/>
And, even it may not be important here, which version of the firmware are you using.
<e>
</e></QUOTE>

Yeah the "3" is a weird one but I keep getting three. I'm going to rewire everything and show the schematics of it. <br/>
The transitions should be "as fast as possible", I mean the more data it can collect the better but within the limits of the Wemos D1 mini.<br/>
<br/>
Firmware: <URL url="https://micropython-on-wemos-d1-mini.re ... <LINK_TEXT text="https://micropython-on-wemos-d1-mini.re ... setup.html">https://micropython-on-wemos-d1-mini.re ... TEXT></URL>
Is where I got the firmware from.

I'm reading the wemos with ampy.

I find it in general very hard to find an example that just reads a piezo (and shows which resistor to use to keep the voltage between 0-1v , or if I should use the ADS1115 to read the analog voltage) and if micropython is faster or better to acces a database then general c. So many variations on how to do it and none that shows me the specifics I need for my project. Or maybe i'm staring blind from all the searching ^^
</r>

Re: Piezo Sensor + Wifi + Database

Posted: Thu Dec 06, 2018 6:24 am
by Roberthh
Th eWemos D1 mini has a built-in resistor divider of 100k + 220k, which changes the analog range at the board level to 0-3.2V. This is intended as support for users, in your case it is bad. The impedance is way too low for a piezo sensor. You have either to use a buffer amplifier or remove the 100k resistor.

Re: Piezo Sensor + Wifi + Database

Posted: Fri Dec 07, 2018 6:45 am
by pythoncoder
I'm not familiar with piezo vibration sensors but, as @Roberthh says, piezoelectric devices are extremely high impedance. They can also produce high voltages. To interface one to an ADC there needs to be a DC bias so that the mean level is in the middle of the ADC range. I would also want to see voltage limiting to avoid the risk of damaging the ESP8266. A suitably designed amplifier/buffer is the answer (assuming the sensor doesn't have one built-in).

@dewildequinten Can you post a link to the sensor?

Re: Piezo Sensor + Wifi + Database

Posted: Mon Dec 10, 2018 10:24 pm
by dewildequinten
Hi this is the link for the piezo: https://www.rapidonline.com/RVFM-ABT-44 ... B#techSpec

Could you show me a diagram or schematic of what you main, because I don't really get what you are saying (language wise (i'm dutch)).