7. Electronics design¶
Week 06 / Feb 23¶
This week’s assignment:¶
Group assignment:¶
- use the test equipment in your lab to observe the operation of a microcontroller circuit board
Observing a square (non-sinusoidal) signal as the led turns on and off:¶
Individual assignment:¶
- redraw an echo hello-world board,
- add (at least) a button and LED (with current-limiting resistor)
- check the design rules, make it, and test that it can communicate
- extra credit: simulate its operation
Research¶
At Fab LAB CIDi we choose to develop our boards based on the ATtiny 45 model.
In terms of software for designing the board, I worked on Eagle. I used basically two libraries for the components:
- spark fun for eagle and,
- Fab Library from 2018 Fab Academy alumnus 2018.
Developing the project in Eagle.¶
I developed the schematics first, locating the components, and establishing the relationships between them, following the template of the ATtiny 45 and the concepts presented by Neil in class (specially the fact that the led can actually explode if it is not properly connected to ground and to a resistance!)
Once the schematics were done, I developed the board. The challenge was to include the button and the led without crossing paths on the board. I am aware that there are many possible solutions for paths that cross, while still maintaining the board fully functional. However, since this was my first experience, I wanted to keep the design as simple and straightforward as possible.
Eagle is a great total and I could experiment myself with the power of an hierarchical and parametric tool. I basically draw the paths by hand using the commands Route Airwire in mode Select wire bend. You can see the result bellow:
Design Rule Check process in Eagle (DRC).¶
Within Eagle there are two built in automatic audit systems to check the consistency of our projects. In the Schematic we can use the Electrical Rule Check (ERC). In the Board it is possible to perform a Design Rule Check (DRC).
The purpose of both processes is to highlight errors and issue warnings about either errors or instances of incomplete information.
I watched this video to obtain more info about the DRC, and which are the parameters used while checking. I also watched this tutorial which is relevant because it provides templates for .dru files
Applying the DRC process I could find 6 errors, all of them related to incomplete connections of wires and components. After isolating the errors with the DRC it was simple to fix all issues.
DRC Menu at Eagle
Parameters used for checking: clearance, distance, sizes, etc
Errors detected
Isolating the error
Wire fixed
Isolating the error (2)
Wire fixed (2)
Final result of the DRC Process: error free project
Calculating the resistor for the LED¶
I developed the following procedure to calculate the resistor for the LED.
I looked at the datasheet of the LED. This is a white LED produced by Lite ON optoelectronics. I found the current intensity corresponding to this LED: 20 mA
The formula to calculate the resistor, according to Ohm’s Law is R = V / I. We apply the formula for the value of 5 volts of tension and 20 mA of intensity.
R = 5 volts / 0.02 A = 250 ohms
The suggestion is to use a higher resistance to increase safety. Thus, a 499 ohms resistor is applied.
Fabrication¶
After I finished the design in eagle, I exported the gerber file to Flatcam in order to produce the cn files. I milled the board at the Roland MDX 540 CNC. I learned to produce the cutout shape for the board, something I have not previously done and that was quite interesting considering the irregular shape of my board.
As previously, I defined two settings for the milling process:
-
The toolpath for the traces is a 1/64 in tool. (0.396875 mm).
- passes 4
- overlap 50%
-
The toolpath for the cutout is a 1/32 in tool. (0.79375 mm).
In general terms, I am very happy with the aesthetics of the traces in the board, and also with its cutout geometry. I must admit however that an irregular cutout geometry is impractical at the moment of securing the board for soldering the components. In general terms, I think that in the future I’ll stick to regular cutout geometries.
I programmed the board using the programmer I previously built (Electronics production week). As software interface for programming I used Arduino.
I tested and loaded three programs:
- first a program to turn the led on and off. - for this I used a template available on Arduino IDE.
- second, a program to use the button. I looked for this one on google and found it here
- a program for the echo_hello world. - I used the example available at fabacademy website.
All three test were - surprisingly - sucessfull in the first run. Many thanks to Abdon on the assistance programing, specially in the process of finding and applying the Arduino pinout.
Design and fabrication Files here:
Link to the lab’s webpage:¶
Please see the tests for electronic design that we developed as a group here:
CIDi’s Electronic Design Testing