float sensor+arduino

how to connect float sensor with arduino uno to make digital fuel meter.plz give circuit diagram…float sensor comes normally in every bikes.

actually my project is to measure the amount of fuel in fuel tank.please i am new to arduino

Does this sensor normally drive an analog meter?

Such sensors generally have a resistance which varies with the position of the float.

Do you have a test meter?

If so, measure the it's resistance in ohms at each end of it's travel

and let me know what you find.

I googled CH-055, and got chainsaws - not much help!



MOELLER Electric Fuel Gauge Sending Units These sending units fit the industry-standard bolt-hole pattern and 240-33 Ohm gauges. Internal measurement components will not rust or corrode.

So, the sender is expecting a resistive gauge. If you intend on using with an existing gauge, you will need to "pull-off" from the sender-meter connection and use a high-value resistor divider to scale the voltage for the Arduino Ax input. I would probably use a 10K linear potentiometer with the wiper going to A0.

If however you are going to use without a fuel gauge, you need to supply a low value resistor to take the place of the meter. Maybe 100 Ohm. But, a 200 Ohm rheostat could be used to fine tune things.


thnx for reply.but i m totally non electronic person and i dont have meter to measure the resistance.please tell me some easy steps...here the link of video that exactlly i want to make using arduino uno https://www.youtube.com/watch?v=dWrfEges1_E

Looking at the video the readout is via the serial monitor feature of the arduino IDE.

This is straightforward.

I append a circuit to drive an anlog input of the arduino. Read that value with analogRead, scale it
( meaure with tank empty and full as your end points) and send to the IDE with Serial.print



ps note that the value depends on that of the 12v supply. If the bike is running the 12v will be higher.

so when you calibrate choose whether you want the bike running or not when you take a reading.

if you want an accurate reading in both cases a regulator will be necessary.

tanksense.pdf (18 KB)

AJAY526: thnx for reply.but i m totally non electronic person and i dont have meter to measure the resistance.please tell me some easy steps...here the link of video that exactlly i want to make using arduino uno https://www.youtube.com/watch?v=dWrfEges1_E

I watched the video and followed the links. What is complicating things is that the YouTube Fritzing diagram uses an OpAmp for stability... not entirely necessary if you use the 5V from the Arduino.

Allen's schematic (attached above) is adequate for this experiment and avoids the OpAmp costs.



go back to your first post, hit the modify button on the bottom right of your post.

Actually you can get away without a regulator if you use a second analog input to read the 12v supply via a resistor pair as for the float input, and scale with that...



you hv send me ciruit diagram for arduino+float sensor.first of all thank u very much for that..but as i told that i m totally newer to ele. so i cant understand circuit diagrams so can u plz make it in easy way???please...what materials will be needed and i m going to use arduino uno so on which pin i will have to attach sensor...plz plz plz help..thnx in advance sir


don't know where to start.

it seems you're totally ignorant of simple electrical circuits, never mind clever little processor boards like the arduino.

I've given you a few (I hope useful ) hints .

but I'm not going to design and code your project for you.

I suggest you learn a lot more - there are lots of sources on the net.



To me, the logical way of reading a low value (x-240ohm) tank sender is this: 560ohm resistor from the 3.3volt pin to the sender. Other sender connector to ground. The sender now produces ~0-1volt that can be read with 1.1volt Aref enabled. Translate the A/D values to liters/gallons/whatever with a lookup table (if your tank has an odd shape). Leo..

any one please give me code for above circuit…thank u

If you want someone to write code for you, be prepaired to pay for it. This part of the forum helps people with hardware, or code they have written that doesn't work as it should. I assume you already have an Arduino, so start with the basics. There are many examples that come with the IDE. Work your way through some. The very first one, AnalogReadSerial, basically does what you want. Attached is the condensed version plus added 1.1volt Aref line. This is only the start. I guess you want an LCD display that show liters. And I assume the tank on your bike is not box-shaped. Start learning, and soon you can do much more than a simple fuel gauge. Leo..

/* Fuel Gauge
  560ohm resistor between the 3.3volt pin and the A0 pin
  fuel sender connected to A0 and ground.
int sensorValue; // raw A/D readings from the sensor

void setup() {
  analogReference(INTERNAL); // use the internal ~1.1volt bandgap reference
  Serial.begin(9600); // start serial monitor

void loop() {
  sensorValue = analogRead(A0); // read A0
  Serial.println(sensorValue); // print to serial monitor