|
|
|||||
|
Thread OP
|
Discussion
DIY simple and inexpensive Arduino-based sailplane variometer![]()
This is my second vario design. The previous one was expensive and bulky. Also the pressure sensor used turned out to be sensitive for RF. This one has no such problems. This is the best investment I have done regarding sailplanes. Makes it way easier to find lift! Any AM/OOK TX/RX can be used, but I had most success with the 433MHz modules from RF-Solutions. Much better than the cheap Ebay ones. The RX audio is fed to a portable, battery operated FM radio. I build the RX into the radio, and connected the audio to the FM radio's volume potmeter. See attachments for schematics. Code:
// All code by Rolf R Bakke, Oct 2012
#include <Wire.h>
const byte led = 13;
unsigned int calibrationData[7];
unsigned long time = 0;
float toneFreq, toneFreqLowpass, pressure, lowpassFast, lowpassSlow ;
int ddsAcc;
void setup()
{
Wire.begin();
Serial.begin(115200);
setupSensor();
pressure = getPressure();
lowpassFast = lowpassSlow = pressure;
}
void loop()
{
pressure = getPressure();
lowpassFast = lowpassFast + (pressure - lowpassFast) * 0.1;
lowpassSlow = lowpassSlow + (pressure - lowpassSlow) * 0.05;
toneFreq = (lowpassSlow - lowpassFast) * 50;
toneFreqLowpass = toneFreqLowpass + (toneFreq - toneFreqLowpass) * 0.1;
toneFreq = constrain(toneFreqLowpass, -500, 500);
ddsAcc += toneFreq * 100 + 2000;
if (toneFreq < 0 || ddsAcc > 0)
{
tone(2, toneFreq + 510);
}
else
{
noTone(2);
}
ledOff();
while (millis() < time); //loop frequency timer
time += 20;
ledOn();
}
long getPressure()
{
long D1, D2, dT, P;
float TEMP;
int64_t OFF, SENS;
D1 = getData(0x48, 10);
D2 = getData(0x50, 1);
dT = D2 - ((long)calibrationData[5] << 8);
TEMP = (2000 + (((int64_t)dT * (int64_t)calibrationData[6]) >> 23)) / (float)100;
OFF = ((unsigned long)calibrationData[2] << 16) + (((int64_t)calibrationData[4] * dT) >> 7);
SENS = ((unsigned long)calibrationData[1] << 15) + (((int64_t)calibrationData[3] * dT) >> 8);
P = (((D1 * SENS) >> 21) - OFF) >> 15;
//Serial.println(TEMP);
//Serial.println(P);
return P;
}
long getData(byte command, byte del)
{
long result = 0;
twiSendCommand(0x77, command);
delay(del);
twiSendCommand(0x77, 0x00);
Wire.requestFrom(0x77, 3);
if(Wire.available()!=3) Serial.println("Error: raw data not available");
for (int i = 0; i <= 2; i++)
{
result = (result<<8) | Wire.read();
}
return result;
}
void setupSensor()
{
twiSendCommand(0x77, 0x1e);
delay(100);
for (byte i = 1; i <=6; i++)
{
unsigned int low, high;
twiSendCommand(0x77, 0xa0 + i * 2);
Wire.requestFrom(0x77, 2);
if(Wire.available()!=2) Serial.println("Error: calibration data not available");
high = Wire.read();
low = Wire.read();
calibrationData[i] = high<<8 | low;
Serial.print("calibration data #");
Serial.print(i);
Serial.print(" = ");
Serial.println( calibrationData[i] );
}
}
void twiSendCommand(byte address, byte command)
{
Wire.beginTransmission(address);
if (!Wire.write(command)) Serial.println("Error: write()");
if (Wire.endTransmission())
{
Serial.print("Error when sending command: ");
Serial.println(command, HEX);
}
}
void ledOn()
{
digitalWrite(led,1);
}
void ledOff()
{
digitalWrite(led,0);
}
...and remember: bigger the blob, better the job! |
||||
|
|
Last edited by kapteinkuk; Aug 08, 2013 at 04:17 PM.
Reason: cause I can.
|
||||
|
|
|
|
|
|
|
Hi KK,
great work ! It could even be greater if you would add Total Energy Compensation feature. Do you plan something this way ? Anyway the response of this vario seems pretty sensible and immediate. Another feature I would like is to have a serial port to transmit over an Xbee or similar (maybe it already work this way ?) or over MAVlink, or M-link. This last one could let use downlink channel of M-link capable RC systems like Multiplex or ACT (which I use ) and avoiding the usage of another frequency.I think Graupner Hott and Jeti Duplex work on a similar way. Best regards, Ric |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Thank you for posting your design and code. I've been tinkering with one my self, but mine has way-to-many parts. This is a lot simpler.
Here in the USA I found Digi Key sells the RF components, but not the same as the RT14 series.Would you recommend any from this list: http://www.digikey.com/product-searc...fffc0165&chp=0 Also, the pressure sensor you used comes in a module as all I found were bare sensors. Can you provide the whole part number to the sensor? Maybe I can match-up the specifications to yours. http://www.meas-spec.com/pressure-se...r-modules.aspx Thank you for your help Martin |
|
|
|
|
|
||||
|
Thread OP
|
Quote:
Quote:
Quote:
|
|||
|
|
||||
|
|
||||
|
Thread OP
|
Quote:
If you can, check out RS components, where I bought mine. My friend uses inexpensive modules from China, and is happy with that. Quote:
You can also find the same module cheaper on Ebay. Quote:
|
|||
|
|
||||
|
|
|
|
|
Hi KK,
what about using one of those tx and rx modules ? Btw this one is 50mW. I saw Telecontrolli has high power modules on 433 and 868MHz (400-800mW), but I can't find a seller. RF solutions has a crazy high abroad shipping rate (~$50.-) :O Is it possible to feed the audio channel on a FPV video tx ? Did I get it right that Arduino already generate an analogical audio signal ? Which modifications are required (e.g. to match video tx audio channel impedance) ? Thanks and best regards, Ric |
|
|
|
|
|
||||
|
Thread OP
|
Quote:
Quote:
Quote:
|
|||
|
|
||||
|
|
||
|
|
Quote:
Is it right I should divide 3.3V into 1V ? Specs for usual FPV video tx are : 10k ohm impedance, 1Vp-p I guess then than I should have : Arduino D2 output Voltage 3.3V R1 10000Ohm in serie R2 4348Ohm to ground Input Voltage to video TX 1V Am I on the right way ? Thanks, Ric |
|
|
|
||
|
|
|
|
|
I am mystified as to why you would need more than 10mW.
A cheap UHF transceiver, $30 or so, and a FM 10mW module ought to give you an airborne LOS to receive the variometer tones of around 60kM. Why would you want to blast out, 400 - 800mW from an aeroplane, causing unknown disruption to other comms, when you only need a few mW ? |
|
|
|
| Similar Threads | |||||
| Category | Thread | Thread Starter | Forum | Replies | Last Post |
| Mini-HowTo | DIY arduino twin video receiver diversity controller. Updates allways in post #1 | Richard_s | FPV Equipment | 145 | Mar 01, 2016 03:39 AM |
| Idea | DIY Video Diversity with Arduino - Please Review! | MayMayDay | FPV Talk | 3 | Aug 22, 2015 09:27 AM |
| Discussion | Arduino based IR tag module for combat | sh4nce | Combat | 38 | Feb 18, 2015 05:02 PM |
| New Product | DIY OpenPilot based FlightControl (F4) | lilvinz | Multirotor Drone Electronics | 271 | Jan 04, 2015 06:58 AM |
| Help! | Engineering student and first arduino based build? | cad2blender | UAV - Unmanned Aerial Vehicles | 3 | May 17, 2012 07:59 AM |