How to display messages on a remote screen? The project combines two technologies to solve this problem.
- A remote device with an e-ink display connected to an IoT-capable board to receive and display the messages.
- A dashboard running on Node-RED to send the messages.
Pervasive Displays offers a wide range of e-paper screens, from 1.54" up to 12.2", in black-and-white or black-white-red versions, as well as the Pervasive Displays Extension Kit Gen 3, a universal driver board.
The e-paper screens act like a sheet of paper: they only need power during the printing of the text or image. Once the text or image has been printed, the screens no longer need power. They can even be detached: the text or image stays on! A more detailed presentation explains How e-paper works.
Apart from the low power and the persistent display, the e-paper screens offer high readability even in direct sunlight and high resolution with 130 dpi.
Particle pioneered IoT and offered a comprehensive IoT eco-system including hardware, the Photon board with a WiFi radio; software with the Particle device API; and service with the Particle cloud.
Remote deviceThe remote device consists on the Particle Photon board, the Pervasive Displays Extension Kit Gen.3 board and a Pervasive Displays e-ink display.
Hardware
For the hardware part, proceed as follow:
- Attach the screen flat cable to the 24-way connector to the Pervasive Displays Extension Kit Gen 3 board.
- Set the jumper to the
≤4.37"
position on the Pervasive Displays Extension Kit Gen.3 board.
- Connect the signals 1 to 10 of the Pervasive Displays Extension Kit Gen 3 board to the pins of the Particle Photon as shown below. I recommend using the provided cable or a 10-way flat cable with the standard electronic colours.
The e-paper screen requires an external frame-buffer, stored in SRAM. The size of the screen is thus limited by the SRAM available on the Particle Photon board: only ca. 50 kB are available out of the 128 kB, enough to support screens up to 4.2" with 400x300 pixels. The project here uses a 3.70" black-white-red screen.
Software
The application relies on the Particle Device OS API for the cloud functions like authenticating, getting time, receiving and sending messages, posting variables.
Particle brings two options, the online Particle Web IDE and the offline Particle Workbench Extension for the Visual Studio Code IDE. The project uses the latter, but it should be the same with the former.
- Either install the Particle Workbench that includes the Visual Studio Code IDE and the Particle Workbench Extension.
- Or install the Particle Workbench Extension on Visual Studio Code.
- Create a new project using the Particle welcome page.
- Download the code of the project from the GitHub repository: the
Particle Project
contains thesrc
subfolder of the project. Copy that subfolder into the project. - Call the menu Particle: Install Libray and type
SparkJson
to install the SparkJson library from Particle. - Download the ePaper EXT3 Basic Library and copy it under the
lib
subfolder of the project.
The ePaper EXT3 Basic Library provides high-level graphics and text routines with extended fonts, and includes all the hardwire-level management of the screen.
The lib
folder should contain now two sub-folders: SparkJson
and ePaper_EXT3_Basic_Library
, and the src
folder the PDI_EXT3_Messages_Particle.ino
main sketch and EnglishCalendar.h
header file.
- Open the file
hV_Configuration
header file underlib/ePaper_EXT3_Basic_Library/src
and ensureCONFIGURATION_OPTION
is set toCONFIGURATION_EXT3_PARTICLE_PHOTON
.
#define CONFIGURATION_OPTION CONFIGURATION_EXT3_PARTICLE_PHOTON
- Open the main sketch and uncomment the line for the size of the screen, by default
eScreen_EPD_EXT3_370_BWR
.
Screen_EPD_EXT3 myScreen(eScreen_EPD_EXT3_370_BWR);
- The messages are sent to and received from a given event. In order to ensure the events are unique, grab one UUID from the Online UUID Generator Tool, here
9ac6b059-bfa5-4ae2-b1cc-a9b3a797884f
.
- Open the main sketch and search for the following lines:
const String eventName = "<first UUID>";
const String readyName = "<second UUID>";
- Replace the
<first UUID>
by the UUID obtained, in this example9ac6b059-bfa5-4ae2-b1cc-a9b3a797884f
. - Add
1
to the<first UUID>
to get the<second UUID>
, in this example9ac6b059-bfa5-4ae2-b1cc-a9b3a7978850
. - Replace the
<second UUID>
by the UUID obtained, in this example9ac6b059-bfa5-4ae2-b1cc-a9b3a7978850
.
const String eventName = "9ac6b059-bfa5-4ae2-b1cc-a9b3a797884f";
const String readyName = "9ac6b059-bfa5-4ae2-b1cc-a9b3a7978850";
- Build and upload.
- Call the menu Particle: Serial Monitor to open a serial console and display the trace of the application.
The dashboard runs on Node-RED and relies on the official Particle node. Various features are used: publishing messages to the Photon, subscribing to messages from the Photon, reading variables from the Photon.
- Publishing messages to the Photon: This is the main feature.
- Subscribing to messages from the Photon: This is used to check whether the screen is busy or ready.
- Reading variables from the Photon: This is used to monitor the free memory and the actual content of the display.
Software
The dashboard runs on Node-RED, a graphical programming tool to manage heterogeneous IoT hardware and software.
- Follow the procedure Getting Started to install Node-RED.
- Launch Node-RED and open http://127.0.0.1:1880.
- Call the top-right menu Manage Palette > Install, search for
node-red-contrib-particle-official
and click on Install.
- Download the code of the project from the GitHub repository: the
Node-RED Project
folder contains theflow.json
file with the flow. - Open the
flow.json
file and copy the full content. - On Node-RED, call the top-right menu Import, and paste the previously copied content of the
flow.json
file.
Now, the Particle nodes need to be configured.
- Go to the Particle Authentication page and create new client by clicking on New Client.
- On the New OAuth Client page, select Two-Legged Auth (Server) and provide a name. Click on Get Client ID and Secret.
- Copy the Client ID and Client Secret and store them in a safe place.
Back to Node-RED, to set the publish node,
- Select the Particle Publish node.
- On the Edit publish node dialogue pane, select Add new Particle-config... in front of Auth then click on the pencil.
- The Add new particle-config config node dialogue pane opens. Paste the previously recorded Client ID
messages-2506
and Client Secret78f64b8887c5ed2ebc5e49b421b9322551c4d59d
. - Confirm by clicking on Add.
- Back to the Edit publish node dialogue pane, set the Event field to the first UUID
9ac6b059-bfa5-4ae2-b1cc-a9b3a797884f
. - Confirm by clicking on Done.
To set the variable node,
- Select the Particle Variable node.
- On the Edit variable node dialogue pane, select
messages-2506
from the drop-down menu for Auth. - Set Variable to
Trace
and Device to the name of the device, heremyPhoton
. - Click on Done to close the dialogue pane.
To set the subscribe node,
- Select the Particle Subscribe node.
- On the Edit subscribe node dialogue pane, select
messages-2506
from the drop-down menu for Auth. - Set the Event to the second UUID
9ac6b059-bfa5-4ae2-b1cc-a9b3a7978850
. - Set Device to the name of the device, here
myPhoton
. - Click on Done to close the dialogue pane.
Finally,
- Click on Deploy to run the dashboard.
- Display the dashboard at http://127.0.0.1:1880/ui
Let see first the e-paper screen in action.
Back to Node-RED, the dashboard offers three panes: Send, Display and Trace.
Send pane
The Send pane includes a form with two lines and other controls.
- The Send button sends the two lines of the form to the remote e-paper display. The first line is mandatory and can't be empty.
- The Cancel button clears the form.
- The Ready dot turns red when the remote e-paper screen is being refreshed and green when it is ready.
- The LED switch turn the blue LED on the remote Particle Photon board on and off.
- The Up button removes the first line from the remote e-paper screen and push all the lines up. This is very useful to remove an old message.
- Finally, the Clear button clears the remote e-paper screen, for example when the screen is not going to be used for a long time.
Check pane
The Check pane retrieves the actual content of the remote e-paper screen and displays it below.
- The Check button launches the operation.
Trace pane
The foldable Trace pane displays the latest message sent or received.
Going furtherPervasive Displays offer a wide range of screens, from 1.54" up to 12.2". Screens larger than 4.20" may require an external memory like SPI SRAM for the frame-buffer. However, the same Pervasive Displays e-Paper EPD Extension Kit Gen 3 drives them all.
Also related to memory, a non-volatile memory keeps a copy of the messages in case of an accidental power-cycling. The FRAM technology combines the speed of SRAM with the persistence of Flash, and provides an interesting option.
The Particle solutions offers interesting options like fleet management for multiple remote screens and low-power mode for battery operation. Similarly, the Particle Console or even the Particule Cloud API with webhooks allow to operate the remote screen without the need of Node-RED.
The WiFi radio is power-hungry and obliterates the low-power capabilities of the e-paper screen. So changing for a radio like Bluetooth or sub-1 GHz would enable a year-long autonomy with standard batteries.
Here is an example of a more advanced version. It includes different options mentioned earlier, like:
- a larger screen,
- external SRAM for the frame-buffer,
- persistent FRAM to keep the messages,
- low-power radio for battery operation.
The nice case fits perfectly in the living room!
Comments