Skip to content
Snippets Groups Projects
Commit d5723b17 authored by Teo Serra's avatar Teo Serra
Browse files

Add doc to week 6 & 8 & 9

parent e40c4dcb
Branches
No related tags found
No related merge requests found
Pipeline #448403 passed
......@@ -528,4 +528,9 @@ UART communication is working properly.
### Python
*Add a doc and a test? Needed?*
These tests were carried out later, during [week 9](https://fabacademy.org/2024/labs/ulb/students/teo-serra/weeklyassignments/week9/),
using [MicroPython](https://micropython.org/) and
[Visual Studio Code](https://code.visualstudio.com/) with a Raspberry Pi Pico.
Using [Thonny](https://thonny.org/) has also been tried, and documented
during [week 8](https://fabacademy.org/2024/labs/ulb/students/teo-serra/weeklyassignments/week8/).
......@@ -378,10 +378,82 @@ class="mx-auto d-block" >
</div>
</div>
I can now weld the various components together, and the result is shown below!
I can now weld the various components together. The result is shown below!
add picture
<div class="row">
<div class="col-md-6 align-self-center" markdown="1" >
<img src = "./img/week8/Soldering_1.jpg" alt = "PCB_Soldering_1"
class="mx-auto d-block">
</div>
<div class="col-md-6 align-self-center" markdown="1" >
<img src = "./img/week8/Soldering_2.jpg" alt = "PCB_Soldering_2"
class="mx-auto d-block" >
</div>
</div>
I had a problem with the 3 input terminal, I made a mistake on the order.
So I had to solder the wires directly to the board to be able to do the tests.
## Testing my PCB
Test with low voltage first.
\ No newline at end of file
Now that everything is welded to my board, I'll be able to test it. I start by
adding the RP2040 that will be used.
<img src = "./img/week8/Soldering_3.jpg" alt = "PCB_Soldering_3"
class="mx-auto d-block" width = 50% >
To test the board, I decided to work with MicroPython and Thonny. The code
imported on the microcontroller will therefore be in Python.
### Programming the Inverter
Testing the board means programming the RP2040 to convert its DC input
voltage into AC output voltage. In practical terms, this means sending PWM
signals to the gate driver so that it activates the MOSFETs correctly.
Before developing the code, I need to prepare the ground for using python with
the Seeed RP2040.
#### Flashing MicroPython onto the RP2040
I followed the tutorial on the official
[Seeed Studio website](https://wiki.seeedstudio.com/XIAO-RP2040-with-MicroPython/).
Here's what I did:
1. **Install Thonny Editor:**
I visited the official [Thonny](https://thonny.org/) and downloaded, and install,
the latest software version.
2. **Setting Up Thonny:**
Then in the application, I went to "Tools -> Options" and chose the
"MicroPython(Raspberry Pi Pico)" interpreter, as well as selecting the port
with "Try to detect port automatically".
3. **Flashing the Firmware:**
Next, hold down the BOOT button to connect the microcontroller in boot mode.
The firmware will be sent automatically by Thonny by pressing "Install or Update
MicroPython" in the bottom right-hand corner of the window opened in the
previous step.
The Seeed RP2040 is ready to receive python code.
#### Coding the Python Programm
Now it's time to code the program that will control the MOSFETs using PWMs.
The code is fairly simple and uses only the machine library.
*Add code*
#### Testing & Measuring Signals
For the tests, I decided to take a step-by-step approach, first testing the
microcontroller outputs alone, and then testing the microcontroller on the board
and measuring the signals at various points.
##### Microcontroller Alone
*Add results*
##### MiconController on Board
*Add results*
......@@ -7,7 +7,20 @@ toc = true
### Summary
Add summary
This week I tested adding an OLED screen to my board. To do this, I used I2C
communication to send data to the screen. I tested first with a raspberry Pi
Pico and then on my board, programming in python.
<div class="row">
<div class="col-md-6 align-self-center" markdown="1" >
<img src = "./img/week9/OLED_Display.jpg" alt = "OledDisplay"
class="mx-auto d-block" >
</div>
<div class="col-md-6 align-self-center" markdown="1" >
<img src = "./img/week9/Testing_OLED_MyPCB.jpg" alt = "TestOLEDCustomPCB"
class="mx-auto d-block">
</div>
</div>
***
......@@ -141,6 +154,8 @@ extension automatically detected my connected Pico.
With MicroPython flashed onto my Pico and the Micro Pico extension set up
in Visual Studio Code, I was ready to dive into coding.
#### Coding the Python Programm
This code sets up an OLED display and dynamically updates it with various
pieces of information. Here's a breakdown of the code:
......@@ -194,6 +209,36 @@ while True:
time.sleep(1)
```
### Measure Power consumption of my OLED
#### Result
The result of programming and using the OLED panel that will be used for my
final project is shown below. Information is clearly displayed on the OLED
screen, and the time is progressing.
<center>
<video width=50% controls muted loop>
<source src="./vid/week9/OLED_Display_Vid.mp4" type=video/mp4>
</video>
</center>
### Testing with My PCB
I then decided to test the OLED panel with my custom board made last week.
This is the board that will be used for my final project (or at least a first version).
Since I've decided to program in python, I'll use Thonny to program the Seeed RP2040.
The extension used previously with VSCode doesn't allow me to use the Seeed
vesion ofthe RP2040.
The code is exactly the same. The difference is that I have to register the ssd1306
library on the Seeed RP2040 by registering it via Thonny on the microcontroller
so that it can access it. The VSCode extension did this automatically on the
Raspberry Pi Pico.
The setup is shown below and works in the same way as with the Raspberry Pi Pico.
<img src = "./img/week9/Testing_OLED_MyPCB.jpg" alt = "TestOLEDCustomPCB"
class="mx-auto d-block" width = 60% >
### Measure Power Consumption of my OLED
This part was done in group and is accessible on the [group page](https://fabacademy.org/2024/labs/ulb/group-assignments/week9/).
static/img/week8/Soldering_1.jpg

234 KiB

static/img/week8/Soldering_2.jpg

171 KiB

static/img/week8/Soldering_3.jpg

187 KiB

static/img/week9/Testing_OLED_MyPCB.jpg

201 KiB

File added
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment