Assignment

Group
   1. Use the test equipment in your lab to observe the operation of a microcontroller circuit board
Individual
   1. Redraw an echo hello-world board
   2. Add (at least) a button and LED (with current-limiting resistor)
   3. Check the design rules, make it, and test it
   4. Extra credit: simulate its operation

Plan for  the week

week06_plan

Introduction

This week we will be focusing on the Electronics Design. We will design a PCB through a designing software, fabricate it and test it. There are many softwares where a PCB can be designed like KICAD, Autodesk Eagle, circuitmaker etc but we will be using Autodesk Eagle for ease. I, personally had no idea about electronics as well as designing. I came to know about electronics production in week 4 and now designing is a new challenge for me. I am excited as well as nervous for this week.

Printed Circuit Board (PCB)

A printed circuit board (PCB) consists of a board which is milled or etched from a copper laminated board on one/both side of a subtrate layer like epoxy, fiberglass, ceramic etc in such a way to connect different terminals of the electronics component that are soldered on to it. you can know more about PCB in this link.

Printed-Circuit-Board

Designing PCB

There are many tools in which you can design a PCB like Autodesk Eagle, KiCAD, LibrePCB, etc. We will be using Eagle for designing out PCB.  For this we will be redesigning a Echo Hello World Board. First the board is studied like routes, electronic components, etc to reverse engineer it on the Eagle so that we can learn about designing PCB from the process. 

hello.ftdi.44

Exploring Eagle

EAGLE is electronic design automation (EDA) software that lets printed circuit board (PCB) designers seamlessly connect schematic diagrams, component placement, PCB routing, and comprehensive library content. Please refer this link if you want to know in detail about PCB design in eagle

Initial process

New_eagle
Open Eagle and right click on the project to create a new project.
Schematics_page
Now right click the project and click on new schematics which should take you the page where you can now prepare the schematics.
Library_import
Download the library from this link. After Downloading open the library manager inside manager and clik on "In Use" browse the library file from where you have saved the downloaded file.
adding_parts
There ia a command bar just above the drawing area where you can write command to execute it. In order to add the components type add and press enter. Now go inside the fab folder and add items

You can move parts by clicking on move and then a "+" sign between the shapes.

Now we have to add Led and a switch to the current board where possible. I decided to put 3 LED in the PCB. For LED, you have to balance the voltage in the LED, hence a resistor had been added. The way to calculate resistance value is:

If,
    Main supply volatage = V,
    Rated voltage for LED = V1,
    Rated current for LED = I1
Then,
    Value of resistor in series= (V-V1)/I1

Then the three LED of Red, Green and Blue is added as FabLab logo in the ports PA7(6), PA3(10) and PA2(11) and a tactile switch is added on PB2(5) port and finally the schematic is finished.  (The pins are recognized according to datasheet of the ATtiny 44 which you can know about in embedded programming week)

Eagle_schematics

Then I did ERC where, it showed that the I had not inserted the values of the resistors and capacitors, then I added the values. the again did ERC where everything was ok.

ERC_elec_design
elex_design_sche

Download the schematics here

After the schematics is finished, click on the switch to board inside file menu or click on the "SCH-BRD" on the top left corner.

Switch_to_board

Now that you are on the board, first thing to do is connect set the design rules which you can get into by clicking DRC inside tools menu. As we are using 16 mill bit, setting clearances of 16mill bit was the first thing to do. Set 16 mill to different clearances between wire, pad, via and smt.

gap_betn_trace
wire_pad_clearance
pad_pad_clearance
Via_Wire_clearance
Via_pad_clearance
Via_via_clearance
Smd_smd_clearance
Smd_pad_clearance
Smd_via_clearance

After setting the design rules, the components are moved into the board and arranged so that there is minimum crossings between wires. Then press auto router. This will try to simulate the wirings keeping components at a fixed place. Now what you can do is connect the components manually where possible and using both auto router and manual input, wiring is done. Then click on move and dragging the boudray line in yellow and shrink it which just fits the design and if you want add cut line in the bottom layer to trim the board.

Board_design

Then the again it was checked from the DRC to see if there is any issue with the trim and clearances.There would be warnings in the screen when there is any problem according to the design rules. If there is any fix them and you should be able to export the files for milling.

