Special Characters LCD Ultrasonic Sensor Widget

NO, I made a hole in the grid and fixed the sensor so that when the lid is lowered the sensor ends in the hole so it does not blink on the grid but only on the fuel.
I did go test:

  • Near empty tank (correct reading)
  • Serbatio more than 50% (correct reading)
  • Almost full servo (incorrect reading is not accurate)

the third case should be in theory the easiest to interpose for the sensor

OK, that sounds like it is getting too many reflections then… I wonder if lower frequency of reading and/or averaging might help?

the value to change the 1000 ???

long duration = pulseIn( echoPort, HIGH , 10000 ); // 10000 µS = max circa 1,7 metri
  r = 0.034 * duration / 2;

I am unsure of how to change the actual sensor function… I was referring to the frequency of your timed reading… at least I thought you were taking pulsed readings using a timer?

I only use this on my bench as a part of a whole test setup for trying and learning with Blynk… I use a timer to read my ultrasonic sensor every second, and it has been accurate within the full range I have available, aprox 50cm.

#define trigPin 27
#define echoPin 26

PingTimer = timer.setInterval(1000L, PingSensor);

void PingSensor() {
  long duration, distance;
  digitalWrite(trigPin, LOW);
  delayMicroseconds(2);
  digitalWrite(trigPin, HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin, LOW);
  duration = pulseIn(echoPin, HIGH);
  distance = (duration) / 58.2;

  Blynk.virtualWrite(vPin, distance);
}

for aprox 85cm?

Try it… I don’t have that much space on my bench :slight_smile:

Hi guys give me some help, unfortunately the Label read the sensor value but when it’s full I read 0% and when empty 82% I tried to create this

Blynk.virtualWrite(V0, 82-r); //Virtual Pin Label (82-r per avere il valore invertito)

83/5000
it reads the inverted value but does not make me perceptual between the values
Max 82 and Min 6

int y = map(r, 6, 82, 100, 0); // valori di percentuale Min 6 - Max 82
  

  Blynk.virtualWrite(V0, y); //Virtual Pin Label 

so it seems to be fine