A project in which I created a working device.
Why do a project like this? It's because recently (in the past few months), I joined the Science Club SBT - "SBT - Solar Boat Team" at Wrocław University of Science and Technology, where due to the influence of passionate, more experienced students,I started to study STM32 architecture. I have never done hardware stuff like this, the idea of designing a working device which can be useful quickly piqued my interests.
The listing below shows main goals which the project aims to be:
- Have fun
- Design a working device
- Study STM32 architecture
- Study techniques of programming an external embedded system
- Study analog signal processing in C Programming Language
- Gather ideas for future projects
- What should I do next with gained experience?
The Device should:
- The total cost is less than $10
- Consume input voltage: 3.3V/5V
- Update current ambient temperature (Celsius scale)
- Update current air humidity (Percent scale)
- Print necessary data on the screen (screen with user friendly graphics)
- Light a LED bulb on data update
- Have RESET button
- Stm32f103c8t6 board (BluePill)
- Nokia LCD screen, 5110 84x48px
- DHT11 temperature&humidity sensor
- LED Red bulb
- 3.3kΩ pull-up resistor (for sensor)
- some random 1mm cables
- Setup necessary environment in order to be ablew to save binary file in Bluepill
- Check connection computer-board. Via program ST-Link Utility, via ST-Link V2 (usb device which allows me to teach Bluepill the code I write - give Bluepill binary/hex .exe file which then is being executed while standalone)
- Program Bluepill with basic 'toggling-LED' program to test whether it's programmable or not.
- Choose cheap devices which fulfill project criterions.
- Ask STM32-experienced students for directions when choosing.
- Choose proper devices compatible with Bluepill, buy them.
- Study their manuals to get into the technical part.
- Configure CUBEMX pinouts, then generate code for pinout - STM32 HAL library:
- Screen - SPI interface
- Sensor - Gives analog signal which can be captured via one pin.
- LED - Pin output
- STM32 clocking stuff
- Write LCD class, display some text with predefined font.
- Display not just text, but a photo
- Since Nokia5110 LCD screeen is black|white (blue|black) I had to convert needed images to proper screen 84x48px
- And set alpha threshold so it just displays pixels in form of 0/1 dots.
- Learn about sensor data capturing.
- Write DHT11 class - sensor class, handle digitization of one pin analog signal.
- Capture 40 bits of data:
- [0-7] - integer part of humidity (in Percent)
- [8-15]- fractional part of humidity
- [16-23]-integer part of temperature (in Celsius)
- [24-31]-fractional part of temperature
- [32-39]- control sum
- Display data on the screen and signal with LED red
- Mount and solder device (since testing it was just on contact palete)
- Add RESET button - short circuit Bluepill pins : (RESET, GND) makes hardware reset.
- Program device with last working version of code.