For exporting the image you have to show only the layers which you want to trace and trim. For this there is a tool on the top left corner, hide all layers and show the top which will be used for tracing using 1/64 inch mill

trace_select

Do the same for the trim line as well

trim_select

To get the png file, first select the top layer for trace, show top layer, export as image, browse the folder where you want to export, check on monochrome, select dpi, 2000 (you can change it according to you requirement) and save.

You should be able to get following files.

fabacademy_trace
fabacademy_trimline

Download traces and trim line here

Now after getting the image use it to mill the PCB from MDX-20. You can know the process of milling here.

milled_PCB
PCB_MILL

After the PCB is milled, see the imperfections if there is any. Test the continuity and the isolation as well. If everything is OK, first collect the electronics components to be attached.

  • 1x ATtiny44 or ATtiny84
  • 1x 2x3 pin header(for ISP)
  • 1x FTDI 1x6
  • 1x XTAL 20 MHz
  • 1x 1uF Capacitor
  • 1x 10kΩ resistors
  • 3x 499Ω resistors
  • 1x Red LED
  • 1x Green LED
  • 1x Blue LED
  • 1x Tactile Switch

After collecting the electronic components, it is stuffed on the board by soldering according to the board design.

PCB

After soldering, the connection is inspected again using the multi-meter and then connected to the ISP using a jumper cable for testing the board.

PCB_ISP

Now after it is connected upload the the program to the board using Arduino IDE. For getting the board setting in IDE,

1. Goto
     File >> Preferences

2. Copy the link
      https://raw.githubusercontent.com/damellis/attiny/ide-1.6.x-boards-manager/package_damellis_attiny_index.json
in Additional Board Manager URLs.

3. Goto Board Manager, Search for ATtiny44 and install it.

4. Goto
       Menu >> Tools
    Select
       Board >> ATtiny 22/44/84
       Processor >> ATtiny 84
       Clock >> External 20 MHz

arduino_set

Now the program was compile pushed and tested in the board.

// constants won't change. They're used here to set pin numbers:
const int buttonPin = 8; // the number of the pushbutton pin
const int ledPin1 = 3;
const int ledPin2 = 2;
const int ledPin3 = 7;
// variables will change:
int buttonState = 1; // variable for reading the pushbutton status

void setup() {
// initialize the LED pin as an output:
pinMode(ledPin1, OUTPUT);
pinMode(ledPin2, OUTPUT);
pinMode(ledPin3, OUTPUT);
// initialize the pushbutton pin as an input:
pinMode(buttonPin, INPUT_PULLUP);
}

void loop() {
// read the state of the pushbutton value:
buttonState = digitalRead(buttonPin);

// check if the pushbutton is pressed. If it is, the buttonState is HIGH:
if (buttonState == HIGH) {
// turn LED off:
digitalWrite(ledPin1, LOW);
digitalWrite(ledPin2, LOW);
digitalWrite(ledPin3, LOW);

} else {
// turn LED on:
digitalWrite(ledPin1, HIGH);
delay (2);
digitalWrite(ledPin1, LOW);
delay (2);
digitalWrite(ledPin3, HIGH);
delay (2);
digitalWrite(ledPin3, LOW);
delay (2);
digitalWrite(ledPin2, HIGH);
delay (2);
digitalWrite(ledPin2, LOW);
delay (2);
}
}

Here internal pull up resistors required as my switch works on open-drain system. Which means, that the pin is always high and when switch is connected there is an open drain which signifies that the switch is on. If you do the design wherethe switch is open, the state of your input is "floating". If you try to digitalRead or analogRead that input, the value will be pretty much just noise. so to avoid this, pull up resistors are used.

final

Let's use other machines 

The casing was designed and fabricated using laser cutter and 3D printer. The parts fabricated are as shown in the picture.

Casing
casing_assembled

Tadaaaa.....

Final_with_casing

Group assignment

This week's group assignment is use the test equipment in the lab to observe the operation of a microcontroller circuit board

FLUKE 101 Pocket Digital Multimeter

This equipment is one of the mostly used equipment in electronics section in the lab. It can be used to measure following

  • AC Voltage
  • DC Voltage
  • Current
  • Continuity
  • Resistance
  • Frequency
  • Capacitance
multimeter

