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
RT @donkey_car: Human-scale Donkey Car! Hope this makes it to a @diyrobocars race https://www.youtube.com/watch?v=ZMaf031U8jg
yesterday
DIY Robocars via Twitter
yesterday
DIY Robocars via Twitter
Jun 16
DIY Robocars via Twitter
RT @GrantEMoe: I won my first @diyrobocars @donkey_car virtual race! Many thanks to @chr1sa @EllerbachMaxime @tawnkramer and everyone who m…
Jun 13
DIY Robocars via Twitter
RT @gclue_akira: JetRacerで自動走行したコースを、InstantNeRFで再構築。データセットは別々に収集 #jetracer #instantNeRT https://t.co/T8zjg3MFyO
Jun 13
DIY Robocars via Twitter
RT @SmallpixelCar: SPC 3.0 Now the motor also works. This car is doable. I just need to design a deck to mount my compute and sensors. http…
Jun 13
DIY Robocars via Twitter
RT @SmallpixelCar: My new car SPC 3.0. https://t.co/CKtkZOxeNQ
Jun 7
DIY Robocars via Twitter
RT @SmallpixelCar: High speed at @diyrobocars thanks @EdwardM26321707 for sharing the video https://t.co/o4317Y2U1S
Jun 7
DIY Robocars via Twitter
RT @SmallpixelCar: Today at @RAMS_RC_Club for @diyrobocars. Used @emlid RTK GPS and @adafruit @BoschGlobal IMU. Lap time 28s https://t.co/R…
May 28
DIY Robocars via Twitter
May 15
DIY Robocars via Twitter
May 14
DIY Robocars via Twitter
May 13
DIY Robocars via Twitter
RT @f1tenth: Say hi to our newest #F1TENTH creation for @ieee_ras_icra next week in Philly. It’s going to be huge! 😎 🔥 @AutowareFdn @PennEn…
May 13
DIY Robocars via Twitter
May 11
DIY Robocars via Twitter
May 8
DIY Robocars via Twitter
RT @SmallpixelCar: Noticed my car zigzagged in last run. It turned out to be the grass stuck in the wheel and made the odometry less accura…
May 8
More…