100%
waveshare_epaper_picture_frame atmega328p view
Description

Imported from GitHub: rob-g2-365/waveshare_epaper_picture_frame · commit f5ed760 · license MIT

Description

E-Ink Picture Frame using and Atmega 328P

README

Waveshare Epaper Picture Frame

Table of Contents

Introduction

This project displays an image on an e-paper picture frame. The picture switches once per day. Included are the list of materials and how to build it.

E Picture frame display

Knowledge Assumptions

I am assuming in this project that the user knows how to do the following:

  • Read an electrical schematic.
  • Basic soldering of through-hole components.
  • Configure and build a project using the Arduino IDE.
  • Slice a 3d Model and send it to a 3d printer.
  • Put brass inserts into plastic using a soldering iron.
  • Run a Python script.

File List

Specifications

  • Display Size 5x7 inches or 10x18cm.
  • Battery life should be about a year with alkaline batteries.

Parts List

Basic Parts

ItemQuantityNotes
PLA400gUsed just plain black PLA
Picture frame1Used 5x7 Vertical Side Natural Frame by Threshold from Target
SolderSmall Amount

Fasteners

ItemQuantityNotes
M2 x 6mm Phillips Flat Countersunk Head Machine Screws2
M2.5 x 8mm Phillips flathead Machine Screws2
#4 x 1/2 inch Wood Screws5Alternative use M3 x 15mm Woodscrews
M2.5 x 5mm Pan Phillips Cross Head Machine screws12You could just use the flathead screws for all screws M2.5 screws
M2 x 4mm Brass Inserts14
M2.5 x 5.8mm Brass Inserts12There is room for longer inserts.

Electrical Parts

Note that all electronic parts are through-hole components. Note that many substitutes can be used for the resistors, capacitors, and diode.

ItemPart NumberQuantity
Waveshare 7.3 inch ACeP 7-Color E-Paper 800x6007.3 inch e-Paper Hat (F)1
MicroSD CardMicroSD Card1
MicroSD Card Adapter for ArduinoMicroSD Card Adapter1
3 AAA Battery Holder3 AAA Battery Holder1
ATmega328-P-PU Arduino Bootloader3647-ATMEGA328P-PUArduinoBootloader-ND1
28 Pin DIP SocketICM-328-1-GT-HT1
PMOS - LP0701N3-GLP0701N3-G-ND1
22pF CapacitorK220J15C0GF5TL22
100nF CapacitorK104K15X7RF5TL23
Diode General PurposeBAW75-TAP1
10K ResistorCF14JT10K01
100K ResistorCF14JT100K2
SW_Push SWITCH TACTILE SPSTB3F-10001
16Mhz 20pF CrystalECS-160-20-1X1

We need a package of straight DuPont-style male row connectors in order to make the 1x2, 1x6, and 1x8 Connectors. Also (10Cm) short multicolor Dupont Female to Female wires.

Note that the Micro SD Card doesn't need much capacity. A 1Gb Micro SD Card should work.

Other Equipment Needed

Other Hardware Needed

Also, it is a good idea to have troubleshooting equipment such as a multimeter and something to decode the SPI bus traffic.

Software Needed

Need the software Arduino IDE to build and download the code. I used version 2.1.0, but the latest version probably would work for you.

Arduino IDE Packages

PackageOwnerCurrent Version
Arduino BuiltinArduinoBuilt Into IDE
SDArduino SparkFun1.2.4
LowPower_LowPowerLabLowerPowerLab2.2
EEPROMArduinoBuilt Into IDE
SPIArduinoBuilt Into IDE

Python Environment

I used Python 3.9 with the Pillow (Python Image Library) 9.3.0 package installed. The latest of each should work.

Optional Software

PackageVersion Used
Freecad0.21.2
KiCad7.0

Printing Instructions

Printer Settings

SettingsUsedNotes
MaterialPLA
Nozzle0.4mm
Layer Height0.2mm
Walls5Needed for Brass Inserts
Infill20%
SupportsOnly Touching Build plate

3D Printed Parts List

PartPicture
Main PartMain Part
Battery CoverBattery Cover
SD Card CoverSD Card Cover
Display HAT CoverDisplay HAT Cover
Main Board CoverMain Board Cover
Frame BorderFrame Border

PCB Board Instructions

Gerber files are listed in the gerber directory. I used OshPark to create the PCBs, but you should be able to use other vendors.

Assembly Instructions

Insert the M2.5 Brass Inserts into the Following Holes

M2.5 Brass Insert Locations

Use a solder gun to insert the brass inserts.

Insert the M2 Brass Inserts into the Following Holes

M2 Brass Insert Locations

Solder Components to PCB Board

Solder components to the PCB board. The silkscreen shows the Component number location.

Component NumberPart
C1, C222pF
C3, C4, C5100nF
D1General Purpose Diode
J1, J2Male Connector 01x06 Pin
J3Male Connector 01x08 Pin
J4Male Connector 01x02 Pin
Q1PMOS - LP0701N3-G
R110K Resistor
R2, R3100K Resistor
SW1Push button switch
U128 Pin Connector for ATmega328-P
Y116Mhz Crystal

