Arduino Bending Machine Upgrade
Ever have a tedious task you know could be automated with Arduino?
This Arduino project, submitted by our member Isaac Rosen, is a great example of just that. At Isaac’s place of work, they test different flexible copper formulations for printing on polyester film for creating flexible circuits. Read below to learn how he turned a manual task into an automated one using Arduino!
From Isaac Rosen:
I work at Copprint, a company that makes copper conductive pastes (An “ink” that is printed, to form a printed pattern that is electrically conductive), my job is to develop new products. For each product there is a long list of requirements, which vary on the intended use. For example, for pastes intended for printing on paper or PET (polyester film- a type of plastic sheet), the printed pattern must be durable to bending. This means that there is only a minimal reduction in electrical conductivity caused by the physical forces during bending of the pattern, enabling it to function on flexible substrates.
We evaluate the flexibility of different copper paste formulations by bending the sample multiple times with a dedicated machine (made in house), and comparing the electrical resistance before and after the test, a flexible paste shows a very low increase, while a non-durable paste will have a steep increase in resistance, or even be non conductive from the bending.
While necessary, this test is daunting: the machine we use has a counter, but you need to keep close attention to stop the process at exactly the right moment after a set number of bending cycles. Since usually you need to test quite a few samples (five samples per experiment to get a reliable result, and usually we compare several different pastes), running this test is torture.
So, out of pure intolerance, this project was born: to make a system that will control the machine, and turn it off automatically after a defined number of bending cycles.
The system has the following components:
- A magnetic sensor (I initially tried using a hall effect sensor, but it didn’t work well, and then found that a Reed Switch sensor works better), to measure the number of bending cycles.
- LCD screen: as an interface
- potentiometer to define the number of bend cycles I want.
- Relay, to turn on and off the motor of the bending machine.
- Start button.
- Arduino Uno to control it all. Sketch (attached as a separate file)
Its operation is simple:
- Chose the number of required bending cycles with the potentiometer (0-264)
- Press the start button.
- The Arduino turns on the Relay, which closes the electrical circuit to the motor, so the test begins.
- There are 2 magnets on the rotating rod and a magnetic sensor, each time a magnet passes near the sensor, an interrupt function is activated, decreasing the number of remaining cycles (as noted on the LCD screen).
- When all cycles are performed, the relay is turned off, and the screen congratulates you “Good Job”.
- The system reboots to the beginning, letting you start over again.
A few thanks are due:
I could not have done this without help:
First of all, to you for making the course. I tried several online courses and yours is definitely the best.
Thanks to Alex Stolov for building the initial bending machine, and helping me with the integration of the Arduino module on the system.
Arduino is a great tool, Thanks!
Arduino Code:
//A sketch for a magnetic counter to upgrade the bending machine at Copprint Technologies, Copprint.com
// Code by Isaac Rosen LinkedIn: https://www.linkedin.com/in/yitzchak-isaac-rosen-6b361217/
// Include the LCD library code
#include <LiquidCrystal.h>
//define pins for the LED, note I used diffrent pins than regular to keep pin #2 availble for the sensor as it uses an Inturupt.
LiquidCrystal lcd (12, 11, 8, 7, 6, 5);
//Seting up the pin for the potentiometer
const byte potentiometrPin = A0;
//Setting up the pin for the magnetic sensor
const byte hallSensorPin = 2;
//Setting up the pin for relay to control the motor
const byte MachinePowerPin = 3;
//Setting up the pin for the LED that indicates the motor is on. This was only used for development
//const byte LEDonPin = 4;
// setting up the pin for the start button
const byte startButton = 13;
boolean MagnetSense = 0;
//Number of bends for the ecxperiment
int TotalBendCycles = 10;
//Last time the counter was updated
volatile long lastBendTime = millis();
unsigned long currentMillis = 0;
//Counter for number of bendings
volatile byte bendNumber = 0;
void setup() {
//To enable trobulshooting of sensing
Serial.begin(9600);
//Set up LED and Motor Relay pins as outputs
pinMode(MachinePowerPin, OUTPUT);
pinMode(LEDonPin, OUTPUT);
//Attach the ISR to the sensor pin
attachInterrupt(digitalPinToInterrupt(hallSensorPin), changeBendNumber, CHANGE);
//Set up the LCD
lcd.begin(16, 2);
lcd.setCursor(0, 0);
lcd.print("Banana Bender");
delay(1000);
lcd.clear();
}
void loop() {
//define the pin, check how to make it a value between 1 and 263.
int potenRead = analogRead(potentiometrPin);
TotalBendCycles = (potenRead / 4);
Serial.println(TotalBendCycles);
lcd.clear();
lcd.print("Set #cycles=");
lcd.setCursor(13, 0);
lcd.print(TotalBendCycles);
lcd.setCursor(0, 1);
lcd.print("Press button to start ");
boolean buttonPressed = digitalRead(startButton);
if (buttonPressed == 1) {
//Start with turinign on the motor and LED
digitalWrite(MachinePowerPin, HIGH);
// digitalWrite(LEDonPin, HIGH);
//This is a while up until we finish all bend cycles
while (bendNumber <= TotalBendCycles ) {
MagnetSense = digitalRead(hallSensorPin);
Serial.print("Sensor state = ");
Serial.println(MagnetSense);
Serial.print("Number of bends = ");
Serial.println(bendNumber);
//LCD display
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Cycles left=");
byte remainingCycles = TotalBendCycles - bendNumber + 1;
lcd.setCursor(0, 1);
lcd.print(remainingCycles);
} //close while
digitalWrite(MachinePowerPin, LOW);
// digitalWrite(LEDonPin, LOW);
lcd.clear();
lcd.print("GOOD JOB!");
delay(5000);
bendNumber = 0;
currentMillis = 0;
}//close if
}//close loop
// Interupt Service Routine
//
void changeBendNumber(void) {
currentMillis = millis();
//if so that the detected magnet will only register if 0.5 seconds passed from the last registration.
if ((currentMillis - lastBendTime ) > 500) {
bendNumber++;
lastBendTime = currentMillis;
}//close if
} //close ISR