Matronics Email Lists Forum Index Matronics Email Lists
Web Forum Interface to the Matronics Email Lists
 
 Get Email Distribution Too!Get Email Distribution Too!    FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

DIY Serial to Gaycode converter

 
Post new topic   Reply to topic    Matronics Email Lists Forum Index -> AeroElectric-List
View previous topic :: View next topic  
Author Message
finn.usa(at)gmail.com
Guest





PostPosted: Sat Jul 11, 2020 7:07 pm    Post subject: DIY Serial to Gaycode converter Reply with quote

Can't find my previous post so here goes.
I was able to use an Arduino Nano to convert serial altitude output from my Dynon D-10A (same from D-100) to gray code altitude inputs on my Garmin GTX 320A transponder.
That replaced my AK-350 altitude encoder. Saved some weight, but mainly I now know that the altitude I see on my Dynon (set to 29.92) is what ATC sees.

I measured altitude inputs on the GTX 320A. Takes less than 0.1mA to pull an input to ground. Internally pulled up to 5V (I measured 4.35V), apparently with a 50K resistor and also has isolation diodes according to the manual.
That means that the digital outputs of the Nano can drive the transponder altitude inputs directly (but needs to be inverted from the altitude table on the aero-electric web site:1 = 0 volts).
http://www.aeroelectric.com/articles/Altitude_Encoding/modecascii.txt
(Note that C4 is LSB and D1 is MSB,  so table should be re-arranged as:
[img]cid:part2.BBB064CB.A051C6CF(at)gmail.com[/img]
...  to make a lookup table in the program. (I'm sure there is an algorithm to calculate the codes, I just found it easier and safer to use the table.)

The serial altitude output from the Dynon are +-7V volts, so needs to be brought to 0 to 5V for input to the Nano. A 2N7000 FET does that nicely. Source to ground, Drain to Nano input (internal pull-up  resistor enabled) and Gate to Dynon output. Gate can handle +-20V, so if handled carefully needs no additional components. Also inverts the signal to what the serial software expects (active low).

Attached program can be compiled and uploaded to a Nano using the Arduino IDE (https://www.arduino.cc/en/main/software).
Remove the .txt extension from the file name (the list server won't allow attachments with .ino file extension).

Accepts -1200 to 125,700', but I assume the Dynon is limited to a lower max altitude.
When you set the Dynon to output altitude in 100' steps, it nicely changes at the displayed 50' points. So if you see 140' displayed you know the transponder transmits100'; 150' displayed transmits 200'.
I programmed it to use D-10A / D-100 format 1 (example):
#AL +05200T+25D7[CR]
(Look for #, then minus sign if there, then digits, then "T". "T" is use as delimiter, rest is ignored till next "#").
1200 baud.
Would be easy to change the program to use any of the other formats and baud rates.
So there you have it: a serial converter/encoder for $6 or less.

Finn
[img]cid:part4.21847B4B.F5F8DF0B(at)gmail.com[/img] Virus-free. www.avast.com [url=#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2] [/url]


- The Matronics AeroElectric-List Email Forum -
 

Use the List Feature Navigator to browse the many List utilities available such as the Email Subscriptions page, Archive Search & Download, 7-Day Browse, Chat, FAQ, Photoshare, and much more:

http://www.matronics.com/Navigator?AeroElectric-List



gkoilchkcjnnkgja.png
 Description:
 Filesize:  5.13 KB
 Viewed:  2780 Time(s)

gkoilchkcjnnkgja.png



foehkppalbfjicjd.jpg
 Description:
 Filesize:  67.12 KB
 Viewed:  2780 Time(s)

foehkppalbfjicjd.jpg



AltEncoder.ino.txt
 Description:

Download
 Filename:  AltEncoder.ino.txt
 Filesize:  16.33 KB
 Downloaded:  215 Time(s)

Back to top
cluros(at)gmail.com
Guest





PostPosted: Sat Jul 11, 2020 7:48 pm    Post subject: DIY Serial to Gaycode converter Reply with quote

Wonderful, the cheapest available units are $100.

Doesn't the D10A output grey code though?
On Sat, Jul 11, 2020, 20:15 Finn Lassen <finn.usa(at)gmail.com (finn.usa(at)gmail.com)> wrote:

Quote:

Can't find my previous post so here goes.
I was able to use an Arduino Nano to convert serial altitude output from my Dynon D-10A (same from D-100) to gray code altitude inputs on my Garmin GTX 320A transponder.
That replaced my AK-350 altitude encoder. Saved some weight, but mainly I now know that the altitude I see on my Dynon (set to 29.92) is what ATC sees.

I measured altitude inputs on the GTX 320A. Takes less than 0.1mA to pull an input to ground. Internally pulled up to 5V (I measured 4.35V), apparently with a 50K resistor and also has isolation diodes according to the manual.
That means that the digital outputs of the Nano can drive the transponder altitude inputs directly (but needs to be inverted from the altitude table on the aero-electric web site:1 = 0 volts).
http://www.aeroelectric.com/articles/Altitude_Encoding/modecascii.txt
(Note that C4 is LSB and D1 is MSB,  so table should be re-arranged as:
[img]cid:part2.BBB064CB.A051C6CF(at)gmail.com[/img]
...  to make a lookup table in the program. (I'm sure there is an algorithm to calculate the codes, I just found it easier and safer to use the table.)

The serial altitude output from the Dynon are +-7V volts, so needs to be brought to 0 to 5V for input to the Nano. A 2N7000 FET does that nicely. Source to ground, Drain to Nano input (internal pull-up  resistor enabled) and Gate to Dynon output. Gate can handle +-20V, so if handled carefully needs no additional components. Also inverts the signal to what the serial software expects (active low).

Attached program can be compiled and uploaded to a Nano using the Arduino IDE (https://www.arduino.cc/en/main/software).
Remove the .txt extension from the file name (the list server won't allow attachments with .ino file extension).

Accepts -1200 to 125,700', but I assume the Dynon is limited to a lower max altitude.
When you set the Dynon to output altitude in 100' steps, it nicely changes at the displayed 50' points. So if you see 140' displayed you know the transponder transmits100'; 150' displayed transmits 200'.
I programmed it to use D-10A / D-100 format 1 (example):
#AL +05200T+25D7[CR]
(Look for #, then minus sign if there, then digits, then "T". "T" is use as delimiter, rest is ignored till next "#").
1200 baud.
Would be easy to change the program to use any of the other formats and baud rates.
So there you have it: a serial converter/encoder for $6 or less.

Finn
[img]cid:part4.21847B4B.F5F8DF0B(at)gmail.com[/img]
Virus-free. www.avast.com [url=#m_7040235781590540538_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2] [/url]



- The Matronics AeroElectric-List Email Forum -
 

Use the List Feature Navigator to browse the many List utilities available such as the Email Subscriptions page, Archive Search & Download, 7-Day Browse, Chat, FAQ, Photoshare, and much more:

http://www.matronics.com/Navigator?AeroElectric-List



gkoilchkcjnnkgja.png
 Description:
 Filesize:  5.13 KB
 Viewed:  2779 Time(s)

gkoilchkcjnnkgja.png



foehkppalbfjicjd.jpg
 Description:
 Filesize:  67.12 KB
 Viewed:  2779 Time(s)

foehkppalbfjicjd.jpg



foehkppalbfjicjd.jpg
 Description:
 Filesize:  67.12 KB
 Viewed:  2779 Time(s)

foehkppalbfjicjd.jpg


Back to top
finn.usa(at)gmail.com
Guest





PostPosted: Sun Jul 12, 2020 6:47 am    Post subject: DIY Serial to Gaycode converter Reply with quote

Nope.

"Dynon's altitude signal output is an RS-232 serial data stream that is
compatible with newer style transponders like the Garmin GTX-330 and
GTX-327. Transponders only accepting the traditional gray code
(sometimes called Gillham code) input require Dynon's optional encoder
converter module." $80

Finn
On 7/11/2020 11:44 PM, Sebastien wrote:
Quote:
Wonderful, the cheapest available units are $100.

Doesn't the D10A output grey code though?


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus


- The Matronics AeroElectric-List Email Forum -
 

Use the List Feature Navigator to browse the many List utilities available such as the Email Subscriptions page, Archive Search & Download, 7-Day Browse, Chat, FAQ, Photoshare, and much more:

http://www.matronics.com/Navigator?AeroElectric-List
Back to top
cluros(at)gmail.com
Guest





PostPosted: Sun Jul 12, 2020 7:04 am    Post subject: DIY Serial to Gaycode converter Reply with quote

Thanks Finn, I was thinking of the old D10.

On Sun, Jul 12, 2020, 07:51 Finn Lassen <finn.usa(at)gmail.com (finn.usa(at)gmail.com)> wrote:

Quote:
--> AeroElectric-List message posted by: Finn Lassen <finn.usa(at)gmail.com (finn.usa(at)gmail.com)>

Nope.

"Dynon's altitude signal output is an RS-232 serial data stream that is
compatible with newer style transponders like the Garmin GTX-330 and
GTX-327. Transponders only accepting the traditional gray code
(sometimes called Gillham code) input require Dynon's optional encoder
converter module." $80

Finn


On 7/11/2020 11:44 PM, Sebastien wrote:
> Wonderful, the cheapest available units are $100.
>
> Doesn't the D10A output grey code though?


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

===========
-
Electric-List" rel="noreferrer noreferrer" target="_blank">http://www.matronics.com/Navigator?AeroElectric-List
===========
FORUMS -
eferrer noreferrer" target="_blank">http://forums.matronics.com
===========
WIKI -
errer noreferrer" target="_blank">http://wiki.matronics.com
===========
b Site -
          -Matt Dralle, List Admin.
rel="noreferrer noreferrer" target="_blank">http://www.matronics.com/contribution
===========





- The Matronics AeroElectric-List Email Forum -
 

Use the List Feature Navigator to browse the many List utilities available such as the Email Subscriptions page, Archive Search & Download, 7-Day Browse, Chat, FAQ, Photoshare, and much more:

http://www.matronics.com/Navigator?AeroElectric-List
Back to top
finn.usa(at)gmail.com
Guest





PostPosted: Sun Jul 12, 2020 7:09 am    Post subject: DIY Serial to Gaycode converter Reply with quote

Oops. Just noticed a bug in the source code I previously uploaded,
should be:

  sAltitude = sAltitude.substring(0, sAltitude.length() - 2);

Otherwise won't see 10,000s of feet.

Attached is the corrected source code and compiled non-test version.

Finn
On 7/11/2020 11:03 PM, Finn Lassen wrote:
Quote:
Attached program can be compiled and uploaded to a Nano using the
Arduino IDE (https://www.arduino.cc/en/main/software).

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus


- The Matronics AeroElectric-List Email Forum -
 

Use the List Feature Navigator to browse the many List utilities available such as the Email Subscriptions page, Archive Search & Download, 7-Day Browse, Chat, FAQ, Photoshare, and much more:

http://www.matronics.com/Navigator?AeroElectric-List



AltEncoder.ino.txt
 Description:

Download
 Filename:  AltEncoder.ino.txt
 Filesize:  16.34 KB
 Downloaded:  203 Time(s)


AltEncoder.ino.hex.txt
 Description:

Download
 Filename:  AltEncoder.ino.hex.txt
 Filesize:  18.61 KB
 Downloaded:  205 Time(s)

Back to top
Display posts from previous:   
Post new topic   Reply to topic    Matronics Email Lists Forum Index -> AeroElectric-List All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group