PCB board

PCB board Silk Screen

Assemble the Main Part to Frame

Remove the original back assembly from the picture frame. We do not need the back of the picture frame, the screws, or the stand. We only need the picture frame and the glass.

Mark Drill Holes. (See frame back picture) Drill holes into the picture frame using a 5/64 or 2mm drill bit.

Remove any stickers from the glass. Clean glass the glass using glass cleaner or isopropyl alcohol. Ensure that no fingerprints are on the inside glass.

Assemble in the following order:

  1. Wooden Frame
  2. Glass
  3. 3D Printed Frame border
  4. E-paper display (Be sure the protective covering is removed and the e-paper display ribbon cable is at the top.)
  5. 3D Printed Main Body

Use the #4 wood screw holes to attach the 3D Printed main body to the wooden picture frame.

Put Boards into Main Picture Frame

Frame Back

Connect the Ribbon Cable to the E-Hat

The extension cable for the e-paper display is not needed. Connect the ribbon cable from the display to the e-hat. Use M2 roundhead screws to attach the e-hat.

Attach the Battery Case

Push battery wires through the holes in the main body. Attach the battery case using M2 Flathead screws.

Attach the Other Components to the Main Board

SD Card Adapter and Main Board used M2 Roundhead screws. Be sure that the hole in the main body for the SD Card matches the SD Card slot.

Attach the main PCB board. Ensure that the J3 screen is next to the hat connector and the SW1 is at the bottom of the display.

Make Connections to PCB Board

Attach the battery to J4. PCB board is marked red for positive and black for negative.

Attach SD card connections to J2. Chip select is closest to R1. Please double-check schematic.

J2 SD Card Header

Attach the Waveshare e-hat SPI connections to J3. Gray should match GRY on the board. Note that the BLK wire may be purple.

J3 Waveshare E-hat header

Arduino Code

Arduino Code Overview

I had to make a couple of changes to the Waveshare drivers. They are:

A. Changes with Waveshare drivers (SPI frequency and chips select) B. Reduced the SPI clock speed.

Download Instructions

Use Board type "Arduino Uno"

Attach FTDI USB to serial connector to J1 serial connector.

Enable Serial Debug

If you run into problems, you may want to enable serial debugging. To enable serial debug out, uncomment line 50.

The last failure is saved in the EEPROM. When booting, the error code is outputted over the serial port. The error codes are listed in line 36 of debug.h.

Python Code

Preprocessing Portrait Images

Images that are formatted as portrait may need to be cropped so that faces and important details may be shown.

Python Command-line Arguments

This command converts images from the source directory or its children into the destination directory.

Images in the destination directory are listed in the following order: pic_000.bmp, pic_001.bmp, pic_002.bmp, etc.

This program also does the following:

  1. Auto-adjusts the contrast.
  2. Increases the saturation so the images don't look washed out.
  3. Mirrors the image to looks correct when viewed from the picture frame.
  4. Crops the image so the image size is correct.
  5. Dithers the images so that only seven colors are needed to display the image.
  6. Randomizes the image's order.

SD Card

Sample SD Card Image

A sample SD Card image is located in:

Sample SDCard Image

SD Card Format and Files

The Micro SD Card capacity can be small since the images don't occupy much space. Format a Micro SD Card using Fat32. Copy the processed image files to the root of the Micro SD Card.

Insert the Micro SD Card into the Micro SDCard Adapter for Arduino.

Testing and Putting it Together

Verify that the image appears on the e-paper display.

Attach the 3D-printed covers.

Picture Frame Back

Battery Life and Power Consumption

It takes about 134 seconds to change the image on the screen. During this time, it uses approximately 40mA.

$$ = 134 (seconds/switch) * 40 (mA) / 3600 (seconds/hour) $$

$$ = 1.5 (mAh/switch) $$

When idle, the current draw is about 10 uA.

$$ = 24 (hours) * 0.01 (mA) $$

$$ = 0.3 (mAh) $$

An approximate alkaline AAA battery life is about 1200mAh. However, the picture frame cannot use the full capacity of the battery.
Once the voltage goes below 3.8v, 1.25v per cell, the picture frame will stop working. This is about 50% of the capacity.

Therefore, the battery life for the picture frame is:

$$ = 1200 mAh * 50% / 1.8 (mAh/ day) $$

$$ = 333 (days) $$

Possible improvements.

Use a ultra low IQ Boost Converter

An ultra-low IQ boost converter is one option for more battery life. This will allow the battery pack voltage to be functional down to 2.7v, which is using the battery's full capacity. I don't know if using the full capacity of the battery will offset the leakage power lost through the boost converter.

Additional Resources

Waveshare 7.3inch e-Paper HAT (F) Manual

e Paper with Arduino and Raspberry Pi

Trolling My Mom With an E-Paper Picture

Comments
Sign in to comment

No comments yet. Be the first to ask about this board.