[Release] HubDuino v1.1.9 - Hubitat to Arduino / ESP8266 / ESP32 / ThingShield Integration (ST_Anything)

Yes, this is expected. You can work around this by adding a delimiter character between the two values, and then parsing that string on the microcontroller.

Send something like

“Command Value1:Value2:Value3”

If you look at the source code for the HubDuino/ST_Anything RGBW device, I think you’ll see something similar to this.

OK, Thank you for the idea.

Have others had issues with ESP32's I/O pins going bad? I've had several inputs that just stop working and I have to move that signal to a different I/O pin.

I have not had that issue. If you’d like to share an image of your wiring diagram, I’d be happy to take a look and see if anything stands out as a possible source of this problem.

below is a table .... i'm wondering now if I can fix with an external pull-up .... have you had any issues with internal pull-ups on inputs?

Please make sure ALL the IO signals are 3.3V only. 5V signal, applied to the input will damage this input but maybe not right away.

Internal pull-ups are very weak (50K-100K). If output of the sensor/device is not a true push-pull and requires an external pull-up the recommended pull-up value is 2K-5.1K (If needed, I am always using 1K external pull-up resistor.)

Also, if external wires from the sensors are very long it is better not to connect them directly to the Inputs. ESD may damage an Input but also not immediately. For the Inputs I am ALWAYS using opto-couplers. They are protecting Inputs very well and also doing a voltage translation for the non 3.3V signals.

And if IO is OUTPUT make sure it is not overloaded. It is better not to drive Relays directly from the Output even if current rating is satisfied.

1 Like

Which GPIO pins are failing?

As @vitaliy_kh mentioned, relays need to be wired to only drive the optocoupler found on most relay boards. Driving the actual electromagnet coil for the relay is not advised.

Also, 5v should never be used on the ESP8266/ESP32 series of boards’ GPIO pins. (Also, as mentioned by @vitaliy_kh.)

Nope. I use internal pull-up resistors for all of my digital input contact sensors. I have never had one fail.

GPIO13 for Fit Garage reed door sensor.
Hmm..i will have to check if I'm doing pull-up to 5v vs 3.3v
I initially started with just internal pullups and had several fail ..then resorted to external
The relays I think are safe ....its been just the inputs (that go to switches that could be 50' away) and the other side to ground

It started out nice and clean

and went from bad to worse

I am redoing from scratch to hopefully clean up ...good to know the recommended pullup values!

You are 100% asking for trouble if 50' wire(s) are connected directly to the CPU Inputs. These Inputs are not ESD-protected and sooner or later ESD will kill the Input. My STRONG suggestion - please use an Optocouplers. They will take care of every potential problem.

Also, these base-board wires you are using are another source for the very unreliable behavior. The contacts are very bad right away and very high resistive. Over time they will oxidate, making everything even worse. You do need solid soldering!

Just in case here is a schematic example:

PS.
All these advices coming from EE with ~50 years of experience.

Here is the proper way to wire up a relay board. Note that the jumper is removed for the coil power, so the microcontroller's GPIO output pins are not forced to supply that current.

Note: Most of these relay boards are designed for 5VDC power. I supply that 5VDC from the same power supply that I power my ESP32 with. Fortunately, the opto-isolators that are used to energize the coils work well with 3.3VDC signaling from the GPIO pins on the ESP32. YMMV, of course, as not every relay board I have tried worked well with 3.3VDC signals.

As for the distance question... My main motivation for creating ST_Anything back in 2014 was to utilize the existing alarm system pre-wiring that was sitting unused in my house. I have 6 traditional reed switch contact sensors on various doors in my house, with cable lengths anywhere from 20' to 60'. I have never had any issues whatsoever using those contact sensors tied directly to their respective GPIO pins and GND on the microcontroller. I have used an Arduino UNO R3, Arduino MEGA 2560, and currently a genuine Espressif ESP32 for this particular application. Hardware failures were never a motivating factor for the upgrades. I guess I have just been pretty lucky over the past 12 years that I have not needed any optical isolation for these inputs, nor have I required any external pullup resistors. The ESP32's internal pullup resistors are about 45kOhm - which means we're only pulling about 73uA of current when the contact sensors are closed (which is most of the time.) My contact sensor wiring is solid-core copper, probably 22 or 24 gauge. The voltage drop for a 50' round trip through the contact sensor (100' total) is about 1mV. Thus, the ESP32 has no issue whatsoever in detecting the change in state when the reed switch is opened/closed.

I agree with @vitaliy_kh that using a breadboard is not going to be extremely reliable in the long run. Having said that, my little HubDuino system does still make use of a breadboard and jumper wiring for a few signals. I have had to replace a wire or two over the years, or move them to a different breadboard hole, to regain reliable performance of my two relays used for our pair of garage doors. I know I should eliminate the breadboard, and replace it with a more permanent solution, but I guess I am just a little lazy. :wink:

I am using a pretty nice ESP32 breakout board for most of the wiring, which uses screw down terminals for nice, reliable connections.

Here is the one I am using - PLEASE NOTE: These breakout boards are very specific to the ESP32 module model number.

https://www.amazon.com/dp/B087P9KGF1
image

1 Like

Yes, you are very lucky. Electrically this setup is extremely unstable by every means. But occasionally Murphy Law also may fail... Good for you.

1 Like