ESP 32 input voltage failing after a few weeks dropping from 3.3v to 2.6v

Hi

looking for a little help i have made a circuit board featuring 4 esp32’s the first three are driving 48 relay’s and work great the last right hand chip is used for digital inputs, doors / motion etc

The below 4 inputs are working great used as door contacts the cable is run in cat 6a and the shield is earthed.

  - platform: gpio
    pin:
      number: GPIO18
      mode: INPUT_PULLUP
      inverted: true
    name: "Input 4"
    device_class: door
  - platform: gpio
    pin:
      number: GPIO26
      mode: INPUT_PULLUP
      inverted: true
    name: "Input 3"
    device_class: door

  - platform: gpio
    pin:
      number: GPIO27
      mode: INPUT_PULLUP
      inverted: false
    name: "Input 2"
    device_class: door
    
  - platform: gpio
    pin:
      number: GPIO25
      mode: INPUT_PULLUP
      inverted: false
    name: "Input 1"
    device_class: door

the next input i’m using and the one thats causing a headache is used for motion. its done via a standard motion sensor with the 240v o/p driving a relay… i have my digital input conncted to the contacts on this relay. When i first installed the circuit board it worked fine but after a few weeks it went faulty and i noted the digital input voltage on the gpio pin had dropped from 3.3v to 2.6v and this caused it to float. Thinking it may have just been this particular gpio pin i moved the motion sensor to a diffrent gpio pin… this then worked but again after a few weeks it failed in the exact same way with the gpio pin dropping to just 2.6v (completely disconnected from the circuit)

The following esp code was used, as you can see it’s identical to the above working door contact code. I don’t believe its a software issue, Note its only # out because of the hardware failure

#  - platform: gpio
#    pin:
#      number: GPIO17
#      mode: INPUT_PULLUP
#      inverted: true
#    name: "Input 8"
#    device_class: motion
#    filters:
#      - delayed_on: 250ms
#  - platform: gpio
#    pin:
#      number: GPIO19
#      mode:
#        input: true
#        pullup: true
#      inverted: true
#    name: "Input 5"
#    filters:
#      - delayed_on: 50ms
#    device_class: motion

Its strange as the door contacts have been working for months with no fault & the only difference between the door and the motion is the motion switching is done via a relay ?

Any suggestions / solutions would be fantastic.

Many thanks

A few questions, but I have to admit this sounds bizarre.

What kind of relay? Dry contacts, opto-coupled or solid-state?

Also, is the relay connected as NC or NO? I would imagine you want an NO circuit, pulled high when the motion sensor is not triggered, so that the internal resistor isn’t actually active (i.e. no current running through it) most of the time.

If you disconnect the motion sensor and only have the relay connected, does this still happen?

Perhaps you can draw us a circuit of only the motion sensor, power inputs, relay and the pin plus ESP?

Hi

Thanks for your reply please find below basic circuit sketch

The 240v signal triggering the relay is going back to my control panel, pictured below… you can see them top right of the panel.

The relay used is as follows

The cable I use from the relay to the esp32 is just single core and it runs a next to a lot of lighting circuits at 240v im wondering if it could be AC pick up and damaging the input pins so perhaps my solution is to run this short cable (within the panel) using a cable with a screen that’s earthed or even a Cat6a

Thanks for your feedback.

I assume the NO contact labelled ESP32 3.3v is actually a GPIO with a pullup enabled?

Otherwise you are shorting the 3.3V supply to ground.

Possibly. You should actually be able to measure this with a multimeter. With the relay contact open what AC voltage do you measure on the GPIO?

A screened cable will reduce capacitively coupled noise (electrostatic) but do little for inductively coupled noise (magnetic).

You could place a 0.1uF 50V MLC capacitor from the GPIO to ground (keep the leads short as possible).

Also switching to the NC relay contact will ensure any noise is shunted to ground except for the brief periods the motion sensor is active. You can invert the logic in the ESP easily enough.

On a possibly related note, I’ve had nothing but trouble with the ESP32 mini clones out of China recently. I switched to these properly designed and provisioned Quinled versions: https://shop.allnetchina.cn/collections/quinled/products/quinled-esp32?variant=39253005762662 They’re not much dearer and are available with our without external antennas. Details here: https://quinled.info/quinled-esp32/

Hi Tom, Thanks for your reply

Sorry it wasn’t labelled very well yes it’s from a gpio pin on the esp32 going to the NO contact

I’ve measured AC pickup and I’m getting 1.5v ac, I think a screened cable should rectify this ?

That’s a good note about the esp32 clones because these are indeed from China / Aliexpress. do you know if the footprint on the ones suggested are the same…. ? I really don’t want to have to remake the boards again.

Thanks

You could try it but as I said:

Parallel conductors will likely have more mutual inductance than capacitance. Use the filter capacitor.

They are 100% compatible with the ESP32 mini, but they do have an extra 3.3V and GND, see: QuinLED-ESP32 Board Details - quinled.info

Many Thanks Tom, I’ve ordered some capacitors and I’ll run some different cable.

Will report back my findings.