12V Solenoid Pressure Controller with FlexiForce

Hi all, thanks for clicking. My project entails pushing an ultrasonic transducer down onto porous objects of various heights (10-25mm range). I’m attracted to Solenoids because of their cheapness and linear motion (it is important that the transducer remain completely parallel to the flexiforce surface).

Using the Arduino Motor Shield R3 (L298P) I’d like to control the pressure exerted by a push-type Solenoid using a FlexiForce as a pressure sensor. My dream goal is to be able to use MATLAB or BreakoutJS to allow my users to enter a force and have the Solenoid put that pressure down (+/- the error of the FlexiForce) onto objects inbetween the solenoid and flexiforce by varying the voltage. Is there any cost-effective way to implement this functionality? (i.e. <$100)

If controlling the exact voltage that the solenoid uses based on the FlexiForce reading is not possible, the other option I thought might work would be to use a 4-channel relay, and somehow change the voltage being sent to the solenoid like that. If this is the way to go, can any of you recommend some links on controlling the voltage.

And one last thing, why the heck do I have a 100microFarad connecting the Ground to the Vin for the 12V power supply? I have no idea but it feels right.

Thanks for reading.


In other words, how can I control the output voltage of the A and B channels on the Arduino Motor Shield R3?