#include <SoftwareSerial.h>
#define rxPin 2
SoftwareSerial serial(10, rxPin);
int analogPin = 3;
int val = 0;
void setup(){
serial.begin(9600); // setup serial
}
void loop(){
val = analogRead(analogPin); // read the input pin
serial.println(val); // debug value
}
So, opening the Arduino IDE serial monitor and setting 9600 as baud rate, the situation in front of us is the following one:
#include <SoftwareSerial.h>
#define rxPin 2
SoftwareSerial serial(10, rxPin);
int digitalPin = 3;
int val = 0;
void setup(){
serial.begin(9600); // setup serial
}
void loop(){
val = digitalRead(digitalPin); // read the input pin
serial.println(val); // debug value
}
After properly wiring the flow sensor to the oscilloscope, we tried to blow on it to see if at there were any kind of state changes on it while operating
What we were able to see was a steep change of tension as soon as the fan inside the sensor was moving.
The resulting current from the sensor was stable and precise, a behaviour that was totally expected since the it's its way of communicating a fluid passing through it.
As soon as the fan stopped moving, the oscilloscope once again reported a flat line of inactivity.