Encoder simulator code
void setup() {
pinMode(5, OUTPUT); //A1
pinMode(6, OUTPUT); //A2
pinMode(7, OUTPUT); //A3
pinMode(8, OUTPUT); //B1
pinMode(9, OUTPUT); //B2
pinMode(10, OUTPUT); //B4
pinMode(11, OUTPUT); //C1
pinMode(12, OUTPUT); //C2
pinMode(13, OUTPUT); //C4
}
void loop() {
digitalWrite(5, HIGH);
digitalWrite(6, HIGH);
digitalWrite(7, HIGH);
digitalWrite(8, HIGH);
digitalWrite(9, HIGH);
digitalWrite(10, HIGH);
digitalWrite(11, HIGH);
digitalWrite(12, HIGH);
digitalWrite(13, HIGH);
digitalWrite(9, LOW);
digitalWrite(13, LOW); //700
delay(3000);
digitalWrite(8, LOW); //800
delay(3000);
digitalWrite(12, LOW); //900
delay(3000);
digitalWrite(13, HIGH); //1000
delay(3000);
}
Duemilanove encoder simulator pinout
I need to be able to simulate and encoder at home. I am building one on my Duemilanove board.
The pinout is as follows
Enc Funct Arduino
- N/C
- A1 5
- A2 6
- A4 7
- B1 8
- N/C
- N/C
- N/C
- B2 9
- B4 10
- C1 11
- C4 13
- C2 12
I figure I can find a sequence or set of decoded altitude numbers where I can have most pins remain the same, change one pin to jump to some other number, wait 3 seconds, change another pin, wait, change another. I will use this sequence to make sure that my decoder is accurately decoding the change.
Mega 2560 Notes, thoughts, and gotchas 1
The digital pins operate at 5V. What will happen when they are connected to a 14v/28v encoder/ what is the pulled up value (voltage) of a pin on the encoder?
It looks like the transponder or other device is what pulls up the signal so I dug out this spec from the Trans-Cal SSD-120-30N manual
Driver Description: The parallel altitude data output is provided by the “uncommitted”
collectors of a transistor array and must be “pulled-up” through a resistive load by the
transponder.
Pull-Up Voltage: +3 to 40Vdc.
Maximum Sink Current: 50 mA.
Maximum Cable Length: 4000 ft. (1219 meters)
Input Signal Requirement: Pin 6 (strobe or signal common) must be either grounded or
connected to the transponder.
Digital pins do have a pull up resistor available.
The maximum DC current per I/O pin is 40mA. I don’t want to burn up pins on my $50 mega board. Do I have to do anything special so I don’t pull too much current when I pull the mega’s pins up to 5V? I believe this is an internal function of the mega becuase it has internal pull up resistors that are selectable (I have to look this up) on each pin.
All ICAO altitude parallel outputs will be pulled low for a self test at power up, then assume the value for the present input pressure.
Arduino airplane altitude encoder project
I have been throwing around the idea for an arduino device that will decode the Gilham (altitude) code from an airplane altitude encoder and spit out a number in hundreds of feet. We have a box at work that does this but the readout has been a little flakey from time to time.
First of all, I am no programmer. I have an idea of how I want this to work but will probably really struggle with the code. I found an example from the internet of people trying to do the same thing in C. There might be some tweaking that needs to happen to get it to play nice with arduino.
I have one Arduino Duemilanove and one Arduino Mega 2650. I was figuring I could program one to simulate a sequence of real valid Gilham codes and use a set of jumpers to input this into the second one.
One function of the way Gilham code is sent around an airplane from the encoder to various boxes like Traffic detection systems, altitude preselect, and transponders is that the encoder pulls down each bit, which means there will have to be a pull up resistor on each line. I will see if the arduino can do this itself or if I will need to provide an extra pull up on each line and if the arduino will be capable of supplying this voltage and current.
N3CRT.NET again
I found a place to host my site again.
Here is a QSO I had via VO-52 on Jan 23, 2009 with W0EOZ.