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.
  • Not all firmware may output data the same way. For example, Shelby Merricks' ESPixelStick uses the GPIO-2 pin while Bill Porter's version of the same firmware uses the TX pin. You should not simultaneously connect more than one pin to your controller's input; choose one or the other or create a method that allows choosing the pin you need.
  • 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
  • The ESP's data output is 3.3v TTL. This may or may not be adequate to drive the controller's input circuitry to a degree that minimizes communication errors. Therefore, a voltage level shifter may be required for error-free operation if the controller requires a 5vdc input signal. 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.
  • It should go without saying that the data output of the firmware flashed into the ESP module must be compatible with the firmware that the controller uses. For example, if the controller is a DMX unit, be sure to configure the ESP module so that its output is DMX. For Renard controllers, be sure that the baud rate for the ESP module matches the baud rate of the PICs in the Renard 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