Circuit Board Manufacturers Near Me China Pcb Assembly Services China

From ScenarioThinking
Jump to navigation Jump to search

If you follow this tutorial step by step,

then even if you have never ever designed any boards before,

by the end of this tutorial, you will have this board.

You will know, how to design it.

You will know, how to upload some firmware on this board

and how to bring it to life.

In this tutorial, we are going to use

this EasyEDA software

and JLCPCB services.

I need to say, this video is not sponsored.

Only the reason why

we are going to use this software and

why we are going to use these services

is because they are simple to use, and they are

not expensive.

Actually, this EasyEDA software is completely free.

You just need to register,

and

you don’t even need to install anything.

This EasyEDA software runs directly in your browser,

and this is the software which we will use to design our schematic

and also PCB.

Okay?

So, in this tutorial,

you will learn how to design this schematic.

I will also explain

everything what we are going to do

and why we are going to choose specific components.

I will explain what

you need to be careful about

when you will be designing your own boards

and also, I will also explain,

how to connect everything together.

So, this can help you to understand,

what you may want to think about

when you will be connecting components on your own board.

Then, once we have the schematic, we will also learn,

how to design PCB.

Again, I will explain,

what you may want to think about, when

you will be doing layout, when you will be drawing the tracks,

when you will be placing components

and once,

we designthe schematic and board,

this is how it is going to look.

Then, we will

learn how to generate all the files

which are needed to manufacture your PCB.

We will learn how to generate all the files

which are needed to assemble your board,

we will send

these files into production.

If you like you can do it too.

And then, once you receive

your boards, this is how it is going to look.

Once you have your boards,

we will learn how to write simple software,

how to upload it on your board

and how to bring your board to life.

I really hope you will find this tutorial useful and

here it is.

To design the schematic and PCB,

we are going to use website which is called

EasyEDA.

Just google for this

or search for this.

Click here,

register on this website and then, click on this EasyEDA Designer.

The registration is free, so you don’t have to pay anything

and also, you don’t need to install anything, because

we are going to design the schematic and PCB directly

in web browser.

Move cursor over File,

New,

left click on Project,

name your project for example My Board

and Save.

Left click on My Board project, be sure it is selected

and then File,

Save

and now we

save this schematic page inside of our project.

We are going to rename this schematic page.

Right click,

Modify, let’s call it My

Schematic

and we are going to add Eastwin PCB, so right click on the Project,

New PCB,

Apply,

click on File,

Save.

Right click,

Modify and we are going to call it My PCB.

Next,

we are going to have a look at specification of our board

and it’s going to be very simple.

On the board we would like to have a microcontroller,

RGB LED, accelerometer,

push button,

we would like this board to be battery powered

and it has to be really small.

So, let’s start with something what is quite easy to add

into our schematic.

First, we are going to add this RGB LED.

Go on JLCPCB website,

just search for JLCPCB,

left click,

then Resources,

SMT Parts Library.

Here we can see the list of all the components which they

can use for the assembly,

and we would like to find LED, so go here,

Light Emitting Diodes.

In this

filter, we would like to only work with components which are in stock,

and we would like to find RGB LED.

Apply.

There are only three options what we can use,

so let’s have a look on the first one, left click here,

left click on download to see the datasheet

and

this is not the kind of LED which we would like to use, because

in this LED we cannot directly control the

RGB LEDs. You can see,

this is special diode, which can be connected in series.

So, let’s go back,

I’m going to close this.

Open the next component, left click,

open datasheet of this component, left click

and this is exactly what we need.

Here you can see this is the component, this is the LED

and inside there are three LEDs.

They have common anode

and then we can individually switch on or switch off

these RGB LEDs inside of this component.

Let’s go back.

We are going to copy the manufacturer part number,

just hover cursor here, left click Copy,

go back into our schematic,

double click on the schematic page,

go on Library, left click.

Here Ctrl+V

and search for our LED,

left click to select,

left click on Place,

to rotate press spacebar

and left click to place the LED inside of our schematic,

press Escape.

Let’s have a closer look at this LED.

You know,

let’s talk about the things what you may

need to think about when you are choosing components

for your project.

So, first I’m going to click on this Library

and here you can see the

LED which we choose for our project

and what is important is this icon,

SMT icon, which says "Assembled",

because this means, that when we will be ordering the

PCBs and when we will ask this company to assemble,

to fit the components,

then this LED is available for this service,

so they can fit it.

You can see it also down here,

there, they have these LEDs in stock,

380 is available for JLCPCB SMT Service,

so this is important.

Maybe you don’t want to use components which are not in stock,

and

we would like to be able to buy this

LEDs in minimum quantity 1.

This is also perfect,

so we don’t need to pay for, I don’t know, 1000 pieces of these LEDs.

When we go and when we have a look inside of the datasheet,

there are few parameters which are important,

when you are selecting LED for your project.

You may want to have a look on this forward current

which is 5 milliamps

and maximum is 10 milliamps.

This is important because

some LEDs, they need high current,

I don’t’ know, 20 milliamps to light up

>and for battery powered device

>maybe we would like to use LEDs with low current

>needed to light up the LED

>So, 5 milliamps is perfect

>and also what is important is this forward voltage

>For red LED it is 2.1 volt

>for green 3.1 and for blue it’s 3 volts

>This is the voltage, which is across the diode

