I am currently working on a project that involves using a proportional solenoid, but I am facing some difficulties. As far as I understand, the solenoid operates at 18 volts and within a current range of 0 to 140mA.
Given my limited experience in this area, I am unsure about which component I need for current control. I intend to control the solenoid using an Arduino Mega.
Could you please advise me on the appropriate component for current control in this setup?
Well, we know that you intend to use an Arduino Mega and that's all we know.
In other words, what solenoid, specifically, do you have or are you intending to obtain?
Does it operate at 18 volts and pull a maximum of 140mA in your intended application?
Do you have a datasheet for the solenoid?
Where is the 18 volts coming from?
What is the application?
Is the application fixed or mobile/portable?
What have you dug up in your own research as to how others have used these with an Arduino?
Oh, and
Given my limited experience in this area
Don't sweat that. Everyone's experience is limited, some just more limited than others.
It's a proportional solenoid from Gevasol P377. It will be integrated into a ventilator to maintain air pressure at a constant value. As per the manufacturer's datasheet, the nominal voltage is 18 volts, and adjusting the current from 0 to 140mA changes the proportion of openness.
im using a 14.8 V 2.9A battery that i intend to bump up to be 18 volts.
My research has led me to consider using an H-bridge like the L298N or employing BJT/MOSFET. However, since my understanding of transistors is not superb, I am seeking assistance in this matter.
A MOSFET driver will work with analogWrite(), which is not actually analog, but PWM.
With PWM at 50% (analogWrite(127) ) the average will be 9V with a 18V supply and the proportional solenoid should go about half way, a motor should run about half speed, an incandescent light bulb would glow at about half-brightness and an LED will appear half-bright, (although the LED will be flashing on & off faster than the eye can see.)
NOTE - Usually none of those things are actually linear so you solenoid might not go half way, a motor probably won't really run at half-speed, and the lights won't appear half-bright. But that's the concept and you can adjust your software as necessary.
Proportional valves (solenoid type) are usually controlled by a voltage-controlled current source, with the current setting often "dithered" or varied slightly in case the valve tends to stick.
Some simple circuit examples, where the valve current is controlled by a DAC or filtered PWM are given in this thread or this thread, although those are only the starting point.