Mike.Powell
01-11-2010, 12:39 AM
This project is an offshoot of the Tachometer interfacing project covered here: http://www.mycockpit.org/forums/showthread.php?18468-Interfacing-real-727-eng-gauges
In the original thread Rob (aka 737NUT) wanted to interface a real aircraft tachometer using an OpenCockpits RC servo control board. We realized this desire by developing an adapter based on a $2.25 microcontroller, the Microchip PIC16F648A. The PIC measures the pulse width of the RC servo control pulse, does a little arithmetic, and generates a square wave output with a frequency somewhere between 0 and 77 Hertz, depending on the pulse width.
Rob also has an EGT (exhaust gas temperature) gauge that he’d also like to interface. He did some testing and determined that the gauge requires 40 millivolts at a negligible current to display full scale. He’d also like to use the OC RC servo card as the basis of the interface. Because the EGT gauge takes a different signal, we need a different adapter.
Because of the flexibility of microcontrollers, we don’t have to start this project with a blank sheet of paper (empty file?). We need only modify the tachometer adapter.
From the PIC firmware perspective we can keep the portion that measures the RC servo pulse width and replace the variable frequency square wave generator with a pulse width modulated output. Pulse width modulation varies the percentage of time that an output is high. The average voltage of the output varies in proportion to the high-time. Since the PIC is powered by 5 volts, an output that is high 50% of the time will have an average voltage of 2.5 volts. If it’s high 20% of the time, it will have an average of 1 volt.
From the hardware perspective we simply replace the output transistor used to drive the tachometer with a few resistors and capacitors. This scales the maximum PIC output of 5 volts to the maximum of 40 millivolts required by the EGT gauge. The capacitors provide filtering so the gauge sees the average voltage value rather than the pulsating pulse width modulated output the PIC generates.
Here’s the schematic of the EGT adapter:
http://www.mycockpit.org/photopost/data/536/egtadapt.jpg
And here’s what a circuit board might look like. This actually combines two tachometer adapters and a single EGT adapter.
http://www.mycockpit.org/photopost/data/536/egtpcb.jpg
These two projects are good examples of why I really, really like microcontrollers. You can do neat things without having to dig particularly deep into your wallet. The cost of electronic components is only several dollars for an adapter. The development tool for writing the firmware (MPLAB) is a free download from Microchip. The device programmer for loading the firmware into the microcontroller is a $50 “PICkit 2” also from Microchip. (Buying the PICkit also gets you some tutorial material and a little practice daughter board with a microcontroller on it). Microchip updates the software of the PICkit and MPLAB for free. The printed circuit board artwork was done using free software from ExpressPCB. Three 2.5” by 3.8” ExpressPCB “MiniBoards” cost $51 plus tax and shipping.
In the original thread Rob (aka 737NUT) wanted to interface a real aircraft tachometer using an OpenCockpits RC servo control board. We realized this desire by developing an adapter based on a $2.25 microcontroller, the Microchip PIC16F648A. The PIC measures the pulse width of the RC servo control pulse, does a little arithmetic, and generates a square wave output with a frequency somewhere between 0 and 77 Hertz, depending on the pulse width.
Rob also has an EGT (exhaust gas temperature) gauge that he’d also like to interface. He did some testing and determined that the gauge requires 40 millivolts at a negligible current to display full scale. He’d also like to use the OC RC servo card as the basis of the interface. Because the EGT gauge takes a different signal, we need a different adapter.
Because of the flexibility of microcontrollers, we don’t have to start this project with a blank sheet of paper (empty file?). We need only modify the tachometer adapter.
From the PIC firmware perspective we can keep the portion that measures the RC servo pulse width and replace the variable frequency square wave generator with a pulse width modulated output. Pulse width modulation varies the percentage of time that an output is high. The average voltage of the output varies in proportion to the high-time. Since the PIC is powered by 5 volts, an output that is high 50% of the time will have an average voltage of 2.5 volts. If it’s high 20% of the time, it will have an average of 1 volt.
From the hardware perspective we simply replace the output transistor used to drive the tachometer with a few resistors and capacitors. This scales the maximum PIC output of 5 volts to the maximum of 40 millivolts required by the EGT gauge. The capacitors provide filtering so the gauge sees the average voltage value rather than the pulsating pulse width modulated output the PIC generates.
Here’s the schematic of the EGT adapter:
http://www.mycockpit.org/photopost/data/536/egtadapt.jpg
And here’s what a circuit board might look like. This actually combines two tachometer adapters and a single EGT adapter.
http://www.mycockpit.org/photopost/data/536/egtpcb.jpg
These two projects are good examples of why I really, really like microcontrollers. You can do neat things without having to dig particularly deep into your wallet. The cost of electronic components is only several dollars for an adapter. The development tool for writing the firmware (MPLAB) is a free download from Microchip. The device programmer for loading the firmware into the microcontroller is a $50 “PICkit 2” also from Microchip. (Buying the PICkit also gets you some tutorial material and a little practice daughter board with a microcontroller on it). Microchip updates the software of the PICkit and MPLAB for free. The printed circuit board artwork was done using free software from ExpressPCB. Three 2.5” by 3.8” ExpressPCB “MiniBoards” cost $51 plus tax and shipping.