Help using pressure sensor to operate solenoid

Please bear with me I am new to this with only a basic understanding of electronics.I am working on a project in which the objective is to power a VGT turbo solenoid from an Arduino uno 3 using a pressure transducer as a sensor.the solenoid functions on 12v PWM, I would like to have the Arduino send 12v to the solenoid when the pressure sensor reads 0 psi and have the volts decrease as pressure increases, until the sensor reads 40psi it will supply 0 volts, and very in between as the pressure fluctuates. The pressure sensor supplies 0.5V at 0psi and 4.5V at 100PSI. I have the digital output pin 3 PWM hooked up to a signal pin on an IRF 520 mosfet Module. The mosfet will supply the 12 Volts to the solenoids. I will include photos. But what I need help with is first of all will this circuit work? And second can anybody help me write the code for this? I will attach what code I have so far but I am just learning so have barely any code experience. Thank you in advance

Stop cross-posting.

Sorry idk how this forum works just joined

Hi, @jjt1648
Welcome to the forum.

The instructions will show you how to post your code into your message.

Thanks.. Tom.. :smiley: :+1: :coffee: :australia:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.