Ah, I misread your earlier post. Sounds like that python code was merely a proof of concept before attempting the ESPHome solution, so there’s no need for a refactor. I’m sure someone with more experience in the ESPHome microcontroller world can help optimize that config.
We can definitely simplify things on the hardware side. No need for that proprietary Navien cable or any of the RJ45 adapters either. A properly sized 5-pin molex connector + some jumpers from your local hobby store should do the trick. The tricky part is identifying the exact shape & size of that connector. These types of connectors are typically sold in bulk for pennies apiece. Another task for someone with more experience in this space
Have you considered starting a dedicated thread in the ESPHome category? You’re already most of the way there, just need some tweaking of the existing solution from someone with the right experience.
I have that cable and can take a look if I recognise the connector. I have a few connector kits I use to crimp my own cables so with some luck…
As for yhe rs485 adapter I see it coverts to 5V but that is not ideal for the esp32 as it is 3.3v, and only 5v tolerant. I did a quick search and saw some converters that have an rj45 connector on them or the space to solder one to simplify connection… however if we make our own cable, we can skip the rj45 connectors altogether as you suggested.
I was going to ask how @tsquared was powering his esp32. We are targeting a self-powered solution (i.e.: drawing power from the Navien’s board), even if it needs to be stepped down to 3.3v, yes?
@brystmar - Correct, the Python was certainly my proof of concept!
You make a good point about making a dedicated thread in the ESPHome category. I’ll have to check that out. Not sure if I link back to this, or create a new one?
@brystmar Correct, self powered is the ultimate goal here. I know that on the 5 pin connector @ the Navien board, there are only 4 wires. RS-485 RX/TX and also 12VDC & GND. I’m thinking about powering it from the 12 VDC and using one of these to step the voltage down to power the ESP32 & the RS-485 board.
I have included some pictures of the 5 pin connector if that helps anyone trying to cross reference it.
I have included a picture of my RJ-45 breakout for the pinout. The 4 wires I have labeled here are the only 4 in use. I left the rest hooked up as they were all attached to the ribbon like cable and didn’t see the need to tear it apart.
@aruffell You mention something about a RS-485 converter board with RJ-45 connectors? Would you have a link for this? Also, as it relates to the 5V/3.3V on the current converter board, it seems to be working as the current solution. I am not sure which voltage you are concerned about. Though I haven’t measured it, the secondary side of that board, is directly connected to one of the ESP32 UART’s and it seems to be handling it ok.
@tsquared I would ask a mod to most post x (fill in) down to the last into a new thread in the esphome section.
The GPIO of the esp32 is 3.3V and only 5V tolerant so whole it works it would be better to use a rs485 to 3.3V board. I will look for one and report back. I will also dig into digikey / mouser to see if I can pinpoint that connector. Do you see any numbers or letters marked on the connector?
Apologies in advance, I don’t know how/who to ask to move the topic, and unfortunately created a post in the ESPHome category before I realized that @aruffell posted that this could be moved. Do you just @ a moderator and they should see it?
If it does move, it probably should begin starting with the post below.
Please let me know if I need to do something else.
Thank you all for your help here! Certainly appreciated!
Also, @aruffell Awesome find here! The connector you show certainly looks like the one I have. Do they usually come with any of the internal pins that you would need to connect the wires? Or can you get them with wires attached.
Could you post pinout of that connector? Which one is 12VDC, which are RS485 and ground pins.
I am thinking of using this RS485 base and add this controller to it. It seems that in that case it can directly power controller from 12VDC input of RS485 and looks neat. They also have RS485 in other forms for other controllers, also with 12-24VDC input to power controller.
Connector does not look like JST VH one. Here is the spec for VH connector. Note how bumps are on the outside edge while Navien connector has bumps little closer to the center of connector.
I realize now what you were saying about the 5vdc scenario. I remembered, I purchased this adapter instead. This is actually what is in the circuit now.
@kkopachev - true, not the one. How about the JST XHB?
I can’t find dimensional drawings, but this picture looks really similar. I need to measure the pitch of the actual connector… that would help narrow down the search.
@tsquared - your post about where to clip the thread so it can be moved to your other post that is in the esphome section seems to reference only that other thread. If you can correct that there is a chance @tom_l can fix it for is.
Appreciate the direct links to those controllers! I love how this RS485 controller steps down voltage to 5v for the ESP. Just ordered mine, will arrive in a few weeks.
I’m eyeing these JST XHB connectors on aliexpress. Going with XHB over the XH to ensure a nice secure fit. Can always snip off the latching tab anyway. Likely ordering the 5-pin model in 300mm length, since I’d much rather cut & re-strip than try extending short wires.
Are we handling enough current here that wire gauge matters? Options are 22, 24, and 26awg. Will probably get the 22 since it’s better to err on the side of thicker wire.
Edit to answer my own question about wire gauges and current. This wire gauge chart outlines the maximum amperage for power transmission by gauge:
Gauge
Max Amps
22 awg
920 mA
24 awg
577 mA
26 awg
361 mA
ESP32 needs 5v @ 500mA, so the 26awg could overheat and melt. 24awg should work, but it’s probably best to spend an extra $0.27 on the 22awg. Ordering now
@kkopachev - Nice solution! I was looking at the compatible Atom controllers and the gray one is the one to go with for me as it can operate up to 60C, while the white Atom S3 Lite only reaches 40C. My attic easily exceeds 40C in the summer.
Based on posts above, it appears the Navien can supply 12V, not 5V. How are you powering the Atom? Did you add a 12V to 5V buck converter?
Edit: Never mind, I just noticed the RS485 part does the 12V to 5V