I am building a cockpit. It will function basically as a flight simulator but for a different game. Mechwarrior online. a Mechpit. Here is my problem.

Toggle switch 1 when flipped on turns on the power to the cockpit. toggle switch 2 when flipped turns on the power to the monitors. Separate power strip possibly chained off the toggle 1 strip? Toggle switch 3 i have yet to assign. Probably activates a 3rd power strip or a power cord that i have a usb hub plugged into to power internal lights.

So house power comes into the cockpit and if i want it totally shut down flip toggle 1.

Here is the catch. each toggle switch is assigned an audio clip to say. When the 3 switches are all in the one position a 4th audio clip will play after. Here is the audio. http://www.youtube.com/watch?v=NCmrp38KjYg

Here is a fellow Mechpit builder. I know how he has his toggle making the audio happen. I've already done something similar. What i don't have is the power control. http://www.youtube.com/user/Fousticle shows a potential panel/toggle.

I've researched what relays are and what they do. But seeing as its 02:49 am sleep deprivation and making electrical decisions is probably a bad idea. Anyone have any thoughts? Thanks.

  • 3
    \$\begingroup\$ That is quite a project :-) I would maybe suggest that no high voltage goes direct to the cockpit..em mechpit. Maybe use a micro controller to control external relays (isolated)(solid state relays are small and easily controlled from MCUIO) and also play your sound file depending and the sequence of switches and all that.I always suggest Arduino for simple and easy micro controlling projects; but there are others. \$\endgroup\$ – Piotr Kula Aug 17 '12 at 10:44
  • 1
    \$\begingroup\$ Incidental: In the deep dungeon I have a commercially built motion simulator that uses pneumatic cylinders and an air pump with control via a PIC. Needs work :-). One of these days ... \$\endgroup\$ – Russell McMahon Aug 17 '12 at 11:50

If the switches in the power strips are double-pole you can use one pole to switch the power and the other pole to switch the digital signal that goes into whatever electronics you're using. Check this table if you're unsure what double-pole means.

Do you need the switch on power strip 2 to still play a sound even if power switch 1 is off? If you don't you can just have your electronics detect the 120 VAC in the power strip. A cheap and easy way to do this is just plug a DC power adapter into the power strip. If you use a 5V USB one ($1 on eBay) you can probably plug it straight into the inputs of the electronics. When you turn on the strip it will get power and output 5V.


If I read you question correctly, you already have the digital part worked out: you have switches connected to a mcu (pic/avr?) and the mcu connected (via usb) to your pc and the pc will sound the audio-clips, right?

Now, you have probably connected both the mcu and switch to a low voltage (5 volt) power supply. When you flip the switch you'll get 5 volt input on one of your mcu's gpio-pins's right?

Then you need to know first how much amps each powerstrip should be able to supply (per switch). The (solid state) relay's should be able to provide at least this much current!

Next you need to make a choice: mechanical relays or solid-state-relays (rated for AC).

Solid state relay's do not require as much power(amps) to hold their contact then mechanical relays. This is because they only drive a led aka opto-coupler (providing isolation), thus it needs only 2 to 15 mA. But they MIGHT interfere with your appliances plugged into your power-strip. Check their datasheet how much current they require (and their max current) and check their max/min input voltage.

Mechanical relay's provide the exact equivalent to a mechanical switch, so it can not interfere with anything it is powering. BUT they need more current to hold their contacts due to their coil. 500 mA is a nice figure and three of them means you need at least 1.5 amps (apart from the current that your mcu draws). Lastly for a mechanical relays you need a reverse protection diode across the coil (a lot of relay's have them embedded, so check this!).

As you can see, the choice solid-state vs mechanical relays also effects how much power your power-supply needs to deliver.

Suppose you have mechanical relays that can switch 230 vac @ rated current (you need) with a 5 volt coil, then you could simply wire the relay's control-input in parallel with the mcu gpio after your panel-toggle-switch.
In other words, if you flip the toggle-switch the 5 volts go to the mcu and to your relay's enable input.
The same goes with the solid state relays (don't forget to work out the correct resistor value to supply the optimum current to it's opto-coupling led)

If you have a mechanical relay with a coil-voltage higher than those 5 volts then you could use an opto-coupled driver for your relays. This would also mean your powersupply needs to supply 2 voltages (although you could use a drop-down regulator for the mcu-part and have the powersupply deliver just 12/24/whatever volts that drive your mechanical relais).

Hope this helps! As a side-question: how did you manage to get the difficult part (mcu usb pc-drivers) to work and get stumped on something like a relay?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.