#Solenoid - How to config it?
1 messages · Page 1 of 1 (latest)
this image if fro here
https://core-electronics.com.au/guides/solenoid-control-with-arduino/
In this tutorial, we will look at the basics of Solenoids and how they work. Then we will design a small circuit that can drive a Solenoid from the input/output pins on your Arduino board.
We covered a whole bunch of rotational motion concepts when we looked at DC motors and how they are used with Arduino. It’s only fair to give linear motion t...
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.
My solenoid is similar to above and I have a relay too. But I would like to understand the configuration insider of Mobiflight.
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.
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.
I suggest you test your components: relay and solenoid separately first to make sure you know how to correctly wire them.
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?
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
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?
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.
Sorry, but I don't use P3D.
Don't worry, thanks for you help me!
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).
- "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.
- "Trigger" solenoid when the switch goes to down position. The MF variable is set to 1.
- At the same time the trigger is done, use the sim time offset to store the time in another MF variable or user offset.
- 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.
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?
😵💫
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.
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!
I think we need more info than that. Which relay are you talking about? Post a picture or diagram of your wiring.
When MF starts, it resets the arduino boards.
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
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
Solenoid Lock is also known as Electric Strike Lock. Learn how to control the solenoid lock using Arduino, how solenoid lock works, how to connect solenoid lock to Arduino, how to program Arduino step by step. The detail instruction, code, wiring diagram, video tutorial, line-by-line code explanation are provided to help you quickly get started ...
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.
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.
Even if I am using a 5v input other than the relay?