Output devices

Circuit diagram

For output devices, I designed a circuit on eagle that includes a voltage regulator,connections and 100uF capacitors for four Pololu stepper motor drivers, connections and filtering capacitors for four limit stwitches, ISP pins, FTDI pins, and several multipurpose pins to connect inputs such as a joystick or LCD threw I2C bus. It also includes DIP switches for micro-stepping.

photo

PCB layout

The design is a double layer with ground plane

Top layer

photo

Bottom layer

photo
photo
photo

Printed layout

For production I experimented with etching. I printed the top and bottom PCB layouts on transparent sheets with a laser printer and superposed them

Top layer

photo

Bottom layer

photo

Superposed layers

photo

Developing PCB

The printer layouts were placed on the two sides of a double side photosensitive board. Each side was exposed to a UV light for a couple of minutes and then placed in the developer solution for a few minutes. The action of the developer is to remove the areas exposed to the UV light.

photo
photo

Etched PCB

The next step was to place the board in an etching solution for half an hour. The etching solution removes the areas not covered by the ink. The etching solution was safely stored after usage.

photo
photo

Finished board

The board includes two vias which were soldered using copper wire, and the pin headers were often used as vias as well, so many are soldered on both sides.

photo

Testing

I had a problem with the voltage regulator, it was getting very hot even without the motors, and drawing high current. I couldn't program the Microcontroller getting rc=-1 connection error. I had to remove the voltage regulator and power the motors and the microcontroller separately to get the board working. The code is meant to control two stepper mo

const int DIR_1 = 5;
const int STEP_1 = 6;
const int DIR_2 = 7;
const int STEP_2 = 8;
const int PULSE=1000;
int x;
int y;


void setup() {
pinMode(STEP_1, OUTPUT);
pinMode(DIR_1, OUTPUT);
pinMode(STEP_2, OUTPUT);
pinMode(DIR_2, OUTPUT);
pinMode(A0, INPUT);
pinMode(A7, INPUT);

}


void loop() {
x = analogRead(A0)-518;
y = analogRead(A7)-518;


if(x > 500) {
digitalWrite(DIR_1, HIGH);
stepper1_on();
}
else if(x < -400)
{
digitalWrite(DIR_1, LOW);
stepper1_on();
}
else if(y > 400)
{
digitalWrite(DIR_2, HIGH);
stepper2_on();
}
else if(y < -400)
{
digitalWrite(DIR_2, LOW);
stepper2_on();
}
}


void stepper1_on(void)
{
digitalWrite(STEP_1, HIGH);
delayMicroseconds(PULSE);
digitalWrite(STEP_1, LOW);
delayMicroseconds(PULSE);
}

void stepper2_on(void)
{
digitalWrite(STEP_2, HIGH);
delayMicroseconds(PULSE);
digitalWrite(STEP_2, LOW);
delayMicroseconds(PULSE);
}

I also connected my board to an LCD screen via a I2C module. To find the adress of the I2c module I mused a I2C scan programme found in an Arduino library

photo
#include 'Wire.h'
#include 'LiquidCrystal_I2C.h'
int x;
int y;
// Set the LCD address to 0x27 for a 16 chars and 2 line display
LiquidCrystal_I2C lcd(0x3F,16,2);
void setup()
{
lcd.init();
lcd.backlight();
lcd.setCursor(0, 0);

}

void loop()
{
x = analogRead(A0)-518;
y = analogRead(A7)-518;
lcd.setCursor(0, 0);
lcd.print("X= ");
lcd.print(x);
lcd.setCursor(1, 1);
lcd.print("Y= ");
lcd.print(y);
delay(10);
lcd.clear();
}
photo