ArduinoGeneral

DFR0034 vs SEN0232

userHead Account cancelled 2019-07-30 13:22:56 1191 Views1 Replies
Hi Folks,

I started with the SEN0232 and it works great! I used the following code:
Code: Select all
static float getNoiseLevel() {
    float voltageValue,dbValue;
    voltageValue = analogRead(SOUND_SENSOR_PIN) / 1024.0 * VREF;
    dbValue = voltageValue * 15.0;
    return dbValue;
}
This module is a little bulky, so I picked up a DFR0034, I tried copying the sample code provided, but all I get is 0 back. If I jiggle the unit a bit it I still get nothing, but eventually it gived a value like 5000+
I'm using the same analog port for both units (one at a time) so I'm pretty sure I'm using the right pin.

I tried powering it with 3.3v out of an ESP32 or a 5v but still no luck.

Are there any other code examples ?
any way I can test it ?