Robert Korn
Published © MIT

RC Thrust Dyno

Just how powerful is that plane?

IntermediateFull instructions provided5,944
RC Thrust Dyno

Things used in this project

Hardware components

Arduino Pro Mini 328 - 5V/16MHz
SparkFun Arduino Pro Mini 328 - 5V/16MHz
×1
ACS-712 Hall Effect Current Sensor
×1
HX-711 Load Cell Amp
×1
Load Cell
×1

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Schematics

Schematic

Code

bluetooth_rc_dyno.ino

Arduino
//****************************************************************
//*  Name    : RC Dyno                                           *
//*  Author  : Robert Joseph Korn                                *
//*  Notice  : Copyright (c) 2015 Open Valley Consulting Corp    *
//*  Date    : 12/15/15                                          *
//*  Version : 1.75                                              *
//*  Notes   :                                                   *
//*          :                                                   *
//****************************************************************
#include <LBT.h>
#include <LBTServer.h>

float voltage ;
float current ;
long  thrust ;

#define PD_SCK 2
#define DOUT 3

void setup() {
  
  pinMode(PD_SCK, OUTPUT);
  pinMode(DOUT, INPUT);
  digitalWrite(PD_SCK, LOW);
  LBTServer.begin((uint8_t*)"RC_Dyno") ;
 
}

void loop() {
   
  if(LBTServer.connected())  {
    
  voltage = analogRead(A0);
  current = analogRead(A1);

  voltage  = map(voltage, 0,343,0,500);
  
  current = constrain(current, 512, 1023); 
  current  = map(current, 512,570,0,280);

  thrust = readhx()/400-21091;

      LBTServer.print(thrust);
      LBTServer.print(",");
      LBTServer.print(voltage/100);
      LBTServer.print(",");
      LBTServer.print(current/100);
      LBTServer.println(",");
      delay(100);
  }
  else
  {
    LBTServer.accept(5);
  }
}


bool is_ready() {
  return digitalRead(DOUT) == LOW;
}

long readhx() {
  // wait for the chip to become ready
  while (!is_ready());
  delay(2);
  unsigned long Count; 
  unsigned char i;  
  Count = 0;
  // pulse the clock pin 24 times to read the data
  for (i=0; i<24; i++) {
    digitalWrite(PD_SCK, HIGH);
      
    if(digitalRead(DOUT) > 0){
      Count++;
    }
    digitalWrite(PD_SCK, LOW);
    Count=Count<<1; 
    delay(1);

  }
  
  digitalWrite(PD_SCK, HIGH);
  delay(1);
  digitalWrite(PD_SCK, LOW);
  Count=Count^0x800000; 
  return Count;          
}

usb_rc_dyno.ino

Arduino
//****************************************************************
//*  Name    : RC Dyno                                           *
//*  Author  : Robert Joseph Korn                                *
//*  Notice  : Copyright (c) 2015 Open Valley Consulting Corp    *
//*  Date    : 12/15/15                                          *
//*  Version : 1.75                                              *
//*  Notes   :                                                   *
//*          :                                                   *
//****************************************************************

float voltage ;
float current ;
long  thrust ;

#define PD_SCK 2
#define DOUT 3

void setup() {
  
  pinMode(PD_SCK, OUTPUT);
  pinMode(DOUT, INPUT);
  digitalWrite(PD_SCK, LOW);
 
  Serial.begin(115200);
  
  while(!Serial){
     delay(100);
  }
}

void loop() {

  voltage = analogRead(A0);
  current = analogRead(A1);

  voltage  = map(voltage, 0,343,0,500);
  
  current = constrain(current, 512, 1023); 
  current  = map(current, 512,570,0,280);

  thrust = readhx()/400-21091;
  
//  Serial.print(millis());
//  Serial.print(",");
  Serial.print(thrust);
  Serial.print(",");
  Serial.print(voltage/100);
  Serial.print(",");
  Serial.print(current/100);
  Serial.println(",");

  delay(100);
}


bool is_ready() {
  return digitalRead(DOUT) == LOW;
}

long readhx() {
  // wait for the chip to become ready
  while (!is_ready());
  delay(2);
  unsigned long Count; 
  unsigned char i;  
  Count = 0;
  // pulse the clock pin 24 times to read the data
  for (i=0; i<24; i++) {
    digitalWrite(PD_SCK, HIGH);
      
    if(digitalRead(DOUT) > 0){
      Count++;
    }
    digitalWrite(PD_SCK, LOW);
    Count=Count<<1; 
    delay(1);

  }
  
  digitalWrite(PD_SCK, HIGH);
  delay(1);
  digitalWrite(PD_SCK, LOW);
  Count=Count^0x800000; 
  return Count;          
}

Credits

Robert Korn

Robert Korn

15 projects • 27 followers
I Made the Internet of Things before people had a name for it.

Comments