+21622886281
App Inventor ESP32 Keypad 4x4

Send message from 4×4 keypad with ESP32 to smartphone via bluetooth

The ESP32 is a powerful, low-cost microcontroller that includes built-in Bluetooth capabilities. This makes it well-suited for use in projects that involve wireless communication, such as a project that connects to a smartphone over Bluetooth.

To create a project that connects to a smartphone over Bluetooth using the ESP32, you will need to do the following:

  1. Write code for the ESP32 that configures it as a Bluetooth peripheral and advertises itself to nearby devices.
  2. Write code for the smartphone that scans for nearby Bluetooth devices and connects to the ESP32.
  3. Once connected, the smartphone can send and receive data with the ESP32, allowing you to control or receive data from the ESP32 via the smartphone.

There are several libraries available for the ESP32 that make it easy to configure and control its Bluetooth capabilities, such as Espressif’s ESP32 BLE Python library. These libraries provide APIs for configuring the ESP32 as a Bluetooth peripheral, advertising itself, and managing connections with nearby devices.

Purpose of tutorial:

In this tutorial we will see how to send a message from the ESP32 card to the smarthpone via bluetooth using the matrix keypad. This is why we will create two programs: a mobile application with App Inventor for the smartphone and a program for the ESP32 card.

Keypad operation and ESP32:

Necessary components

ESP32 Card

An ESP32 card is a development board or module that is based on the ESP32 microcontroller developed by Espressif. It typically includes the ESP32 chip, as well as a number of peripheral components, such as RAM, flash memory, power management, and input/output (I/O) pins. ESP32 cards can come in a variety of form factors, including the ESP32-DevKitC, ESP32-WROVER, ESP32-PICO-D4 and more.

ESP32 card can be programmed using various programming languages such as C, C++, Python and MicroPython. The ESP32 has a built-in support for the Arduino IDE which makes it easy to program and debug.

4×4 keypad

A 4×4 keypad is a type of input device that consists of a grid of 4 rows and 4 columns of buttons. It is often used as a simple, low-cost way to add numerical input to a project, such as an access control system or calculator.

The buttons on the keypad are typically labeled with the digits 0-9, as well as a few additional characters such as * and #. Each button is connected to a pin on the keypad’s circuit board, and the pins are connected to a microcontroller or other electronic device.

connecting wires

Wires are used to transmit electrical signals and power to various components such as motors, sensors, and microcontrollers. It’s important to properly route and secure the wires to prevent tangles and damage. There are several methods for doing this, including using cable ties, clamps, and wire looms. It’s also a good idea to use different colors or labeling to identify the different wires and their functions. When connecting wires in a robot, it’s important to follow proper safety procedures, such as using the correct wire stripper and connectors, and wearing protective equipment such as gloves and safety glasses.

test plate

A test plate is a type of device used in robotics to test the functionality and performance of various components or systems. It is typically a physical platform or structure that is designed to hold and support various test items or devices, such as sensors, actuators, motors, or other types of mechanical or electrical components. Test plates can be used to simulate different environments or conditions, such as temperature, humidity, vibration, or other factors, in order to evaluate the performance of the components or systems being tested. They can also be used to perform a variety of diagnostic or diagnostic tests, such as stress testing, endurance testing, or other types of evaluations.

Assemby:

We connect the 8 outputs of the keyboard to the 8 pins of the ESP32 card following this order: D2, D4, D5, D18, D19, D16, D15 and D23.

Micropython program

Here are the programs that connect the ESP32 board to the smartphone and send a message by bluetooth using the 4×4 matrix keypad.

boot.py

esp_ble_uart.py

Creating the application with App Inventor:

We will create a mobile application named ‘esp32_clavier’ with App Inventor which allows to receive a message from the ESP32 card.

We therefore suggest that you create the design of the application, with the following visual:

Programming with App Inventor

To program the application, App Inventor offers us to use the Blocks space which allows you to create a program in the form of a block diagram. Very easy to use but requires some programming logic.

Here is the program of the application made in the Blocks space of the App Inventor:




1 commentaire

nylto.org 06-08-2323

It's a pity you don't have a donate button! I'd without a doubt donate to this outstanding blog! I suppose for now i'll settle for bookmarking and adding your RSS feed to my Google account. I look forward to fresh updates and will share this website with my Facebook group. Chat soon!


Leave a comment

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Scroll to Top