Back to Final Project Main Page - PSB

Designing the Control Board - PCB

PCB Design


After designing all the Mechnical Components of the Pipe Surveying Bot, and deciding which inputs and outputs i will be using, the next step was to design the control board that will be controlling all the electromechanical components and sensons in the robot, in order to achieve its objective.




Software Used

The following software were used in this week's assignment:
  1. Eagle
  2. was used to design the PCB.
  3. GIMP
  4. was used to extract and enhance the image of the PCB design.



Pinout Connection of My Components



My Board Design

So in order to build the board that will be controlling the PSB, i had to make some research regarding the differnt components i am using in my project, in order to design the board according to its architecture and technical specifications.

The robot has various inputs and outputs that will connected to the PCB. The inputs are:

  1. Ultrasonic Sensor used to measure distance
  2. Accelerometer and Gyroscope used to measure angular acceleration and the angular position
The outputs are:
  1. Nema 17 Stepper Motors that will be used to drive the robot. I will be using a DRV8825 Stepper Motor driver to control the Stepper motors in my system.
  2. Servo Motor used to help scan the area when the robot reches an abstacle
  3. SparkFun microSD Transflash Breakout used to save the data collected by the robot

Ultrasonic Distance Sensor

As mentioned above, the Ultrasonic Distance Sensor is a Digital Sensor. The HC-SR04 Ultrasonic Sensor Module has four pins:

  1. Vcc which is connected to the 5V power source, either from the Arduino Board, or any other board
  2. Trigger pin which is connected to a digital pin which will be set as an output pin
  3. ECHO pin which is connected to a digital pin that is set to be an Input
  4. GND which is connected to the GND of the power source or board you are using
So a Four-Pin connection will be needed on My Board for the Ultrasonic Distance Sensor



You can download the data sheet for the Ultrasonic Ranging Module HC-SR04 from the following link
Ultrasonic Sensor

Accelerometer and Gyro (MPU-9250)

The main sesnor i will be using in my Pipe Surveying Robot is the the MPU-9250.
The InvenSense MPU-9250 sensor contains 3-Axis Accelerometer, Gyro, & Magnetometer MEMS in a single chip. It is very accurate, as it contains 16-bits analog to digital conversion hardware for each channel. Therefor it captures the x, y, and z channel at the same time. The sensor uses the I2C-bus to interface with the Arduino.
The MPU-9250 is not expensive, especially given the fact that it combines Accelerometer, Gyro, & Magnetometer.

The module has 10 pins:

  1. Vcc that could be connected to a 5V or 3.3V power suply. The MPU-6050 module has a voltage regulator on board
  2. GNG pin which is connected to the GND of the control board
  3. SCL which has to be connected to SCL pin of the micro controller, known by the Analog 5 pin on the Arduino Board
  4. SDA pin which has to be connected to the SDA pin of the microcontroller, known by the ANalog 4 pin on the Arduino board.
  5. EDA pin
  6. ECL pin
  7. AD0 pin
  8. INT pin is connected to the GND of the control board
  9. NCS pin
  10. FSYNC pin


You can download the data sheet for the MPU-9250 9-DOF 3-Axis Accelerometer, Gyro, & Magnetometer from the following link

MPU-9250

Stepper Motor - A4988 Stepper Motor Driver

I will be using the Nema 17 stepper motor as the main driver of my Pipe Surveying Robot. In that case, i can keep track of the exact distance that the robot cover inside the surveyed pipe.

In order to drive the Nema 17 stepper motor, I needed a stepper motor driver. I chose to use the Polulu a4988 stepper motor driver because it is cheap an small, and could be easily located on my PCB. The A4988 module has 16 pins, among which only 12 will be used:

  1. Vcc that is connected to a 5V power suply.
  2. GNG pin which is connected to the GND of the control board
  3. VMot that will be connected to the 12V power suply. This is the voltage supplies to the Stepper Motors
  4. GNG pin which is connected to the GND of the control board
  5. Step pin which is connected to a digital pin which will be set as an output pin. This controls the number of steps of the stepper motor
  6. Dir pin which is connected to a digital pin which will be set as an output pin. this control the direction the stepper motor should rotate
  7. 1A, 1B, 2A, 2B pins are the pins that the stepper motor connects to.



You can download the data sheet for the Polulu A4988 Stepper Motor Driver Carrier from the following link
Polulu A4988

Servo Motor

In order to be able to scan the area when the robot reaches an obstacle, the Ultrasonic sensor will be fixed on top of a servo motor. The servo motor i am using, Futaba S3003 has 3 pins:

  1. Vcc that is connected to a 5V power suply.
  2. GNG pin which is connected to the GND of the control board
  3. Signal pin which is connected to a digital pin which will be set as an output pin. This controls the angle of the servo
You can download the data sheet for the Futaba S3003 Servo from the following link


Servo Motor

Micro Sd Transflash Breakout

The main tool i will be using to save the data collected by the robot is the microSD Transflash Breakout.
Breakout board for the microSD socket that is not much bigger than your fingernail. Compatible with the SPI interface found on any SD card, this tiny form factor was created for cell phone storage and is perfect for your next MP3 project! Board comes fully assembled and tested.

The microSD Transflash Breakout has 7 pins:

  1. Vcc that could be connected to a 5V or 3.3V power suply.
  2. GNG pin which is connected to the GND of the control board
  3. SCK which has to be connected to SCK pin of the micro controller, known by the Analog 5 pin on the Arduino Board
  4. D0 pin which has to be connected to the MISO pin of the microcontroller.
  5. DI pin which has to be connected to the MOSI pin of the microcontroller.
  6. CS pin which is connected to a digital pin.
  7. CD pin which is connected to a digital pin.
