Button-bolt-on: Difference between revisions

No edit summary
 
Line 1: Line 1:
==Introduction==
==Introduction==
<br>
<br>
[[File:Button Bolt-on white background.jpg|700px]]
[[File:Button Bolt-on white background.jpg|600px]]


The Button Bolt-on for the ESP32-X2 development board features a TS-1002S-04326C tactile switch and WS2812B 2020 RGB LEDs. The TS-1002S-04326C is a compact, low-profile push button from XUNPU, designed for reliable on/off operation in space-constrained applications. Its 6x6 mm size and 4.3 mm actuator height make it easy to use while minimizing accidental activations. This switch is widely used in consumer electronics and industrial control panels.The WS2812B 2020 RGB LED, known for its minimal 2x2 mm size, offers individually addressable lighting with vibrant colors, operated with a 5V power supply. It is perfect for space-sensitive applications like wearables and mobile devices.Each tactile switch on the Button Bolt-on board is paired with two WS2812B 2020 RGB LEDs, providing a total of four switches and eight LEDs. This combination enhances the interactivity and visual feedback for user inputs.
The Button Bolt-On is a modular accessory designed to enhance the functionality of the ESP32-CAN-X2 development board. It integrates tactile push buttons and RGB LEDs for intuitive user interaction and feedback.


==Features==
==Key Features==
Following are the features of 2 main components TS-1002S-04326C and WS2812 (2020 package) that are used in the Button bolt-on board.<be>
Following are the features of 2 main components TS-1002S-04326C and WS2812 (2020 package) that are used in the Button bolt-on board.


'''TS-1002S-04326C (Tactile Switch):'''<br>
* Four tactile switches with a 6x6 mm footprint and 4.3 mm actuator height, offering reliable operation and minimal accidental presses.
* Compact design with 6x6 mm square footprint
* Eight WS2812B 2020 RGB LEDs are strategically positioned around the buttons to provide clear visual feedback for user actions or system states.
* Actuator height of 4.3 mm for easy pressing
* Rated for reliable on/off tactile feedback in electronic circuits
* Mechanical lifespan suitable for frequent-use applications
* SPST (Single Pole, Single Throw) contact configuration
* Compatible with through-hole mounting for secure placement on PCBs
* Ideal for consumer electronics, control panels, and portable devices<br>


==Primary Purpose==


'''WS2812 (2020 package):'''<br>
* Facilitates CAN-based messaging and local device control.
* Ultra-compact 2x2 mm package for space-sensitive applications
* Enhances user experience with interactive lighting and button functions.
* Individually addressable RGB LED with built-in driver IC
* 800 kHz data transmission rate for seamless color control
* 24-bit color depth (8-bit per channel), supporting 16 million colors
* Operates on a 5V power supply
* Single-wire data communication protocol, simplifying wiring
* Daisy-chainable for easy multi-LED control with a single data line
* High brightness and adjustable color intensity for vivid lighting effects
* Low power consumption with idle current < 1 mA per LED
* Suitable for wearables, mobile devices, and compact LED matrices


==Getting Started==
===Components===
[[File:Button Bolt-on getting started.png|700px]]
[[File:Button Bolt-on getting started.png|700px]]


The Assembly of the bolt-on board includes the following components:
==Applications==
* 8x RGB LED WS2812 (2020 Package)
* 4x Tactile Switch TS-1002S-04326C
* Printed Circuit Board with LED and tactile switch


===Hardware Connection===
Button bolt-on consists of just a button and an LED so it makes user input functionality simple and efficient. Following are some of the real-world scenarios in which button bolt-ons can fit in perfectly.


The assembly requires 2 x 20-pin headers to be soldered onto the PCB, providing the necessary connections.
===Automotive===


