UDB5mini Analog Inputs

33 views
Skip to first unread message

john andrews

unread,
Nov 13, 2019, 6:05:40 AM11/13/19
to uavdevboard
Hello Guys, 

I want to connect a battery voltage _current sensor to the UDB5mini, 

In the configuration file of analog inputs there are a two options of analog inputs connection: the IN1 and IN2 channels, 

But  

The UDB5mini has four extra analog inputs channels (AN15, AN16, AN17, AN18) ,  

I can connect the voltage_current sensor on each one of extra analog inputs listed above ?

If yes 

What is the right configurations in option.h file  to connect this sensor to extra analog inputs channels ?    

Best wishes, 

John, 



ben levitt

unread,
Nov 13, 2019, 12:48:06 PM11/13/19
to uavdevboard
Hi John,

Yes, that is one of the intended uses for the extra analog inputs. Here's a chunk from my options.h for a flying wing with current and RSSI sensing:

#define NUM_ANALOG_INPUTS                   2


#define ANALOG_CURRENT_INPUT_CHANNEL        CHANNEL_2

#define ANALOG_VOLTAGE_INPUT_CHANNEL        CHANNEL_UNUSED

#define ANALOG_RSSI_INPUT_CHANNEL           CHANNEL_1


On that plane I'm pulling analog RSSI from a DragonLink, and current from this board: https://www.sparkfun.com/products/retired/9028

Another option for current and voltage sensing is to use a Castle Creations ESC that supports the CastleLinkLive protocol (only the higher end ESCs include current data) and then you get voltage and current sensing over the same wire that sends the throttle control to the ESC.  So 0 extra components and 0 extra wiring.  Hardware support for this is built into the UDB5mini boards. That's what I use now for current and voltage sensing.

Ben


--
--
---
You received this message because you are subscribed to the Google Groups "uavdevboard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to uavdevboard...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/uavdevboard/c6d4ffaa-0dff-455a-8b3a-313e8d7bece1%40googlegroups.com.

john andrews

unread,
Nov 13, 2019, 1:35:50 PM11/13/19
to uavdevboard
Hello Ben, 

Thank you for your help, 

but i still have a question , when the NUM_ANALOG_INPUTS  is defined as follow , this mean that the two extra analog inputs pins (AN15 and AN16 ) are ready to receive analog signals? 

#define NUM_ANALOG_INPUTS                   2          

and can you please show the configuration of AN15 and AN16 as analog inputs in the code ? 


Best wishes, 

John, 

ben levitt

unread,
Nov 13, 2019, 2:28:44 PM11/13/19
to uavdevboard

Yes, if NUM_ANALOG_INPUTS is set to 2, the A15 and A16 are set up to receive analog input.  And by setting up ANALOG_RSSI_INPUT_CHANNEL and ANALOG_CURRENT_INPUT_CHANNEL to CHANNEL_1 and CHANNEL_2 respectively, the analog signals get handled appropriately and used in the right spots (like in the OSD).

You can also find the scaling constants for the various analog inputs in libUDB/libUDB_defines.h:

#define MAX_CURRENT             900 // 90.0 Amps max for the sensor from SparkFun (in tenths of Amps)

#define CURRENT_SENSOR_OFFSET   10  // Add 1.0 Amp to whatever value we sense


#define MAX_VOLTAGE             543 // 54.3 Volts max for the sensor from SparkFun (in tenths of Volts)

#define VOLTAGE_SENSOR_OFFSET   0   // Add 0.0 Volts to whatever value we sense


And I think this one is in options.h still:


#define RSSI_MIN_SIGNAL_VOLTAGE             0.8     // Voltage when RSSI should show 0%

#define RSSI_MAX_SIGNAL_VOLTAGE             3.0     // Voltage when RSSI should show 100%


Ben


--
--
---
You received this message because you are subscribed to the Google Groups "uavdevboard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to uavdevboard...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages