Use of pullup resistor with digital input from a module

Hi. I am new to arduino (and electronic projects in general). I have read a lot and have implemented several tutorial projects successfully. So I'm getting the hang of things. I designed a project that I am working on. It involves a sound sensor module (KY-038). It is a module with a microphone and 4 pins (Vcc, ground, analog out, and digital out). I'm using the digital output of the module to signal if a sound is detected or not. (The module outputs HIGH if sound level above the detection threshold and LOW it the sound level is below the threshold. All tutorials say to connect Vcc pin to +5v arduino pin, ground to arduino ground and digital output pin to one of the arduino digital pins. I connected it to D7 (which I have programmed pinMode (D7, INPUT) and I use a digitalRead (D7) to get the value from the sound module and use that value in my sketch to do various things. What I don't understand is that it is working fine with no pullup or pulldown resistors... I tried both INPUT and INPUT_PULLUP for D7 in my sketch and both ways it works... why is that? If the sound module is sending a LOW to D7, isn't that leaving D7 floating? Or am I misunderstanding something here? Also if in fact I should be using a pullup/pulldown/internal pullup resistor, how would the wiring schematic be? I totally understand how to use it with pushbutton but with the module (which takes ground and Vcc from arduino board and then outputs a digital signal to a digital pin on arduino), I'm a bit confused how and where to add the pullup/pulldown resistor. I would appreciate any help and any insight as to why my setup is actually working and not providing erratic behaviour on pin D7 (which I assume should be floating when the sound module isn't detecting sound above the threshold, correct? Thank you.

Here, have some of these: \n \n \n \n

Hi'

Hi.
I am new to arduino (and electronic projects in general).
I have read a lot and have implemented several tutorial projects successfully. So I'm getting the hang of things.
I designed a project that I am working on.
It involves a sound sensor module (KY-038).
It is a module with a microphone and 4 pins (Vcc, ground, analog out, and digital out).
I'm using the digital output of the module to signal if a sound is detected or not. (The module outputs HIGH if sound level above the detection threshold and LOW it the sound level is below the threshold.)
All tutorials say to connect Vcc pin to +5v arduino pin, ground to arduino ground and digital output pin to one of the arduino digital pins.
I connected it to D7 (which I have programmed pinMode (D7, INPUT) and I use a digitalRead (D7) to get the value from the sound module and use that value in my sketch to do various things.
What I don't understand is that it is working fine with no pullup or pulldown resistors... I tried both INPUT and INPUT_PULLUP for D7 in my sketch and both ways it works... why is that?
If the sound module is sending a LOW to D7, isn't that leaving D7 floating?
Or am I misunderstanding something here?
Also if in fact I should be using a pullup/pulldown/internal pullup resistor, how would the wiring schematic be?
I totally understand how to use it with pushbutton but with the module (which takes ground and Vcc from arduino board and then outputs a digital signal to a digital pin on arduino).
I'm a bit confused how and where to add the pullup/pulldown resistor.
I would appreciate any help and any insight as to why my setup is actually working and not providing erratic behaviour on pin D7 (which I assume should be floating when the sound module isn't detecting sound above the threshold, correct?
Thank you.

Sorry I had to edit your post, spreading and paragraphing makes it easier to read, and to get forum members to attempt to read.
You do not need a pullup resistor as one is already fitted on the sound detector PCB.


Tom... :slight_smile:

Thank you for your replies. Much appreciated.