An ESP32-S3 ball counter controlled over WebSerial from a browser. Reads four beam-break sensors, drives a WS2812B LED strip, and controls two motors via the Alfredo NoU3.
| Component | Detail |
|---|---|
| Microcontroller | ESP32-S3 with Alfredo NoU3 |
| Beam-break sensors | Pins 4, 5, 6, 7 (INPUT_PULLUP) |
| LED strip | WS2812B on pin 8, GRB order |
| Motors | NoU3 motor ports 1 and 2 |
Install both libraries through the Arduino Library Manager:
- FastLED by Daniel Garcia
- Alfredo_NoU3 by Alfredo Systems
- Open
FlexHub/FlexHub.inoin the Arduino IDE. - Set
LED_COUNTat the top of the file to match your strip length. - Select board: ESP32S3 Dev Module (or your specific NoU3 board variant).
- Flash. The device will appear as FlexHub on the USB serial port.
Open index.html in Chrome or Edge (WebSerial is not supported in Firefox).
- Click Connect and select the FlexHub port.
- Use the LED and motor buttons to control the hardware.
- The ball count increments automatically each time a sensor fires and can be reset at any time — the count is stored in the browser, not on the ESP32.
| Mode | Behavior |
|---|---|
| Red / Blue / Green / Purple | Solid color |
| Chase Red | Solid red with a white comet running over it |
| Chase Blue | Solid blue with a white comet running over it |
| Pulse Red | Heartbeat pulse in red |
| Pulse Blue | Heartbeat pulse in blue |
| Off | All LEDs off |
All messages are newline-terminated ASCII over USB Serial at 115200 baud.
Browser → ESP32
CMD:LED:OFF
CMD:LED:RED
CMD:LED:BLUE
CMD:LED:GREEN
CMD:LED:PURPLE
CMD:LED:CHASE_RED
CMD:LED:CHASE_BLUE
CMD:LED:PULSE_RED
CMD:LED:PULSE_BLUE
CMD:MOTOR:ON
CMD:MOTOR:OFF
ESP32 → Browser
EVT:BALL # sent once per beam-break falling edge