We are looking for someone to create a sketch to take over the control of one automation task in a Dairy. There has been a lengthy discussion elsewhere in the forum on whether we could adapt an existing sketch to do this task and general opinion was that it was inadvisable and beyond the ability of a novice (me). I would still like to learn about the eventual coding in the sketch, what or why each section is necessary and why it is compiled the way it is. If anyone is interested, I’d appreciate a quote on the cost to do this please. I apologise that there is no schematic or fancy flow chart, just the detail as follows:
The dairy parlour in question was fitted with a very advanced system controlling most aspects of the milking process 25 years ago. The costs of resurrecting this system are astronomical and out of the question, with most of the functionality no longer required anyway. To avoid confusing the project needs, I won’t detail them unless someone wants to know.
Sensor monitoring (conductivity) to determine when no milk is flowing and subsequent timed/delay of switching of solenoids to initiate milking cup removal and switching of ‘status’ lights
Inputs required: (by the operator)
Manual (button) inputs initiated by the operator are: Start – to start the whole process Cancel –to abort the monitoring process at any time and return the solenoids to ‘resting’ state Bypass – the ability to have the controller switch the solenoids to start milking (or washing) but not monitor flow or take further action until cancel is pressed.
Electronic Inputs: -Continuity ‘signal’ from the milk sensor when milk is present – we are still gathering data on the units in question to determine their output. Their operating voltage is either 12 or 24v, so a step down will likely be needed unless the output is already adjusted by the unit.
Two 3v outputs to activate two different solenoids, when the system is powered in ‘resting’ mode, one is normally open (the vacuum ram holding cups off the ground), the other normally closed (allows/prevents milk to flow to the vat). We know other components may be required depending on actual voltage and current requirements of these solenoids that is still to be confirmed.
Two confirmation lights indicating status – (these exist in the system already and are 24v) need to be controlled. One green for ‘operating’ and one red for ‘resting’. It would be nice if the green light could flash when in bypass mode, but not essential. More detail on light status below.
The main reason I haven’t tackled this sketch is the timing requirements that need to be within the process.
Sequence of Events Required in Resting Mode
- The system is powered on (Arduino board will not be powered unless the farmer needs to milk) the Vacuum Ram solenoid should be opened (holding the cups off the ground)
- The Milking Claw vaccum solenoid should be closed.
- The red light is lit.
Sequence of Events Required: Working Mode
- The farmer presses the Start button the Ram solenoid is closed
- The Claw solenoid is opened. (no delay)
- The green light is turned on.
- The red light is turned off.
- A timer or delay of 15 seconds is required before the sensor monitoring commences (during which time solenoid status must remain as just set). This is to allow the farmer to apply the cups to the cow and allow time for the cow to let down.
- Continual monitoring of the sensor is required to establish if continuity (milk flow) is present.
- When milk flow stops and sensor shows no continuity, a timer/delay of approximately 3 seconds is required. (to ensure milk has stopped) and red light should flash once a second.
- If no flow is confirmed, the claw solenoid is closed.
- Another 3 second delay is required (to allow vacuum to bleed off so the cups can come away from the teats) and then the ram solenoid is opened (to pull cups off)
- The red light is on (no flash).
- If at anytime the Cancel Button is pressed (momentarily) any process underway should be interrupted (timing or monitoring) claw solenoid should be immediately closed.
- A delay of 3 seconds enacted then the ram solenoid opened to withdraw the cups.
- Green light is turned off
- Red light is on (no flash)
Sequence of Events required: By pass mode
- When the bypass button is pressed (momentarily), the Ram solenoid should be closed.
- The Claw solenoid should be opened.
- The green light should flash (once a second).
- No flow monitoring takes place.
- Status should remain as in steps 1-5 until the Cancel button is pressed (momentarily)
- When cancel is pressed the claw solenoid should be immediately closed.
- A delay of 3 seconds enacted
- The ram solenoid should be opened to withdraw the cups.
- Green light turned off
- Red light turned on.
If you have questions, please ask...