>and it basically means

>for example that you cannot powe

>these LEDs with 1.5 volt

>because then they would not work

>Okay? They need this forward voltage to work

>It means we may need to power up these LEDs maybe wit

>5 volts for example

>In this case

>in this RGB LED is als

>quite important maybe to use this common anode

>because when we have a look at the finished schematic

>I’m going to open this finished schematic

>here you can see, that we would like to contro

>this ground connection to this each individual LED

>So, this is how you normally control LED

>by connecting ground to LED, okay

>If they would not have common anode

>then it could be little bit more tricky

>You would have to use different circuit

>So, this is also perfect

>common anode is exactly what we would like to use

>It means

>thi

>LED is exactly what we would like to have in ou

>schematic, and we can plac

>another component

>I’m going to open our specification agai

>and the next what we would like to place into our schematic is accelerometer

>Let’s go back t

>SMT Parts Library

>click on All Categorie

>and in Sensors

>Motion Sensors – Accelerometer

r>check this In Stock only componen

r>and there are not so man

r>We would like to use maybe the cheapest on

r>so I’m going to have a look what is t

r>price for 1 piec

r>It is $2.1 for this on

r>$4.

r>$7

r>$1

r>$1.

r>$

r>$2.

r>$1.

r>So, this is the cheapest o

r>and we would like to double check the datashee

r>I’m going to close this datasheets which are her

r>This one and this one, we don’t need them anymo

r>and I’m going to op

r>datasheet for this accelerometer, left clic

r>Our board is going to be very smal

r>so first we need to double check the size of th

r>acceleromet

r>and it is only 2 x 2 millimeter

r>It’s like 80 x 80 mils, it’s very smal

r>And becau

r>our board is battery powered, we would like to be su

r>this chip i

r>or this chip has low current consumptio

r>0.9 microamp in standb

r>This is really goo

r>We are going to power up this chip by 3.3 vol

r>and this is up to 3.6, so this is perfec

r>We would like to use I2C for communicatio

r>because it’s like super simple interface for communicatio

r>And als

r>we would like to be sur

r>there is an interrupt pin which can wake up our syste

r>I need to search for this informatio

r>So, I’m going to scroll down little bi

r>This is the senso

r>some power

r>some other pin

r>The best will be just find table with pin descriptio

r>It is here, you can se

r>Okay, so this is address pi

r>This is just to connect it to ground or powe

r>I2C Serial Dat

r>Powe

r>This is just, this just need to be connected to groun

r>This is the interrupt pin, this is perfect, this is exactly what we nee

r>Ground, power, ground a

r>serial clock. Oka

r>This is super simple chip. It has everything what we nee

r>only what I would like to check is how this physical interru
r>work

r>So, let’s search for motion detection or something like tha

r>Motio

r>motion interrup

r>This chip h

r>"threshold interrupt triggered by internal digital wake-up engin

r>and "the wake-up event can be programmed to be reported on physical pin

r>This is exactly what we need, oka

r>So, this chip c

r>basically dete

r>movement and then it wi

r>change the status of th

r>INT p

