SIMULTANEOUS MULTI SENSOR COUNTER PROGRAMMING HELP

Hi Everyone, Can anyone provide me some help regarding programming my arduino?

I have a 4 motorized track that allow objects to fall down, with 4 senors counting them and falls into a pneumatic chute.

I need help programming to do the following steps:

  1. simultaneously count with all sensor to a 12 units in total (not each)

  2. once at 12, triggers a relay to stop the motor to prevent any further objects from falling

  3. then trigger a relay that with a pneumatic cylinder to open the chute

  4. close the chute

  5. turns on the motor

  6. then loop

I hope I provide with all the information for a good question.

Thank you for any help.

image

industrial-chute-250x250.jpg

How to inline an image

industrial-chute-250x250.jpg

simultaneously count with all sensor to a 12 units in total (not each)

I very much doubt if you need to read 4 inputs simultaneously, which you can do if you choose the right 4 pins, rather you can read each of the 4 pins sequentially so fast that to all intents and purposes they have been read at teh same time, certainly in human perceivable timeframes.

What have you tried so far ?

Can you read the state of one input and increment the value of a variable when the input changes state ? Note the need to detect the change of state rather than simply its current state to avoid multiple counting.

What type of sensors will you be using ?

UKHeliBob:
What type of sensors will you be using ?

Those yellow cigar things look like ir to me, so should as you say be able to count using state change detect, high to low transition probably.

And should also work even if those screws (if those are the items to be counted) hit the sensors literally at the same time, since they should stay in front of each sensor long enough for loop() to get round and count the next sensor.

several things at the same time

Using millis() for timing beginner’s guide

Arduino reference

State Machine Tutorial

Tell more about the sensors, like a part number.

@azianstunn

Other post/duplicate DELETED
Please do NOT cross post / duplicate as it wastes peoples time and efforts to have more than one post for a single topic.

Continued cross posting could result in a time out from the forum.

Could you take a few moments to Learn How To Use The Forum.
It will help you get the best out of the forum in the future.
Other general help and troubleshooting advice can be found here.