A web-based servo controller for the Raspberry Pi Pico (RP2350) with Ethernet connectivity using the CH9120 Ethernet module. https://www.waveshare.com/wiki/RP2350-ETH https://www.amazon.com/dp/B0C3R86WFB?ref=ppx_yo2ov_dt_b_fed_asin_title
This project implements a web server on the RP2350 microcontroller that allows remote control of up to three servos (tilt, zoom, and focus) through a simple web interface. The system uses the CH9120 Ethernet module to provide network connectivity.
- Raspberry Pi Pico (RP2350)
- CH9120 Ethernet Module
- 3 Servo Motors
- Power supply for servos
- Jumper wires
- TX: GPIO20
- RX: GPIO21
- CFG: GPIO18
- RST: GPIO19
- Tilt Servo: GPIO2
- Zoom Servo: GPIO3
- Focus Servo: GPIO4 -- Yaw Servo (external): GPIO5
- Web-based control interface
- Real-time servo position adjustment
- Persistent storage of servo positions
- Support for three independent servos
- Simple HTTP API for integration
The web interface provides sliders for each servo with the following features:
- Range: 1000-2000 μs
- Real-time position updates
- Numeric input option
- Automatic position saving
GET /- Serves the web interfaceGET /set?{servo}={value}- Sets servo position- Parameters:
servo: tilt, zoom, or focusvalue: position in microseconds (1000-2000)
- Parameters:
- Connect USB-C cable from computer to module
- Push and hold boot and reset buttons, then release reset, then release boot. A file volume will appear on your OS.
- Drag and drop rp2-pico-20230209-unstable-v1.19.1.uf2 to the drive that shows up. The board will restart and the file volume disconnect.
- Install mpremote: pip install mpremote
Make sure to setup device with RPI_PICO-20250415-v1.25.0
- Flash the RP2350 with the provided firmware: mpremote cp main.py :main.py and mpremote cp ch9120.py :ch9120.py
- Connect the servos according to the pin connections
- Power on the system - if debugging, run main.py with mpremote run main.py (otherwise main.py runs on boot)
- Access the web interface at http://192.168.2.42
- MicroPython for RP2350
- CH9120 Ethernet module driver
This project is open source and available under the MIT License.
Contributions are welcome! Please feel free to submit a Pull Request.