r>and we can use it to wake up our [https://openclipart.org/search/?query=microcontroller microcontroller

r>Oka

r>We can use this chip in our schematic, everything what we have to

r>is go back to this SMT Parts Librar

r>copy manufacturer part numbe

r>go back into our schemati

r>Librar

r>Ctrl+

r>search for this acceleromete

r>Be sure there is this S

r>icon, left clic

r>Be sure it is in stock, we can buy it

r>1, in minimum quantity 1 piec

r>click on Plac

r>put it inside of our schematic, left cli

r>and press Escap

r>When we go back into our specificatio

r>next, what we would like to place into our schematic is push butt

r>and there is nothing really special about push butto

r>When y

r>go into SMT Parts Librar

r>you can go to All Categori

r>a

r>here Pushbuttons, Tactile Switche

r>you can find any button which you lik

r>but I use this on

r>so if you like, you can use same, search for this numbe

r>A

r>I use it because it is this kind of standard butto

r>Copy this manufacturer part numbe

r>go into our schemati

r>click on Librar

r>Ctrl+

r>search for this butto

r>left clic

r>It is available for JLCPCB SMT servi

r>and minimum quantity 1

r>I need to be honest, I don’t exactly kno

r>if it means that when we use their service,

r>have to buy at least minimum 10 of these switche

r>but I checked the other switches a

r>many of them, they have minimum quantity 10, so

r>really didn’t spend much time investigati

r>what exactly this means. It’s oka

r>Click on Plac

r>left click to place this button into our schemat

r>and press Escap

r>When we go back into our specificatio

r>only what left to place into our schematic is the microcontrolle

r>So, open t

r>SMT Parts Librar

r>go to All Categorie

r>Embedded Processors & Controlle

r>and from all these manufacturer

r>we would like to use something simpl

r>so maybe we would like to use something from ST Microelectroni

r>or something from MICROCHI

r>I’m going to click on MICROCHI

r>Again, we would like to use only the components which are in sto

r>and from this lis

r>many of these cores are little bit more comple

r>we don’t really need the

r>The simplest thing will be probably this 8-bit PIC microcontrolle

r>but this is not the right one, because you can se

r>there are not many and this one

r>too big, 80 pins, we don’t need 80 pins, we don’t need 44 pi

r>and this is too small, 8 pins i

r>it’s not enough for what we nee

r>I’m going to reset th

r>and I’m going to select this on

r>Okay? This looks bette

r>Appl

r>There are still number of microcontroller

r>what we can choose fro

r>So, it means we can have a look on some low power suppo

r>in our microcontrolle

r>because we are going to use battery powered devic

r>so ideally maybe it could work with some low voltage

r>1.8 to 3.

r>Appl

r>And only one lef

r>So, let’s have a look at this microcontrolle

r>I’m going to open datasheet, left clic

r>Scroll do

r>and we are going to check if there is everything what we nee

r>But first, we would like to check the siz

r>because we would like to design something really smal

r>The maximum width of P

r>should be like 1 centimeter, 400 mils or les

r>And the size of this microcontroller is 5.3 x 7.2 millimete

r>It is li

r>200 x 280 mils or something like thi

r>So, it’s going to fi

r>this is goo

r>A

r>we would like to check if there is internal oscillato

r>because we don’t want to add a

r>like extra components and there is internal oscillato

r>this is goo

r>1.8 to 3.6 volt operation for this PIC16LF par

r>PIC16LF that’s the part what we are going to us

r>Sleep mode 20 nanoam

r>for PIC16LF par

r>This is also, this is really really good, because for batte

r>powered device this is very importan

r>Up to 17 I/O pin

r>programmable weak pull-up resistors, this is also good, because th

r>we can sa

r>space on some of the component

r>We don’t need to add ext

r>external pull-up

r>Programmable interrupt-on-change pins, this is importa

r>because we would like

r>support interrupt for the push butt

r>and also interrupt coming from the acceleromete

r>And we would like to have at least 3 PWM outpu

r>for the LEDs to regulate the intensit

r>There are

r>in CCP module

r>and it looks like there are also some ECCP modules with PWM suppor

r>so this should be fin

r>And we need also I2C interface to communicate with the acceleromete

r>It looks like there is everything what we nee

r>so let’s

r>back to this parts librar

r>copy manufacturer part numbe

r>go into our schemati

r>click on Librar

r>search for this microcontrolle

r>left clic

r>15 is available for JLCPCB SMT servic

r>minimum order quantity

r>Click on Plac

r>left clic

r>Escap

r>When we go back into our specificatio

r>you can see that we placed all t

r>key components into our schemati

r>Now, what we are going to do in the next ste

r>we are going to add the component

r>which are needed to support this key componen

r>and the first one is power suppl

r>Go to SMT Parts Library websit

r>All Categorie

r>we are going to search for Power Management I

r>and probably the simplest regulator is LD

r>so I’m going to click here, Dropout Regulators (LDO

r>There are many different manufacture

r>and for this kind of component I have good experience wi

r>Texas Instruments, so I’m going to select i

r>In Sto

r>a

r>we would like to use a regulator with fixed outp

r>3.3 vol

r>Appl

r>This LM1117

r>very popular part and we have th

r>here so that’s what I’m going to us

r>It’s not maybe the best component for batte

r>powered device, b

r>it's good enough for what I nee

r>Click on Download and open datashee

r>We are going to find an example, how to connect th

r>chip, this regulato

r>I’m going to click here, System Exampl

r>and here it i

r>It is super simpl

r>just the regulator and t

r>10 microfarad capacitors, one on input and one on outpu

r>Go back to SMT Parts Librar

r>copy the manufacturer part numbe

r>go back into our schemati

r>Librar

r>Ctrl+

r>and search for the regulato

r>Left clic

r>Plac

r>left clic

r>Escap

r>We would like to place also the 10 microfarad tantalum capacitor

r>you kno

r>these capacitors from the reference schemati

r>So, in our schematic go to Librar

r>left click on Capacitor

r>left click on Tantalum Capacitor

r>once you see the list of the capacitors order

r>based on the capacitance, left click her

r>scroll down, find the 10 microfarad capacito

r>a

r>for this kind of parts f

r>passive components, very ofte

r>you can find basic part

r>So, here in this colu

r>we are going to search or look for Basic Par

r>Basic parts are usually cheaper to fit on your boar

r>Extended parts are little bit more expensiv

r>So, if they have basic part for 10 microfarad capacito

r>that’s maybe what we would like to us

r>Here it is, Basic Part, 10 microfara

r>Now, very importan

r>Hover cursor over the capacit

r>and double-check the voltag

r>You can see this capacitor is f

r>16 volts, that’s perfect, that�

r>okay for our applicatio

r>So, left clic

r>left click on Plac

r>zoom in, just use mouse whee

r>press spacebar to rotat

r>be sure the plus sign

r>on the top of the symb

r>and left clic

r>left clic

r>Escap

r>To connect these capacitor

r>we are going to use this wire featur

r>this button here in Wiring Tool

r>So, left clic

r>zoom i

r>left click, left click, left click, left clic

r>Lef

r>lef

r>left, lef

r>Escap

r>We would like to add also ground

r>so left click her

r>left click, left click, Escap

r>I will move it little bit down, ju

r>press left button, hold it down and move i

r>move i

r>And also we would like to add the power symbol

r>so left clic

r>lef

r>lef

r>Escap

r>Select this text "VCC

r>we are going to change it to "+VIN

r>because it can be, battery powe

r>it can have all the kind of different voltage

r>and left click he

r>and this is going to be the 3.3-volt outpu

r>so let’s put he

r>"+3V3", Ente

r>We still need to connect these two pin

r>So, let’s have a look into datashee

r>what they say about these pin number 1 a

r>pin number

r>I will go

r>and we are going to find the table with the pin

r>Thi

r>So, in our footprint SOT-22

r>pin number

r>is connected to groun

r>"Ground this pin for fixed output option

r>That’s exactly what we hav

r>And pin number

r>should be connected to the outpu

r>"Output voltage pin for the regulator

r>In our schemati

r>we would like to place ground symb

r>to this pin number

r>Escape, move it little bit do

r>and we would like to connect this pin number 4 with the outpu

r>Left clic

r>lef

r>lef

r>lef

r>Escap

r>To connect battery to our boar

r>we will need two through hole pins or through hole pad

r>where we will solder two wires coming from battery holde

r>And the simplest and quickest way how to add two through hole pi

r>into our board

r>to put there a simple two-pin head

r>which we will not fi

r>And that’s what we are going to do no

r>Go to Librar

r>click on Connector

r>find Pin Header & Female Heade

r>order these components based on footpri

r>a

r>notic

r>how they named the footprint

r>Maybe we could use this to find our specific componen

r>We don’t have to scroll down. We can simp

r>just write something like Header (HDR

r>Through hole (TH

r>2 pins (2P

r>pitch 2.54 (P2.5

r>and we need vertical (V) male (M

r>Search for th

r>and scroll down, fi

r>the headers which are highlighte

r>Thes

r>Left clic

r>and yeah, this could be the kind of header what we can use on our boar

r>So, just simply click on Place, left cli

r>and left click to place it into our schemati

r>Escap

r>Now, maybe we would like to flip this connecto

r>we would like to have pins on the right sid

r>so left click to selec

r>go to Forma

r>flip this symb

r>and we would like to have pin number 1 on the to

r>because that’s usually pl

r>and we would like to have pin number 2 on the botto

r>because that’s usually ground,

r>this is okay, let’s leave th

r>header like thi

r>For debugging and firmware development it can be super usefu

r>if we provide alternative power sourc

r>And the simplest way how to pow

r>this kind of simple board is use USB microconnect

r>and that’s what we are going to add nex

r>Go on SMT Parts Library websit

r>All Categorie

r>Connector

r>USB Connector

r>and let’s have a look what they have her

r>USB Type C, we don’t want USB Type

r>Micr

r>USB microconnector, this could be something what we could us

r>Copy the part number, left clic

r>go into our schemati

r>Librar

r>Ctrl+

r>search for the connecto

r>left clic

r>left clic

r>left click, Escap

r>We would like to rotate the connector, so left click to select i

r>press spacebar to rota

r>and maybe move it like thi

r>Normally, you don’t need

r>add like nothing super ext

r>around this USB microconnecto

r>but there may be some special case

r>when you would like to maybe conne

r>these D- and D+ pins through some resistor

r>If you would like to know more, you can search for something like th

r>"USB micro charging resistors

r>There are number of websites on this top

r>and usually you will find informati

r>something like thi

r>for different manufacturers and different curren

r>you may want to use different resistor values and differe

r>resistor connections between these D+ and

r>pins and the power and the groun

r>S

r>just in ca

r>you may need thi

r>what we can do, we can add some footprin

r>on our boa

r>and normally you will not fit these resistor

r>but if your special charger will requi

r>these resistors, then you may fit them late

r>Oka

r>So, that’s what we are going to do no

r>We are going to add some components around this U

r>microconnector, and we are going to connect i

r>Even we are not going to f

r>these resistors which are connected to D- and D

r>we still may want to choose resistors with values what ma

r>some sens

r>So, I will choose some of these examples which are her

r>and we will use this connecti

r>with 10k and 5.1k resistor

r>So, first we will need to find a 10k resisto

r>Go to Librar

r>be sure you have this JLCPCB Assembled selecte

r>so we only list t

r>components which can be used for the JLCPSB SMT Servic

r>and search for R04

r>10K resisto

r>Again, ideally, we would like to use a basic compone

r>so I’m going to click her

r>a

r>it looks like this first one is t

r>10k resistor what we nee

r>click on Pla

r>and just place it somewher

r>Press spacebar to rota

r>and place it like thi

r>Do exactly same for t

r>5.1k resisto

r>So, go to Librar

r>search for R04

r>5.

r>and let’s have a look if they have basic part, 5.1

r>Okay, this is exactly what we need. Left clic

r>Plac

r>and place it somewhere into schemati

r>Press spacebar to rotat

r>left click, Escap

r>We need the same resistor combination also for the second D pi

r>You know, R1 5.1, R2 10k, R3 5.1, R4 10

r>D+, D

r>So, I’m going

r>move this little bit u

r>press Ctrl hold it down, left click also here to select the

r>Ctrl+C, Ctrl+

r>left cli

r>and we can connect them togethe

r>So, left clic

r>connect these tw

r>Connect these tw

r>Escap

r>And place also ground pi

r>Escape, move it little bit dow

r>Close to this VBUS pi

r>we would like to place maybe 10 microfarad capacito

r>You kno

r>the 5 volt is coming through this VBUS pin a

r>this 10 microfarad capacitor c

r>help improve this 5 volt little bi

r>It’s not li

r>the best and super proper way how to connect USB connector, b

r>in our application it is just good enoug

r>We would like to keep it simpl

r>So, I’m going to copy this 10 microfarad, left click, Ctrl+

r>Ctrl+V and I’m going to place it maybe like her

r>Escap

r>We would like to connect the ground he

r>and we would like to connect everything togethe

r>Zoom i

r>move th

r>maybe like thi

r>connect D

r>connect D

r>connect the capacito

r>one resist

r>and also this resisto

r>Escap

r>I’m going to make some space, so I’m going to move this do

r>and all this little bit her

r>I’m going to place here the +5 USB power net symbo

r>so when we are routing the

r>tracks, then we will know it is powe

r>Just call it +5V_US

r>Ente

r>Connect i

r>and also maybe connect this shield to groun

r>so I’m going

r>draw something like thi

r>and al

r>I will connect thi

r>Escap

r>And place the ground symbols her

r>You can use this, or you can ju

r>Ctrl+C, Ctrl+V, you know, you can always select something existing a

r>do copy and past

r>We have almost connected this USB connecto

r>Only what left is this ground (GND) pi

r>that’s the simple one, but we also need to connect this ID pi

r>It can be sometimes little bit tricky, if you would like to know mor

r>you can search for something like th

r>"USB ID pi

r>and when I click for example on this lin

r>you can find the

r>information about all the kind of possibilitie

r>So, you can sometimes connect this p

r>to ground, you may leave it unconnecte

r>or you can even like put there resistors with different value

r>And the very safe way, how we can connect this p

r>is just use 0 Ohm resistor connected to grou

r>and in case you will need to experiment with this pi

r>th

r>just unfit the 0 Ohm resisto

r>leave it unfitted or you can put the

r>resistors with different value

r>Oka

r>So, in the next step, we are going to find 0 Ohm resistor a

r>we are going to connect it to this ID pi

r>I’m going to show you different wa

r>how you can maybe search for resistor

r>So, select existing on

r>copy the manufacturer part number, Ctrl+

r>go to Librar

r>and we are going to search Ctrl+

r>we are going to search based on this number, we will just change it little bi

r>So, this was 5.1

r>It mean

r>how we need to adjust this for 0 Ohm resisto

r>We need to replace this with 0 and also this one with

r>Searc

r>Okay, basic part, 0 Ohm resistor, left clic

r>left click to Plac

r>left click, Esca

r>and we can connect

r>like thi

r>And Ctrl+C, Ctrl+

r>Nex

r>we are going to connect these two power inputs togethe

r>However, we cannot just simply connect th

r>battery connector directly to th

r>5 volts coming from this USB connecto

r>Because

r>battery is connected and also the USB cable is connecte

r>USB power is connected, then they could fight togethe

r>For exampl

r>if the voltage on the battery is higher than 5 volt

r>then this this power from the batte

r>would like to go inside of th

r>power supply on the US

r>And also on the other side, if the voltage on the battery is low

r>than the 5 volt coming from the US

r>then this 5 vo

r>from the USB would try to go inside of the batter

r>And very simple way how we can prevent this fighti

r>is use diode

r>A

r>there’s actually o

r>special component which has two diodes in one footprin

r>I have used this component number of times in my previous proje

r>and that’s exactly what we are going to use also n

r>to prevent this fightin

r>S

r>let’s go inside of the Libraries, and let’s search for this special componen

r>Click on Libra

r>and search for thi

r>Left clic

r>click on Plac

r>press spacebar to rota

r>and left click to place it into our schemati

r>We are going to connect i

r>I’m going to make a little bit of spac

r>I’m going to move th

r>little bit dow

r>maybe like th

r>and also I’m going to move thi

r>I’m going to select everything around our power suppl

r>move it little bit dow

r>use the Wire button to conne

r>battery connector with the diod

r>connect USB 5 volts to dio

r>and connect it to our power suppl

r>Escap

r>I’m going to name this ne

r>so when we will be doing layout, we know this is important power n

r>I’m going to call

r>"+VBAT

r>Ente

r>I’m going to connect i

r>oka

r>And we can also connect ground symbol her

r>maybe like thi

r>Escap

r>Ctrl+C, Ctrl+

r>How th

r>special dio

r>is going to help u

r>Why we use it in this circui

r>How it is going to work, do you kno

r>A diode is a component whi

r>c

r>control how current is going to flo

r>So basically, when you have a diod

r>current can only fl

r>from this side of the diode to this other side of the diod

r>And current can’t fl

r>from this side of the diode to this side of the diod

r>It mea

r>that for examp

r>the current from this batter

r>it can vey nicely flow through this diode, which is her

r>but it can’t flow through this other diod

r>And same for the currents from this USB connecto

r>They can very nicely flow through this diod

r>but they can’t flow through this diod

r>So, by using this special component, we prevent

r>fighti

r>these two power supplies together or power sources togethe

r>When you will

r>deciding on what kind of diode to use in your applicatio

r>there are few paramete

r>what you would like to doublechec

r>so when we open datasheet of this dio

r>the important numbers or important parameters for

r>is the maximum forward curren

r>which has to be basically high

r>for as what we need for our boar

r>200 milliamps

r>high enough for what we nee

r>And also what you would like to be sure th

r>forward voltage is maybe as low as possibl

r>That’s the reason, why we use th

r>Schottky diode, because they usually ha

r>lower forward voltage, than standard diode

r>And this forward voltage

r>very important, becau

r>this is the voltage, which you will lose across the diod

r>S

r>even if we have 5 volts for example here on this USB connecto

r>you are going to use this forward voltage on this diod

r>so if it’s lik

r>I don’t kno

r>0.5 volt for 100 milliamps, then basicall

r>here on the input of our power supply, we will have not 5 volt b

r>4.5 vol

r>when we will be taking 100 milliam

r>through this diod

r>Oka

r>And there is al

r>another factor what you may want to conside

r>This voltage across the diode and the curre

r>going through this diode is going to change to powe

r>so when you multiply the voltage by the curren

r>then you will get pow

r>which is going to be changed to he

r>on this diod

r>And you would like t

r>of course you would like to be sure that th

r>heat is not too high, so your diode is not damage

r>Okay? S

r>two important number

r>forward volta

r>and the maximum forward curre

r>which you need to doublecheck if you use a dio

r>in your circui

r>We are going to make our schematic nicer, more professiona

r>I’m going to add some note

r>so place Tex

r>left click, Escap

r>select the tex

r>I’m going to change it

r>"USB (FOR POWER ONLY)

r>I’m going to change the col

r>and I’m going to make it little bit bigg

r>and maybe Itali

r>Like thi

r>And I’m going add also some text up he

r>about the battery connectors, so I’m going to copy this, Ctrl+

r>Ctrl

r>and we are going to change it maybe li

r>"BATTERY CONNECTO

r>is the text what we would like to have her

r>I’m going to squeeze this a little bi

r>so we have more space for rest of the schemati

r>By the way, it’s important how you draw this selectio

r>If you draw from the top-lef

r>then it will only select all the components which are inside of the squar

r>but if you draw this selection rectangle from bottom-righ

r>then it will select everything what is also on the ed

r>of the rectangl

r>So, this time I would like to select onlyeverything what

r>like her

r>so I’m going to move it little bit u

r>like thi

r>and same her

r>I’m going to move it may

r>little bit down like thi

r>What is also always very useful to have on your board is power LE

r>so go inside of Librar

r>we are going to fi

r>"0805 LE

r>maybe green colo

r>search for i

r>And be sure we are going to use a basic par

r>so this first one is okay, left clic

r>left click on Plac

r>press spacebar to rota

r>and put it inside of our schematic maybe somewhere like thi

r>Escap

r>When you place an LED into your schemati

r>then, together with LE

r>usually you also need to place a resisto

r>Because this resistor will lim

r>the maximum current which will flow through this LE

r>Okay? You cannot fl

r>very high current through LED because you will damage this LE

r>And little bit later I will show you, how you can calculate th

r>minimum value of the resist

r>which you may need to use with LE

r>but for this power L

r>when I calculated this minimum value of the resisto

r>the LED was like super bright, it w

r>disturbi

r>and it mea

r>what I had to do,

r>I had to actually try different valu

r>different resistor value

r>I just desolder

r>one resistor and placed different o

r>and I found out that when we use 10k resist

r>together with this LED, then the brightness of the LED is just righ

r>And that’s what we are going to use in the schemati

r>we are going to place 10k resist

r>to limit the current which will flow through this LE

r>It’s going to be super simpl

r>because we already have 10k resistor in our schemati

r>We can just select it, left clic

r>Ctrl+C, Ctrl

r>and left click to place i

r>Connect the resistor to the powe

r>connect resistor to the L

r>a

r>copy the ground symbol, Ctrl+C, Ctrl+

r>connect it to the L

r>and maybe move it little bit down like thi

r>Don’t forg

r>the currents through a dio

r>can only flow one directio

r>So, if your LED is rotated like thi

r>it’s not going to wor

r>Okay? It has to be rotated like thi

r>because current only can flow from this side of dio

r>to this other side of the diod

r>No

r>a tricky questio

r>Do you know why we connected this power L

r>to this +V_US

r>We could connect it to +VB

r>or even bette

r>We could connect it to this +VI

r>And then, power LED would be always

r>when our board would be powere

r>Howeve

r>when you are using batte

r>to power up your boar

r>maybe you really don’t want to was

r>the energy from the batter

r>to light up this power LE

r>And that’s the reason why it is connect

r>only to this +V_USB, becau

r>in this case, the power LED will on

r>turn on when your board is powered from US

r>but it’s going to stay of

r>it’s not going to consume any ener

r>when your board is powered from batter

r>So, we place it here to sa

r>the power from the batter

r>We have finished our power circui

r>we are going to make few small adjustments or tweak

r>I’m going to make it little bit nicer,

r>it looks symmetrica

r>We would like to maybe a

r>some notes that these resistors are not going to be fitte

r>I’m going to copy this, Ctrl+

r>Ctrl+

r>I will change the text to "NF" like not fitt

r>and I don’t want to make it

r>visible, maybe u

r>this kind

r>grey color, oka

r>Ctrl+C, Ctrl+

r>Ctrl+

r>Ctrl+

r>Oka

r>I’m going to add a titl

r>Ctrl+C, Ctrl+

r>Let’s call it "POWE

r>and make it little bit bigge

r>Use bol

r>no itali

r>Oka

r>A

r>maybe move it little bit dow

r>Perfec

r>Nex

r>we are going to connect this L

r>and to limit current

r>flowing through these LED

r>we need to put here some resistor

r>And as I promise

r>we are going to lea

r>how to calculate value of these resisto

r>which we would like to use together with an LE

r>Select our LE

r>we would like to see the datashe

r>so left click on View Datashee

r>open datashe

r>and the numbe

r>which are important for us a

r>forward curre

r>and forward voltag

r>When we have a closer look at like very simp

r>circuit, how an LED is connecte

r>it is going to look like thi

r>There is some powe

r>then we have a resistor and the LE

r>Now, the voltage across the LED, we know this voltag

r>This is t

r>forward voltage which we can see here, and it is different f

r>different LED colo

r>The voltage which is going to be across this resist

r>is basically the power voltage – the voltage on this L

br>And biggest voltage on this resis

br>will be here when…

Do you know w


When this voltage across LED is going to be the low


So, from these three numb


the most important for us is this low


2.1 volt num


That’s what we would l


that’s what we would like to use in our calculat


Then also this forward current 10 milli


is important for our calculat


So, remember these two numb


2.1 volt and 10 millia


Let’s go back to our simple cir


and I’m going to en


this next l


which is telling us what we already k


O


So, this is the voltage across the diode, 2.1 v


and this is showing the cur


0.01 amps or 10 milli


which we would like to have flo


through our circuit, through our resistor and through our di


As I already explai


to calculate the vol


across this resistor is very sim


Basica


it is the input voltage – the voltage on the d

>
And in our

>
the input vo

>
can be 5 x 1.5 volt, thes

>
five 1.5 volt batte

>
And – 2.1 volt which is across the

r>
it means the maximum v

r>
which we will have in our circuit across this re

r>
is going to be 5.4

r>
Once we know this voltage across this res

r>
and we also know the current which should flow through this res

r>
we can very simply calculate the value of this res

r>
We can use this equat

r>
Ohm�

r>
which says that the resistor

r>
equals the voltage divided by cu

r>
so in our case it would be 5.4 volt / 0.

r>
and our minimum resistor which we can use together with our

r>
is 540

r>
So, this

r>
super simple way, how you can approximately calc

r>
what is the minimum value of the res

r>
which you need to connect together with a

r>
Based on this calculated

r>
we would like to find our res

r>
So, what you can do, you can sear

r>
somethin

r>
"resistor va

r>
I’m going to click on this

r>
and in this table you c

r>
the basic st

r>
resistors what you can normall

r>
And in our case, we would like to use the c

r>
resistor with higher value than what we have calcu

r>
So, we calculated 54

r>
and the closest higher standard re

r>
is 560

r>
So, this is the resistor what we are going to add into our sche

r>
We are going to use same tec

r>
as we used when we were looking for 0 Ohm res

r>
I’m going to select an existing res

r>
I’m going to copy manufacturer part number, C

r>
go to Li

r>
clear

r>


r>
and we are going to adjust this n

r>
change it to 560 Ohms (

r>
s

r>
Okay, this is 560 Ohm res

r>
it is extended pa

r>
it’s

r>
We need this one for ou

r>
so select it, left

r>
and place it into our sche

r>
Left

r>
zo

r>
press spacebar to

r>
and place it maybe like

r><b

r>
and

r>
E

r>
When you would like to connect something in your sche

r>
you don’t have to always use this wiring

r>
you can simply just click o

r>
pin which is

r>
and you can just start drawing the

r>
It is little bit faster,

r><br

r>
One of the most common

r>
how to contro

r>
is to use a transistor, which is connected betwee

r>
LED and resistor and the g

r>
And the, probably the most common transistor what i

r>
for this purp

r>
2N7002 trans

r>
So, go into our Li

r>
and search for 2

r>
As you can see this is the basic part, so just left

r>
click on

r>
zo

r>
place it

r>
then we need also another on

r>
and the third on

r>
here. E

r>
Connec

r>
together with the res

r>
E

r>
And we need to connect these transistors also to ground, s

r>
ground symbol, Ctrl+C, C

r>
C

r>


r>
and conne

r>
I’m going to make it a little bit

r>
I’m going to move this litt

r>
away from each other, so there is little bit more

r>
I’m going to select

r>
press Ctrl, hold it down, select also the tran

r>
and just mo

r>
And same

r>
select

r>
press Ctrl, hold it down, select also the tran

r>
and move it like

r>
I’m going to draw short lines, which will be connected to

r>
gates of the transi

r>
and then we will name these

r>
or these connec

r>
To name them, we would like to see which of these LEDs i

r>
which is blue, and which is

r>
so sele

r>
Edit

r>
and show these nu

r>
So

r><b

r>
ye

r>
This is pin number 2,

r>
When we go into dat

r>
of th

r>
we can see pin number 2 i

r>

r>
this is the re

r>
and we would like to nam

r>
mayb

r>
"L

r>
Pin numbe

r>
blu

r>
so click on this Net

r>
left click here, E

r>
left click to sel

r>
and change

r>
"LED_B",

r>
And the last one, pin number 4 w

r>
the gree

r>
so again what you can do you can click here, or you can simply just copy

r>
Ctrl+C,

r>
and cha

r>
to

r>
Select the LED, Edit Symbol and hide

r>
names or numbers

r>
because they don’t look very nice in the s

r><

r><b

r>
my question to

r>
where to connect this pin of th

r>
Do you

r>
We could connect it to the battery v

r>
or this USB v

r>
or t

r>
or 3.3

r>
What would be the best way to connect

r>
We don’t want to connect it to the battery or the USB, because

r>
it would only work when the battery would be con

r>
or when the USB power would be conn

r>
So, we could connect it to +VIN o

r><

r>
there are two reasons why we don’t want to use 3.3

r>
The first

r>
that it can be quite low vo

r>
If you re

r>
the forward voltage for thes

r>

r>
2.1, 3.1 and 3.0

r>
so this means that this green LED, it ma

r>
at least 3.1 volt to be able to

r>
So, 3.3 volt as a power supply may not be the best

r>
and

r>
we really don’t want to drive high currents through thi

r>
because on this LDO, there will be some l

r><

r>
and the losses, it means we would just

r>
energy from the ba

r>
So, maybe the best way to connect o

r>
is use this

r>
And that’s where I’m going to conn

r>
or that’s where we are going to conne

r>
Left click on this +VIN s

r>
Ctrl+C, C

r>
place it here and conne

r>
Where we have a look on

r>
our finished LED conne

r>
you may notice it is little bit differen

r>
what we calculated

r>
Okay? This is like super simple conne

r>
Just power, resistor an

r>
In our

r>
the power goes through this

r>
there will be some loss like I don’t know 0.5

r>
Then it also goes through

r>
transistors, there may b

r>
voltage loss across these transi

r>
but our calculation is still good enou

r>
to use the values of the resistor what we have calcu

r>
The currents are not going to be h

r>
They will be actually, in this real ci

r>
they may be actually little bit

r>
because the final voltage across the diode plus re

r>
may be little bit

r>
than this 7.

r>
what we use for the calculation as the power input from these batt

r><br

r>
I just wanted to point out this

r>
even we use like super simple calculation, this calculat

r>
still like good

r>
for what we n

r>
good enough to calculate the resistor

r>
for thi

r><b

r>
you may be asking

r>
why we had to use these trans

r>
to control these

r>
Could we maybe connect these LEDs directly with our microcontr

r>
In some cases

r>
you can control LED directl

r>
the pins of the microcontr

r><

r>
you need to know, what you are

r><br

r>
And anyway, if, even if you know what you are

r>
as you ca

r>
even I have used i

r>
our schematic, this kind of connection, because t

r>
much more sta

r>
and this kind of connection is much

r><

r>
it is the easies

r>
how you can control all the kind of components or d

r>
which may require even higher cu

r>
than what you can drive with directly, with microcontroller di

r>
and

r>
when you use these transi

r>
then you can basically power up

r>
devices or components from all the kind of different p

r>
and you don’t really need to

r>
if this power is going to influence somehow your microcontroller o

r><br

r>
So, this kind of connection is much

r>
and I use it

r>
to control something or an

r>
through the pins of the microcontroll

r>
almost always, use these transi

r>
Even when I drive

r>
I’m going to open datasheet of this trans

r>
left click, View Data

r>
open data

r>
and we are going to have a look, how this transistor

r>
So, I’m going to copy this "MOSFET (N-Chan

r>
that’s what we are using, C

r>
and I’m going to

r><

r>
something like this and may

r>
"switch simula

r>
When I scroll little bit

r>
here left

r><b

r>
this is a very nice article, where y

r>
learn, how the transistor is going to

r>
but basi

r>
whe

r>
when the gate of our transistor is going to be connected

r>
then the transistor itsel

r>
behave as a open s

r>
So, basi

r>
when this is going to be 0 it

r>
this LED is not connected to g

r>
Ho

r>
if you connect the gate of the transistor to

r>
then this transistor is going

r>
like closed s

r>
so in our

r>
when we connect

r>
for example when the microcontroller set output to

r>
then this transistor wil

r>
and it will make conn

r>
between this resistor and the g

r>
so it means the current will flow through our LED and it will switch o

r>
Okay? If you would like to know more, then you can rea

r>
whole ar

r>
If you would like to choose your own transistor for your own

r>
there are couple of numbers which are impo

r>
So, when we g

r>
datasheet of the trans

r>
this is what you may n

r>
double

r>
So,

r>
you would like to know what is going to be the maximum c

r>
which can flow through your trans

r>
Okay? In this case,

r>
0.115 am

r>
115 mill

r>
It is enough for our applic

r>
The maximum voltage between D and S is 60

r>
we have like 7.5 volt, that’s

r>
Maximum Gate-Source voltage +- 20 volts, th

r>
the voltage what you can put on the

r>
But what is more important is this Gate-Thre

r>
This is basically the voltage what you need to

r>
on this gate to open the trans

r>
so it i

r>
2.5 volt, we will be using 3.3 volt, that, it’s

r>
And also Drain-Source On-Resis

r>
This is the resis

r>
which you will have between D and S when your transistor is

r>
And this resistance it depends on the voltage which you apply on the

r>
so for example if on the gate there is like 5

r>
then the resistance i

r>
transistor can be like as h

r>
7 Ohms, so this could be then like 7 Ohm res

r>
Okay? So, these are the n

r>
which you may want to doubl

r>
when you will be using your own transistor in your own boards.