Your Grove sensor gives readings in dB. Your phone gives readings in dBA. Google tells us: What Is the difference between dB and dBA? dB sound pressure levels are unweighted. dBA levels are "A" weighted according to the weighting curves to approximate the way the human ear hears. For example, a 100 dB level at 100 Hz will be perceived to have a loudness equal to only 80 dB at 1000 Hz.
So, you are not comparing apple and apples. You will need to use a real dB meter for calibration.
Paul
Yes, I know, I need to compare comparable things. But not my point though, I just put the reading from my phone as a reference, not because I want to get that value directly out of the sensor reading.
I still don’t get why the sensor is not giving a reading between 0 and 1024. In the example at SeeedStudio page, these seems to be the values.
I could map this in the code, but I want to understand why is giving those values.
I understand that there could be different reasons, and I have tried several of those routes.
faulty batch | unlikely
I have tried two sensors, from different kits, bought at different times. The results are the same.
different specification | unlikely
It is the v1.6 of the sensor, the same one that SeeedStudio shows
issue with your code | unlikely
I have tried different approaches, including the Calibration example provided with the Arduino IDE.
The code below gives readings of ~0-14 when quiet and ~100-200 when clapping in front of the mic.
// test code for Grove - Sound Sensor
// loovee @ 2016-8-30
const int pinAdc = A0;
void setup()
{
Serial.begin(9600);
//Serial.println("Grove - Sound Sensor Test...");
}
void loop()
{
long sum = 0;
for(int i=0; i<32; i++)
{
sum += analogRead(pinAdc);
}
sum >>= 5;
Serial.println(sum);
delay(10);
}
some step I am misinterpreting | unlikely, but…
I am expecting the analogRead to be 0-1023. I tried changing the analogReadResolution() value as explained, because I am using a MKR 1010, but it's also not giving reasonable values.