Skip to content

Commit 126036d

Browse files
authored
New project's documentation (#500)
Added the new project's documentation.
1 parent d2f0e89 commit 126036d

12 files changed

Lines changed: 93 additions & 46 deletions

File tree

Lines changed: 93 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,97 +1,144 @@
1-
# Game Console
2-
A compact game console for user-friendly games like Snake or the Chrome dinosaur game, designed for offline entertainment.
1+
# Cooling Station
2+
Adjustable fan that is powered by a smart thermostat
3+
34
:::info
45

5-
**Author**: POSTELNECU Ioana \
6+
**Author**: Postelnecu Ioana \
67
**GitHub Project Link**: https://github.com/UPB-FILS-MA/project-IoanaP0711
78

89
:::
910

1011
## Description
1112

12-
My idea is to have the ability to play user-friendly games-such as Snake or the one with the dinosaur on Chrome, when you don't have a connection- on a tiny and simple game console. It consists in a breadboard, where's attached the Raspberry Pi, a LCD screen, a LED to show if the console is powered on or off and the buttons. There's one for the velocity and four for left/right/up/down, similarly to a regular gaming console or just one for going up(based on what game I'm going to write I'll either put one button or four).
13+
Cooling station is a practical way to cool-off on a hot summer day. Made to stand on your desk with a big fan to cool off any programmer. With an easy and fast Rust powered software can be easily reprogrammed in order to cool-off your room, no matter how hot it is. It is powered with two bright LEDs and a Buzzer that will let you know when the temperature gets to the set threshold. No more need of desk fans or thermometers when you can use the Cooling Station to automatically keep you cool.
1314

1415
## Motivation
1516

16-
I've decided to choose this project, because ever since I was a kid, I've used to play video games and I've told myself that I'll learn how to make one from scratch. On top of that, for many years my desire for playing has been decreasing, because even though I like the games, I'm getting bored of them, so I want to create one at some point, that keeps me playing it. To sum up, I want to make this as my project, because I want to understand the basics of game development, in order to actually start designing and developing my own game.
17+
This idea came to be on a hot summer day, when I was sitting at my desk working on my laptop, thinking... what if there was a fun way to build a fan that can cool you off whenever the temperature gets too high. Knowing that my laptop generates a lot of heat, and that my desk is right in the way of the radiating hot sun, I knew this was the right idea of a project.
1718

1819
## Architecture
1920

20-
![Architechture Diagram](photos/Arhitechture.JPG)
21+
1. **Raspberry Pi Pico W**: Microcontroller board used for processing and sending the data to all devices
22+
2. **LCD screen 1602 module**: Used for displaying the live temperature and usage instructions
23+
3. **LED**: Shows when the temperature is lower than the threshold or over it (blinks when approaching limit temperature)
24+
4. **Buttons**: Used for controlling fan speed once the temperature is above certain threshold
25+
5. **Buzzer**: Beeps louder and louder when temperature is rising until the threshold
26+
6. **Breadboard**: Needed for building and testing the circuit
27+
7. **Jumper wires**: Needed for connecting the components
28+
29+
 
2130

22-
This project's architecture revolves around the Raspberry Pi Pico W as the microcontroller, executing the game code. The LCD screen 1602 module serves as the display interface for the game graphics. An LED is integrated to signify the console's power status. User input is facilitated through buttons, with one controlling velocity and the other managing movement. To construct and test the circuit, a breadboard and jumper wires are employed, allowing seamless connectivity between components. Here are some photos of the actual hardware:
23-
![Hardware](photos/hardware1.jpeg)
24-
![Hardware1](photos/hardware2.jpeg)
31+
![Architecture Diagram](photos/architecture.png)
2532

2633
## Log
2734

2835
<!-- write every week your progress here -->
2936

30-
### Week 6 - 12 May
37+
### Week 12 - 18 Aug
38+
39+
I came with the idea, ordered the pieces and started looking into potential software implementations.
3140

32-
I've started to assemble the hardware and to work on the KiCAD schematic, as well as starting to write the code, by using the Bevy framework.
41+
### Week 19 - 25 Aug
3342

34-
### Week 7 - 19 May
43+
Put the hardware together and started initial software testing. Made the KiCad schematic.
3544

36-
I've done the KiCAD schematic and because I couldn't find the symbol for the 1602 I2C display in the given KiCAD libraries, I've created one for the project.
45+
### Week 26 - 1 Sep
3746

38-
### Week 20 - 26 May
47+
Finished hardware, and did the last few touches to the software code done in Rust. Also, started writing the journey of getting this idea, turned to a real, functional thing, into the documentation you are reading right now.
3948

40-
I've started to work on the embedded software, while the Dino game was done with ggez, glam and oorandom. Because it was made initially for the playing on the computer and then modified for the i2c display. I encountered some difficulties, which requiered me to change a bit the idea of the project, meaning using the display for writing "game over" when you would've hit the dino and the buttons for controling the game. In order to do that, by having two Rust projects, I've had to create a Rust Workspace.
4149
## Hardware
4250

