Help needed, will pay.


I'm new to coding the arduino and don't have time to learn and play with code. I have done a few tests and tutorial so get the basics but i need the arduino to control a capping machine that i need to get up and running asap.

I had a bit of help on here not so long back to get a pneumatic actuator to extend and retract with delays in between but now i need to go to the next step and fully automate the machine. If anyone can help with the code i am willing to pay.

This is what i need to happen.

Turn a steper motor 45 degrees then stop (im using big easy stepper driver)
wait a set ammount of time (lets say 500ms)
out put a pin to switch a solenoid (to activate a pneumatic actuator that holds bottle)
output needs to stay constant for set time (lets say 2000ms) (to keep bottle held for 2000ms)
out put another pin to switch a second solenoid (200ms after the first solenoid) (this will activate another actuator that will cap the bottle)
keep this pin out put constant for set time (lets say 1500ms)
then repeat.

so the basics of how the machine works is

a disc pics up a bottle from a conveyor belt. it tuen 45 degrees and positions the bottle under the capper.

an actuator extends to hold bottle in place

actuator above extends down to cap bottle then goes back up

actuator releases bottle

disc turns gain and repeats the process.

I'm sure the cod is not too hard but i really dont have the time to sit down and experiment with it, if anyone can help i would be very much appreciated and like i mention i am willing to pay if anyone is up to the job.

Use a PLC.

Most of the code needed is very simple port control and delay timing, the more complex thing is to control the stepper motor, but that driver board has several well documented pages with code; -

Are you intending to merge the code with the other Arduino or use a separate one ?

Though think all driver boards are much the same, I don't have that particular one, but think anyone who has could help you out quite quickly , if you do not have time to try the above examples ?

You will have to be familiar with the code as the timings etc will need to be adjusted to suit the speed of your actuators and stepper motor.

I'd be happy to help, and I agree with ricky101 that you will probably have to mess with timing to get everything working properly. But that can be done with a clever user interface or other configuration, so no code needs to be changed.

A basic test routine below that runs a sequence of the Hold and Cap actuators every 5 seconds.

It does not include the stepper drive; also what device you are using to sense the bottle is present ready for the operation to begin ?

AArg mentions using PCL which is designed for noisy industrial machines, how well an Arduino would work faced with similar electrical interference from your machine ..?

Perhaps worth testing it out with this code first to ensure it will work properly, before adding the Stepper part.

No mention from you about what driver you are using for the actuators/ what power they need ?

 * Bottle Capper

const int Hold_Act =  8;      // hold actuator on pin 8 - Digital Output
const int Cap_Act =  9;      // capper acutator on pin 9 - Digital Output

void setup() {
  // set the digital pin as output:
  pinMode(Hold_Act, OUTPUT);
  pinMode(Cap_Act, OUTPUT);

void loop() {

  // wait here for signal from bottle present sensor/switch  ?
  //  stepper turns +45%

  delay(500);                      // 500ms delay after stepper operation

  digitalWrite(Hold_Act, HIGH);    //  Turn Hold Actuator ON

  delay(200);                     // 20mms delay after Hold Actuator turned On

  digitalWrite(Cap_Act, HIGH);    //  Turn Cap Actuator ON

  delay(1500);                   //  Hold Cap Actuator on for 1500ms

  digitalWrite(Cap_Act, LOW);   //  Turn Cap Actuator OFF

  delay(300);                    //  Slight puse before turning off Hold Actuator
  digitalWrite(Hold_Act, LOW);    //  Turn Hold Actuator OFF

   delay(500);                          // slight pause to allow actuators to retact

  // stepper turns -45%

  delay (5000);                 //  for testing only -  delay of 5 seconds between each loop
}                               // end of Loop so return to beginning

Hi Skella,

I'm curious. How'd it turn out?


Seems straightforward.

Datasheet for the steeper driver is here:

How many steps are in a quarter of a turn? I suppose it's not a big deal - you'd play with it until it's right. How fast should it perform the quarter of the turn?

Only other issue is: how does the arduino know when to start doing its thing? Should it just begin it's little routine indefinitely? Would you like an on/off toggle switch? A button that just does a single step when you poke it?

Is there any sort of delay between the last step and first step?

Should the sketch put the disk back 45 degrees to put it in its previous position, or are we just moving forwards 45 degrees at a time each step?

Would we like soft starts and stops on the 45 degree turn?