Gig- looking for a quote/help

Hi All,

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.

Functionality needed:

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.

Electronic Outputs:

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

  1. 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)
  2. The Milking Claw vaccum solenoid should be closed.
  3. The red light is lit.

Sequence of Events Required: Working Mode

  1. The farmer presses the Start button the Ram solenoid is closed
  2. The Claw solenoid is opened. (no delay)
  3. The green light is turned on.
  4. The red light is turned off.
  5. 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.
  6. Continual monitoring of the sensor is required to establish if continuity (milk flow) is present.
  7. 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.
  8. If no flow is confirmed, the claw solenoid is closed.
  9. 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)
  10. The red light is on (no flash).
  11. If at anytime the Cancel Button is pressed (momentarily) any process underway should be interrupted (timing or monitoring) claw solenoid should be immediately closed.
  12. A delay of 3 seconds enacted then the ram solenoid opened to withdraw the cups.
  13. Green light is turned off
  14. Red light is on (no flash)

Sequence of Events required: By pass mode

  1. When the bypass button is pressed (momentarily), the Ram solenoid should be closed.
  2. The Claw solenoid should be opened.
  3. The green light should flash (once a second).
  4. No flow monitoring takes place.
  5. Status should remain as in steps 1-5 until the Cancel button is pressed (momentarily)
  6. When cancel is pressed the claw solenoid should be immediately closed.
  7. A delay of 3 seconds enacted
  8. The ram solenoid should be opened to withdraw the cups.
  9. Green light turned off
  10. Red light turned on.

If you have questions, please ask...

Cheers Chris

Are the solenoids powered open or powered closed? I don't know much about milking machines, but isn't the vacuum to the cups intermittent?

It might help if you told us which country you're in and the region/state/county or nearest town/city. Someone near to you would be advantageous.

Henry Best, London, UK.

Hi Henry,

The existing solenoids are powered both ways, i.e to keep them open or closed, I assume this is because of them working against vacuum.

No the vacuum to the claw is permanent, the milk line is under permanent vacuum and it is opened to the claw for milking. The intermittent part you’re thinking of is the pulse that causes the squeezing affect. That is done separately and unrelated.

Im in Gippsland, Victoria in Australia


Hi Chris

Sounds like a Job for a PLC. I would use a Siemens S7-1200 or similar. You need to have a reliable solution for the whole year i guess.

This is the discussion of the same subject.

It’s not a simple sketch. It’s a complete hardware solution, so you’ll have to find someone local to you that can actually come to your farm.

wvmarle: This is the discussion of the same subject.

It's not a simple sketch. It's a complete hardware solution, so you'll have to find someone local to you that can actually come to your farm.

Local is overrated! I've designed far more complex systems that I packaged up and shipped for the client to wire up. The important thing is to have someone on the other end who is technical enough to understand how things need to be connected or to be able to create detailed wiring diagrams if they are not. Obviously the former is preferable!

One of the more interesting business ideas I read about (wish I could find the podcast now) was someone who developed a system to monitor the quality of ski trails. As part of development, he had to learn about all the popular trail groomers so he could write instructions on how to wire his system into theirs, knowing that the person doing this was likely a non-technical 20 year-old.