Cockpit

* User Profile

Welcome, Guest. Please login or register.

Login with username, password and session length

Who's Online

  • *Users: 1
  • *Guests: 39
  • *Total: 40

Our Discord

Author Topic: Voltage control gauge help!  (Read 5739 times)

Offline Trevor Hale

  • Administrator
  • I am chained to this website!
  • *
  • Posts: 3,838
    • Cockpitbuilders.com
  • First Name: Trevor
  • Home Location: New Liskeard, Ontario
Voltage control gauge help!
« on: October 22, 2014, 06:43:28 AM »
Hi guys,

I have two REAL instruments in my possession  that came out of my cockpit. One of them is pictured below.
They operate on a voltage input.

The Flap indicator and the stab trim indicator.

When a voltage of about 1.5 volts DC is applied to the gauge the indicator moves about 1/2 an inch.  when voltage is removed from the Stab Trim indicator it rests at the bottom of the scale. The flap position indicator rests at a 12-o-clock position which indicates nothing as there isn't any numbers at the 12-o-clock position.

My question is, how would you guys control this?

I have an output board that will activate with 12V, I was thinking if I used 3 or 4 outputs, and put resistors off each output I could activate each output based on flap position and just put all the outputs in parallel. with a diode on each output protecting it. each resistor value would change the voltage drop across the instrument at the various positions.

Will this work?

the Trim indicator would be tricky because it is a constant voltage varying in small increments all the time when the trim is used. Does anyone have any ideas here?

Thanks,

Trev
« Last Edit: October 22, 2014, 06:47:49 AM by Trevor Hale »
Trevor Hale

Owner
http://www.cockpitbuilders.com

Director of Operations
Worldflight Team USA
http://www.worldflightusa.com

VATSIM:

Offline KyleH

  • Administrator
  • Forum GURU
  • *
  • Posts: 430
  • B763!
  • First Name: Kyle
  • Home Location: Ontario
Re: Voltage control gauge help!
« Reply #1 on: October 22, 2014, 08:09:06 AM »
How would I do it?
I would design a microcontroller circuit to drive a transistor with a PWM signal that corresponds to the various flap/trim settings sent from the sim. But that's me.

I would suggest a 0-10V phidgets card: http://www.phidgets.com/products.php?category=0&product_id=1002_0

The 12V outputs with Resistors may work with the flaps gauge. You'll have to test needle positions and measure current and voltage required for each one, then carefully select your resistors. A problem with this is the resistor may end up dissipating a fair amount of power depending on the current draw of the gauge, requiring a higher power resistor.
This will also just cause the needle to jump to each position, no values in between will be shown.
Also, if 2 of the outputs on the card happen to come on at the same time you could end up damaging the gauge.

Be sure to check the maximum current the gauges draw to make sure whatever card you use can handle it.


Offline Trevor Hale

  • Administrator
  • I am chained to this website!
  • *
  • Posts: 3,838
    • Cockpitbuilders.com
  • First Name: Trevor
  • Home Location: New Liskeard, Ontario
Re: Voltage control gauge help!
« Reply #2 on: October 22, 2014, 08:17:41 AM »
How would I do it?
I would design a microcontroller circuit to drive a transistor with a PWM signal that corresponds to the various flap/trim settings sent from the sim. But that's me.

I did electronics engineering 18 years ago, might be out of my reach now.  But if I build the circuit to drive the gauge, how would I tie that to an output?  Are you suggesting a complete new interface card that will read the offsets directly and apply the pwm based on the reading?

My god, I think I would rather throw it in the garbage LOL.  My head hurts just thinking about it.

The gauges have part numbers, but there is likely no way to get specs on the gauges like current etc.
« Last Edit: October 22, 2014, 08:18:38 AM by Trevor Hale »
Trevor Hale

Owner
http://www.cockpitbuilders.com

Director of Operations
Worldflight Team USA
http://www.worldflightusa.com

VATSIM:

Offline Bob Reed

  • Administrator
  • I am chained to this website!
  • *
  • Posts: 2,378
  • Bob the Builder!
  • First Name: Bob
  • Home Location: Holley, New York
Re: Voltage control gauge help!
« Reply #3 on: October 22, 2014, 08:25:21 AM »
Careful what you say Kyle.. We will have you captive for several days!! lol

Offline Trevor Hale

  • Administrator
  • I am chained to this website!
  • *
  • Posts: 3,838
    • Cockpitbuilders.com
  • First Name: Trevor
  • Home Location: New Liskeard, Ontario
