Issue with my analogic value

Hello everyone,

I am having a problem with the output value of my arduino mkr nb 1500 I am turning to you for advice or solutions.

Here are the details of my setup:

  • Arduino card: MKR NB 1500
  • Power supply used: PC (+ External battery)
  • Connected components: Microphone equipped with a pre-amp
  • Supply voltage: 5V

The problem I encounter is the following: My microphone is connected to port A0 of the arduino and then thanks to the maths, i determine the voltage and then htanks to the sensivity of the micro i have the SPL value but when i am wired to te PC + an external battery i have a value and then when i disconnect one the value drops despite the same noise.

If anyone has encountered this type of problem before or has any idea what could be causing this, I would appreciate any advice. All suggestions are welcome!

Thank you in advance for your help.

Interesting, sounds like a hardware problem. Post an annotated schematic showing exactly how you have wired it, include all power sources and links to technical information on each module. Show what battery you are using. If it is a 9v smoke alarm battery expect that to be the problem.

1 Like

what do you try to achieve?

If you have a multimeter, check to see if the 5V or 3.3V is changing. I don't know much about the MKR but the default analog reference is probably 3.3V.

1 Like

Hello everyone,

First, thank you for your answers.

-@intstarep: my goal is to acheive a sort of dB meter that sends a SMS by NB-IoT when the sound level pass a thereshold.

-@DVDdoug : yes i already checked and the value is always 3.3 V which is the reference (work) voltage.

thank you for answering my issue so there it is a schematics :

and i am using a 3pin micro with a pre-amplifier on it and a phone external battery related to the Vin port of the board.

You forgot the links.

What is this and post a link to its technical information.

I will take a SWAG and say your microphone board has a digital output but not an analog. Also the pot adjusts the threshold of the onboard OP-AMP/comparator allowing you to set a threshold level.

here it is the link for the the microphone + the amplifier : https://cdn.hackaday.io/files/1838017863741984/1815587.pdf

I didn't think like that i wil try putting on digital and see if i have better values

The Microphone you have and what you originally showed are completely different. It sounds feasible with what you have. Post that schematic, the pictures do not cut it. Also measure the voltages when it is connect up each way. Analog is very sensitive to supply voltages and noise.

I don't get you problem. If connected like you showed, just read out A1 and print it out to the console and open the serial plotter. Then you should see the waveform. Here freestyle without checkin:

int sensorPin = A1;    // select the input pin for the potentiometer
int sensorValue = 0;  // variable to store the value coming from the sensor

void setup() {
  Serial.begin(115200);
  delay(1500); // Wait for Serial Monitor to start
}

void loop() {
  // read the value from the sensor:
  sensorValue = analogRead(sensorPin);
  Serial.println(sensorValue);
  delay(5); // Bit hickup prevention, maybe not neccesary
}

If you start this and then ->Tools->Serial plotter
Make sure you switched the plotter to 115200 Baud or whatever you define in the code

What dou you see while you talking into the micro?

Thank you i have already found the problem, it was the micorphone which was not fully supply when it isn't supplied by 5V it sends wrong values