Hacker News new | ask | show | jobs
by jvm___ 1226 days ago
I want to build a game with - a wireless led (a 5-light length of a led strip would work) - a camera or other module to tell what color ball is in front of it

And a controller to change multiple of the wireless LED lights based on different cameras...

Is ESP32 suitable?

2 comments

Esp32-cam has 4 available gpio pins (there are 2 more pins but one is used by SD card and one is connected to built-in flash) plus 2 uart pins. With narrow angle camera it costs around $6. Wide angle camera costs $4 or so. You need serial port to program it. There are some other limitations you'll only find when you start playing with it like DAC not working when wifi is on. So theoretically you can control 6 LEDs directly. On one 18650 battery it lasts 2 hours.

                  --------------
                 |    SDCARD    |
      5V        -|1           16|- 3V3
      GND       -|2   CAMERA  15|- GPIO_16 (useless, can't be used for anything)
    A GPIO_12   -|3           14|- GPIO_0, connect to GND during programming, used by camera, don't use!
    A GPIO_13   -|4           13|- GND
    A GPIO_15   -|5           12|- 3V3/5V
    A GPIO_14   -|6           11|- UART RX, GPIO_3
    A GPIO_2**  -|7           10|- UART TX, GPIO_1
    A GPIO_4*   -|8            9|- GND (weird, don't use)
                 |         LED  |
                  --------------
- A=analog input 0..4096

- GPIO_4 is connected to FLASH LED, if you want to use as input you need to desolder resistor R13 that goes to base of npn transistor

- GPIO_2 is HS2_DATA0 for SD card, it has 47k pullup

You may want to check out the ESP-EYE module.

https://www.espressif.com/en/products/devkits/esp-eye/overvi...

Any suggestions for remotely switching LEDs on and off within a system that can also read the camera.
You could use addressable RGB LEDs, like the WS2812B. You just need to supply power and a single IO line to control them so you don't need any external hardware like MOSFETs.

The ESP32 can read the camera, recognize objects/colors, and control the LEDs without any external systems.

So we want to build a simple game.

Light up one tube out of 10.

Ball needs to pass through tube.

Once the ball has gone through another tube lights up. Goto step 1...

More can be added to the game, but that's the starting basis.

How would I coordinate the various ESP32? I'd need a raspberry pi, no?

Ah ok I see.

Using ESP32s connected via Wifi and MQTT to a host (Pi or something) would be the easiest way I can think of to coordinate that.

You could also go without a host, by having the ESP with the ball randomly choose another and send the command to it, and connect them all together with ESP-NOW which is direct P2P communication.

I've never bought any hardware before but am a programmer, any shopping list you or anyone could provide would be appreciated. Canada.