Re: Voltage control gauge help!
« Reply #4 on: October 22, 2014, 08:30:31 AM »
I found this...  An indistructable for PWM and Transistors, but controlled through the parallel port..  Not such a good plan...  and a pain to write in lua.

http://www.instructables.com/id/A-Simple-Introduction-to-Transistors-and-PWM-Puls/?ALLSTEPS

Maybe Fs2Phidgets would drive the Phidgets board for what i want it to do.  that would probably be the easiest solution.  Anyone running FS2Phidgets care to tell me if the card Kyle suggested is supported?

Trev
« Last Edit: October 22, 2014, 08:44:56 AM by Trevor Hale »
Trevor Hale

Owner
http://www.cockpitbuilders.com

Director of Operations
Worldflight Team USA
http://www.worldflightusa.com

VATSIM:

Offline 727737Nut

  • I spend way too much on this forum!
  • *
  • Posts: 925
  • 737-300 Using Real parts and X-Plane 10
  • First Name: Rob Archer
Re: Voltage control gauge help!
« Reply #5 on: October 22, 2014, 08:46:45 AM »
Teensy series cards have naitive X-plane support,  use PWM out with correct resistor and cap to smooth it out a little.  Piece of cake.
737 Junkie

Offline Trevor Hale

  • Administrator
  • I am chained to this website!
  • *
  • Posts: 3,838
    • Cockpitbuilders.com
  • First Name: Trevor
  • Home Location: New Liskeard, Ontario
Re: Voltage control gauge help!
« Reply #6 on: October 22, 2014, 09:43:29 AM »
Doesn't help when I use FSX LOL


Correction, I guess some people are using it with FSX, needs more investigation, and for $16.00 for the board, this may be a very cheap solution.

http://www.jimspage.co.nz/link2fs_experts.htm

https://www.youtube.com/watch?v=OSzE6hgFWCM
« Last Edit: October 22, 2014, 12:08:59 PM by Trevor Hale »
Trevor Hale

Owner
http://www.cockpitbuilders.com

Director of Operations
Worldflight Team USA
http://www.worldflightusa.com

VATSIM:

Offline KyleH

  • Administrator
  • Forum GURU
  • *
  • Posts: 430
  • B763!
  • First Name: Kyle
  • Home Location: Ontario
Re: Voltage control gauge help!
« Reply #7 on: October 22, 2014, 10:37:39 AM »
How would I do it?
I would design a microcontroller circuit to drive a transistor with a PWM signal that corresponds to the various flap/trim settings sent from the sim. But that's me.

I did electronics engineering 18 years ago, might be out of my reach now.  But if I build the circuit to drive the gauge, how would I tie that to an output?  Are you suggesting a complete new interface card that will read the offsets directly and apply the pwm based on the reading?

My god, I think I would rather throw it in the garbage LOL.  My head hurts just thinking about it.

The gauges have part numbers, but there is likely no way to get specs on the gauges like current etc.

Yes you would essentially be developing your own interface to FlightSim.  This is what I am doing for my sim, so I already have a c program that reads FSUIPC / LevelD variables and sends the required info over to a bus to my microcontrollers. So...that's what I would do.
IMG_20140402_210918 by m_disco, on Flickr

For these types of gauges it is best to get a card that can output a variable voltage signal, especially for the trim.

As far as getting the current, just measure it. Put the current meter in series with the gauge, and a variable dc power supply; adjust the dc supply to get the needle to deflect to the proper locations and measure the values. BE SURE TO START AT 0V to avoid damage to the gauge.

Offline Trevor Hale

  • Administrator
  • I am chained to this website!
  • *
  • Posts: 3,838
    • Cockpitbuilders.com
  • First Name: Trevor
  • Home Location: New Liskeard, Ontario
Re: Voltage control gauge help!
« Reply #8 on: October 22, 2014, 10:47:14 AM »
I can measure it, just not sure if the current would run away on it that's all.  I will meter it later tonight perhaps and see if I can figure more out.

Thanks for the advice..
Trevor Hale

Owner
http://www.cockpitbuilders.com

Director of Operations
Worldflight Team USA
http://www.worldflightusa.com

VATSIM:

Offline Trevor Hale

  • Administrator
  • I am chained to this website!
  • *
  • Posts: 3,838
    • Cockpitbuilders.com
  • First Name: Trevor
  • Home Location: New Liskeard, Ontario
