I whipped up a little connection diagram of my wifi energy meter. In addition to the first design i did add some led indicators and some buttons. Experienced engineers and critical readers wil spot some flaws in this design. The MAX485 RS485 to serial converter is a board with 5v logic levels. This normaly would make it incompatible with the ESP32 and its 3.3v logic levels.
As this project is ment to be a quick and one time build to do some one time measurementsi don’t think this wil be a issue.
Espressif CEO, Teo Swee Ann stated in a facebook message that the ESP32 is 5V “tolerant” . The build in snapper diodes would protect the module if 5V levels are connected to any input.
I used several ESP32 modules with 5V logic modules to do some quick tests without any problems. One of these modules is functioning as a fan controller for several years. My energy meter wil be a one time object ment to study and learn the ESP32 and not a production model.The individual parts of this setup are tested and work fine under the ESP32 Arduino SDK.
Another hack is using the first WS2812 LED as a level shifter. This was a quick way to get the 2 serial leds going.
If you want to know more about this hack you should read the article at https://hackaday.com
If your intend is to build something for production you should add the appropriate level converters.
The picture below shows the same setup as a more traditional Eagle schematic.