7. Electronics design¶
|This weeks design|
|Scematic view kicad||sch|
|Kicad export pcb||svg|
|Kicad export outline||svg|
|Kicad export pcb||svg|
Group assignment: digital voltmeter, oscilloscope, regulated power supply¶
When you start building and programming electronics there are some tools to help you test the electronics. There are three main devices we use to check electronic components and circuits. We got a small instructions of what they do and how you should use them with electronics. Will try to explain What the difference are between the machines and when you use a specific machine.
A multimeter is the most essential tool for electronics. You use this device often to check for shorts or continuity of the line. You can test The amount of voltage. Or the current that flows though a circuit. Its a good device to check when encountering a problem in your electronics. This way you able to check all components till you can see the problem. Most multimeter can check ac and dc electricity. Alternating current is indicated with a wave symbol and direct current with a stripe withe dots underneath.
Overview of different functions multimeter
At the bottom you have three ports to connect the wires to. The com port is used for the GND or negative node in a circuit. The mAHz port you use to measure voltage and resistance. It also enable you to measure small amount of current. Milliampere. When measuring larger amount of current you use the 10A port, which is the maximum my multimeter can measure.
Multimeter at fablab Amsterdam
When you want to measure the voltage between to point in the circuit on Dc you slide the switch to the amount of voltage you expect with the DC symbol. When measuring a voltage drop by a resistor you place the possitive probe (wire) to the possitive side and Com to the negative.
A other option is to measure the amount of ohm (resistance) of a resistor. Often you start in a low settings to see the amount of ohm in a resistor. When ohm is to low the multimeter indicates 1, Move up the ohm till you see the amount of ohm a resistor have.
Testing the continuity can come in handy with circuits. You can check which direction the current flows in a diode. On side show the the connection and the voltage drop. When changing the probe you see the number 1 which indicate there is no flow of electricity through the diode.
You can measure the current flow through a circuit with the multimeter. Often you break the circuit and connect the multimeter. Parallel results in shorts. Make sure that you set the probe right for the amount of current you expect. It show you the average amount of current. It does not reflect capacitors, inductors high spike. To measure this you have to you a oscilloscope.
The oscilloscope let you see electrical signals over time. This machine is used for analyzing and debugging circuits. It can measure amplitude (Maximum extend of vibration), frequency and transient signals( Short lived burst of energy). The Oscilloscope show the electrons move in the shape of waves. Most oscilloscope come with 2 or 4 channels to measure waves. The one at Fablab Amsterdam have two channels which enable it to measure two wave signals at the same time.
The machine come with probes to connect the device/circuit on. Probes come with a ground clip. The ground clip you connect to the ground and the other to the power input. Passive voltage probes measure the voltage difference between the ground clip and the tip of the probe.
overview of a oscilloscope
The machine enables you to find the electrical signal waves and visualize it on the screen. There are lots of function to make the signals look static, to move the signal to the middle of the screen, capture the image, etc.
The Machine is in general divided in four sections:
Vertical section: This section control the Amplitude of the displayed signal.
Horizontal section: This section controls the time base of the sweep (Wave).
Trigger section: Here you decide the start of the sweep. The trigger can be set to restart after each sweep or at a given event.
The display: Here you can set the reference lines on the horizontal and vertical axis. Further you can set the focus, intensity and the beam finder.
quick demonstration of the machine
Regulated power supply (powerbench)¶
This machine provides a steady voltage to a device or circuit. It converts Alternating current (AC) to a direct current (DC) On the device you can sett the voltage you want to apply and the max amount of current running through the circuit/device. It has a simple display where you can set the rules. In the display it shows how much ampere is running through the device and further it is showing the usage of the device indicated in watt.
This device enable you to see the current running through, the minimal amount of ampere (current) and Voltage on which the device still functions. This is useful in testing a circuit and also checking power consumption of a device.
Most Regulated power supply devices convert AC to DC. Which basically means the power supply of the device itself comes from AC power and convert it in to a steady DC power. Which is commonly used in electronic devices.
To be able to design circuits i need to have a basic understanding of electronics. In this chapter i want to explain the very basics of electronics. I have no prior knowledge on this matter so i think it is useful writing some essentials down before starting to make a circuit. During my coarse i try to update this chapter regular.
Watt: multiply amp and voltage to see the watt Amp: the amount of electron flow to a certain point in one second volt: Voltage is the pressure in which electorn get pushed through a circuit
Ohms law: The relation between voltage, current and resitance Current (I)= Voltage (V)/Resistance (R) –> Measured in amperes (A)
Find voltage (v) V(volts) = I (amp)X R (Ohm) Find current (I) I(amp) =V(volts)/R(ohm) Find Resitance(R) R(ohm)=V(volts)/I(amps)
In a electrical circuit the power (volts) goes from VCC to GND. VCC stands for Voltage common collector. This will be responsible to the supply of power to the components. GND is ground, and is connected to the negative pole of the circuit. Vcc is the higher voltage in respect to gnd (ground)
AC power = alternating current DC power = Direct current
Making a circuit using Kicad¶
Kicad is a program designed to make your own customized circuits where you can place electronic components on. When you start to design in kicad you first open a new project and give it a name. To produce a design for a pcb circuit you go through different phases. The first phase is the schematics of the design.
Often you start designing in the schematic layout editor. Here you can select all the electric components you need to be able to make a circuit. We make use of the fab lab inventory to select the components. These are the components i used to design the board.
6-pin isp header Microcontroller ATtiny44A FTDI header 20MHz resonator 2x Resistor (10k) Resistor (value unknown till I calculate for the LED) Button (6mm switch) LED (red) Resonator (220-MHz) Phototransistor Capacitor (1uF) Ground VCC
The program works with different libraries where you can select the exact symbol of the component you need. Fablabs have a own library where all the components can be found which should be available in all the different labs around the world. Library When something is made in one fablab it should be reproducible in the other labs. On the right side of the screen you have a buttom to place a new component. When this selected and you press on the work field a symbol finder menu opens where you can search for the right symbol for that component. The quick key to open this menu is A. This is a more efficient way of working through interface. There are many quick keys available to create a easier workflow.
Placing a component
First is to select all the components you need to create the circuit you want. Then placing the vcc input and gnd symbols in the work field. This way the program recognize which wires belong to Vcc and Gnd. Then start wiring the cables by giving them labels. On the right side menu you have the wire function. To keep a clear overview it is a good practice not to connect the cables to the different component but by giving them names. The software will connect the parts where the wires been given the same name. This results in a more clean view. In a later stage you can create the actual path to connect the components. Every possible connection need to be wired. You draw a small line and double click you can end the line. Then edit the label by again right click and give the wire the same name as the line you want to connect it to.
When all components are connected by wires and labeled it is time to give the components a name corresponding to the value of the actual component. Which makes it in a later stage more clear what specific components need to be used for the board. Most of the parts are already clarified but for example with resistor it is wise to value them already. Just as the labeling the wires you label the components by right click and edit label. 11
Everything in place
Better overview of the scematics and wiring
Next step is to safe your file and go to the icon annotate schema op the top taskbar. A pop up appears and press annotate. This result in the numbering of the different component. Resistor 1, resistor 2, etc Now there is a hierarchal order in the design.
When this is done you assign a pcb footprint to the design. This icon can also be found in the top taskbar. This tool allows you to assign a footprint to your components.
The tab on the right of pcb footprint is a electronic rule checker. This enables you to track errors in your design.
This tab shows errors in my design
At first i though these errors were pins i am not using. The check place a arrow at all the points that need to change. Here i noticed i misspelled a few wire connections in which the software can’t connect the wires.
Two errors remain
These errors might happen because there is no power supply connected to the circuit. With trouble seeking i found information of the use of a powerflag to incated GND and Vcc. https://kicad.txplore.com/index-p=156.html When doing this i received error 4. Our instructor assured that this was no issue and error is created by having no power input. It was not neccesary to use a powerflag in this case. It is a good procedure taking the warnings serieus. Some warning show conflicts in your schematic design.
Assigning footprint is the next step in the process. I had to look up what footprint means in this context. I found the explanation on this forum very helpful in understanding this topic. https://forum.kicad.info/t/what-is-the-difference-between-footprints-and-symbols/8900 “Symbols abstract the function of a component and communicates the interface of it to both KiCad and the person reading the schematic.” “Footprints define the physical interface between the pcb and the component (The land pattern) and also include documentation information (outline, polarization mark, reference, …)”
icons of the different functions
The footprint icon can also be found on the top taskbar in the eeschema workflow. All the components you select before to include in the circuit show up in the menu and you have to connect them to a footprint. I have the fab library installed libraryand the components i chose you see on the right side. By double clicking on the description on the right of the menu you assign them to the symbols in the middle. This you have to do for all the chosen components.
assigning the footprints
After assigning the foot print you have to generate a netlist. Icon to be found in the same taskbar. After generating the list you open the pcbnew workflow by pressing the icon located at same taskbar. A New empty workfields opens. You first load the netlist. You do so by opening the icon. A popup menu appears and select current netlist. Now a messy footpint of the components appear in the workfield.
*choatic view of all the components *
I moved the components away from each other to see the connecting lines better. Now i can move them around and try finding a way to connect the components without constraints.
Drag the parts away to see the constraints
Now its time to set up the design rules for the specific machine we will be using for the cutout. In our case this is The roland mx20. You can set the rules by going to setup and select design rules. A pop up appears where you can set the net classes editor which correspond to the milling machine and global design rules. In the net classes editor i changed the settings to fit our machine. The correct information i found on the fabacademy archive of our instructor Henk Buursen. http://archive.fabacademy.org/2018/labs/fablabamsterdam/students/henk-buursen/week07.html
set up designrules for the available milling machine
To create the right thickness of the traces its important to set them so your milling machine is able to cut out the traces in the desired thicknes
In the pcb new Mode you can wire all the components to each other. In the Eescheme you add labels to the wires. The pcbmode recognize those connections and is indicated with white lines. The idea is to place all the components in such a way that you can connect all the wires to each other. In the end there should not be white line visible anymore. It is a day consuming puzzle. I redid the whole placement several times before i was able to connect all the wires. What did not help that i was not sure if the Vcc could be connected to each other or that it needed to have a specific path. Looking into the archive of fablab was very useful to check the boards of previous`students how they connect the Vcc connection.
Dragging components to make a design
When the design was set i made a outline in yellow lines (edge cuts) so that i can export two files. The board and the outline. It is important to create the outline in the design to make sure both parts work with the same dimension. This is of importance when milling the board. So the origin of the design is similar in both layers.
final design with all the lines connected
I exported the file as a svg file with only the front copper layer and the edge cuts layer selected. Color i set on black and white, board area only and selected print board edges. In file options i selected onb file per layer. Now in the chosen directory 2 files popped up. One for pcb design and the other for the outline.
Next step was to import the svg files in Gimp and change the bpi to 1000 pixels per inch. This is necessary for the software of the roland mdx 20 to read the file. Further removing the background alpha channel. When That is set you can export the files as png to be cut.
remove alpha channel
When all was set i opened Mods.cba.mit.edu to set the rules for the machine. I started of with the pcb design which i wanted to cut out using a .4 mm mill. I selected in pcb default mill traces. I inverted the image. The rest of the settings i left in default. In week 5 i explain more about the mods software. When all was set i connected the software to the machine by opening the terminal in the last module. When pressed calculate i was able to send the file to the machine.
Before sending the file i made sure that the origin was set correctly and that the .4 mm drill touched the surface. After pressing sending file the machine started drilling. Unfortunately halve way in the process the drill broke and had to cancel the job. I had to replace the copper sheet for a new one since i had not enough space to continue my design. The second time the process went smoothly and the board got printed out in 45 minutes.
Settings cut board
Next step was to cut out the surrounding by importing the edge cut file. What should have been a 5 minute job turned out to take much more time then hoped for. Somehow the software did not recognized the circle as a valid path. Trying to solve the issue by making the line bigger to the correct dimension of the drill. Did not work. Importing new circle. Did not work. Resizing the canvas worked to see the whole circle intact in the calculation. The issue by enlarging the canvas was that the origin was not set at the same point as the pcb. In my design i did leave space around the pcb design so i was willing to take my changes. Another strange thing which i had was that the outline was cut on both sides. Need to do a bit more research in how to cut out the outline with one trace.
Machine at work
Happy with the board.
Soldering the board¶
When the board was set it was time to solder the components on the board. To do this it was essential to have my kicad program on. I constantly switched between the pcbnew mode and the eeschema mode. The circuit is quite confusing and you need to look where component belong and also which side is connected to Vcc and GND. With some of the component placement is of less importance like resistors. But most parts need to placed to with the correct side to gnd. Most trouble i had was finding how to place the phototransitor. I looked only with general search questions how in general these part need to be found. Later on i search on datasheet for this specific component and this explained well how to place this component. More and more i realize the power of good specific search. Slowly improving. started with the inside placing the aTiny44 and then worked around with placing small components. Last i placed the 6 pin header and the ftdi Header. The pushbutton has not been placed yet. Our instructor wanted to double check the buttons since there was a issue before. This i will do as soon as we get permission. I hope i will grow in soldering. I like doing it but having some difficulties in keeping the components in place. And perhaps get some reading glasses....
Testing the board¶
I used a multimeter to check for shorts. it beeps to indicated a connection. I was relieved to see the connections seemed fine after the soldering. My soldering technique is not great and i had some spoil on the board. Luckily not on essential spaces.
settings to check for fuses
After this was set i had to connect my board to the micro controller to see if the device would recognize the board. This you do by connect the two board on the 6 pin headers. Before connecting the board to the computer check if the gnd on both sides is connected by the same wire.
When placing the device in the computer and opening the terminal i could perform a command to see if the device recognized the board.
avrdude -c usbtiny -p t44
My computer seem to recognize my controller but failed to see my board. When my instructor checked on his computer it worked on and of. He pointed me on the 6 pin header on my board. The soldering on this part did not connect the header steady to the board and that seemed to be the mistake. After a quick soldering where the solder flowed more on the component my computer recognized the board.
With the arduino software
The only component missing on the board was the button. The first student soldering the button i recieved some error. We looked on the datasheet of the particular button to see in which direction it should be placed. At the time i did not take a picture of my complete board. Since then i broke my ftdi connector and replaced it by other smaller pins. Here is a picture how the board looks after 3 months..
The board including the button
What i learned and what went wrong.¶
I really enjoyed this weeks assignment. Most parts of it at least. Feels like a adventure creating something and not being sure what it does. Electronics is a new thing for me and i am keen on learning more. Having said this it is quite a challenge to learn a new program to create a board with components which function still has to be fully understood. But i do like the program and it gave me a better notion of schematic view. I like as well to continue learning in soldering. its a fun and useful exercise.
For improvement i would say learn to Google. All the information is there as long you find the correct keywords to search. I have a practical way of learning so i think knowledge of electronics comes with time and mostly practice. Looking forward!