Re: Voltage control gauge help!
« Reply #9 on: October 22, 2014, 12:17:07 PM »
Just bought the card below.  It will do 6 PWM outputs, I only need 2 now, which will leave me 4 additional for later use.  Jimz software interfaces with Simconnect and FSUIPC Direct, and will allow me to drive the gauges with a little bit of code that I will somehow need to experiment with LOL

I never realized this existed, and I have no programming experience, but Maybe it will be ok!


 
UNO R3 Compatible - ATMEGA328 w/USB Cable For Arduino
 [/color]Descriptions

 This Board is 100% compatible with Arduino UNO / UNO R3 ATmega328P-PU

 The Uno now uses an ATmega32U2 instead of the 8U2 found on the Uno (or the FTDI found on previous generations). This allows for faster transfer rates and more memory. No drivers needed for Linux or Mac (inf file for Windows is needed and included in the Arduino IDE), and the ability to have the Uno show up as a keyboard, mouse, joystick, etc.

 The Uno R3 also adds SDA and SCL pins next to the AREF. In addition, there are two new pins placed near the RESET pin. One is the IOREF that allow the shields to adapt to the voltage provided from the board. The other is a not connected and is reserved for future purposes. The Uno R3 works with all existing shields but can adapt to new shields which use these additional pins.

 Arduino is an open-source physical computing platform based on a simple i/o board and a development environment that implements the Processing/Wiring language. Arduino can be used to develop stand-alone interactive objects or can be connected to software on your computer (e.g. Flash, Processing, MaxMSP). The open-source IDE can be downloaded for free (currently for Mac OS X, Windows, and Linux).

 
Main Features ATmega328P-PU microcontroller[/l]
[/size][/font]
  • ATmega32U2 USB Controller
  • 14 Digital I/O Pins (6 PWM outputs)
  • 6 Analog Inputs
  • 32k Flash Memory
  • 16Mhz Clock Speed
  • Package includes 1 x USB cable[/color][/size]
  • 1 x header kit
  • 1 x Arduino compatible UNO R3 Clone


  •  
    [/l]
    [/font]
Trevor Hale

Owner
http://www.cockpitbuilders.com

Director of Operations
Worldflight Team USA
http://www.worldflightusa.com

VATSIM:

Offline Trevor Hale

  • Administrator
  • I am chained to this website!
  • *
  • Posts: 3,838
    • Cockpitbuilders.com
  • First Name: Trevor
  • Home Location: New Liskeard, Ontario
Re: Voltage control gauge help!
« Reply #10 on: October 22, 2014, 01:34:04 PM »
Some of you may be surprised that I would post this, but clearly not everything resides here like I wish it would. :)
regardless Credit where Credit is due I guess.

The following is a really great resource for interfacing with Arduino cards and link2fs.

http://www.mycockpit.org/forums/arduino-cards-link2fs/

best regards,

Trev
Trevor Hale

Owner
http://www.cockpitbuilders.com

Director of Operations
Worldflight Team USA
http://www.worldflightusa.com

VATSIM:

Offline RayS

  • I spend way too much on this forum!
  • *
  • Posts: 817
  • Private Pilot, Sim Enthusiast
    • Anthony Scott Photography
  • First Name: Ray Sotkiewicz
  • Home Location: Seattle, WA
Re: Voltage control gauge help!
« Reply #11 on: October 22, 2014, 02:53:49 PM »
I think Gene Buckle wrote something to interface these gauges to an Arduino with great success....

If memory serves, I think these voltage gauges have 3 separate movements and the full range is divided into 3 angular areas... I think... maybe I had to much wine that night...

« Last Edit: October 22, 2014, 02:55:09 PM by Botox »
Ray Sotkiewicz

Offline Trevor Hale

  • Administrator
  • I am chained to this website!
  • *
  • Posts: 3,838
    • Cockpitbuilders.com
  • First Name: Trevor
  • Home Location: New Liskeard, Ontario
Re: Voltage control gauge help!
« Reply #12 on: October 22, 2014, 03:08:24 PM »
LOL..  I should maybe ask Geneb if he knows of this, or maybe the wine has completely sent you over the edge LOL.

Thanks Ray, I will check it out!


Trevor Hale

Owner
http://www.cockpitbuilders.com

Director of Operations
Worldflight Team USA
http://www.worldflightusa.com

VATSIM:

