Thursday, April 18, 2024

DIY: e-Ink-based IoT Touch Switch

ashwinie-ink displays are quite impressive as they use electrically activated ink molecules, which doesn’t lead to fading away of designs made using it – even after the power supply is turned OFF; the designs seem to be printed on paper with a normal ink pen. Unlike conventional display systems, e-ink does not use any LED or OLED light. It only needs a small amount of electricity.

In this IoT project, you will learn to make a power-efficient IoT touch switch that consumes minimum power and gives an impressive smart home switching experience. So let’s begin our project by shopping for the following components.

Bill Of Material

- Advertisement -

Coding 

Install the latest Raspbian OS on the Raspberry Pi board. Also, install the required libraries for controlling the GPIO and for interfacing the e-ink display. For these, open the Linux terminal and run the following commands:

sudo pip3 install gpiozero

wget http://www.airspayce.com/mikem/bcm2835/bcm2835-1.68.tar.gz

tar zxvf bcm2835-1.68.tar.gz 

cd bcm2835-1.68/

sudo ./configure && sudo make && sudo make check && sudo make install

sudo apt-get install wiringpi

sudo apt-get update

sudo apt-get install python3-pip

sudo apt-get install python3-pil

sudo apt-get install python3-numpy

sudo pip3 install RPi.GPIO

sudo pip3 install spidev

cd ~

git clone https://github.com/waveshare/Touch_e-Paper_HAT

Now you are ready to write the code.

First, create a UI having the image/icon of the appliance you wish to control. Save it on the e-ink display and run the code to preview it on the e-ink display. The code can be found inside the e-ink library folder.

- Advertisement -

After displaying the UI, turn off the Rpi and code. As you are aware, the display will remain unchanged with the same image even after the power is switched off unless the display is refreshed. e-ink display uses a special technology of ink molecules that get activated electrically and remain on display as printed ink on paper.

Next, create a code that will check the touch/sensing points on the touch panel of the e-ink display for turning them ON/OFF as required. Import the code to the display.

Next, create a while loop in which you should define the function for toggling the LED to control the appliance that you wish to control. If the touch/sensing point is within the range of the image/icon on display, then the LED to control that appliance will toggle.

Fig 4. Code importing module
Fig 5. Getting touchpoints.
Fig 6.Code for controlling appliance

Connection 

After creating the code, connect the LEDs on the Raspberry Pi pins as shown in the circuit diagram. Then make a solid state relay using TRIAC to control the AC appliance.

Next, assemble everything within the physical enclosure of the touch e-ink display. Put the e-ink touch display on the Raspberry Pi GPIO and connect each other on the top of the e-ink display box (refer to pics below).

Fig 7. Connection of LED to control

 

Fig 8. Connection with LEDS and TRiac and AC appliance
Fig 9.Fixing Raspberry pi
Fig 9. Connecting and fixing solid state relay
Fig 10. Connecting the E-INK Touch display on raspberry pi
Fig 11.E-INk display Switch
Fig 14. ICON of Touch Switch

Testing 

Connect the Raspberry Pi with a 5V power supply. Then plug the relay with an AC socket appliance, run the code and then touch the relevant icon on the e-ink IoT touch switch to control it.

Fig 15.
Fig 16.

Download Source Code

This article is a part of the Top 30+ IoT Projects | IoT Project Ideas for Enthusiasts. If you want to read more interesting IoT Projects can go through this article.
Ashwini Sinha
Ashwini Sinha
A tech journalist at EFY, with hands-on expertise in electronics DIY. He has an extraordinary passion for AI, IoT, and electronics. Holder of two design records and two times winner of US-China Makers Award.

SHARE YOUR THOUGHTS & COMMENTS

Unique DIY Projects

Electronics News

Truly Innovative Tech

MOst Popular Videos

Electronics Components

Calculators