My name is Cristian nd i'm new to the Arduino world. i've made some small LED, Switches and Servo projects with my Arduino UNO board.
I'm looking to make a labeling machine project using the input from an PNP/NPN output sensor.
Components used :
Micro-switch(to start the labeling cycle), Label sensor , wich is 12-24Vcc , and it it commands a relay witch comands the main drive motor (wich is a motor with brake function)
The description of the machine functioning:
The machine is powered on, and it starts the program, but does not start the motor(relay).
the switch is pressed, then the Arduino sends a signal to the relay, and keeps it on (motor is started) until the next singnal (detection of gap between the labels) , wich stops the cicle. and then waits for the switch to be pressed.
Any ideas/recomandation to study for doing this project ?
Please be patient, I am willing to learn!
Thank you ,
Cristi
Thank you Paul,
Yes, i have tested all the parts.
In fact i have a labeling chasis and components laying around defective at work for about a year,wich i was hoping to revive and improve.
So no stress about mechanical parts. Only the arduino programing and setting up is the issue.
First thing to figure out is how to connect the sensor signal to the Arduino board. I was thinking of using a voltage divider or 5v voltage regulator. What do you think ?
ICristi:
Thank you Paul,
Yes, i have tested all the parts.
In fact i have a labeling chasis and components laying around defective at work for about a year,wich i was hoping to revive and improve.
So no stress about mechanical parts. Only the arduino programing and setting up is the issue.
First thing to figure out is how to connect the sensor signal to the Arduino board. I was thinking of using a voltage divider or 5v voltage regulator. What do you think ?
That's great! You are so far ahead of many of the people posting on the forum.
If this was my project I would focus on the unknown part first and that is how to identify the gap in your labels, what ever that means. Can you use a mechanical sensor or a light sensor that monitors light passing through the label backing? Perhaps a bit more information?
the micro switches are connected correctly. i have tested them previously.
i have even removed them and placed a jumper wire instead.
the behaviour is the same
i have even tried mBlock,
in mblock if i do not use the second "if statement", the circuit works ok- it only switches on the 13 pin
but i want it to switch off by reading pin 10 also...
It more simple and less prone to error to run these switches between the input pin and ground, where the input pin is pulled up with an internal pullup resistor by using pinMode(#,INPUT_PULLUP).
If you remove the 5v and pulldowns on the switches, change the pinMode to INPUT_PULLUP, and wire the switches between the input pin and ground, and reverse the logic to !digitalRead() does it function as desired?
It would be better if your code responded to a change in state of the switch inputs (when the switch changes from LOW to HIGH, or HIGH to LOW), rather than checking to see if the switch input is HIGH or LOW. Otherwise you will run into problems when trying to start the motor while the 2nd switch is sitting over a label gap, and likewise trouble stopping it if someone decides to sit and hold the start button down. Have a look at the tutorial on State Change Detection
cattledog:
It more simple and less prone to error to run these switches between the input pin and ground, where the input pin is pulled up with an internal pullup resistor by using pinMode(#,INPUT_PULLUP).
If you remove the 5v and pulldowns on the switches, change the pinMode to INPUT_PULLUP, and wire the switches between the input pin and ground, and reverse the logic to !digitalRead() does it function as desired?
Thank you !
It is much more simple now, and it works.