Offline Bob Reed

  • Administrator
  • I am chained to this website!
  • *
  • Posts: 2,378
  • Bob the Builder!
  • First Name: Bob
  • Home Location: Holley, New York
Re: Voltage control gauge help!
« Reply #13 on: October 22, 2014, 04:36:45 PM »
Gene is in the middle of switching his entire F-15 sim over to Arduino interface. He is a good one to ask.

Offline Trevor Hale

  • Administrator
  • I am chained to this website!
  • *
  • Posts: 3,838
    • Cockpitbuilders.com
  • First Name: Trevor
  • Home Location: New Liskeard, Ontario
Re: Voltage control gauge help!
« Reply #14 on: October 22, 2014, 05:20:39 PM »
Gene is in the middle of switching his entire F-15 sim over to Arduino interface. He is a good one to ask.

Apparently Ray wasn't into the wine as hard as he thought then.  :cheers: I have asked him for his help to see if he can get me going.  Heck it is only 7 instruments in total.  (really only 6 cause that's all the card I got will handle, but no big deal)  It will take me a long time to get 6 working LOL
Trevor Hale

Owner
http://www.cockpitbuilders.com

Director of Operations
Worldflight Team USA
http://www.worldflightusa.com

VATSIM:

Offline Caflyt

  • Forum GURU
  • *
  • Posts: 285
  • Private Pilot/ 737ng cockpit builder
  • First Name: Craig
  • Home Location: Boca Raton, Florida
Re: Voltage control gauge help!
« Reply #15 on: October 22, 2014, 09:54:53 PM »
My first generic sim was Arduino based and I used Jimz old IO program to run some led's and an LCD.
It was much more limited then (2011-12) but was surely easy to use.
I still have 2 UNO's and a Mega which I reflashed to act as joystick cards but can easily reconfigure to their original state.
I was using one of them in my throttle.
They are more capable now and are inexpensive enough to make them very attractive.
I will likely use them for something in my new build.
Just need to figure out what I would want them to do and I'm sure they can do it.
Love this thread!

Craig

Offline Trevor Hale

  • Administrator
  • I am chained to this website!
  • *
  • Posts: 3,838
    • Cockpitbuilders.com
  • First Name: Trevor
  • Home Location: New Liskeard, Ontario
Re: Voltage control gauge help!
« Reply #16 on: October 23, 2014, 07:08:43 AM »
Thanks Craig.

I have been in contact with somoene in the Arduino community, and they have walked me through a basic program.  I am only going to use the arduino Uno for gauges. 2 voltage gauges and 4 or 5 stepper/servo gauges.  It has been mentioned to me to watch out for Hysteresis issues with the servos and I will, its a good warning.

In any case for the voltage controlled instruments I have This should work and as you said for the price you can;t really go wrong.

Here is my code.

Quote
*/
// ***********************BEGIN DECLARATIONS
********************************************
#include <Wire.h>
#include <Adafruit_PWMServoDriver.h>
Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver(0x40);  //Base address
for PCA9685
uint8_t servonum = 0;          // servo (or analog device) is connected at
position 0 on the PCA9685.
int trimFSX;
int old_trimFSX;
int trimPWM;
String data;
int const a=(1); //(replace 1 with your number for a) int const b=(1);
//(replace 1 with your number for b) int CodeIn; //
**********************************************************************
// ***********************BEGIN VOID SETUP*******************************
void setup()
{
Wire.begin();               //Join the bus as master
Serial.begin(115200);
trimFSX=0;                  //Just to put an initial number for starters
// --------Increase PWM refresh rate to 240Hz
---------------------------------------
pwm.begin();           //Starts communication with PCA9685
pwm.setPWMFreq(240);
}//end void setup
//
****************************************************************************
**********
// **************BEGIN VOID LOOP
********************************************************
void loop()
{
 old_trimFSX=trimFSX;
 
  //**** Check for data from L2FSX ****
  if (Serial.available() > 0) {  //if there is a charactor in the serial
receive buffer then ,,,,
    CodeIn = getChar();// read it via the "char getChar" routine
    if (CodeIn == '<') {
      LESSTHAN();
    }// The first identifier is "<" goto LESSTHAN void
  }//end of serial.available
 if (trimFSX!=old_trimFSX) {
   trimPWM=(a*(trimFSX) +b);
   pwm.setPWM(servonum, 0, trimPWM);
   old_trimFSX=trimFSX;
 }//end of if
}//end void loop
//--------------- Subroutine getChar ------------------------------ char
getChar()// The serial buffer routine to get a character {
  while(Serial.available() == 0);// wait for data
  return((char)Serial.read());
}// end of getchar Routine.
 
