Bag sealer automation:
I am trying to automate our bag sealing production line whereby a photo sensor stops an unsealed bag along a conveyor in the heat sealing position.
The heat sealer is waiting with its sealing jaws open, the heat sealer is manually activated and the jaws close to heat seal the bag.
The jaws then open, and then the bag continues along the conveyor.
I have been successful in stopping the conveyor using the photo sensor and relay using the following code:
int photoswitch = 7;
int sensorVal;
void setup() {
Serial.begin(9600);
pinMode(8, OUTPUT);
pinMode(7, INPUT);
digitalWrite(8, HIGH);
}
void loop() {
int sensorVal = digitalRead(photoswitch);
Serial.print("Sensor Value");
Serial.println(sensorVal);
photoswitch = digitalRead(7);
if (photoswitch == LOW) {
digitalWrite(8, LOW);
}
else {
digitalWrite(8, HIGH);
}
}
I am using an induction sensor to sense the position of the heat sealing jaws.
I can get the induction sensor to operate independently using the following code:
int inducswitch = 6;
void setup() {
Serial.begin(9600);
// declare the LED pins as outputs
pinMode(8, OUTPUT);
// declare the switch pin as an input
pinMode(6, INPUT);
}
void loop() {
int sensorVal = digitalRead(inducswitch);
Serial.print("Sensor Value:");
Serial.println(sensorVal);
// read the value of the switch
// digitalRead() checks to see if there is voltage on the pin or not
inducswitch = digitalRead(6);
// if
if (inducswitch == LOW) {
digitalWrite(8, LOW);
}
// this else is part of the above if() statement.
// if the
else {
digitalWrite(8, HIGH);
}
}
The problem is combining the two sensors as there is a conflict between them after the bag has been sealed.
The photo sensor has stopped the conveyor and the induction sensor is trying to start the conveyor when the jaws open after sealing.
Using code is there a way that the induction sensor can record when the sealing jaws move from open to closed to open and only restart the conveyor after the second open. Hope that makes sense.
Please find attached a drawing of the sealing setup.
Any help would be greatly appreciated.
bagsealerproject.pdf (554 KB)