Oil tank depth gauge
Hi
I'm currently putting together a roomnode with an ultrasonic module in an effort to measure oil depth in my tank.
I have modified the roomnode.pde to accomodate the module and am using the "light" part of the payload to transfer the data (in litres).I am getting sensible readings for lower values (over my kitchen sink) but this being a byte variable is limited to 255. I could factor it by say 4 and then correct at the rx end but that is not always possible. I've messed with changing the variable type but am getting strange results. I'm not great with linux and don't know where to look for the software that interprets the incoming data.I could also send percentage full ie 0 to 100% but am still curious as to how larger numbers could be accomodated.
thanks
John
You are almost there.
-From the RoomNode.pde Sketch you would tweak the number of bits from 8 to say 16.
struct {
int oil:16; // oil sensor: 0..32767
byte moved :1; // motion detector: 0..1
byte humi :7; // humidity: 0..100
int temp :10; // temperature: -500..+500 (tenths)
byte lobat :1; // supply voltage dropped under 3.1V: 0..1
} payload;
From the roomNode.lua code (The receiver)
local oil, mo, hu, te, lo = jeenode.bitslicer(data,16,1,7,-10, 1)
If you want to move from a BYTE to say a WORD then just change the "byte light" and increase the number of bits in the receiver too - something like this and make this receive a new node type by renaming the classes and filename.
Like what I recommended here when I was talking about a new "boilerNode"
http://www.homeautomationhub.com/content/temperature-measurement-hahnodes
Brett
any further info appreciated. (wiring code etc)
Parts ordered from ebay :) and roomnode from Derek :)
Dean
The roomnode arrived yesterday ()thanks Derek() still waiting for sensors from china :)
Electronics is "my thing" coding isnt but i do have a programmer (and associated bit that goes with it) and AVR studio 4
and i have no idea what the DHT22 libary is (but i have downloaded it :)
all i have ever used the programmer for is to copy chips (when firmware updates come out) and i simply read the hex eprom and elf files then write them out to the new chip.
Looks like i am going to have to start reading how to get the code into the Chip :)
My tank is a 2500L bunded so its sort of rectangular but i am not too worried if its not 100% accurate-got to be better than my watchman with 10bars on it.
Dean
Going to send you a chip. BUT i am also going to try and program my own and then compare.
can you send me your address? (will include a sae) my email is dean AT packetradio.co.uk
my tank is apx 2.2*1.1*1.1 Metres (2500L) and this is my second roomnode.
No rush still waiting for china stuff.
to reduce power could you not restrict TX to once an hour to help? (and increase TTL ) luckily i have power fairly near my tank :)
Still debating if to go down the battery or run a cable route...
thinking the battery route for testing and cable route as a pernament soloution.
will let you know how i get on and will take photo's of construction.
Dean
Check my wiring?
seems my ultrasonic "looks" different to yours.
http://www.packetradio.co.uk/gallery/index.php/HAH/vi-Gallery-Image-7203...
And Derek have i got the electrolytic round the right way? just being 100% certain :)
http://www.packetradio.co.uk/gallery/index.php/HAH/vi-Gallery-Image
I have wired all the sensors to the wrong side of the board :(
Somethink strange on XFX viewer.
http://www.packetradio.co.uk/gallery/index.php/HAH/photos/hahnode2
John i must ask do you have your oil tank in your living room?
Joking aside been testing and it looks really good, values are pretty accurate.
now all i need to do is weatherproof box it, run cable set it up on Gui and explain to wife 0=no heating :)
Dean
Its working well :) just installed it on the oil tank this afternoon-late.
one question do you find oil level drops when the temp drops? only by 20L from a 16degree to 10degree temp change?
what/how do you find the accuracy over time/temp?
Once again thank you. running on 3 d cells at the moment as it was getting too cold to run a cable tonight (and SWMBO would have wabbled- she was iffy about me drilling holes in tank lid as it was! )
Dean
Dean, is this possibly just thermal contraction?! Not sure what the thermal expansion coefficient is for fuel oil but on a 2500l tank you are only seeing <1% change on 6degrees which doesn't sound unreasonable to me. If this is the case you should be able to factor this out to give you a reading at a fixed temp?!
just a thought.
Garry
0.8% change in volume for 10oC change, but either way I'm sure this is the cause and as John says easy to factor out.
Factor = 0.0008 per oC
Factor for 10oC = 0.008 = 0.8%
i might be wrong it's been a while since i did stuff like this in anger ;)
PS You could always display the cost in £s intead of litres and maybe her indoors will turn the heating down!
I wish.
Yep forgot about expansion of liquids-set fire to physics lab when at school, used a bunsun instead of hot water-the petroleum went up well big hole in roof day off school!!
thanks all, quite happy to watch it expand and fall-might put a heater undertank so it uses less fuel---(JOKE)
Dean
And a hell of a lot cheaper and capable than this water ultrasonic level meter too !
http://www.jaycar.com.au/productView.asp?ID=XC0331
I say POOEY too this item and HELLO JeeNode.
Brett
Depending on what build you are on as you never indicated (what after the upgrade meant)
If you are on 307
class = require("pl.class").class If you are on the BETA 307.2 then its like this
class = require("pl.class")
The penlight library had some internal changes when I uplifted it.
Brett
John,
You only get the point release BETA's by explicity updating to them. 307.1 has a bug with jeenodes and you need to update to the latest beta 307.2 - normally if you are on a beta is because you want to test something I just released but it may/may not work as expected, as so happened with 307.1 it was a bad build. 307.2 is good (so far).
There are differences in the PL library that may affect hand coded classes.
Brett
Been running this since october.
apart from having issues with power (my bad) it is working perfect.
the other day i got 500l delivered and my readings went from circa 190 to 700 Litres. so it is pretty accutrate. sometimes it goes full scale 2500 (it blips) but suspect this could be interferance from my watchman (that i run in the same tank)
so thank for the excellent desgn etc and if anyone is "thinking" about doing one i thoroughly recommend it.
dean
i use the stuff below and coat all exterior sircuit boards with it (pir light etc) the boiler jeenode ultrasonics etc are just coated with this stuff no box!
I was doing proof of concept for a work project.
i will get round to boxing it one day :)
http://cpc.farnell.com/_/rust-guard/rust-guard-500ml/dp/SA02493?Ntt=rust...
this is something i am very interested in.
especially now oil is in use :)