7. Electronics design¶
Objectives :¶
Group assignment :
- Use the test equipment in your lab to observe the operation of a microcontroller circuit board
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)
Group assignment¶
Link to ULB Group : Link
Here is the list of measurement equipment in our fablab.
RIGOL DS1054 oscilloscope
For the group exercise, we will use this last tool.
Installation Logic of Saleae¶
First step, we go to https://www.saleae.com/ to download the software that goes with our logic analyzer
By going to the download section, the site automatically detects the operating system of your computer. (here GNU/Linux)
I download the software. Here it is an AppImage. I click on properties, then permissions and in execution, I check the option “Allow the file to be executed as a program”.
We start the program and it opens the following window:
To make measurements, we will connect our logic analyser to a VMA440 (The VMA440 is a USB-serial UART/TTL interface based on the FT232RL chip.)
Here is a picture of the connection (GND of the analyzer to GND of the VMA440, channel 1 of the analyzer to TXD of the VMA440)
We connect the two devices.we start Logic from Saleae. If it detects the analyser, it starts directly.
Installation Arduino¶
Go to arduino.cc for download Arduino IDE (https://www.arduino.cc/en/software )
Open arduino.We need to add the cards recognised for our training in the fabacademy.
In the preferences, we will add the url to add the planned maps (Thanks to Quentin Bolsée, my instructor for the link provided).
https://raw.githubusercontent.com/qbolsee/ArduinoCore-fab-sam/master/json/package_Fab_SAM_index.json
Once the link is added, we will add the cards. You have to go to Tools then Board and then Board Manager.
To be added: Fab SAM core for Arduino
Be patient, it takes a little time.
We are ready.
Plug in the device, then in Arduino IDE, go to tools, port and choose the USB port
Open the serial monitor.
You can write whatever you want? I will write Hello FabAcademy ;) . You don’t click on send immediately.
We start Logic from Saleae. Set the number of data readings to 8Mbs
Beware, this is going to happen very quickly. We will click on play in Saleae and on send in the serial monitor. Then pause quickly in Saleae.
We will zoom in and find the analysis trace
We are in hexadecimal, we will change this to ascii to see understandable data. Right click on one of the data.
One can read the data that one has previously sent.
Individual assignment¶
For the individual work, my instructor started me directly on a project that could be integrated into my final project. So I started with one of the basic files in which I added buttons and a led. All this to end up on a mini gamepad. But before we start we will install Kicad.
Installation KiCAD¶
First step, you have to install kicad (https://www.kicad.org/ )
To work properly, the Fab Electronic Component Library for KiCad must be installed (https://gitlab.fabcloud.org/pub/libraries/electronics/kicad )
Installation of libraries (copy of the original)¶
- Clone or download this repository. You may rename the directory to fab.
- Store it in a safe place such as ~/kicad/libraries or C:/kicad/libraries.
- Run KiCad or open a KiCad .pro file.
- Go to “Preferences / Manage Symbol Libraries” and add fab.kicad_sym as symbol library.
- Go to “Preferences / Manage Footprint Libraries” and add fab.pretty as footprint library.
- Go to “Preferences / Configure Paths” and add variable named FAB that points to the installation directory of the fab library, such as ~/kicad/libraries/fab or C:/kicad/libraries/fab. This will enable the custom 3D shapes to be found. The 3D shapes project has just started and most of them have to be populated still.
Start Kicad¶
Start Kicad and click on schematic editor
You arrive at the shematic editor page.
To add a component, you click on the following icon
Thanks to the installation of the FAB library, you can directly access the components you need.
You just have to connect your different components and then click on the icon to switch to the PCB editor
Click on update PCB to update the components on the PCB editor (the keyboard shortcut is F8)
We will be able to think about the layout of the components and the connecting wires directly. You can add the wires via the wire icon. Do not confuse this with the plots for the cuts
When you are happy with your layout, you can export to SVG. Choose your different layers (here, F-CU and cut). Don’t forget to choose where you want to save the different files
You just have to open them in inkscape and save them as PNG. Don’t forget to leave a correct margin for the export
After going through MODS, you can move on to the PCB milling machine
It remains to solder the components and to test the whole thing
Code in Arduino for Blinking LED #define PIN_LED 15
void setup() {
// put your setup code here, to run once:
pinMode(PIN_LED, OUTPUT);
digitalWrite(PIN_LED, LOW);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(PIN_LED, HIGH);
delay(500);
digitalWrite(PIN_LED, LOW);
delay(500);
}
Result :
Files :