question

nebulight avatar image
nebulight asked

Raspberry Pi, ADC and tank sender with custom ohms 0-90?

So I finally installed my pi and touch screen in my camper van. Everything is working fine on the victron product side but when I went to disconnect my tank sender from the manual gauge to install on the Expander PI ADC board and it still said shorted. I couldn't figure out what was wrong, then I take out the voltmeter and found that the tank sender is a 0 empty to 90 ohms full.... *facepalm*. I bought my camper van from someone else and the sender was already installed and I just assumed it was a standard NA 240-33ohm sender. Instead of getting a new tank sender, is it possible to change the settings somehow on the Pi to read this tank sender?

At least the panel turned out well (looks like I can't upload any photos).


Venus OSVenus GX - VGX
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

3 Answers
nebulight avatar image
nebulight answered ·

I found this in the file sensors.h. Can I just change those values? However I don't know much about programming, after I make this change, do I need to compile or just drop this file on my Pi?


// defines for the tank level sensor analog front end parameters

#define TANK_LEVEL_SENSOR_DIVIDER (680) // ohms

#define EUR_MAX_TANK_LEVEL_RESISTANCE (180) //ohms

#define USA_MAX_TANK_LEVEL_RESISTANCE (240) //ohms

#define USA_MIN_TANK_LEVEL_RESISTANCE (30) //ohms

8 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

kai avatar image kai ♦ commented ·

I'm just guessing from the context - yes you would have to recompile / make for the header file changes to take effect

0 Likes 0 ·
nebulight avatar image nebulight kai ♦ commented ·

Any tutorials for a guy who has zero experience? The link is broken here:


building

This is a velib project.

Besides on velib, it also depends on:

  • python
  • dbus libs + headers
  • libevent libs + headers

After cloning, and getting the velib submodule, create the Makefile:

cd software ./ext/velib/mk/init_build.sh

More information about this is in velib/doc/README_make.txt

For cross-compiling for a Venus device, see here. And then especially the section about velib projects.

0 Likes 0 ·
kai avatar image kai ♦ nebulight commented ·

The info snippet above seems to be from the dbus-adc daemon (linux process).

This is from a bit of quick googling and poking around in github - someone who is actively involved in venus would be able to give you more help.

As an alternative, rather than recompiling, is it possible to get to what you need from dbus and rescaling the value outside of the venus code? And/or pad out the resistance physically so venus doesn't clip the reading and then rescale it?

0 Likes 0 ·
dunnp avatar image dunnp commented ·

Where can I find that file? I have the same problem - 0-90 ohm sender.

Phil

0 Likes 0 ·
nebulight avatar image nebulight dunnp commented ·

https://github.com/victronenergy/dbus-adc


If you get anywhere, please let me know.

0 Likes 0 ·
nebulight avatar image nebulight dunnp commented ·

Have you gotten anywhere on this?

0 Likes 0 ·
dunnp avatar image dunnp nebulight commented ·

No. I was hoping someone inside Victron might give us a clue where to find the relevant settings. I’ve spent hours searching without any luck.

Nudge!!

0 Likes 0 ·
sv-soleil avatar image sv-soleil dunnp commented ·



I am interested in modifying the sensors.h file and recompiling (for a variety of reasons). Did you ever get any insights on how to do this?

0 Likes 0 ·
nebulight avatar image
nebulight answered ·

are bumps allowed? I never figured this out and I'm considering getting a Cerbo GX when the come out. Maybe it would be nice to have the software give you the option to assign your tank sender settings? In the US, there are a lot of different values.

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

tonyjobson avatar image
tonyjobson answered ·

https://community.victronenergy.com/questions/41629/tank-sensor-calibration.html

custom sensors are in the new or soon to be released beta firmware for the Venus physical devices so we should hopefully be able to calibrate full and empty and then cope with a wide range of restive sensors.

(I've not setup my pi to test any of this yet. i was doing my research before buying anything.)

My use case was: (and for search engines) : Gas it. Gas-it sender 0 to 90 Ohms and 95 Ohms



2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.