Stefanica Matei-Costin, 331CB
Brief presentation of the project:
What I want to achieve with this project is a device that is small enough to fit into a pocket, costs less than 50 euro (the average ebook reader price is ~150 euro) and allows the user to read any book, as long as it can be stored on an SD card. The target is to create a MVP, but if all goes well I will also try using a battery and I hope to have at least 12 hours autonomy.
In the middle of the project it the ATmega328P Xplained mini, which will be the brain of everything. Using SPI, it will communicate with a MicroSD Card Adapter to extract from the MicroSD card the book in byte chunks. Also using SPI it will send the information to the Display for the user to see. On the other hand, I want the device to be as easy to be used as possible, so the Display will also have an autorotate feature, for which I will use a gyroscope that will communicate with the uC using I2C. For the user experience side of the project I will also use a few buttons that will be used to navigate the book and a some other options and settings, as well as a buzzer, used to make a sound similar to the one of pages turned.
After I encountered the Hardware issues described down below, I am now using Arduino Uno R3 instead of ATmega328P Xplained mini and ST7735 instead of the original ILI one
Details regarding the hardware implementation:
A diagram of all the HW involved can be seen in the following diagram:
The user will turn on the device and will see the current page of the current book. He will be able to press one of the Next or Prev buttons to turn pages and will hear an audio feedback (one for valid and one for invalid page turns). The user will also be able to press the Menu button, that will save his progress and take him to the menu screen, where he will be able to navigate through books and choose the one he wants to read. Thanks to the MPU6050 sensor and its accelerometer, the device will be able to detect its spatial orientation and autorotate if being held in different positions.
| Module Pin | Connected To | Notes |
|---|---|---|
| VCC | 5V | Power supply |
| GND | GND | Common ground |
| CS | D9 | Chip Select |
| RST | D8 | Display reset |
| D/C | D7 | Data / Command |
| MOSI | D11 | SPI MOSI |
| MISO | D12 | SPI MISO |
| SCK | D13 | SPI Clock |
| LED | 3.3V | Backlight |
| Button Pin | Connected To |
|---|---|
| 1.r | D6 |
| 2.l | GND |
| Button Pin | Connected To |
|---|---|
| 1.r | D2 |
| 2.l | GND |
| Button Pin | Connected To |
|---|---|
| 1.r | D4 |
| 2.l | GND |
| Module Pin | Connected To | Notes |
|---|---|---|
| CS | D10 | Chip Select |
| SCK | D13 | SPI Clock |
| DO | D12 | SPI MISO |
| DI | D11 | SPI MOSI |
| VCC | 5V | Power supply |
| GND | GND | Common ground |
| Sensor Pin | Connected To | Notes |
|---|---|---|
| VCC | 5V | Power supply |
| GND | GND | Common ground |
| SDA | A4 | I2C Data |
| SCL | A5 | I2C Clock |
| AD0 | GND | I2C address configuration |
| Buzzer Pin | Connected To |
|---|---|
| 1 | GND |
| 2 | D3 |
For the most part, the project is similar to the schematic. The only different piece is the lcd, which is a ST7735. I have also soldered the buttons to a protoboard, as can be seen in the following image
In the beginning, I used PlatformIO, but as I mentioned in the Journal, that caused some issues with the SPI of the MicroSD card (not sure why), so I switched over to ArduinoIDE. In my project, as can be seen, I have implemented functionalities from those labs: L0(GPIO), L1(USART), L4(ADC), L5(SPI) and L6(I2C). Initially, I planned to also implement some of the functionalities using registers, not higher level libraries, but as my project would be what I could called 'Software oriented', this task would have made the code almost impossible to debug and understand(Neither was this a requirement for the final grade). I used the following libraries:
One issue I encountered multiple times was the lack of RAM, as Atmega328P only has 2KB of it, so you can fill it out quite easily. The first time I encountered this issue was while prototyping the project on Wokwi. That's where I also found out that an easy way to move strings from RAM to the Flash memory is by using the `F` prefix before them, so you will see that a lot in my code. In order to avoid filling the RAM memory, I also tried using variables as small as possible (that would not create overflowing issues) and I limited the number of books to only 10.
The device has 2 operating modes: reading mode and menu mode. It uses the SD card to store the books (in .txt format) and store the progress of the reading. It stores the current page for all the books the user has stored on the SD card.
The microcontroller stores the user's data (regarding the reading progress) creating files with .DAT syntax, so besides the books, on the SD card are files with the page that the user stopped at for every book (ex: P0.DAT) and a file that stores the last book that the user was reading so it can be opened after the startup: LAST.DAT.
For the pagination and the display of the pages, I wanted to be able to “cut” the words at the end of a line, but not at the end of a page. Therefore, after reaching the limit of characters per page, the algorithm searches for a space or a newline so it can pass to the next page. Everything that is displayed is calculated based on the size of the screen (so it can be replaced with minimum effort). Every page has a header that displays the page progress (the algorithm also computes the total number of pages) and a footer where the orientation of the screen is displayed.
Speaking of the orientation, for the autorotate feature I extract the gravitational force on all three axes from my MPU6050 via I2C, and the values of those axes that I autorotate at where determined empirically, after placing the sensor in its fixed position in the box. As it also works in most of the modern devices with autorotate, the implementation also uses hysteresis. This means that besides the debounce (the interval between two consecutive checks), the device also waits to detect the same orientation for at least 3 times before reacting. This is particularly useful for small devices that are held by the users in their hands, as the hand gestures can trigger many unwanted reactions.
For the audio feedback, I defined 3 functions that make suggestive sounds for valid and invalid actions, as well as for changing the functioning mode.
At setup, the main steps are: initializing the buttons and buzzer pins, setting the Chip Select pins on High (to initialize the SPI correctly), beginning the SPI connection with the SD card (the most sensitive one in my experience), doing the same thing with the LCD, beginning the I2C communication with MPU6050, scanning for the books available on the SD card, loading the last read book and selecting the current functioning mode.
The device has 2 operating modes: reading mode and menu mode. It uses the SD card to store the books (in .txt format) and store the progress of the reading. It stores the current page for all the books the user has stored on the SD card.
It is worth mentioning that most of (if not all) of the components I used are chinese fakes, not original components, therefore the values I have extracted from the datasheets may not be really accurate.
total 41.2mA
I_avg = (100mA * 0.1s + 1mA * 29.9s) / 30s = 1.33mA
I will consider that the buzzer consumes too little current to be taken into consideration
Total = 41.2mA + 20mA + 1.33mA + 5mA = 67.53mA
Even though I did not have enough time to also implement a battery, the one I would have used would have been a Li-Po 1000 mAh type battery. The one i intended to use is 2.5 x 62 x 58 mm, so it is also small enough for the purpose of this project.
Autononomy = 14.8 hours
Despite the fact I don't even have a battery, I want to specify some of the improvements I believe would have been useful for achieving a longer battery life:
| Component | Estimated Price (RON) |
|---|---|
| Arduino Nano R3 | 25.40 RON |
| LCD ST7735 1.8” | 30 RON |
| MicroSD module | 4.39 RON |
| MPU6050 (GY-521) | 14.68 |
| Passive buzzer | 1 RON |
| Tactile buttons (x3) | 1.20 RON |
| MicroSD card 16GB | 38 RON |
| Jumper wires + breadboard | 16 RON |
| Cardboard box + adhesive tape | 2 RON |
| TOTAL | 132 RON |
As we are talking about a MVP, I also need to include in this calculation the cost of the powering circuit:
| Component | Estimated Price (RON) |
|---|---|
| Li-Po battery 1000mAh 3.7V | 14 |
| TP4056 charging module (USB-C) | 4 |
| MT3608 boost converter (3.7V → 5V) | 5 |
| Power switch | 1.20 |
| TOTAL | 24.2 RON |
So that brings us to the grand total of 156.2 RON so about 30 euro, which is below my original target of 50 euro.
If we want to take this to the next step, the cost can drop even further… as mass producing would make all the components much cheaper. Because of the lack of data and experience I will not be able the compute all the exact prices, but my estimation is that the real mass production cost would be 40-45% lower, at about 85 RON (17 euro)
If to that we add a 30% profit margin for the distributor and and a 40% margin for the retailer, and also adding a 10 euro margin for any cost that I might have not taken into consideration… our final price for the mass produces product would
I consider that I achieved the main goal of this project, which was to create a working and and cheap Pocket E-Book Reader, accessible to a large range of potential users, that I hope would make reading as convenient as possible. Even though my MVP is comically large (definitely not pocket sized), the real life product has the potential to really be small, as most of the components that take a lot of space now would not even exist in the final version (the arduino uno r3, for instance, would be replaced with only Atmega328P chip).
The main achievement is, in my opinion, the price, which is even lower than I intended.
When it comes to key take-aways from this project, I learned that cheap HW components malfunction and get broken really easily, and you really need to take that into consideration and test everything thouroughly.
I encountered numerous Hardware issues:
Therefore, I lost a lot of time trying to understand why things did not go as expected, so I lost precious time. Because of this, I will not be able to also integrate a power supply or 3D model the case, as I have planned a few weeks back
13.05.2026