HobbyKing.com New Products Flash Sale
Reply
Thread Tools
Old Nov 13, 2012, 11:23 PM
Radd Graduate '06
Mochaboy's Avatar
United States, MA, Sudbury
Joined Aug 2006
1,820 Posts
Discussion
Attopilot 45A current sensor

I searched through the Crius AIO thread but apparently - either no one's completely figured out how to add this sensor, or they have and just haven't gotten around to documenting it. I recorded a video of my attopilot setup - voltages come through just fine, but now I'm stuck with the sensor reading current draw.

Let me share what I've found to date.

First off, the current portion of the sensor works. I verified it by hooking up the current signal pin to A0 on an Arduino board and then GND to GND.

The code to spit out to the serial monitor looks like this:
Code:
int analogPin = 0;     // define analog pin
int val = 0;           // variable to store the raw millivolt
float IFinal;          // 
void setup()
{
  Serial.begin(9600);          //  setup serial
  Serial.println("waiting for sensor");
}

void loop()
{
  analogRead(0);     // quick read to stabilize the voltages
  delay(10);
  val = analogRead(analogPin);    // read the input pin
  Serial.print("I: ");
  IFinal=(val/14.9);    // scaling factor for the 45A model on 5v
  Serial.print(IFinal);
  Serial.print(" amps\n");
  delay(500);
}
On a test harness with 2 50W 12v halogens - it reported it was pulling about 7 amps which tracks with what a multimeter current shunt reported.

I should mention that it took a while to get to this stage just because I had to fiddle around with different GND ports.

So finding a home for the GND pin finally got the script returning back good values. So I figured it should be easy with the Crius because it has like 14 ground pins

Wasn't the case

I tried every 5v ground pin I could access easily - servos, I2C, FTDI, taps into S0, and taps into the 5V GND in the extend port.

No matter what I did - I couldn't get current numbers to display in Mission Planner - it just keeps flashing high and low (68.23 Amps, and 0 amps). When I arm the rig, the current values stop flashing and stay stuck at 68.23 amps.

So has anyone gotten this to work? Any suggestions on how to troubleshoot this further?


Thanks.

Mocha
Mochaboy is offline Find More Posts by Mochaboy
RCG Plus Member
Sign up now
to remove ads between posts
Old Nov 14, 2012, 05:15 PM
Radd Graduate '06
Mochaboy's Avatar
United States, MA, Sudbury
Joined Aug 2006
1,820 Posts
My hunt for the correct ground pin continues.
Mochaboy is offline Find More Posts by Mochaboy
RCG Plus Member
Old Nov 18, 2012, 05:15 PM
Radd Graduate '06
Mochaboy's Avatar
United States, MA, Sudbury
Joined Aug 2006
1,820 Posts
I've done some troubleshooting on this.

Where I'm at right now is that the only analog pin that returns any value is A0. In other words, current and voltage sensing work, but I can only display one of those numbers. I tried connecting the voltage pin into A1..A5 and flashing accordingly, and they all return back with floating point numbers (oscillates between high and low outputs). That's what you see when the analog sensors don't see anything.

I checked the arduino docs and the default of each pin is INPUT, but I'm not so sure that's the case. I'm trying to find a spot in the code to insert a snippet to activate the board's internal pullup resistors for that pin to force that pin into INPUT mode (just to be sure).

Anyway - that's where I'm at...Be interested to see if anyone else is pursuing this.
Mochaboy is offline Find More Posts by Mochaboy
RCG Plus Member
Reply


Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Discussion Crius All in one Pro with Attopilot Voltage Sensor Megapirate? flippergrz Multirotor Electronics 3 Oct 03, 2012 05:22 PM
Sold DOSD V2, GPS, Current sensor and Baro Sensor cavu flyer FPV Equipment (FS/W) 13 Jul 16, 2012 01:15 PM
Sold Save 50% - RVOSD 4 w/New Mainboard, GPS, IR Sensors, 70A Current sensor, & Remote whatasteele FPV Equipment (FS/W) 6 May 12, 2012 11:52 AM
Sold EZOSD with Current sensor lloyd j FPV Equipment (FS/W) 10 Apr 28, 2012 06:44 AM
Discussion plugging Hitec current sensor into nitro aircraft sensor station? le fou Radios 1 Apr 17, 2012 11:20 PM