Hi Guys,

I designed this protocol since few months ago but it lost in hole of internet.
I hope it helps someone.

Everyone using video transmitters on UAV/FPV planes and audio channels empty or only transmitting propeller sound, this is why i designed this telemetry protocol on audio ;)



Advantages of Audio Telemetry Protocol (ATP)

  • You don't need any extra hardware except your Autopilot/OSD's processor for transmitting datas
  • You can receive all data without any hardware with your PC/laptop
  • Audio channel less noisy than video
  • %90 of video Tx/RX modules supports ATP's 2000-1300hz audible waves without any problem

How ATP Works?

ATP uses AFSK method to sending telemetry data over VideoTX’s audio
channel. The carrier is 2100Hz and a byte starts with one 1300hz wave(start bit), ATP sends
data bits after the start bit. and it sends minimum 10 carrier wave(zero) before a new start bit.
You can read my detailed information from this link (sorry for my English): http://www.flytron.com/pdf/audio_modem.pdf

Code Example for Atmel Users


Calibrating a PWM generator for 2100Hz carrier wave (for Atmega328)
TCCR1B   =   0x00;   //stop timerTCNT1H   =   0;TCNT1L   =   0;
ICR1 = ((Xtalfrequency/8) / 2100); //2100hz carrier generator value 878 for 14.7Mhz
OCR1B = ((Xtalfrequency/8) / 2100)/2; // ICR1 / 2 for %50 PWM waves
TCCR1A = 0x22;
TCCR1B = 0x1A; //start timer
This code generates static 2100hz square waves, put a 100nf capacitor on outside of processor and connect it on Audio in of TX, now you have a sinus on RX side ;)


You can send the bytes any time in your main code flow because AFSK protocol following waves not time sensitive protocol.
modem[] is an byte array that filled with data to send.
modem_byte is an integer for selecting byte of modem[] array
modem_bit is an char for counting sinus waves of AFSK

This code sends start bit at start and 8 bit of byte,
you should wait for 5ms for next byte for balancing sinus waves on audio stream, then you can send another byte also.
modem_bit = 0;while (modem_bit<18) //wait for all bit waves        {

if ((modem_bit%2==0) && ((PINB & (1 << 2))) ) // wait for 1 on PWM output.
{
if (modem_bit==0) // start bit
{
TCNT1H = 1; // this values creates small delay for increasing the wave width
TCNT1L = 180; // and AFSK decoder can detect this big waves to 1, other small(2100hz) waves 0
}

if (modem_bit>1)
{
if (modem[modem_byte] & (1<<((modem_bit-2)/2))) // if bit of bte is 1, change the wave width for 1 on AFSK
{
TCNT1H = 1; // this values creates small delay for increasing the wave width
TCNT1L = 180; // and AFSK decoder can detect this big waves to 1, other small(2100hz) waves 0
}
}

modem_bit++;
}

if ((modem_bit%2==1) && (!(PINB & (1 << 2)))) // wait for 0 on PWM output
{
modem_bit++;
}
}



ATP Modem Software

I wrote a modem software for reading AFSK waves without any hardware (maybe a serial 100k resistor on microphone in)
File name is: SOSD_Modem.exe

audio_telemetry_modem.png


This is only software modem on the planet (or i didn't see another) :)
It is decoding AFSK codes from microphone input like an oscilloscope and giving output values from TCP for 3th party softwares. You can design your loggers, goggle earth interfaces or more with this plug.

It is using 20byte data pack for transmitting and software can separate them
First 16 byte is data bytes last 3 byte is line end and CRC
Pack of Bytes
[0-3] Latitude (4 byte = 32 bit long integer of coordinates)
[4-7] Longitude (4 byte = 32 bit long integer of coordinates)
[8-9] Altitude (2 byte = 16 bit long integer of altitude)
[10] Heading Angle (multiply it with 1.4 for finding angle value)
[11] Battery 1 voltage (divide 10 for value, 111 mean 11.1Volt)
[12] Battery 1 voltage (divide 10 for value, 74 mean 7.4Volt)
[13] Current Sensor 1 (multiply with 0.4 for value, 101 mean 40.4Ah
[14] Current Sensor 2 (multiply with 0.4 for value, 101 mean 40.4Ah
[15] RSSI (It is percentage of maximum value, 35 mean %35)
[16] Speed (km/h)
[17] Line End 1 (value 10)
[18] Line End 2 (value 13)
[19] CRC ( 8 bit totals of first 19 btye)

If you uses my original data pack Software Modem giving this type output from port 1976 (my birth year)
$TELE,lat,lon,alti,heading,voltag1,voltage2,curren t1,current2,rssi, speed, #13 #10

Or you can use your own data pack and you can decode them yourself from modem's RAW data output.
$RAWS,byte0,byte1,byte2,byte3,byte4.........,byte16, #13 #10
then you can decode your data bytes(first 16 byte)

This software only part of ATP i didn't share the codes because i want to share the protocol with all autopilot/OSD producers and i want to use their 3th party tools too.If I share the code, they can change only AFSK frequency and visuals for non compatible products.

New Features

I added direct KML file based live view for Google Earth on the new version of modem software.
You can click on plane_tracker.kml file and Google Earth connects your Modem Software to tracking the plane :)
It is already primitive because we have some connection problem on Google Earth since few months :(


Story Of ATP

If you want to read all discussions follow this link: http://www.rcgroups.com/forums/showthread.php?t=1157558

Thanks for reading
Melih

E-mail me when people leave their comments –

You need to be a member of diydrones to add comments!

Join diydrones

Comments

  • @Carlito
    It's baudrate around 400-480bps (60byte per second)
    You should fly with autopilot and send only direction commands to the pilot. It is only way for low baudrates
  • You might have more luck googling for Software Defined Radio rather than software modem. As C Moss above said, this is a very widely used idea (both by hobbyists and industry) and you can do many very clever things with it. (However with just the PWM timer on an AVR for the transmitter, many of these clever algorithms won't be suitable as they expect an I/Q arrangement.)
  • Very nice idea
  • @John

    I didnt notice any problem since few months. AFSK is already solid method (remember 14.4k phone modems) If you using very low quality transmitters maybe your problem was that, disable the "digitize" mark for watching all sinus waves. Then you can see your noise problem. Maybe you can use a band pass filter for reducing noises but it is not about protocol's problem, it is rock solid as possible ;)
  • its too sensitive to transmitter noise your protocol, i think it should be remade to be rock solid on any transmitter/ receiver. Too many people have problems with it.
This reply was deleted.