#Solenoid - How to config it?

1 messages · Page 1 of 1 (latest)

midnight stump
#

I am trying to configure a solenoid for the disengaged A/T of the MCP. unfortunately I am not getting success to make this configuration. Could someone help me, please?

sullen shoal
#
#

You can use the Led/Output type of config to turn on/off a solenoid through a transistor

#

you need to know how much current your solenoid draws. The above image shows the solenoid getting power directly from the 5v pin in the arduino, which is limited to 500mA.

midnight stump
#

My solenoid is similar to above and I have a relay too. But I would like to understand the configuration insider of Mobiflight.

sullen shoal
#

Mobiflight controls pin state HIGH or LOW with the Led/Output config. If the output config has a value of 1 the pin goes HIGH, if 0 the pin goes LOW.

#

In the above image, pin 9 is used to control the transistor. In your case it would trigger the relay.

#

Connect the relay to pin 9 and create a LED device connected to pin 9 in your arduino hardware config.... then create an output config bound to this device.

midnight stump
#

I tried what you told me and even other settings, but I couldn't solve it. I'm doing something wrong, and I can't find my mistake.

sullen shoal
#

Show what you did in Mobiflight.

#

How did you wire the solenoid and relay?

sullen shoal
#

I suggest you test your components: relay and solenoid separately first to make sure you know how to correctly wire them.

midnight stump
sullen shoal
#

ok

#

why do you have two configs for the solenoid? Only one is needed

#

I see in Compare you are trying to invert the value. Why?
can you please explain in words how do you need the solenoid to work?

midnight stump
#

If Real switch is ON but Virtual switch is OFF we will fire the solonoid.
The question is just.... Is this a "Holding" Solonoid or a Pushing solonoid or a Pulling Solonoid.
Whatever of the 3 ways we need to design the config logic a little different
We need take care the solonoid is not powerd and "active magnetic" at long time while flying or while on Ground.
So we need to design a little Window where the Solonoid do its work but get unpower shortly behind to protect demage and overheat on this electrical part

sullen shoal
#

Is the hardware all working ok? I mean can you trigger the solenoid by setting the arduino pin to HIGH?

#

Are you running MSFS2020? Which airplane?

midnight stump
#

Apparently yes, but it doesn't work with the simulator. When I click to Run Mobiflight, the A/T ARM switch goes ON and it should be OFF.

#

I'm use P3d and PMDG.

sullen shoal
#

Sorry, but I don't use P3D.

midnight stump
#

Don't worry, thanks for you help me!

sullen shoal
#

I am thinking that you could assign a MF variable or a Fsuipc user offset to control the solenoid. Defaul value is 0 (solenoid off).

  1. "Arm" the solenoid when the A/T switch is in up position. This just means switch up is a condition to monitor when it changes state.
  2. "Trigger" solenoid when the switch goes to down position. The MF variable is set to 1.
  3. At the same time the trigger is done, use the sim time offset to store the time in another MF variable or user offset.
  4. When sim time offset - stored time > 1 second, set the MF variable for the solenoid back to 0, effectively turning it off. Reset everything and wait for next "Arm" event.
#

It would have been easier for me to help if it were MSFS2020.

midnight stump
#

I tried to do it, but I am not to understand the MF variable. If it possible may you show me how can I do you this, please?

#

😵‍💫

sullen shoal
#

The important point is that the solenoid needs an independent way to control it because it needs to retract after a short while without anything having happened in the Sim to command that. That is why it would be better not to rely on any Sim variable for this.

midnight stump
#

Could someone explain to me why when I connect the relay to the arduino the red and green leds are on? And when I open the MF the same thing happens!

sullen shoal
midnight stump
fair vessel
#

I suggest you google for some arduino relay tutorials

#

and then when the arduino sets the output pin to high to run the delay, that works with a led/output

#

in mobiflight

sullen shoal
# midnight stump

I don't understand your wiring. Did you Google how to do the wiring? Here is a picture from a quick Goodle search

#

I don't see any wire to any Mega GPIO pin. How do you expect to control the relay trigger?

#

here is an article on how to control a solenoid with a relay and an arduino.
https://arduinogetstarted.com/tutorials/arduino-solenoid-lock

midnight stump
# midnight stump

White wire - 5V
Grey wire - GND
Purple wire - PIN 16

And I'm using another 5v for the common of the relay, the red wire from the solenoid goes to NO and the black wire to the GRD.

sullen shoal
#

Using the arduino 5v to power the solenoid defeats the purpose of the relay. I think you want the solenoid power completely independent of the arduino.

midnight stump
#

Even if I am using a 5v input other than the relay?