Converting a controller to use an ESP Module

From diychristmas.org wiki
Jump to navigation Jump to search

This is generally not difficult to do although there are some critically important considerations to be made.

  • Powering the ESP module adequately is vital to success. If you are tapping the controller's power circuitry for power, remember that the ESP by itself can require upwards of 300ma of current just to start up and connect to an access point. Also remember that the ESP module requires 3.3vdc power; it will likely not survive 5vdc for even a moment or two.
  • Different ESP firmware packages may use different default GPIO pins for serial or pixel data output. Verify the default output pin for the firmware version and hardware platform you are using before making connections. Many current firmware versions allow the output pin to be configured, while some earlier versions used fixed GPIO assignments.
  • It is necessary to connect the ESP's ground connection to the controller's ground for any data connection to be successful. Below is the default pinout of the popular ESP-01 module:
Esp01 pinout.png
While the ESP-01 remains a popular module for compact serial interface applications, many newer projects use ESP8266 or ESP32 development boards that provide additional GPIO pins, integrated USB programming, and larger flash memory.
  • ::The ESP's data output is 3.3V TTL. Most modern pixel controllers and many legacy controllers accept a 3.3V logic signal directly. However, some controllers, long cable runs, or electrically noisy environments may require a 3.3V-to-5V level shifter for reliable communication. Note that in practice, users have found that most controllers can generally accept the 3.3vdc signal, but YMMV (your mileage may vary...) You may have the best luck connecting the output directly to the input pin of your controller's CPU. Determining which pins to use can be done by analyzing data input circuit of your controller either via electronic schematic (if available) or close examination of the PCB itself. For example, if it uses an RS-485 chip to decode a serial or DMX signal from the computer, the RS-485 chip probably reassembles the signal into a single output that goes directly to the CPU. Check the pinouts of both the CPU and the data chip your controller uses for assistance, or use a magnifying glass to follow the circuit tracing from the chip to the CPU. You can also use a DVM to find the line of continuity between the two but you should remove both from the controller both before testing lest the DVM's voltage or polarity damage either chip. ::IMPORTANT: If you use a DVM, don't just poke around and try things -- especially if the controller is powered up. Do some research first on the various chips used and make an educated choice.
  • The ESP module includes an on-chip antenna beneath which there is no circuitry. For best reception and to minimize noise (which can hamper your wireless connection to the access point) position the antenna area at least an inch or two away from any other electronics on the controller and especially away from anywhere where high powered circuitry is in use. Also understand that some experimentation may be necessary as the elevation and orientation of the antenna to the access point's antenna can also be significant factors for successful communications.
  • The protocol selected in the ESP firmware must be compatible with the controller it is driving. Depending on the firmware and controller, this may include Renard, DMX, pixel data (WS2811-compatible), or other supported protocols. Verify that communication settings such as baud rate, protocol selection, and output format match the controller's requirements.
Many modern ESP firmware packages also support network protocols such as E1.31 (sACN) and Distributed Display Protocol (DDP). These protocols are typically received over the network and then converted by the ESP into the appropriate local output for the connected controller.
  • Addressing: The ESP firmware may or may not have the capability to include an "address" such as might be used for a universe number and/or "start channel." Be certain that the configuration of the ESP firmware is compatible with the controller's own settings. For example, if the controller has on-board DIP switch settings for a universe ID, make sure the ESP firmware is configured to work with it. As a general rule, it's probably the best idea to use either the controller or the ESP firmware for setting such addresses and start channels instead of using both.
  • Below is an example of the basic data connection for Shelby Merrick's ESPixelStick firmware (using GPIO-2) and the PIC16F688 chip, or most any chip that is a drop-in replacement for the PIC16F688. The drawing does not include the ESP's 3.3v power connection circuit, which you would need to supply.
Basic connection.png