mookie

  • *
  • 17
Sparky 2 Analog Port
« on: August 20, 2016, 11:56:13 pm »
As the title suggests, Does anyone know if the analog port is supported in the latest next on Sparky 2? As on my version its not. :)

Thanks

Malc

f5soh

  • *****
  • 4572
    • LibrePilot
Re: Sparky 2 Analog Port
« Reply #1 on: August 21, 2016, 12:48:29 am »
What do you mean with analog port ?
What device you want to connect ?

mookie

  • *
  • 17
Re: Sparky 2 Analog Port
« Reply #2 on: August 21, 2016, 11:03:58 am »
i want to connect my attopilot current sensor 3.3v to the adc or analog port

Mateusz

  • *
  • 808
Re: Sparky 2 Analog Port
« Reply #3 on: August 21, 2016, 11:39:18 am »
I am using multilpe Sparky2 boards with LibrePilot and AttoPilot 90A current &volage sensor, connected as described on Wiki. It works just fine with I guess recent commit 19fa385f28d8ba8d95e5db79ed5d947ea4687fa2. At least I am getting values nicely displayed on OSD.

First screenshot, how to enable battery module, and set adc0, adc1 routing.
Second screenshot how I entered calibration values from wiki, they're not exact for my sensor, but I didn't bother for correcting them either, since sensor is not that accurate and will give approximate values anyway.
Third screenshot shows values in GCS from aircraft (motors not spinning) copter is laying on my bench and powered via PSU.
« Last Edit: August 21, 2016, 12:40:02 pm by Mateusz »

f5soh

  • *****
  • 4572
    • LibrePilot
Re: Sparky 2 Analog Port
« Reply #4 on: August 21, 2016, 12:35:39 pm »
Currently only the Volt / Current pins (pin3 and pin4) works.
You should follow Wiki page https://librepilot.atlassian.net/wiki/display/LPDOC/Configure+a+Current-Voltage+sensor

Just swap Voltage and Current in adc mapping, this should be fixed soon and also add Dac pin as input in same port.
https://bitbucket.org/librepilot/librepilot/pull-requests/305/lp-387-analog-port-add-dac-pin-as-input/diff

mookie

  • *
  • 17
Re: Sparky 2 Analog Port
« Reply #5 on: August 21, 2016, 03:41:52 pm »
Perfect, cheers guys, its a case of RTFM i think :)