pneumatic small scale factory using arduino questions

hi, I am not native English, sorry if my English is bad,
I have some project for my friend,
he has some small-scale factory for making metal cabinets, lockers, or something like that,
he asks me as a programmer to make some pneumatic robot,
my specialty is web programmer, and that is years ago,
but I have zero experience with electronics thing like : robot, resistor, transformer, transistor, etc.

note :
-it an only small conversation with my friend, so except for pneumatic that he show to me (the real thing), I am do not yet buy the arduino and their parts.
-his place is quite far from the city so often to have a blackout or power outage from the electrical company, so I will 12-volt car battery as the power resource

I have some research on this project and found some question :

  1. will it safe if I use the 12-volt car battery as power resource?
  2. will it safe if I put 12-volt valve Electric Pneumatic to arduino?
  3. is there any sensor set to put on pneumatic that indicating if the pneumatic has reached full length and return length?
  4. number of pneumatic is quite a lot, let said it will contain :
    a.10 pneumatic (10 digital cable slot + 1 ground),
    b.10 sensor of full length sensor (10 digital cable slot + 1 ground[it will be combine with ground at point a.]),
    c.10 sensor of full return sensor (10 digital cable slot + 1 ground[it will be combine with ground at point a.and b.]),
    can arduino handle it?

for this time I only found this problem,
if you have the answer(s), tip(s), trick(s), thing(s) to avoid, tutorial link(s), or something like that, please tell me, I will very appreciate it.
thank you.

Kucingmiow:

  1. will it safe if I use the 12-volt car battery as power resource?

Basically: yes, as long as you have a proper step-down to the 5V the Arduino needs. A buck converter is the best solution, for prototyping you can rely on the built-in regulator and power it through the RAW pin or (in case of an Uno) the 12V socket.

  1. will it safe if I put 12-volt valve Electric Pneumatic to arduino?

You will need appropriate driver hardware to translate a 5V signal into 12V power. A mosfet comes to mind, but without knowing details of your actuators that's all I can say.

  1. is there any sensor set to put on pneumatic that indicating if the pneumatic has reached full length and return length?

Limit switches will do great.

  1. number of pneumatic is quite a lot, let said it will contain :
    a.10 pneumatic (10 digital cable slot + 1 ground),
    b.10 sensor of full length sensor (10 digital cable slot + 1 ground[it will be combine with ground at point a.]),
    c.10 sensor of full return sensor (10 digital cable slot + 1 ground[it will be combine with ground at point a.and b.]),
    can arduino handle it?

No problem for an Arduino.
Can you handle it? That's the big question.
Start with one, just one. Get that working well. Get it to move in and out. Consider whether you just want it to go in and out completely or whether you want a more precise positional control.
Then when that one works you can build ten, and worry about all the issues with scaling up (a Mega has more than enough inputs for this). Power supply may become an issue.

wvmarle:
Basically: yes, as long as you have a proper step-down to the 5V the Arduino needs. A buck converter is the best solution, for prototyping you can rely on the built-in regulator and power it through the RAW pin or (in case of an Uno) the 12V socket.
You will need appropriate driver hardware to translate a 5V signal into 12V power. A mosfet comes to mind, but without knowing details of your actuators that's all I can say.

Limit switches will do great.
No problem for an Arduino.
Can you handle it? That's the big question.
Start with one, just one. Get that working well. Get it to move in and out. Consider whether you just want it to go in and out completely or whether you want a more precise positional control.
Then when that one works you can build ten, and worry about all the issues with scaling up (a Mega has more than enough inputs for this). Power supply may become an issue.

thank for the info,
but why you recommended "mega" instead "due"? ( i have no idea what information from the voltage chart ),
for electronic parts like mosfet, buck converter, and limit size, i will ask the seller when buythem,

anyway any of you have some tutorial link about pneumatic and the sensor(limit size)? what keyword if i want to learned it? ( just make loping opposite direction if the full length or the return length reached )

and thanks again for the answer wvmarle, i really appreciate it

Kucingmiow:
thank for the info,
but why you recommended "mega" instead "due"? ( i have no idea what information from the voltage chart ),

Lots of inputs. Due may do as well, no experience with them. With a little more work an Uno or similar (Nano, Pro Mini) will also do.

anyway any of you have some tutorial link about pneumatic and the sensor(limit size)? what keyword if i want to learned it? ( just make loping opposite direction if the full length or the return length reached )

Those things are called "limit switch" or "micro switch". That are also some those keywords. Basically just switches that are pressed by something you attach to your actuator.

Pneumatics as such, no idea. Arduinos can e.g. send signals to valves to open and close, or send digital commands to a pneumatics controlling computer, and in that way it would be able to control pneumatics.

wvmarle:
Lots of inputs. Due may do as well, no experience with them. With a little more work an Uno or similar (Nano, Pro Mini) will also do.

