Skip to content

DFRobot/SportsButtonESP32C3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 

Repository files navigation

DIY Sports Push Buttons - Based on ESP32-C3

image

Push buttons, also known as tactile switches, can be found everywhere from simple lamps, doorbells to large industrial machines. There are so many kinds of push buttons, but I like the arcade push buttons most because they usually have a great tactile, "clicky” feel. I had several arcade buttons in my toolbox, and I always want to make something with them. Lately, I've been working out. One day an idea comes to my mind, can I turn my arcade buttons into a device that helps me do sports? Sounds not bad. I decided to give it a try. I am going to make 4 sports push buttons, one as a master node with a screen that supports a menu display and the other three as salve nodes. They are all based on ESP32-C3, a micro Beetle controller from DFRobot. It integrates a battery charging management function, which allows us to connect a lithium battery to it as a mobile power supply for the project, or charge the battery from the controller's USB-C port when the battery is low. Also, to make them more interactive, I will add some sound and lighting to the push buttons.

This is what it looks like in the end. image

The relevant information is uploaded on our YouTube channel

HARDWARE LIST

  • 4x ESP32-C3
  • OLED Display
  • 4x Digital Buzzer
  • WS2812 RGB LED strip
  • 4x 3.7V battery
  • 4x Arcade Push Button
  • 4x Power switch
  • 4x Case

Connection

The master node comes with a screen while the slave nodes do not. All parts should be connected as the diagram below.

  • Buzzer -> Controller’s P6
  • Button -> Controller’s P5
  • WS2812 -> Controller’s P0
  • Screen->I2C image

Upload Program

Since the master node communicates with the slave nodes by ESP-NOW in this project, the only MAC address of each ESP32-C3 should be obtained so that the master knows which device the message is intended for. image

Revise the MAC address to yours and upload the program. image

Start to Play

In the program, I set three modes for the buttons. Short press to select mode, press and hold for 2 seconds to confirm or enter the selection menu. image

Mode 1- Whac-A-Mole

In this mode, all 4 buttons show green light at first, then one of them changes to red randomly, and we need to hit the red one within a certain time to score. They can be played in various ways.

image image image image

Mode 2- Relay Race Mode

In this mode, hit the first button, then the second will light up green. Just like a relay race, the green light acts like a baton, which will be transferred one by one among four members repeatedly. image

Mode 3- Random Picker Mode

When entering this mode, 4 buttons repeatedly show blue light in order, hit the main button(button with screen), and this time the button whose light turns on in blue will be the picked one.

Or you can only use one button to test how high you can jump.

image

ESP-NOW delay test:

In the project, the master communicates with the salves by ESP-NOW. To ensure that the NOW protocol meets the communication requirement, here I completed a simple ESP-NOW delay test to record the time one node transmits a message to another and receives a replay. It can be seen that the total delay for transmitting and receiving is about 4ms, which means only a 2ms delay for one-direction transmission, equaling to 1/100s.

image

Thank

Well, that's all for this project. There are so many possibilities for these sports push buttons. Come and try your sports buttons! Thanks for reading, feel free to leave your comments if you have any other good ideas!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages