H2S sensor: Difference between revisions
From wikiluntti
Line 33: | Line 33: | ||
Pins 33 and 32 have an analog to digital converter (ADC), which means that you can use analogRead (and adcToVoltage) to read the voltage on this pin. | Pins 33 and 32 have an analog to digital converter (ADC), which means that you can use analogRead (and adcToVoltage) to read the voltage on this pin. | ||
<syntaxhighlight lang="C"> | |||
// Sensor is connected to GPIO 33 | |||
const int Pin = 33; | |||
// variable for storing the potentiometer value | |||
int Value = 0; | |||
void setup() { | |||
Serial.begin(115200); | |||
delay(1000); | |||
} | |||
void loop() { | |||
// Reading the value | |||
Value = analogRead(Pin); | |||
Serial.println(Value); | |||
delay(100); | |||
} | |||
</syntaxhighlight> |
Latest revision as of 18:21, 10 March 2025
Introduction
Nice introductory tutorial from the manufacturer: https://community.dfrobot.com/makelog-315191.html
SEN0568 from DFROBOT based on MEMS technology.
https://wiki.dfrobot.com/SKU_SEN0568_Fermion_MEMS_H2S_Sensor_breakout
Connectors
3.3V - 5.0 V
Analog
Arduino
int sensorPin = A0;
int sensorValue = 0;
void setup(){
Serial.begin(9600);
}
void loop(){
sensorValue = analogRead(sensorPin);
Serial.println(sensorValue);
delay(100);
}
ESP32 Cansat NeXT
Pins 33 and 32 have an analog to digital converter (ADC), which means that you can use analogRead (and adcToVoltage) to read the voltage on this pin.
// Sensor is connected to GPIO 33
const int Pin = 33;
// variable for storing the potentiometer value
int Value = 0;
void setup() {
Serial.begin(115200);
delay(1000);
}
void loop() {
// Reading the value
Value = analogRead(Pin);
Serial.println(Value);
delay(100);
}