Analog float switch to Pixhawk aux ports

Hello people!

I am planning to build a UAV sprayer system that will trigger an RTL if the the liquid inside the tank reach a certain level. My idea is to install a float switch inside the tank and maybe hook up the connection to one of the aux ports of the Pixhawk. And have the FC read the pwm values of the switch with out using a companion computer.Unfortunately, I could not find the answer despite scouring the internet and wiki for information. 
Is this something you guys have come across with? If so could you gave hints as how to approach this problem? Thank you.

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • Paul, the problem with measuring tank contents in an aircraft is that the fluid is subject to forces outside of the aircraft's inertial frame of reference. Put simply, the fluid sloshes around. Full size aircraft face this problem. Float sensors don't work very well except on the ground. Capacitive sensors work better but you need lots of them. When I fly I ignore them and use fuel flow to calculate my remaining fuel. This is what you do when your life depends on it.

    The model jet flyers are starting to catch on, at last!! They are using fuel flow sensors.

    In your case it's not too hard. Replace your pump with a positive displacement pump, say like the ones the jet flyers use. These are a geared pump, ie. two intermeshing gears. You need a motor with a pulse output to sense revolutions. Alternatively put a pulse flow sensor in the fluid line somewhere. These can be purchased from any of the model turbine accessory suppliers or you can source yourself directly.

    Each pulse represents a fixed delivery quantity. If you know how much you started with, then any time you know how much you have left. In the case of the model turbine sensors, the accuracy is better than 10mL on a 3L tank.

    You can use a small processor to do the counting and output whatever you like to the PixHawk. An AtTiny Arduino would work just fine and be easy to program. You could also add the counting to the PixHawk code so the PixHawk interfaces directly to the pulse meter.

    Hope this helps,

    Afterthought: Add the fluid contents to the MavLink data stream so you can see it in your GCS.

  • Hi Paul.  Chris definitely has the right idea. A float would be unnecessarily heavy and complex - especially if you simply want to know when the tank is empty.  Back in the day I designed a meniscus sensor for an automated pipettor that was essentially two stainless steel wires, a 10-turn potentiometer, a couple of resistors and a small darlington transistor.  Dirt simple, adjustable for the conductivity of the liquid, highly reliable, lightweight and you can get a PWM output by feeding the circuit to something like an Arduino Trinket. You could also compensate for sloshing via soft hysteresis - tell the Arduino not to provide an output to your FC unless the tank appears empty for a solid 1 or 2 seconds.

    Introducing Trinket
    Trinket may be small, but do not be fooled by its size! It's a tiny microcontroller board, built around the Atmel ATtiny85, a little chip with a lot…
  • 3D Robotics

    Crop sprayer support is already built in: http://ardupilot.org/copter/docs/sprayer.html

    As for the switch you describe, there are lots of problems with your proposed method:

    1) Switches typically don't produce PWM. They're digital on/off

    2) It's very difficult to have a floating switch give accurate readings on moving tank due to sloshing, unless you have some very sophisticated baffling in the tank.  Why not go with multiple moisture sensors around the tank and average the values? 

    As for the question on how to read a sensor of any sort, an easy way is to treat them like analog sonar modules and just use trigger action based on "distance" (actually whatever you're really measuring)

    Crop Sprayer — Copter documentation
This reply was deleted.

Activity

DIY Robocars via Twitter
15 hours ago
DIY Robocars via Twitter
16 hours ago
DIY Drones via Twitter
yesterday
DIY Robocars via Twitter
RT @Heavy02011: @diyrobocars : A Home-brew computer club* for Connected Autonomous Driving on Jan 23rd, 2021 https://www.meetup.com/Connected-Autonomous-Driving/events/275728684/ #Meetu…
yesterday
DIY Robocars via Twitter
yesterday
David Hori liked Isabella Domi's profile
Wednesday
DIY Robocars via Twitter
RT @Heavy02011: ⁦@diyrobocars⁩ Autonomous Driving Assembly at #rC3. join us at https://rc3.world/rc3/assembly/diyrobocars-f1tenth/ ⁦@f1tenth⁩ ⁦@DAVGtech⁩ ⁦@DWalmroth⁩…
Monday
DIY Robocars via Twitter
RT @chr1sa: New car designs coming for our next @DIYRobocars @donkey_car virtual race on the 23rd. Choose any one you want at race time Le…
Monday
DIY Robocars via Twitter
RT @RoboticMasters: Thanks to @EllerbachMaxime and the Sydney Uni Capstone Students the @donkey_car @diyrobocars simulator is getting a ma…
Monday
DIY Robocars via Twitter
Jan 6
DIY Robocars via Twitter
Dec 28, 2020
DIY Robocars via Twitter
An interesting line-following simulator to use with with your robocars: https://github.com/ron-grant/LFS
Dec 23, 2020
DIY Robocars via Twitter
Dec 23, 2020
DIY Robocars via Twitter
An improved version of the @IntelAIResearch OpenBot: https://diyrobocars.com/2020/12/14/an-improved-version-of-the-intel-openbot/
Dec 14, 2020
DIY Drones via Twitter
An improved version of the Intel OpenBot https://ift.tt/2KkHT8Q
Dec 14, 2020
DIY Robocars via Twitter
Dec 10, 2020
More…