Pressure Sensor with Counter Input and LCD Readout

Evening all,

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.

Thanks!

Josh

Could you find code for the parts of your project?

... most pressure sensors are MEMS devices and I2C or SPI. If your selected sendor is analog, it is critical that you design into the circuit a precision reference voltage for the analog A/D.

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.

As the counter is a prerequisite and then the venting/pressurization are separate; build your code such that everything unique is in separate functions and use global variables to communicate states and values. (As you gain experience programming you can implement more sophisticated function return values and parameter passing.)

I have a rather large collection of Arduino projects on my webpages... steal anything ;)

Ray