Input Devices¶
Here is the group assignment for this week:
-
Probe an input device(s)โs analog levels and digital signals
-
Document your work to the group work page and reflect on your individual page what you learned.
For this week’s group assignment, we decided to try out the Sen-14262 sound sensor ๐.

The SEN-14262 sound sensor is a small module that detects sound in the environment. It works with a 3.3โ5V power supply and has five pins: VCC and GND for power, AUDIO for the raw sound signal, ENVELOPE for a smoother signal showing how loud the sound is, and GATE which turns HIGH when the sound crosses a certain level. It uses a microphone to pick up sound vibrations and convert them into electrical signals, allowing a microcontroller to detect both the presence and intensity of sound ๐.
Since the SEN14262 Sound Sensor can output both digital (gate) and analog (envelope) signals, we used a single program to read both values and observe the waveform on the oscilloscope.

Here is the code that we used:
/*
Displays Digital (Gate) and Analog (Envelope/Audio) values.
*/
const int digitalPin = 2; // Gate output
const int analogPin = A0; // Envelope or Audio output
void setup() {
Serial.begin(115200);
pinMode(digitalPin, INPUT);
Serial.println("Reading SparkFun Sound Detector...");
Serial.println("Format: DigitalValue , AnalogValue");
Serial.println("------------------------------------");
}
void loop() {
int digitalVal = digitalRead(digitalPin);
int analogVal = analogRead(analogPin);
Serial.print(digitalVal);
Serial.print(" , ");
Serial.println(analogVal);
delay(10);
}
This was the setup:

What is an Analog Signal?
An analog signal is a type of signal that changes smoothly and continuously over time, rather than switching between fixed values. It can represent real-world things like light, sound, or temperature by allowing any value within a range.

The AUDIO/ENVELOPE pin of the sound sensor was connected to the analog pin (A0) of the microcontroller using a jumper wire. The probe tip of the oscilloscope was placed on the AUDIO/ENVELOPE pin (the same line connected to A0), while the ground clip was connected to the circuitโs GND.
This allowed us to read the continuous voltage changes produced by the microphone and visualize the sound waveform on the oscilloscope.
What is a Digital Signal?
A digital signal is a type of signal that only has fixed values, usually just two (on or off). Instead of changing smoothly, it jumps between these set levels. This makes it very clear and reliable, which is why digital signals are used in computers and electronic devices. For example, a button being pressed or not pressed is a digital signal because it only has two states.

The GATE pin of the sound sensor was connected to a digital pin (D2) of the microcontroller using a jumper wire. To observe this signal, the oscilloscope probe tip was placed on the GATE pin (the same line connected to D2), while the ground clip was connected to the circuitโs GND to provide a common reference.
Unlike the analog signal, the GATE output only switches between two fixed voltage levels (Low and High) depending on whether the sound exceeds a certain threshold. Because of this sudden switching behavior, the signal appears as a square wave on the oscilloscope. This allowed us to clearly see when any kind of sound was detected, as the waveform jumps between on and off states instead of changing smoothly.
That is all for this week.