hi i received a fuel gauge sending unit and i wanna set it up
the ohm valus are
33-240 for empty to full or vise versa…
Brown wire is signal output
Blue is negative…
do i wire it
Blue to gnd of esp32
brown to 3.3v pin
5.6k ohm resistor from A0 to 3.3 pin (brown wire) ?
this is the code i have plus the sending unit i using 21 "
First is this Home Assistant or ESPHome? I don’t think Home Assistant has a resistance or adc sensor platform, but I could be wrong.
Also it would be proper on the forum here to supply links without the affiliate or tracking part of the link text so people can click on them safely. If you could edit that to remove all text including and after the:
you might find someone else that would actually click on it.
and does anyone know if i need a bigger resistor as i read something about you need half the size of the biggest ohms… so 240 /2 so would i need a 120ohm resistor instead of the 5,6k
@Karosm ok the resister from the example was too big or too small.?
ill see what i got in resisters
and is the code for min max value right too for 33 ohms and 240 ohms… or how do you then make it work in percentage… as 1% to 100% as i wanna use a Gauge display
for future projects how you know which resistor to choose from… as the resistance sensor page didnt it say it but another page said it had to be half the size of the maximm of the resistor…
5.6k means 5600ohms, too high value for your sensor. It would give you 0.1V difference between full and empty. With 120ohm resistor you get 1.5V difference.
Half the max is good choice, but don’t go below 100ohms.
@Karosm so i got a 120ohm resistor… and i wired it the way you have it… but it doesnt seem to be working … if i put it full or empty i get the same reading… and its slow it doesnt check resistance instantly… not sure why and this is the code i using
[15:15:19][D][sensor:094]: 'Fuel_Tank_Sensor': Sending state 1.03300 V with 2 decimals of accuracy
[15:15:19][D][resistance:039]: 'Fuel Tank Sensor' - Resistance 54.7Ω
[15:15:19][D][sensor:094]: 'Fuel Tank Sensor': Sending state 54.68019 Ω with 1 decimals of accuracy
[15:16:19][D][sensor:094]: 'Fuel_Tank_Sensor': Sending state 1.03300 V with 2 decimals of accuracy
[15:16:19][D][resistance:039]: 'Fuel Tank Sensor' - Resistance 54.7Ω
[15:16:19][D][sensor:094]: 'Fuel Tank Sensor': Sending state 54.68019 Ω with 1 decimals of accuracy
[15:17:19][D][sensor:094]: 'Fuel_Tank_Sensor': Sending state 1.03300 V with 2 decimals of accuracy
[15:17:19][D][resistance:039]: 'Fuel Tank Sensor' - Resistance 54.7Ω
[15:17:19][D][sensor:094]: 'Fuel Tank Sensor': Sending state 54.68019 Ω with 1 decimals of accuracy
[15:18:19][D][sensor:094]: 'Fuel_Tank_Sensor': Sending state 1.03300 V with 2 decimals of accuracy
[15:18:19][D][resistance:039]: 'Fuel Tank Sensor' - Resistance 54.7Ω
[15:18:19][D][sensor:094]: 'Fuel Tank Sensor': Sending state 54.68019 Ω with 1 decimals of accuracy
and if i change the downstream to upstream… i get this … it still stays the same if i move from bottom to the top
[15:22:30][D][sensor:094]: 'Fuel_Tank_Sensor': Sending state 1.03300 V with 2 decimals of accuracy
[15:22:30][D][resistance:039]: 'Fuel Tank Sensor' - Resistance 263.3Ω
[15:22:30][D][sensor:094]: 'Fuel Tank Sensor': Sending state 263.34946 Ω with 1 decimals of accuracy
[15:23:00][I][safe_mode:041]: Boot seems successful; resetting boot loop counter
[15:23:00][D][esp32.preferences:114]: Saving 1 preferences to flash...
[15:23:00][D][esp32.preferences:143]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
[15:23:30][D][sensor:094]: 'Fuel_Tank_Sensor': Sending state 1.03300 V with 2 decimals of accuracy
[15:23:30][D][resistance:039]: 'Fuel Tank Sensor' - Resistance 263.3Ω
[15:23:30][D][sensor:094]: 'Fuel Tank Sensor': Sending state 263.34946 Ω with 1 decimals of accuracy
[15:24:30][D][sensor:094]: 'Fuel_Tank_Sensor': Sending state 1.03300 V with 2 decimals of accuracy
[15:24:30][D][resistance:039]: 'Fuel Tank Sensor' - Resistance 263.3Ω
[15:24:30][D][sensor:094]: 'Fuel Tank Sensor': Sending state 263.34946 Ω with 1 decimals of accuracy
You have something wrong there. Send a good picture of your wiring.
Also, your board Esp32 mini D1 is… not common at least. What board you have defined in your code??