I am working on a Project for myself and I am stumped as to how to go about the project.
I have a pressure transducer that i want the Arduino Uno to monitor the voltage, i than want to be able to set a value in the Arduino (1.6v) to than switch a relay in the relay shield that i have to turn off a solenoid.
i don't want the solenoid to turn back on until i press a button to activate the solenoid, than switch back off once the value (1.6v) is reached again.
i can find anywhere that some one has split the control circuit for the Arduino and the shield.
If anyone could shed some light on my project i will be very grateful.
The basic premise is that you have loop() always checking the analogRead() value…
When the input value moves across your on-off thresholds, it turns the output pin on or off as needed.
You can add millis() delays to implement any holdoff (hysteresis) you might want to add.
If your relay is only there to drive a DC solenoid, it’s possibly irrelevant, you can use your relay driver (MOSFET etc) to drive the solenoid directly!
Also, a tip that can be useful to save continuous power draw… use a PWM output to drive the relay/solenoid, because the coil requires more energy to pull-in than to hold - hence 100% duty-cycle for 100mS to pull the coil in, then back off to 30% duty as long as it needs to be held ‘on’.