43-
1. **Raspberry Pi Pico W**: Microcontroller board used for running the code
44-
2. **LCD screen 1602 module**: used for displaying the actual game
45-
3. **LED**: shows when the console is on or off
46-
4. **Buttons**: one for velocity and one for up and down
47-
5. **Breadboard**: needed for building and testing the circuit
48-
6. **Jumper wires**: needed for connecting the components
51+
The project is based on the Raspberry Pi Pico W, which is the brain of the whole operation. Together with the BMP280 temperature sensor, the two LEDs used for visual temperature warnings, the buzzer for acoustic warnings, and the LCD for written instructions and live temperature, while the fan has the role of the cooler agent.
4952

50-
In this project, Raspberry Pi Pico W runs the game code, while the LCD screen 1602 module displays the game. An LED indicates power status, and buttons control velocity and movement. A breadboard and jumper wires connect the components for testing and construction.
53+
:::info
5154

52-
### Schematics
55+
In this project, Raspberry Pi Pico W is used for `processing` the `temperature data`, and depending on it, the MCU will `power on` the component assembly `accordingly`. This results in proper temperature `announcements` and a good cooling when `necessary`.
56+
The board will not power the fan at first, unless the threshold is `reached`, doing a `regulated` cool of the temperature, `adjusting` the fan `speeds` depending on `ambiental temperature`. If the temperature is `near` or `above` the threshold and the user does not consider the cooling good enough or that is too fast, the `button` can also be used for `manual adjustments` that are `saved` while the temperature is `oscillating` between the `alert` values.
5357

54-
![KiCAD Schematic](photos/kicad_schematic.png)
58+
:::
5559

56-
### Bill of Materials
60+
**Pictures**
61+
62+
Here are some photos of the actual hardware:
63+
64+
<table>
65+
<tr>
66+
<td>
67+
68+
![HDW1](photos/hardware1.png)
69+
70+
</td>
71+
<td>
72+
73+
![HDW2](photos/hardware2.png)
5774

58-
<!-- Fill out this table with all the hardware components that you might need.
75+
</td>
76+
<td>
5977

60-
The format is
61-
```
62-
| [Device](link://to/device) | This is used ... | [price](link://to/store) |
78+
![HDW3](photos/hardware3.png)
6379

64-
```
80+
</td>
81+
</tr>
82+
</table>
83+
<table>
84+
<tr>
85+
<td>
86+
87+
![HDW4](photos/hardware4.png)
6588

66-
-->
89+
</td>
90+
<td>
91+
92+
![HDW5](photos/hardware5.png)
93+
94+
</td>
95+
<td>
96+
97+
![HDW6](photos/hardware6.png)
98+
99+
</td>
100+
</tr>
101+
</table>
102+
103+
### Schematics
104+
105+
![KiCAD Schematic](photos/kicad_schematic.png)
106+
107+
### Bill of Materials
67108

