Software for an ESP32-driven, Internet-connected pet treat dispenser.
This software is very barebones. It exposes a minimal REST API to configure and interact with it, and not much else. The core components are:
- Camera. Get a snapshot or MJPG stream of the camera.
- Audio. Using ESP8266Audio and the onboard ESP32 DAC, play an MP3 audio file.
- Motor. Control a stepper motor to dispense treats.
- Settings. Configure the device.
Inspect and update settings.
- Get a JSON blob of settings:
- Patch settings blob:
Get images from the camera.
- Get a snapshot from the camera:
- Get an MJPG stream from the camera:
Manage audio files that are stored on flash.
- Get a list of audio files:
- Upload a new audio file:
- Get the contents of a particular file:
- Delete a particular file:
Play audio files
- Play an audio file:
Control the motor
- Send a command to the motor controller:
Retrieve system information
- Get system informat:
Default Pin Mappings
There's a really sloppy Fritzing diagram checked into the project. Otherwise, here are some pin mappings:
The ArduCAM module is hooked up to the default I2S and VSPI bus on the ESP32.
We use the builtin DAC (channel 1) and a Class D amplifier:
|Class D Amp||ESP32|
|Class D Amp||Speaker|
|VMOT||N/A||Connect to 12v w/ inline 100 uF capacitor|
|~RST||Vin||This and ~SLP should be tied HIGH.|
Bipolar motors have two positive/negative pairs. You can find them by connecting two arbitrary wires and checking if you can turn the motor shaft with your hand. If you can't, or if there's a lot of resistance, you've got a pair. If not, pair it with one of the other wires.
Connect one pair to 1A and 1B, and the other to 2A and 2B on the A4988.