Airplane cockpit gauges using Arduino

I've been thinking about starting a big project, specifically, making my own Cessna 172 cockpit.

I have experience with Arduinos and I've been thinking about using them in my project. I will be building my own panels and flight instruments, but my question is about the analog gauges I make using small "switec x27.168" stepper motors.

Should I use multiple small arduinos like the pro mini or maybe an Attiny85 for each gauge I make, or get an Arduino Mega (or something like that) and connect multiple stepper motors to it. I would prefer to use smaller arduinos glued to the back of each gauge instead of the mega but I don't have that many USB ports on my PC. If you have any suggestions please let me know. Any help will be appreciated.

Thanks in advance, Stefan.

1 Like

I don't have that many USB ports on my PC

Connect the mini Arduinos to the Mega and control them from that and not directly from the PC

Thank you for the super fast reply.

I thought of doing that. Getting the values from the game, then sending it to the Arduino mega is the easy part. But how will I send separate values from the mega to the small Arduinos and make everything work real time and move all the motors depending on the game?

And even if I can do it like that, wouldn't it be simpler to just connect the motors directly to the mega? It would be cheaper at least.

Presumably the sArduinos would need a value to tell them what angle to move the instrument (stepper motor) to. Given that number they would each just get on with moving the stepper as required. Meanwhile the Mega, or even a smaller Arduino, would read values from the game, which you say you can do, and send them to the slave Arduinos on each instrument.

how will I send separate values from the mega to the small Arduinos

One way to do it would be to use SPI to transfer the data
lave

I'd do it with the Mega alone and connect each gauge to it. Looking at a random google image of the cockpit, I'd guess that there are no more than ~fifteen gauges that you could control with a stepper so the Mega has plenty of pins.

If you had to add additional Arduinos to the mix, you can use serial to communicate with them. Either have the master Mega pass on instructions to its slaves or have them all listening to the signal from the PC. Remember that in this latter scenario that the Arduinos should only be listening, not transmitting.

You'll need to parse the data packets coming from the simulator and interpret them to tell you what position the steppers should take. I expect that you'll find code to do some of that parsing on forums dedicated to flight sims although once you've got the data the gauge is supposed to display, you'll need to write custom code to make your particular steppers do the appropriate thing.

Not sure how many gauges you want but an I2C connection between the Mega (master) and all the stepper controllers (slaves) would be my first inclination.

Use a few of the DIOs to set each one's address (on start, it reads three of four DIOs and forms a slave address from that.)

You should be able to use the same code for each slave. You could use an I2C command to set each one's function during initialization or you could read a few more DIOs from which the slave determines its own function (cylinder head temp, fuel flow, manifold pressure, altimeter, IAS etc.)

I never had a project where I needed to use multiple Arduinos and I'm still new to the "master-slave" thing, but I will definitely check it out.
Also I will not be making every single gauge from the airplane, I will try to make 5-6 just to test everything and if I should continue making more of the home cockpit.

In addition to that I will have some 7 segment displays which will probably come out of the Arduino Mega, so using multiple smaller "slave" arduinos would be a really nice interpretation.

Anyways, thanks to everyone for enlightening me.

I don't know if you've noticed, but planes these days are going to graphics displays, scroll down about 1/2 way on this page

Maybe instead of stepper motors and analog guages, you could use a set of little displays like these

Or a larger display showing several instruments

I thought about using something like a cheap PC monitor and just displaying the instruments that way but I much prefer having analog gauges. I would be way simpler to use a smaller monitor but that doesn't pose a challenge for me.

Initially i was going to use monitors for everything but then decided that I want to spend more time and learn how things work and also I love making Arduino projects and I think this will be good practice.

Thank you for your suggestion. If I can't make good analog gauges I will have to use a monitor since I'm trying to build this for as cheap as possible.