68109
| Device | Usage | Price |
69110
|--------|--------|-------|
70111
| [Rapspberry Pi Pico W](https://www.raspberrypi.com/documentation/microcontrollers/raspberry-pi-pico.html) | The microcontroller | [35 RON](https://www.optimusdigital.ro/en/raspberry-pi-boards/12394-raspberry-pi-pico-w.html) |
71112
| [1602 LCD](https://www.optimusdigital.ro/en/lcds/2894-1602-lcd-with-i2c-interface-and-blue-backlight.html) | LCD Screen | [16.34 RON](https://www.optimusdigital.ro/en/lcds/2894-1602-lcd-with-i2c-interface-and-blue-backlight.html) |
72113
| [ Button 6x6x6](https://www.optimusdigital.ro/ro/butoane-i-comutatoare/1119-buton-6x6x6.html?search_query=butoane+&results=197) | Buttons for controls | [0.36 RON](https://www.optimusdigital.ro/ro/butoane-i-comutatoare/1119-buton-6x6x6.html?search_query=butoane+&results=197) |
73-
| [Breadboard, Wires](https://kits.plusivo.com/microcontroller-starter-kit/claim.html) |Breadboard with 830 points, Wires | [74.99 RON](https://www.optimusdigital.ro/ro/kituri/12333-kit-plusivo-microcontroller-starter.html?search_query=plusivo+microcontroller+starter+kit&results=3) |
74-
TOTAL : 126.69 RON
114+
| [Electronic Components Starting Kit](https://kits.plusivo.com/microcontroller-starter-kit/claim.html) |Kit with electronical components | [74.99 RON](https://www.optimusdigital.ro/ro/kituri/12333-kit-plusivo-microcontroller-starter.html?search_query=plusivo+microcontroller+starter+kit&results=3) |
115+
| Breadboard with 830 points | Connects components | In-Kit |
116+
| Buzzer | Connects components | In-Kit |
117+
| LED x 2| Electrical Component | In-Kit |
118+
| 220KΩ x 2| Electrical Component | In-Kit |
119+
| Wires | Connects components | In-Kit |
120+
| [Pressure sensor Barometric BMP280 GY](https://components101.com/sensors/gy-bmp280-module) | Pressure Sensor | [8.49 RON](https://www.optimusdigital.ro/ro/senzori-senzori-de-presiune/1666-modul-senzor-de-presiune-barometric-bmp280.html?search_query=BMP280&results=11) |
121+
| [120x120 PWM Fan](https://www.arctic.de/media/8c/5d/bd/1693305992/Spec_Sheet_P12_PWM_EN.pdf) | Fan | [26.99 RON](https://www.emag.ro/ventilator-arctic-p12-pwm-black-black-120mm-acfan00119a/pd/DZT5RTMBM/) |
122+
| [5-12 Power Source](https://www.arctic.de/media/8c/5d/bd/1693305992/Spec_Sheet_P12_PWM_EN.pdf) | Power Source | [10.41 RON](https://www.emag.ro/sursa-de-alimentare-12v-1a/pd/DFMG13BBM/?ref=history-shopping_374985296_18482_1) |
123+
75124

76125
## Software
77126

78127
| Library | Description | Usage |
79128
|---------|-------------|-------|
80-
| [embassy-rp](https://github.com/embassy-rs/embassy/tree/main/embassy-rp) | RP2040 peripherals | Used for accessing the peripherals of the microcontroller |
81-
| [embassy-hal](https://github.com/embassy-rs/embassy) | Hardware Abstraction Layer | Interfaces with Raspberry Pi Pico W hardware |
82-
| [embassy-sync](https://github.com/embassy-rs/embassy/tree/main/embassy-sync) | Synchronization primitives | Used for syncronizing asynchronous tasks |
83-
| [ag-lcd](https://github.com/mjhouse/ag-lcd) | Display library | Used for writing to the display |
84-
| [wasmi](https://github.com/wasmi-labs/wasmi) | Game Framework | Game Engine used for the development of the game/ WebAssembly Interpreter |
129+
| [embassy-rp](https://crates.io/crates/embassy-rp) | Embassy Hardware Abstraction Layer (HAL) for the Raspberry Pi RP2040 microcontroller | Used for `initializing` hardware PINs and protocols used by devices such as the Display, Buzzer, LCDs, Fan and Sensor. |
130+
| [embassy-embedded-hal](https://crates.io/crates/embassy-embedded-hal) | Collection of utilities to use `embedded-hal` and `embedded-storage` traits with Embassy. | Dependency of `embassy-rp` used for adding `embedded-hal` traits to embassy |
131+
| [embassy-time](https://embassy.dev/) | Instant and Duration for embedded no-std systems, with async timer support | Stops code execution for a definite time period |
132+
| [embassy-executor](https://crates.io./crates/embassy-executor) | async/await executor designed for embedded usage | Used for spawning/tasking asynchronous functions like `main` and tasking functions like `logger-task` |
133+
| [lcd1602-driver](https://crates.io/crates/lcd1602-driver) | An embedded-hal based driver for the LCD1602 display | Used for defining and customizing display's `traits` and `features` |
134+
| [heapless](https://crates.io/crates/heapless) | `static` friendly data structures that don't require dynamic memory allocation | Used for variables `unsigned` to `String` conversion |
85135

86136

87137

88-
## Links
89138

90-
<!-- Add a few links that inspired you and that you think you will use for your project -->
139+
## Links
91140

92-
1. [tutorials for creating a game + libraries](https://arewegameyet.rs/)
93-
2. [game engine that works with Rust and WebAssembly](https://github.com/bevyengine/bevy/tree/latest)
94-
3. [step by step tutorial on how to create a game by using Rust and Bevy](https://www.youtube.com/watch?v=E9SzRc9HkOg)
95-
4. [understanding and starting to use wasmi](https://blog.knoldus.com/hosting-wasm-modules-in-rust-easily-using-wasmi/#hosting-in-rust)
96-
5. [book on how to create a game with Rust and WebAssembly](https://www2.irb.hr/korisnici/zskoda/hoffmanWasmRust.pdf)
97-
6. [libraries for Rust and Bevy(in case I'm using Bevy I've decided to put all the info for Wasmi & Bevy too)](https://lib.rs/game-development)
141+
1. [How to use BMP280 GY over SPI with a Pico Microcontroller using Rust](https://embedded-rust-101.wyliodrin.com/docs/lab/06)
142+
2. [How to make Temperature Controlled Fan Using Arduino and DHT11](https://www.youtube.com/watch?v=eg8AlYlV0PM)
143+
3. [How to Use the Adafruit BMP280 Sensor](https://www.instructables.com/How-to-Use-the-Adafruit-BMP280-Sensor-Arduino-Tuto/)
144+
4. [BMP280: Measure Temperature, Pressure and Altitude](https://projecthub.arduino.cc/SurtrTech/bmp280-measure-temperature-pressure-and-altitude-6002cd)
-371 KB
Binary file not shown.
91.4 KB
Loading
-275 KB
Binary file not shown.
245 KB
Loading
-301 KB
Binary file not shown.
268 KB
Loading
226 KB
Loading
211 KB
Loading
286 KB
Loading

0 commit comments

Comments
 (0)