Arduino Based Flap Position Indicator Setup For Aerolite 103
Arduino Based Flap Position Indicator Setup For Aerolite 103
DISCLAIMER: The author or anyone else connected with the information in this article, in any
way whatsoever, is not responsible for the use or application of the information contained
herein by any other person and that any person that uses the information provided here does
so at their own risk. Under no circumstances whatsoever shall the author be responsible for any
damages or loss with respect to any damage or injury to any vehicle, or the occupants thereof,
or any other person or property.
See drawing for method to connect the slide-pot and slider to the actuator
/actuator arm!
Arduino Sketch:
NOTE: The values for the Slide-pot may have to be calibrated (The current values gave a good
approximation of the relevant flap position) but the values may differ for your set-up)
#define PIN_SLIDE_POT A0 // Attach Pot slider pins to A0, GND and 5v(VCC) on ARDUINO
// 5" long SLIDE POTENTIOMETER (5-10K OHMs can be used) will read
// values approx between 0 and 1023 on 5V)
// Calibrate below values according to actual flap positions
int f_up_less_than = 15; // Flaps are in UP position if LESS THAN this value
int f_10_more_than = 30; // Flaps are in the 10DEG position if BETWEEN this value..
int f_10_less_than = 50; // ....AND this value
int f_20_more_than = 100; // Flaps are in the 20DEG position if BETWEEN this value..
int f_20_less_than = 180; // ....AND this value
int f_dwn_more_than = 500; // Flaps are in the DOWN position if MORE THAN this value
int delo = 250;
int delf = 20;
void setup() {
pinMode(4, OUTPUT); // Up LED - pin 4 LEDs will glow steady when flaps are UP, 10DEG,
// 20DEG and DOWN respectively, and flash when between those positions //
respectively
pinMode(5, OUTPUT); // 10 Deg LED - pin 5
pinMode(6, OUTPUT); // 20 Deg LED - pin 6
pinMode(7, OUTPUT); // Down LED - pin 7
pinMode(PIN_SLIDE_POT, INPUT_PULLUP);
}
void loop() {
int val_sp = analogRead(PIN_SLIDE_POT);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
digitalWrite(6, LOW);
digitalWrite(7, LOW);
if (val_sp <= f_up_less_than) {
digitalWrite(4, HIGH);
}
if (val_sp > f_up_less_than && val_sp < f_10_more_than) {
digitalWrite(4, HIGH);
delay(delo);
digitalWrite(4, LOW);
delay(delf);
digitalWrite(5, HIGH);
delay(delo);
digitalWrite(5, LOW);
delay(delf);
}
if (val_sp >= f_10_more_than && val_sp <= f_10_less_than) {
digitalWrite(5, HIGH);
}
if (val_sp > f_10_less_than && val_sp < f_20_more_than) {
digitalWrite(5, HIGH);
delay(delo);
digitalWrite(5, LOW);
delay(delf);
digitalWrite(6, HIGH);
delay(delo);
digitalWrite(6, LOW);
delay(delf);
}
if (val_sp >= f_20_more_than && val_sp <= f_20_less_than) {
digitalWrite(6, HIGH);
}
if (val_sp > f_20_less_than && val_sp < f_dwn_more_than) {
digitalWrite(6, HIGH);
delay(delo);
digitalWrite(6, LOW);
delay(delf);
digitalWrite(7, HIGH);
delay(delo);
digitalWrite(7, LOW);
delay(delf);
}
if (val_sp >= f_dwn_more_than) {
digitalWrite(7, HIGH);
}
}