Display LCD controlado pela Web – (Parte 9/12)

Web Controlled LCD Display – (Part 9/12)

This tutorial meets the requirement of sending messages to the display from a web application. We learned how to create a web server using python using the Flask framework in the previous article. The LCD interface with the Raspberry Pi is well discussed on the AdaFruit website. Here is a simple but interesting example of how to create a new web application that will interact with the Raspberry Pi and display the characters provided by the web application on the LCD interfaced with it.

Tela LCD controlada pela Web usando protótipo Raspberry Pi

Web Application Based LCD Display Using Raspberry Pi

Prerequisites and equipment:

You will need the following:

  1. A Raspberry Pi Model B or higher.

  2. A USB WiFi adapter (Edimax – 802.11b/g/n wireless nano USB adapter is used here).

  3. An SD card updated with the Raspbian operating system (here's a guide if you need it)

  4. Access to Raspberry via keyboard and monitor or remotely.

Creating web server:

We will make a simple web application with a frame that allows the client to send a message to the Raspberry Pi using Flask in a web browser. This will allow us to control the Raspberry Pi from a PC, tablet or smartphone. At the time of submitting the form, it will send the message to the LCD through the Raspberry Pi's GPIO ports. All code, including the web application, is in Python and HTML.

Creating webpage:

Here we will be using the AdaFruit_CharLCD.py library modified according to our connections in the circuit, so make sure you have everything working as per the AdaFruit tutorial, except the connections. Therefore, we have to configure the folder structure we need.

Create a web_lcd folder in your home directory:

Criando a pasta web_lcd no diretório inicial semelhante ao AdaFruit

Fig. 2: Creating Web_lcd folder in home directory similar to AdaFruit

And create two folders and a python script file called lcd.py in the web_lcd directory.

Download the project files here and transfer them to the Raspberry Pi using the file server discussed in the previous tutorial.

Change the IP address for your Raspberry Pi. (Raspberry Pi IP address can be known by ifconfig command.

Altere o endereço IP do Raspberry Pi

Fig. 3: Change the Raspberry Pi IP address

To change the pin numbers, navigate to Adafruit_CharLCD.py and edit the numbers.

Note: In GPIO.setmode (GPIO.BOARD), BOARD means numbers specified by the board.

Alterando o número PIN no Raspberry PI usando Adafruit_CharLCD.py

Fig. 4: Changing PIN number on Raspberry PI using Adafruit_CharLCD.py

Enter the command below after SSH browsing to the Web_lcd folder.

sudo python lcd.py

  Reiniciando o Servidor para Display LCD

Fig. 5: Restarting the server for LCD display

This will start your web server and the characters you type and send will be displayed on the LCD.

Painel de controle web do display LCD no Raspberry Pi

Fig. 6: LCD display web control panel on Raspberrypi

Project source code

###

 //Program to

###

Project source code

###

 //Program to

###

Circuit diagrams

Circuit Diagram-Web Controlled LCD Display

Project video

Conteúdo Relacionado

What is the role of automotive sensors in modern vehicles?
A network of sensors is embedded in every vehicle,...
How to choose an e-bike controller
The motor controller is one of the most important...
How to Troubleshoot Common ESP32-CAM Problems
ESP32-CAM is a compact camera module that combines the...
A guide to USB standards from 1.0 to USB4
A evolução dos padrões USB foi fundamental para moldar...
Schurter aprimora série de seletores de tensão com revestimento prateado
A SCHURTER anuncia um aprimoramento para sua conhecida série...
A interface serial PCI fornece conectividade confiável em ambientes extremos
A Sealevel Systems anuncia o lançamento da Interface Serial...
STMicroelectronics expande portfólio de conversão de energia com diodos Trench Schottky de 100 V
A STMicroelectronics introduziu Diodos retificadores Schottky de trincheira de...
O que são Sistemas Globais de Navegação por Satélite (GNSS) e como são usados?
Determinar uma localização precisa é necessário em várias indústrias...
O conversor GaN de 50 W da STMicroelectronics permite projetos de energia de alta eficiência
O novo VIPerGaN50 da STMicroelectronics simplifica a construção de...
Samsung e Red Hat farão parceria em software de memória de próxima geração
A Samsung Electronics, fornecedora de tecnologia de memória avançada,...
Primeiro MPU single-core com interface de câmera MIPI CSI-2 e áudio
O mercado embarcado tem uma necessidade de soluções de...
Understanding Support Insulators in Electrical Systems
You probably have a support insulator if you've noticed...
Explore Stay Insulator – safety, installation and maintenance
You've probably seen stand an insulator sit on power...
More safety and efficiency with the shackle isolator
You've probably seen shackle insulators enthroned on electricity poles,...
Discover the power of latching relays for energy efficiency and more
You have probably experienced situations where controlling a circuit...
Capacitando Tecnologia: Um Guia para Relés Eletromagnéticos
Você pode não pensar nisso com frequência, mas relés...
Back to blog

Leave a comment

Please note, comments need to be approved before they are published.