Open Source Audio Telemetry Protocol for Everyone



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


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

Views: 2092

Comment by NomDePlums on August 9, 2010 at 3:03am
The ham radio community have been doing software modem for many years. Just letting you know it's far from being a new idea. You'll find many advanced algorithums for receive filtering and transmit generating using various modulation methods plus data compression and forward error checking algorithums to help with this.

Good use for the unused audio channel(s) though.
Comment by Jhon on August 9, 2010 at 3:20am
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.
Comment by Melih Karakelle on August 9, 2010 at 4:06am
@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 ;)

Moderator
Comment by Morli on August 9, 2010 at 4:57am
yep , HAMs have been using many software modems to use along with their HF or VHF radios. Infact files can be transmitted too with right software and radio interface like Tigertronics or simply use software like MixW to decode . It is good idea however to use the audio channel.
Comment by ionut on August 9, 2010 at 5:51am
Very nice idea
Comment by Hugo Vincent on August 9, 2010 at 6:31am
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.)
Comment by Carlito Oliveira on August 9, 2010 at 7:20pm
Hello man! I've being trying to implement AFSK with eletronics such as the LM567 tone decoder, but doing that by software is way better!

My final Idea is to transmit the PPM signal from the manual controller to the plane trough GSM calls, do u think it's possible?

What was the highest baud rate u've achieved with this protocol?

Congrats!
Comment by Melih Karakelle on August 9, 2010 at 10:19pm
@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
Comment by Simon Wood on August 10, 2010 at 9:28am
As others have mentioned the HAM community having being playing with this sort of thing for ages; APRS is normally transmitted on the 2M band (144.39MHz) but there is no reason it shouldn't be use over other frequencies providing there is sufficient bandwidth.

One project I have used in the past is the OpenTracker (http://www.argentdata.com/products/otplus.html) which receives the GPS data, format and modulates into AFSK 2400 tones. These can then be sent to radio and out into the ether.

The benefit of using APRS is the huge amount on infrastructure and code already out there. For example, internet tracking sites such as http://aprs.fi which will so any activity in your local area. If you are using a non-standard radio config, you can also 'gate' the data onto the APRS network to make it available for others to see.

That said, it's always fun to hack around and try something new,
Cheers,
Mungewell.

Moderator
Comment by Morli on August 10, 2010 at 1:09pm
& @ 1.2 baud rate too if I remember it right. Though I suggested it to Melith But I could not acertain if aprs protocol is open source or not clearly or find decent info source on the protocol for him to refer :(

Comment

You need to be a member of DIY Drones to add comments!

Join DIY Drones

Social Networking

Contests

Season Two of the Trust Time Trial (T3) Contest has now begun. The fourth round is an accuracy round for multicopters, which requires contestants to fly a cube. The deadline is April 14th.

A list of all T3 contests is here

Advertisement

© 2013   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service