These headers are available separately from a variety of sources (male/female) [https://www.amazon.com/s?k=1x20pin+header+2.54+female Amazon] | [https://www.ebay.com/sch/i.html?_nkw=1x20pin+header+2.54+female+straight Ebay]
* Driver selection (e.g., using buttons to identify which driver is using the car).
* Adjust ECU tuning with a press of a button.


==Hardware, Pin Description, Connections==
===Home Automation===


===WS2812 RGB LED Hardware===
* Use buttons to control smart appliances.
* Indicate device states with customizable LED lighting patterns.


The hardware of the WS2812 LED module is as follows:
===Industrial Use Cases===


[[File:WS2812 RGB LED.png|700 px]]
* Trigger remote devices like pumps or fans.
* Use LED signals to display system statuses or warnings


===WS2812 RGB LED Pin Description===
==Getting Started==


Pin Description of the WS2812B LED with 2020 package is as follows:
===Assembly Instructions===
 
[[File:WS2812 RGB LED Pin description (2) (1).png|700 px]]
 
{| class="wikitable"
|+ '''WS2812 RGB LED Pin Description'''
|-
! Symbol !! Description
|-
| DO || Data Output (DOUT): Outputs the control data signal to the next device in the chain. Used for cascading multiple modules or LEDs to create a series connection. Connect to the DI of the next module in a daisy-chain setup.
|-
| GND || Ground: Connect to the ground (0V) of the power supply. Ensures stable operation by providing a common reference point for the circuit.
|-
| DIN || Data Input (DIN): Receives the control data signal from the microcontroller or the previous device in the chain. Used for controlling the LED or module by sending data signals through this input pin.
|-
| VDD || Power Supply: Connect to a 5V DC power source to power the module. Ensure a stable and sufficient power source to support the device’s operation.
|}


===Tactile switch Hardware===
* Solder two 20-pin headers SV1 and SV2 to the Button Bolt-on PCB. These headers are available separately from a variety of sources (male/female) [https://www.amazon.com/s?k=1x20pin+header+2.54+female Amazon] | [https://www.ebay.com/sch/i.html?_nkw=1x20pin+header+2.54+female+straight Ebay]
* Ensure secure connections between the Bolt-on board and ESP32-CAN-X2 as per the following hardware connection


The hardware of the TS-1002S-04326C module is as follows:
===Hardware Connections===


[[File:Tactile Switch hardware.png|700 px]]
The following are the hardware connections for the Button Bolt-On and the respective ESP32 GPIOs from the ESP32-CAN-X2 board


===Tactile switch Pin Description===
[[File:Button bolt-on pinout.png|700 px]]
The pin description of the TS-1002S-04326C can be found in the sheet with the mechanical drawing.
[https://www.lcsc.com/datasheet/lcsc_datasheet_2304140030_XUNPU-TS-1002S-04326C_C455108.pdf TS-1002S-04326C Datasheet]


===Connections===
The Following are the ESP32 GPIOs from the ESP32-CAN-X2 board to be used on the button bolt-on


Connection details of the button bolt-on board are as follows.
{| class="wikitable"
{| class="wikitable"
|+ Button bolt-on Connections
|+  
|-
|-
! SV1 Pins !! ESP32 GPIO !! Purpose
! SV1 Pins !! ESP32 GPIO !! Purpose
Line 102: Line 67:
| 14 || GPIO38 || Connect to Push button S4
| 14 || GPIO38 || Connect to Push button S4
|}
|}
===Required Tools and Materials===
* Button Bolt-On board.
* ESP32-CAN-X2 development board.
* Soldering iron (for assembling headers, if not pre-soldered).
* USB cable Type-C for programming the ESP32.
==Working==
Working of the button bolt-on is simple as mentioned below for both button and LEDs
* Each button can be configured to send unique CAN messages when pressed as well as periodically
* RGB LEDs can provide dynamic feedback based on:
** Button states (e.g., green for "on," red for "off").
** Incoming CAN messages (e.g., flash when a message is received).
** System diagnostics or statuses.
==Project Examples==
===Project 1: Remote Device Toggle===
'''Description:'''Use the Bolt-On to send CAN messages to toggle a remote device.
'''Implementation Steps:'''
* Connect the ESP32-CAN-X2 and button bolt-on on top of each other through the connector SV1 and SV2 in the correct configuration.
* Program the ESP32-CAN-X2 board to send a CAN message with the specific data (e.g., "Turn Light On"). based on the button bolt-on input through the S1, S2, S3, and S4 push buttons.
* Program the ESP32-CAN-X2 to use the RGB LEDs on the button bolt-on to flash green on successful transmission and red on unsuccessful transmission of the CAN messages.
===Project 2: Driver Selection System===
'''Description:''' Configure buttons to assign driver profiles in a vehicle.
'''Implementation Steps:'''
* Connect the ESP32-CAN-X2 and button bolt-on on top of each other through the connector SV1 and SV2 in the correct configuration.
* Map each button to a driver ID (e.g., Driver A = Button 1).
* Use the LEDs to display the selected driver's ID with a specific color pattern.
* Button Status / Driver profiles can be sent periodically or on event bases through CAN bus and remotely so some servers as well.
===Project 3: Status Indicator===
'''Description:''' Display system health or warnings using the RGB LEDs.
'''Implementation Steps:'''
* Connect the ESP32-CAN-X2 and button bolt-on on top of each other through the connector SV1 and SV2 in the correct configuration.
* Program the LEDs to show green for normal, yellow for warning, and red for critical conditions.
* Update LED states based on incoming CAN messages.
* Reset the LED states via buttons as well.


==Demo Code==
==Demo Code==
Access the source code repository through the provided link.
 
The demo code for the button bolt-on can be found in the following GitHub repo in which the button states are periodically sent over the CAN bus as well as when the button is pressed.
[https://github.com/autosportlabs/ESP32-CAN-X2 Demo Code]

Latest revision as of 05:42, 28 November 2024

Introduction


Button Bolt-on white background.jpg

The Button Bolt-On is a modular accessory designed to enhance the functionality of the ESP32-CAN-X2 development board. It integrates tactile push buttons and RGB LEDs for intuitive user interaction and feedback.

Key Features

Following are the features of 2 main components TS-1002S-04326C and WS2812 (2020 package) that are used in the Button bolt-on board.

  • Four tactile switches with a 6x6 mm footprint and 4.3 mm actuator height, offering reliable operation and minimal accidental presses.
  • Eight WS2812B 2020 RGB LEDs are strategically positioned around the buttons to provide clear visual feedback for user actions or system states.

Primary Purpose

  • Facilitates CAN-based messaging and local device control.
  • Enhances user experience with interactive lighting and button functions.

Button Bolt-on getting started.png

Applications

Button bolt-on consists of just a button and an LED so it makes user input functionality simple and efficient. Following are some of the real-world scenarios in which button bolt-ons can fit in perfectly.

Automotive

  • Driver selection (e.g., using buttons to identify which driver is using the car).
  • Adjust ECU tuning with a press of a button.

Home Automation

  • Use buttons to control smart appliances.
  • Indicate device states with customizable LED lighting patterns.

Industrial Use Cases

  • Trigger remote devices like pumps or fans.
  • Use LED signals to display system statuses or warnings

Getting Started

Assembly Instructions

  • Solder two 20-pin headers SV1 and SV2 to the Button Bolt-on PCB. These headers are available separately from a variety of sources (male/female) Amazon | Ebay
  • Ensure secure connections between the Bolt-on board and ESP32-CAN-X2 as per the following hardware connection

Hardware Connections

The following are the hardware connections for the Button Bolt-On and the respective ESP32 GPIOs from the ESP32-CAN-X2 board

Button bolt-on pinout.png

The Following are the ESP32 GPIOs from the ESP32-CAN-X2 board to be used on the button bolt-on

SV1 Pins ESP32 GPIO Purpose
7 GPIO14 Connect to DIN of U1 (WS2812)
8 GPIO21 Connect to Push button S1
9 GPIO47 Connect to Push button S2
10 GPIO48 Connect to Push button S3
14 GPIO38 Connect to Push button S4

Required Tools and Materials

  • Button Bolt-On board.
  • ESP32-CAN-X2 development board.
  • Soldering iron (for assembling headers, if not pre-soldered).
  • USB cable Type-C for programming the ESP32.


Working

Working of the button bolt-on is simple as mentioned below for both button and LEDs

  • Each button can be configured to send unique CAN messages when pressed as well as periodically
  • RGB LEDs can provide dynamic feedback based on:
    • Button states (e.g., green for "on," red for "off").
    • Incoming CAN messages (e.g., flash when a message is received).
    • System diagnostics or statuses.

Project Examples

Project 1: Remote Device Toggle

Description:Use the Bolt-On to send CAN messages to toggle a remote device.

Implementation Steps:

  • Connect the ESP32-CAN-X2 and button bolt-on on top of each other through the connector SV1 and SV2 in the correct configuration.
  • Program the ESP32-CAN-X2 board to send a CAN message with the specific data (e.g., "Turn Light On"). based on the button bolt-on input through the S1, S2, S3, and S4 push buttons.
  • Program the ESP32-CAN-X2 to use the RGB LEDs on the button bolt-on to flash green on successful transmission and red on unsuccessful transmission of the CAN messages.

Project 2: Driver Selection System

Description: Configure buttons to assign driver profiles in a vehicle.

Implementation Steps:

  • Connect the ESP32-CAN-X2 and button bolt-on on top of each other through the connector SV1 and SV2 in the correct configuration.
  • Map each button to a driver ID (e.g., Driver A = Button 1).
  • Use the LEDs to display the selected driver's ID with a specific color pattern.
  • Button Status / Driver profiles can be sent periodically or on event bases through CAN bus and remotely so some servers as well.

Project 3: Status Indicator

Description: Display system health or warnings using the RGB LEDs.

Implementation Steps:

  • Connect the ESP32-CAN-X2 and button bolt-on on top of each other through the connector SV1 and SV2 in the correct configuration.
  • Program the LEDs to show green for normal, yellow for warning, and red for critical conditions.
  • Update LED states based on incoming CAN messages.
  • Reset the LED states via buttons as well.

Demo Code

The demo code for the button bolt-on can be found in the following GitHub repo in which the button states are periodically sent over the CAN bus as well as when the button is pressed. Demo Code