The analogic pins are not set on INPUT because it's their default setting. The values read by the analogic pins will be sent to the serial port.

You can download the data sheet for the Micro Sd Transflash Breakout from the following link

MicroSd Transflash

Designing My Board Sketch



My Board Design

Next i need to design the sketch for the control board of my pipe surveying robot i am building. Many points had to be taken into consideration while designing the board, mainly the Architecture of the Microcontroller i am using, the pin connection to the sensors and outputs i am using. The different parts of the Control board are described in details below.

The image represents the different part of the full control board such as:

  1. Microcontroller
  2. Power and Input Pins
  3. Inputs and Output Pins
  4. Power Board
  5. Polulu A4988 Pins
  6. Nema 17 Stepper Motor Pins

4 a - Microcontroller Connections

In my board, i will be using the ATmega328/P, which is the same Microcontroller used on the Arduino UNO board.

Saying that, and based on the data sheet, other than the Analog and Digital pins, the following connections were made:

  1. RESET connections. The Reset pin on the microcontroller will be connected to the Reset Pin of the ISP, and that of the FTDI, plus to a push button to be able to Reset the microcontroller whenever i want.
  2. XTAL1 and XTAL2 pins that will be connected to the external clock, in our case a Crystal having a frequency of 16000 mhz
  3. Debugging LED, that is connected to the SCK (Arduino pin13) which is mainly used for debuggining
  4. Power LED, that is connected in parallel to the input 5V Vcc.
  5. Decoupling Capacitors, that are connected in paraller to the +5V input, to regulate the voltage and current recieved by the microcontroller, and achieve a stable power supply. More details on how to calculate the Decoupling capacitors can be found on this link

Micro controller Decoupling Capacitors

4 b - Power and Input Pins

The main Input Pin headers that i will be using for my board are mainly the following:

  1. Power Pins that will have a 3.3V and 5V power source, a GND pin and a Vin pin.
  2. FTDI pins that are used to connect the board to the computer using an FTDI cable


Main Pins

4 c - Inputs and Outputs Pins

A set of pin headers was prepared for the Inputs and Outputs that will be used in my system and connected to the Microcontroller i am using.
Each pin head will have a Vcc pin and a GND pin, plus a number of dedicated Analog or Digital pins.

Among those pin headers are the following:

  1. Ultrasonic Distance Sensor Pin Headers: I will be using the Ultrasonic Sensor. The pins chosen on the micro-controller are Analog Pins that could be also used as digital inputs or outputs.
  2. Gyro and Accelerometer Pin Headers: The Accerlometer has 10 pins. So i will prepare a pin header that has pins, that will be mainly used to support the sensor flat paraller to the board. However, only Five pins will be connected to the microcontroller, the VCC and GND plus the SCL and SDA pins on the microcontroller.
  3. Servo Motor Pin Header: The servo has 3 pins.
  4. Micro SD Transflash Pin Header: The servo has 7 pins.
  5. Servo Motor Pin Header: The servo has 3 pins.
  6. Polulu Pin Header: The servo has 16 pins, devided into two parallel 8 pin headers.


Sensor Pins

4 d - Power Board

My board will have one battery as a power source dew to the limtied and tight space. Thus i will need power regulators that will achieve having a 12V, 5 V and 3.3 V power supplies on the board. Saying that a power regulation circuit was added to the board to achieved that.


Power Board



Finalizing Board Layout and Extracting Images



My Board Design

After finalizing the Sketch of my board, the next step is to design the board layout, taking into consideration all the points i mentioned above.

The image represents the layout of the different part of my board such as:

  1. Microcontroller
  2. MPU 9250 Pins
  3. FTDI Pins
  4. UltraSonic Pins
  5. Servo Pins
  6. Polulu A4988 Pins
  7. Nema 17 Stepper Motor Pins
  8. Power Pins
  9. Reset Pin
  10. Power Board
  11. V12 Input Pins

You can download the original Eagle design from the following links: My Board

Some Design Details

Various points has been taken into consideration while designing the board layout.

  1. The stepper motor pins along with the stepper motor driver pins are located at the corners of the board, to make the connection of the motors to the board much easier
  2. The servo pins and the ultrasonic pins are at the center line of the board, which will give us some freedom when assembling, as they are the last parts to be plugged in
  3. The MPU pins are located in a way that the MPU-9250 module is centered on the whole board. Thus the chip on the MPU module is centered in the robot for higher accuracy
  4. The reset pin is used because i did not use a ISP pinout. I will be using the Micro Sd pins to burn bootloader

Final Board Design

Extracting the Board Layout Images

After finalizing the layout of the PCB on Eagle, we want to extract the image that represents the PCB design. To do so we need to follow the following steps.

  1. First we turn off all layers by following the following path "view" > "layer settings" > "select none"
  2. Next we turn on only the layers we want to appear, mainly the ones we need to stay on the copper board during the milling process
  3. Extract the image in a Monocrome form
You can download the extracted images from the following link:


Monocrome Image

Producing Images on GIMP to be Used for Preparing the G-codes

So the next step after extracting the image from Eagle is to produce the images we need to use on Fab Modules to generate the g-code later.

So first we open the original image from Eagle and "extract as" a new copy that you can edit.

Using GIMP is easy, just fill the area you dont want with black and that's it. I produced 3 images to be used in fab modules. The images are the following:



Drilling

Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License