A bit of an approaching winter "heads-up" on openLRS and my experiences.
Well I have been operating only on openLRS 458 Mhz since Spring 2015. My 40 Mhz gear has mostly been "raffled-off" at Club meetings!
openLRS is still rather thin on the ground at the various national meetings I have been to (Bournville, Norwich etc.) with a maximum of 2 people using it. So we haven't tested its ability to operate 30 sets on frequency-hopping all at once! But no need for crystals, peg-boards and the plaintive cry of "any one on Channel XX etc."
I have only been using the Hobbyking receivers, still available at about $15 (That's about £75 of your English Pounds - feeble joke!)
I have rationalised my use of Telemetry and I only use sensors for battery voltage and depth. I didn't find compass heading very useful or consistent - stray magnetic fields?? Battery voltage readout is a real boon if you are using Lipo batteries. It is the only reliable system I know of for subs.
This has reduced the "wiring loom" in the sub. The next photo shows the Arduino Nano used to handle the telemetry. Note only 5 wires.
The next 2 photos show the inside of my standard WTC with the telemetry board above the Hobbyking receiver:
I attach the Arduino sketch which works with this. ( I hope that Tim forgives my clumsy "hacksawing" of his software. The original software is on the SubPirates Forum https://www.subpirates.com/showthread.php?5271-Custom-Frsky-Telemetry-Hub/page4 )
The TX option is rather limited for use by others because I am using the FrSky LCD display on my Futaba T9CP . (This LCD display is no longer available but Tim points out that many Tx's have LCD telemetry displays built in.)
I am really pleased with this development thanks to Tim. It is not just a replacement for 40Mhz but it is a significant improvement. (BTW after my early experiments with different antennae I have gone back to the standard commercial ones - they are easily good enough.)
David
// FrSkyTelemetryLRS - Version: Latest
#include <FrSkyTelemetryLRS.h>
/*
FrSky Telemetry library LRS test
(c) Pawelsky 20150724
Not for commercial use
FrSkyTelemetry library modified to deal with LRS format (TTL level serial instead of FrSky format...
renamed to FrSkyTelemetryLRS
modifications by tim senecal
Working for voltage input (/2?) on A3 by David Forrest
A2 gives depth input from pressure sensor.Multiply reading by 3 to give mm of water approx,
Software from Page 4 of Subpirates
Improvements? - get actual battery voltage. Calibrate depth sensor. Aug 2017
*/
#include "FrSkyTelemetryLRS.h"
#define minraw 272.0
#define maxraw 1015.0
#define minreal 9.0
#define maxreal 158.0
//#define voltsdiv 84.81
//#define voltsdiv 102.40
#define voltsdiv 82.0 ; // was 67 by RDF for Holland lipo
FrSkyTelemetryLRS telemetry; // Create telemetry object
const int analogTemp1 = A0;
const int analogTemp2 = A1;
const int analogAmp = A2;
const int analogVolt = A3;
int mVperAmp = 66; // use 185 for 5A, 100 for 20A, and 66 for 30A
int ACSoffset = 2500; // offset to remove negative side of range
float amperes = 0;
float voltage = 0;
float actual_rpm = 0;
float calc_speed = 0;
float Temp1;
float Temp2;
float depth;
void setup()
{
// Configure the telemetry serial port
telemetry.begin(SERIAL_1);
Serial.begin(9600);
}
void loop()
{
actual_rpm = 3000;
calc_speed = 2.258;
amperes = calc_amperage_val();
voltage = calc_voltage_val();
telemetry.setFasData(amperes, // Current consumption in amps
voltage); // Battery voltage in volts
depth = amperes-180;
telemetry.setFgsData(depth); // Fuel level in percent - unsigned int16 - any value between 0 and 65535
// Set LiPo voltage sensor (FLVS) data (we use two sensors to simulate 8S battery
// (set Voltage source to Cells in menu to use this data for battery voltage)
float v1 = voltage/2;
//float v2 = voltage/2;
telemetry.setFlvsData(v1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); // Cell voltages in volts (cells 1-8). Cells 9-12 are not used in this example
// Set variometer sensor (FVAS) data
telemetry.setFvasData(depth); // Altitude in m (can be nevative)
// Set GPS data
float heading = 125.22;
telemetry.setGpsData(39.847993, -105.104269, // Latitude and longitude in degrees decimal (positive for N/E, negative for S/W)
depth, // Altitude in m (can be negative)
calc_speed, // Speed in m/s
heading, // Course over ground in degrees
15, 2, 19, // Date (year - 2000, month, day)
12, 00, 00); // Time (hour, minute, second) - will be affected by timezone setings in your radio
float accel_angle_x = 2.35;
float accel_angle_y = 4.25;
float accel_angle_z = 3.15;
telemetry.setTasData(accel_angle_x, // calculated x angle
accel_angle_y, // calculated y angle
accel_angle_z); // calculated z angle
// Set temperature sensor (TEMS) data, two temperatures T1 & T2
// Set temperature sensor (TEMS) data, two temperatures T1 & T2
Temp1 = calc_temp_val(analogTemp1);
Temp2 = calc_temp_val(analogTemp2);
telemetry.setTemsData(Temp1, // Temperature #1 in degrees Celsuis (can be negative)
Temp2); // Temperature #2 in degrees Celsuis (can be negative)
// Set RPM sensor (RPMS) data
// (set number of blades to 2 in telemetry menu to get correct rpm value)
telemetry.setRpmsData(actual_rpm); // Rotations per minute
// Send the telemetry data, note that the data will only be sent for sensors
// that had their data set at least once. Also it will only be set in defined
// time intervals, so not necessarily at every call to send() method.
telemetry.send();
delay(100); //delay for 1/10 of a second
}
float fmap (float x, float in_min, float in_max, float out_min, float out_max) {
return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
}
float calc_temp_val(int analog_pin){
uint16_t raw_val;
float temp, raw_float;
temp = 0;
raw_val = analogRead(analog_pin);
// raw_val = 1023 - raw_val;
raw_float = raw_val;
temp = fmap(raw_val, minraw, maxraw, minreal, maxreal);
// Serial.print("raw temp: ");
// Serial.print(analog_pin);
// Serial.print(" ");
// Serial.println(raw_val);
return temp;
}
float calc_voltage_val(){
int RawValue = analogRead(analogVolt);
voltage = RawValue;
// Serial.print("raw volt: ");
// Serial.println(RawValue);
voltage = voltage / voltsdiv; // Gets you adjusted Volts
return voltage;
}
float calc_amperage_val(){
int RawValue = analogRead(analogAmp);
Serial.print("raw amps: ");
Serial.println(RawValue);
float mVoltage = RawValue;
mVoltage = mVoltage / 1024.0;
mVoltage = mVoltage * 5000; // Gets you mV 5000 is VCC for 5v arduino
Serial.print("mVolts: ");
Serial.println(mVoltage);
//Next 2 lines by RDF to output raw amps
//amperes = abs(((mVoltage - ACSoffset) / mVperAmp));
amperes = RawValue;
Serial.print("Input on A2: ");
Serial.println(amperes);
return amperes;
}
Tue Oct 29, 2024 4:46 pm by tsenecal
» RC Drift Gyro for pitch control
Sun Oct 20, 2024 2:04 pm by geofrancis
» WW2 mini sub build
Thu Oct 17, 2024 2:34 pm by geofrancis
» sonar data link
Mon Oct 14, 2024 4:31 pm by geofrancis
» Robbe Seawolf V2
Sat Oct 12, 2024 3:52 pm by geofrancis
» ExpressLRS - 868/915 Mhz equipment
Fri Oct 11, 2024 8:58 pm by Marylandradiosailor
» Flight controllers as sub levelers
Fri Oct 11, 2024 8:14 pm by geofrancis
» 868/915 Mhz as a viable frequency for submarines.
Thu Oct 10, 2024 3:21 am by tsenecal
» Microgyro pitch controller corrosion
Wed Oct 02, 2024 11:32 am by geofrancis