SwarmDrive is like any other ESP32 development board and can be used as such. The main difference though is that SwarmDrive has an integrated three-phase motor driver (the L6234) with peripheral components such as ESD protection and a buck converter.
So, to get going with the ESP32 (to upload code) you only need to connect it to your PC using a micro USB cable. This will power the board and provide a data connection to it. SwarmDrive uses a Silicon Labs USB controller chip, you need to have the drivers installed for it. There are many resources available for getting a serial connection to an ESP32 board with the CP210x USB controller.
The GPIO connections are available for general use but some of them are located conveniently close to (next to) the motor driver (EN and IN) pins. SwarmDrive comes with jumpers to connect these GPIO’s to the motor driver pins (by default they are installed/connected on delivery). You can also use jumper wires to connect these lines which can be convenient for branching out to an oscilloscope for example.
Also broken out are 4-GND, 2-3.3V, 2-5V and 2 battery pins. These can be used to power other peripheral components like sensors. The three EN (enable) pins of the L6234 are connected to a bridging connector. This can be used to combine all three EN pins as one pin. If your code will enable all phases together (not separate or by PWM) then you can save two GPIO pins by shorting all three EN pins together as one unit controlled by one GPIO for example.
Of course, you will need a BLDC motor of some kind. There are many types of motors, large, small, cheap and expensive. For straightforward experiments you can suffice with a small and cheap gimbal motor (they sell for as low as $10). The three phases are connected to the “motor OUT” connector. The order in which the leads are connected doesn’t matter. You also need to power the motor using the BAT/Power-IN connector. Pay attention to put the leads in with care. The connector needs to grab on to the wires. Sometimes the wire gets under the mechanism and not between the contact plates
When you have connected a battery or power supply, the ESP32 can be powered by this source too. The buck converter will kick-in and regulate the power to 3.3V to feed the ESP32 if it is not connected to USB anymore. So, for field use you can power the board (with ESP32) and motor together from one power source (battery). To monitor the device (when no longer connected through a serial USB connection) you could use Wi-Fi or Bluetooth. For this to work you will need to setup something like this.
Other peripherals you most likely will need are a potentiometer (value doesn’t matter too much as it will be used purely as a voltage divider) and a rotary encoder. Without these you could start with a very simple open-loop setup but soon you will want to move on to more interesting experimentations.
The potentiometer can be connected to one of the SwarmDrive 3.3V and GND pins with the “wiper” connected to the pin used in your code (the default getting started firmware uses pin 34).
The standard getting started firmware assumes the use of the AMS AS5048B rotary encoder. The firmware code includes a simple but convenient class to read angle values. This encoder can be purchased for around $10-$15 at Digikey or Mouser in a board/adapter formfactor kit with accompanying magnet. The SwarmDrive code uses the “B” type, which is the I2C type. Of course, you can also use other encoders if you write your own interfacing.
The magnet should be attached to the motor shaft somehow and the AS5048 chip should be mounted close to it. It would be nice to have a 3D printer at hand for this.
To connect the AS5048B to SwarmDrive you should connect both, the 5V and 3.3V connections to 3.3V on the SwarmDrive board. When using the standard firmware code, SDA and SCL should be connected to GPIO 32 and 33. For the standard I2C address A1 and A2 (together with GND) should be connected to GND on the SwarmDrive board.
For the simplest first test, even if you don’t have an environment like PlatformIO running yet, you could just load a simple Arduino sketch. For this you should install the Arduino IDE and install the ESP32 board manager. There are many resources available for guidance.