This equipment is used mostly to measure continuity and isolation of the traces. It was also used to find the polarity as well for diodes.

BK PRECISION 9123a series Programmable DC Power Supply 
The 9120A series are laboratory grade, programmable DC Power Supplies providing great performance and features not found in other supplies in this price category. The power supplies were designed to meet the needs of today's applications in R&D design verification, production testing or university labs that require clean and reliable power, high resolution/accuracy and fast transient response time.

Features:

  • Excellent display resolution
  • Fast transient response time (< 150 µs)
  • SCPI compatible
  • Communicate via USB Interface, using included USB to TTL serial converter cable
  • GPIB interface (model 9123A only)
  • Closed case calibration
  • Compact size for bench use or rack mountable (2U x 1/2U size)
  • DVM and Milliohm Meter
  • Discrete Fault Indicator/Remote Inhibit (DFI/RI). Useful for turning multiple power supplies On/Off simultaneously
  • Application Software for front panel emulation and simple test sequence generation included
  • Sheathed banana plug terminals for safety
9123a

This has been used to calculate the current in the controller board. In parallel is was used to calculate the power in the vacuum cleaner that we had in lab as well. Power of the vacuum cleaner was calculated to be 69W from the power supply by setting rated voltage of 15.6V

9123a_test
power_supply

INSTEK GPD-3303D Power Supply

Instek GPD-3303D is a Multiple Output Programmable Linear D.C. Power Supply. The GPD-X303 Series offers digital panel control, large display, bright LED indicators, high output resolution, 4 sets of setup memory, USB remote control and smart cooling fan control. Additionally , the GPD-X303S Series provides easy operation , a wide selection of panel setting and operation.

Features:

  • 2/3/4 Independent Isolated Output
  • 4 LED Display Sets: 3 digits after decimal point
  • 1mV/1mA(GPD-2303D/GPD-3303S/GPD-4303S)
  • 100mV/10mA(GPD-3303D)
  • 4 Sets Save/Recall
  • Tracking Series and Parallel mode
  • USB Standard Interface
  • Labview driver
GPD-3303D

UNISOURCE DS-1100 100 MHZ, 2 CH, Digital Storage Oscilloscope

The digital storage oscilloscope is an instrument which gives the storage of a digital waveform or the digital copy of the waveform. It allows us to store the signal or the waveform in the digital format, and in the digital memory also it allows us to do the digital signal processing techniques over that signal. The maximum frequency measured on the digital signal oscilloscope depends upon two things they are: sampling rate of the scope and the nature of the converter. The traces in DSO are bright, highly defined, and displayed within seconds.

Features:

  • 100 MHz bandwidth, 1 M Memory
  • USB storage, RS232C & J45 interface
  • 4000 point record length for each channel
  • Multi-waveforms math, FFT Function
  • Cursor & Track measurement
  • Waveform Record & Recall, Trigger Mode for Edge, Video, Pulse Width, Slope & Alternate
DS-1100

This is used to find see the frequency at which resonator was working and also the led on off signal was visualized.

Oscilloscope

INSTEK AFG-2100/2000 SERIES ARBITRARY FUNCTION GENERATOR

A function generator is a specific form of signal generator that is able to generate waveforms with common shapes. Unlike RF generators and some others that only create sine waves, the function generator is able to create repetitive waveforms with a number of common shapes. The AFG-2100/2000 Series Arbitrary Function Generator is a DDS (Direct Digital Synthesized) based signal generator designed to accommodate the Educational and Basic Industrial requirements for an accurate and affordable signal source covering the output of Sine, Square (Pulse), Ramp (Triangle), Noise and Arbitrary waveforms.

Features:

  • 0.1Hz to 25MHz with in 0.1Hz Resolution
  • Sine, Square, Triangular, Noise and Arbitrary Waveform
  • 1% ~ 99% adjustable duty cycle for Square Waveform
  • Waveform Parameter Setting Through Numeric Keypad Entry & Knob Selection
  • Amplitude, DC Offset and Other Key Setting Information Shown on the 3.5" LCD Screen Simultaneously
  • AM/FM/FSK Modulation, Sweep, and Frequency Counter Functions (AFG-2100 only)
  • PC Arbitrary Waveform Editing Software
AFG-2100_2000

Created with Mobirise