Those things are called "limit switch" or "micro switch". That are also some those keywords. Basically just switches that are pressed by something you attach to your actuator.

Pneumatics as such, no idea. Arduinos can e.g. send signals to valves to open and close, or send digital commands to a pneumatics controlling computer, and in that way it would be able to control pneumatics.

ah, because "mega" more familiar to you or other user,

sorry if this question out of question, but how to stop loop using a button in arduino?
(of course not plug out electric input cable)

this is code as example :

OnStartButtonPressed()
{
Start = 1;
While start = 1
{
A=A+1;
Delay 1 second;
}
}

OnStopButtonPressed()
{
Start = 0;
}

what is that procedure called,
is there kind of script can be apply in arduino?,
what keyword in google if i like to apply this code in arduino?
sorry if i ask too many,
once again, relly thanks for the answer

Kucingmiow:
sorry if this question out of question, but how to stop loop using a button in arduino?

If you put the second half of that question in the search box, you will get many hits.

The short answer: you don't.

The long answer: you don't stop loop(), that's just a bad idea. You can start/stop performing a function called from within loop() based on a button state.

wvmarle:
If you put the second half of that question in the search box, you will get many hits.

The short answer: you don't.

The long answer: you don't stop loop(), that's just a bad idea. You can start/stop performing a function called from within loop() based on a button state.

ah thanks, and very sorry if i broke the rule, i new in this workline

You have to understand the function of both setup() and loop().

setup() runs once upon startup of the device.

loop() is meant to run and run and run and run. Stop it, and your Arduino is dead in the water, unless you find a way to restart it.

wvmarle:
You have to understand the function of both setup() and loop().

setup() runs once upon startup of the device.

loop() is meant to run and run and run and run. Stop it, and your Arduino is dead in the water, unless you find a way to restart it.

I have study it,
maybe something like this :
loop()
{
While start = 1
{
A=A+1;
Delay 1 second;
}
}

OnStartButtonPressed()
{
Start = 1;
}

OnStopButtonPressed()
{
Start = 0;
}

maybe because i looking for 1-push button to stop, not constant switch(ed) to on, i cant find the code i looking for,
again, thanks for reply and the patient to guide me,

Indeed, something like that.

Now add the millis() based timing and finite state machine techniques, and you're complete (there are even libraries for the second, but I don't have the feeling that's of much use for implementing a FSM).

wvmarle:
Indeed, something like that.

Now add the millis() based timing and finite state machine techniques, and you're complete (there are even libraries for the second, but I don't have the feeling that's of much use for implementing a FSM).

wvmarle:
Indeed, something like that.

Now add the millis() based timing and finite state machine techniques, and you're complete (there are even libraries for the second, but I don't have the feeling that's of much use for implementing a FSM).

thanks for reply,
i am understand about delay
i just realize, my main problem in this code is, how to make toggle,
like i write before :

OnStartButtonPressed()
{
Start = 1;
}

OnStopButtonPressed()
{
Start = 0;
}
if i can solve this, the code is done

There are no built-in events like "onStartButtonPressed". You have to detect the events yourself by reading the digital inputs directly.

Also see: Planning and Implementing an Arduino Program

There are two ways to control many things in a factory.
one Arduino for one device.
start / stop button
emergency stop button
extend pneumatic actuator
end-switch at end of stoke
retract pneumatic actuator
end swith at close of stroke
part ready sensor (switch ?)

maybe a few lights to say it is working.

one Arduino does one thing.

or, one arduino does many things
start and stop for each of 5 machines
end switch for each of 5 actuator
close end switch for each of those 5 actuator
5 emergency stop switches......

only you know how you want to do things.

rememver, one arduino can prove that a part is in the machine
and that one operation is complete,
and then signal a second Arduino that the first step is complete and now step 2 is to start.

I made a machine that had two drill heads and one part clamping.
the part clamping was on a separate controller from the drilling.
once the clamp was locked, the drilling could occur
if the clamp failed, the drilling would perform an emergency retraction.

in a factory, you might have many controls that are all separate, but that all signal each other that things are working.

If you are good with programming but near zero with electronics, perhaps consider a small PLC unit, plenty around.

Easy enough to pick up the ladder logic side of things for a programmer I would imagine.

Kucingmiow:
OnStartButtonPressed()
{
Start = 1;
}

OnStopButtonPressed()
{
Start = 0;
}
if i can solve this, the code is done

in loop()
read stopButton
read startButton
if stopButton =0
if startButton = 1 // you can only start if the machine is stopped
start = 1
only when the machine is running does it check for start
if start=1
if stopButton = 1 // you can only stop if the machine has started
start = 0

it is my personal preference to not jump out of loop() to do one thing.
especially do not like to be in another part of the program when the emergency off button is pressed.