//--------------- Subroutine LESSTHAN ------------------------------ void
LESSTHAN() {//the first identifier was a '<'
  CodeIn = getChar();//get another charactor from serial port
  if (CodeIn == 'H'){//found the identifier "H"
    delay (11);    // It seems to need a delay here
    data = ""; // Empty data string
    data += char(Serial.read());    //Read the first data charactor sent
    data += char(Serial.read());   //Read the second data charactor sent and
add it to the first
    data += char(Serial.read());   //Read the third data charactor sent and
add it to the other two.)   
    trimFSX = data.toInt();
  } //end of "found the identifier "H"
}  // end of LESSTHAN loop
 
// ************** END
*********************************************************
Trevor Hale

Owner
http://www.cockpitbuilders.com

Director of Operations
Worldflight Team USA
http://www.worldflightusa.com

VATSIM:

 

FlightSimExpo 2019

FsExpo

Recent Posts

How to install DZUS fasteners?
by jackpilot
[June 19, 2019, 09:12:08 PM]
Throttletek 737 Throttle For Sale
by kevinsayre
[June 19, 2019, 03:57:33 PM]
For sale - rudder pedals and linkages
by Caflyt
[June 19, 2019, 07:49:14 AM]
Flooring Installed!
by Mach7
[June 18, 2019, 05:41:16 PM]
737-800 Arduino X-Plane Build
by kurt-olsson
[June 18, 2019, 11:26:12 AM]
737 Throttle Conversion OC + ProSim
by kattz
[June 16, 2019, 11:39:03 AM]
A friendly FYI on Boeing rudder pedals
by kattz
[June 15, 2019, 10:36:39 AM]
Wanted - 737 Audio Panels - OEM
by jackpilot
[June 14, 2019, 08:08:09 PM]
2020 Microsoft Flight Simulator - new at E3 2019
by 757Simulator
[June 14, 2019, 03:39:07 AM]
737 starter switch mechanism
by paulnd
[June 13, 2019, 02:58:39 PM]
Make up your mind, Microsoft!
by jmlohrenz
[June 12, 2019, 07:25:10 PM]
What have you done for your simulator today?
by C150DIY
[June 12, 2019, 12:53:27 PM]
Complete 737-800 cockpit - moving sale
by FaustoP
[June 12, 2019, 01:26:39 AM]
Flyengravity desktop MIP
by patiju
[June 10, 2019, 01:01:06 PM]
the perfect thing to complete your sim hanger
by fsaviator
[June 09, 2019, 03:12:50 PM]
Wanted - COMPLETE set of Boeing 727 or 737 rudder pedals
by kattz
[June 08, 2019, 01:26:09 PM]
For sale: 200° Curved screen with 3 projectors
by sim172
[June 08, 2019, 09:07:03 AM]
Visual system screen by Northern Flight Sim for sale $500
by peterkwu
[June 08, 2019, 06:07:39 AM]
Wanted: GoFlight T8
by C150DIY
[June 07, 2019, 02:32:29 PM]
For Sale - CPFlight MCP737 + EFIS
by ZillaUK
[June 07, 2019, 09:54:58 AM]
737 FWD Overhead Switch Diagram
by bernard S
[June 07, 2019, 08:21:46 AM]
Change the Forum Theme to suit your own Needs.
by AdamMilstead
[June 07, 2019, 06:20:41 AM]
Aileron & Elevator jump back to center
by iwik
[June 06, 2019, 08:01:24 PM]
Join me on Vatsim Tonight
by Trevor Hale
[June 05, 2019, 05:17:13 PM]
Machinery for home cockpit building
by giaviv
[June 04, 2019, 04:12:10 PM]
PROMOCION STEERING FREE
by alvaro castillo
[June 04, 2019, 11:42:43 AM]
FLIGHTSIMEXPO LAUNCHES DISCOUNTED ADVANCE REGISTRATION FOR ORLANDO 2019 EVENT
by fsaviator
[June 03, 2019, 06:52:44 PM]
Question about linking the yokes
by jackpilot
[June 01, 2019, 02:22:10 PM]
Wanted: Jetmax 737
by nisx
[May 30, 2019, 01:49:24 AM]
Cessna 150 Builder
by C150DIY
[May 27, 2019, 04:59:48 AM]