Childhood Memory in the DIY E-Album
by Lan_Makerfabs in Circuits > Electronics
332 Views, 2 Favorites, 0 Comments
Childhood Memory in the DIY E-Album
Hello everyone, welcome to Makerfabs channel! After the Spring Festival holiday, we leave the countryside to return to working. When we were living in the countryside, it was a very unforgettable time. every year, we can see that our hometown is changing with each passing day. when I was young, we can see the many fields and the fish swim in the pond. Fortunately, those wonderful memories have been saved as the picture. we want to design a E-Album to display them. As thus we can see these memories every day.
Supplies
- ESP32-S3 Parallel TFT with Touch 4.0" , with 480*480 resolution, it integrated display/ touch/ audio speaker/ Lipo charger, to make this product ideal for electronic photo frame. It would be a nice experience to be able to show pictures and play music at the same time!
- 3D printer: It needs to be used to print the required brackets.
- screw, nut and isolation column.
Hardware Assembly and Bracket by 3D-Printing
- ESP32-S3 Parallel TFT with Touch 4.0" use the ST7701 screen driver, FPS>50, resolution is 480*480, 4.0 inch High Lightness IPS, and attached speaker. It meets our criteria for designing an E-Album. Lipo battery socket and charger to support any 3.7v lipo battery, it is portable and easy to carry.
- We choose PETG material as the raw material for 3D printing. Its feature that environmentally friendly, economical and good workability. The design of this bracket takes into account the stability of the triangle. This design also allows us to use as little material as possible.
- 3D printing allows us to print things we design, such as the bracket we design for the screen, which would be very expensive to customize. Making your idea into something real is the fun of DIY!
Software
Development environment is Arduino IDE
Get the code in GitHub. Can be designed as a reference program.
Declaration uses file and pin definitions to enable the program to successfully drive the chip to read images and music resources from the SD card.
#include "Audio.h"
#include "Arduino_GFX_Library.h"
#include "JpegFunc.h"
// microSD card
#define SD_SCK 12
#define SD_MISO 13
#define SD_MOSI 11
#define SD_CS 10
// I2S
#define I2S_DOUT 19
#define I2S_BCLK 20
#define I2S_LRCK 46
// TFT
#define TFT_BL -1
#define AUDIO_FILENAME_01 "/ChildhoodMemory.mp3"
Initialize screen parameters, The screen uses the ST7701 driver.
Arduino_ST7701_RGBPanel *gfx = new Arduino_ST7701_RGBPanel(
bus, GFX_NOT_DEFINED /* RST */, 0 /* rotation */,
true /* IPS */, 480 /* width */, 480 /* height */,
st7701_type1_init_operations, sizeof(st7701_type1_init_operations),
true /* BGR */);
Set music playback and image display loop tasks.
void Task_TFT(void *pvParameters) // This is a task.
{
while (1) // A Task shall never return or exit.
{
Serial.println(image_list[image_index % IMAGE_COUNT]);
jpegDraw(image_list[image_index++ % IMAGE_COUNT].c_str(), jpegDrawCallback, true, 0, 0, gfx->width(), gfx->height());
vTaskDelay(2000);
}
}
void Task_Audio(void *pvParameters) // This is a task.
{
while (1)
audio.loop();
}
void audio_eof_mp3(const char *info)
{ // end of file
Serial.print("eof_mp3 ");
Serial.println(info);
audio.connecttoFS(SD, AUDIO_FILENAME_01); //"/ChildhoodMemory.mp3"
}
The main design of the program, shown above, is very simple and easy to understand.
Test and Result
- Connect the screen and bracket with screw, nut and isolation column.
- Using the card reader, move image files and audio files from the computer to the SD card.
- Verify and upload the code.
- Use a USB cable or plug in a battery. (Or USB supply power)
Note: Because the resolution of the screen is 480*480, our pictures also need to modify the resolution to be consistent with the screen. Image format is JPG, audio format is MP3.
We can see childhood photos and scenery on the screen and melodious music coming from the loudspeaker in sync.
Our souls seem to return to that wonderful childhood. The night is moist, the ground wet, air still, trees silent. what a wonderful memory! I hope you like this project.