Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 10, 2016, 11:17:13 23:17


Login with username, password and session length


Pages: [1]
Print
Author Topic: Eliminate a switch - change mode by power reset during startup  (Read 1303 times)
0 Members and 1 Guest are viewing this topic.
Terry Dactil
V.I.P
Newbie
*****
Offline Offline

Posts: 10

Thank You
-Given: 18
-Receive: 6



« on: August 26, 2012, 12:58:33 12:58 »

As a new member to this forum, and looking for something to share, I thought this may be of interest.

I was developing a fuel quantity gauge for a light aircraft. As well as the quantity display I needed to read the raw frequency count from the capacitive probes in the fuel tanks in order to calibrate the tanks and make a frequency vs quantity table.

I used a switch in the prototypes to change modes, but because it would seldom be used in normal operation, it made sense to eliminate the switch from the limited space on the instrument panel if possible. 

The solution was to have a flag in the non-volatile memory of the 16F689 chip I was using that was set then reset 5 seconds later during startup. This meant that if the power was cycled during this 5 second window, the following startup would find the flag set and go into the counter mode.

Doubtless this has been done before, but I was quite pleased to work this out all by myself.




Logged
solutions
Hero Member
*****
Offline Offline

Posts: 1446

Thank You
-Given: 591
-Receive: 851



« Reply #1 on: August 26, 2012, 11:40:32 23:40 »

I hope you have bags of money if this is going on an aircraft. FAA approvals and liability insurance premiums, wide temperature range, alpha particle and cosmic ray hits on memory, spark ignition hazard, are just a few reasons why we don't see a lot of this kind of thing.

Nice algorithm, though.

What did you use for the probes themselves and how are they excited?
Logged
Terry Dactil
V.I.P
Newbie
*****
Offline Offline

Posts: 10

Thank You
-Given: 18
-Receive: 6



« Reply #2 on: August 27, 2012, 01:48:16 01:48 »

No bags of money, unfortunately.  Sad

However, this fuel gauge is fitted to a home-built aircraft registered in the 'experimental' category in Australia.
One of the requirements is to have a big placard in the cockpit reading "persons fly in this aircraft at their own risk". This category basically means that we are free to go and kill ourselves in any manner we like, as long as we do not affect anyone else in the process.
In Australia we still tend to accept responsibility for the consequences of our own actions, and not sue everyone else remotely involved as seems to happen in the USA. (There are signs that we are trying to catch up with you though).

The fuel tank probes are off-the-shelf items from Vision Microsystems who do a great range of electronic instruments for the homebuilt market.
Power input is 5vDC, and the output is around 4vAC with the frequency depending on the fuel level. In our case the main fuel tank is 11,747 Hz full and 19,986 Hz when empty. The quantity vs frequency change is non-linear due to the irregular shape of the fuel tank, and this is why a look-up table is used to determine the quantity to display.

I am still utterly amazed at just what can be done with a PIC chip costing less than $10.
Not many fuel gauges say good morning to the pilot!
Here is the result:


The code is available if anyone wants it.
Logged
PaulC
V.I.P
Active Member
*****
Offline Offline

Posts: 162

Thank You
-Given: 3584
-Receive: 132


information is free and should be shared for free


« Reply #3 on: August 27, 2012, 02:52:21 02:52 »

Hi  Terry Dactil
I and probably others would very much like the code to this project.
wondering if this could be modded for a car fuel tank. & possibly on a small boat fuel tank.
this could be a very interesting project, even if only on a educational purpose.
Logged

find it , read it , share it .
solutions
Hero Member
*****
Offline Offline

Posts: 1446

Thank You
-Given: 591
-Receive: 851



« Reply #4 on: August 27, 2012, 07:24:43 07:24 »

Adding a fuel flow sensor to this one would be sweet and opens up some interesting management and reporting possibilities.

Nice work, mate, including the documentation many of us are too lazy to do.
Logged
metal
Global Moderator
Hero Member
*****
Offline Offline

Posts: 2018

Thank You
-Given: 514
-Receive: 477


Top Topic Starter


« Reply #5 on: August 27, 2012, 12:33:29 12:33 »

Hi Terry,

Where can I find the datasheets of your sensor? Could you please post the project here. What language did you use?
Logged

nothing to say..
Terry Dactil
V.I.P
Newbie
*****
Offline Offline

Posts: 10

Thank You
-Given: 18
-Receive: 6



« Reply #6 on: August 27, 2012, 02:33:36 14:33 »

Quote
wondering if this could be modded for a car fuel tank. & possibly on a small boat fuel tank.
This could be done fairly easily, and there are plenty of articles on the internet on how to make a capacitive probe.
This system is designed to read two tanks, so you could eliminate the multiplexer and a lot of the code.

However, there are a few traps to avoid.

Capacitive fuel probes are sensitive to the dielectric value of the fuel being measured.
Large aircraft have a small reference probe always covered by the fuel in order to read the dielectric value and calculate the quantity accurately.
I did not need to worry about this as the specification for avgas is tightly controlled, and this light aircraft operates in a limited temperature range.

The main problem would be with automotive gasoline which varies significantly with various percentages of ethanol added, and a reference probe would probably be needed if reasonable accuracy is required.

Quote
Adding a fuel flow sensor to this one would be sweet and opens up some interesting management and reporting possibilities.
That should be easy to do; just some maths to calculate and display the rate of change of the quantity.
I did not need to do this as it was already included on another instrument.

Quote
Where can I find the datasheets of your sensor?
It came as part of a Kit from Vision Microsystems Inc, There are other manufacturers serving this market. The probe is fairly simple; just a metal tube with a metal rod on nylon standoffs inside it , combined with an oscillator whos frequency depends on capacitance. 

Here are links for the code, circuit and flowcharts.

Flowcharts
https://rapidshare.com/files/973161074/Fuel%20gauge%201.PNG
https://rapidshare.com/files/583303768/Fuel%20gauge%202.PNG
https://rapidshare.com/files/493051634/Fuel%20gauge%203.PNG
https://rapidshare.com/files/3727185504/Fuel%20gauge%204.PNG
Logged
Terry Dactil
V.I.P
Newbie
*****
Offline Offline

Posts: 10

Thank You
-Given: 18
-Receive: 6



« Reply #7 on: September 01, 2012, 03:27:42 03:27 »

Quote
Adding a fuel flow sensor to this one would be sweet and opens up some interesting management and reporting possibilities.
That should be easy to do; just some maths to calculate and display the rate of change of the quantity.

Sorry. I should have taken more notice when you wrote "Adding a fuel flow sensor..."

My reply assumed that just massaging the data coming from the probes would be an easy way to get a fuel flow value.
A bit more thought on that leads me to suspect that using the rate of change of of quantity would have serious problems with accuracy and response rate.

However, adding a normal fuel flow sensor with variable frequency output could be easily done. In fact if you only have one fuel tank you could just replace the reserve tank probe input with the fuel flowmwter input and modify the calculations for the display.
Logged
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC