New arduino hobbyist here. starting on my journey to understand arduino and microcontrollers by taking in my own time a work project for a specific tool.
I require a 'box' that will operate a 24v dc solenoid output dependant on a user setting and a pressure sensor input. This solenoid will vent an external compressed air reservoir through a silencer.
The operator will set a desired threshold by counting up or down to a desire pressure threshold, for example 4.0 bar. This threshold will be displayed on an lcd. When a seperate 'vent' button is pressed, a relay output will be set as HIGH and a solenoid coil will be energized until 4.0 bar is sensed by the pressure sensor (the sensor will have a set value for 4.0 bar that is determined via trial and error) On sensing this voltage, the relay output will now chang to LOW and the solenoid will de energise. The difficulty im finding is a suitable type of code that will both sense a variable counter ( which could be any value between 0 and 10bar) and have a proprtional linked analogue threshold, which will set the relay output to high or low.
Any help would be much appreciated.