+ Post New Thread
Results 1 to 9 of 9
  1. #1
    Full Member level 3
    Points: 2,738, Level: 12
    Achievements:
    7 years registered

    Join Date
    Jul 2009
    Location
    Portugal
    Posts
    165
    Helped
    10 / 10
    Points
    2,738
    Level
    12

    Measuring current with ESP32 and Seeed board

    Hello!

    I have a project where I have to reads the current of a compressor. It has a nominal current of 4,5A and the maximum of the board is 5A:
    https://www.seeedstudio.com/Grove-El...sor-p-777.html

    My doubt is when the compressor kicks in, the inrush current can burn the input of the ESP32?

    Is there a way to prevent it?

    •   AltAdvertisement

        
       

  2. #2
    Advanced Member level 5
    Points: 24,267, Level: 37
    barry's Avatar
    Join Date
    Mar 2005
    Location
    California, USA
    Posts
    4,655
    Helped
    1031 / 1031
    Points
    24,267
    Level
    37

    Re: Measuring current with ESP32 and Seeed board

    It says right there : maximum current, 5 amps. What’s your question?

    If you exceed the PLAINLY STATED manufacturer’s spec, you’re on your own. Maybe it will be ok, maybe it won’t. You don’t even state your inrush; 5.1 A? 1000 A? 1 microsecond? 100 ms?



  3. #3
    Full Member level 3
    Points: 2,738, Level: 12
    Achievements:
    7 years registered

    Join Date
    Jul 2009
    Location
    Portugal
    Posts
    165
    Helped
    10 / 10
    Points
    2,738
    Level
    12

    Re: Measuring current with ESP32 and Seeed board

    Sorry, perhaps I was misinterpreted! I was referring that the inrush current will induce a voltage greater than 3,3V at the input of the ESP32. I’m afraid of burning the microcontroller.
    I know that it is rated for 5A as nominal current, and I will have a current greater than 5A on the current transformer, but it will be for 100ms, in theory, because it is a 3-phases compressor. So, I will have a voltage greater than 3,3V (7x greater) in the input of the ESP32.



    •   AltAdvertisement

        
       

  4. #4
    Advanced Member level 5
    Points: 24,267, Level: 37
    barry's Avatar
    Join Date
    Mar 2005
    Location
    California, USA
    Posts
    4,655
    Helped
    1031 / 1031
    Points
    24,267
    Level
    37

    Re: Measuring current with ESP32 and Seeed board

    Your attachment tells us nothing, other than the physical dimensions of the transformer and that there are a 330 and 470 ohm resistors on the secondary. What's the current transfer ratio?

    If what you say is true, that you'll have 23 volts on the input of your ESP32, I'd be VERY concerned.



    •   AltAdvertisement

        
       

  5. #5
    Full Member level 3
    Points: 2,738, Level: 12
    Achievements:
    7 years registered

    Join Date
    Jul 2009
    Location
    Portugal
    Posts
    165
    Helped
    10 / 10
    Points
    2,738
    Level
    12

    Re: Measuring current with ESP32 and Seeed board

    Yes, I'm concern. But at the moment I cannot know the voltage spike that will occur. Perhaps a zener+resitor in parallel will avoid the voltage go above 3,3V?
    Perhaps, I will change my question to: What I can do to avoid the input going above 3,3V on the ESP32?
    The datasheet that I sent is the one that the seeed has available. I know it uses the TA12-200 current transformer.



  6. #6
    Advanced Member level 5
    Points: 24,267, Level: 37
    barry's Avatar
    Join Date
    Mar 2005
    Location
    California, USA
    Posts
    4,655
    Helped
    1031 / 1031
    Points
    24,267
    Level
    37

    Re: Measuring current with ESP32 and Seeed board

    Why a resistor in parallel? That will just change the voltage scaling.



  7. #7
    Super Moderator
    Points: 81,409, Level: 69
    Achievements:
    7 years registered
    Awards:
    2nd Helpful Member
    betwixt's Avatar
    Join Date
    Jul 2009
    Location
    Aberdyfi, West Wales, UK
    Posts
    13,346
    Helped
    4456 / 4456
    Points
    81,409
    Level
    69

    Re: Measuring current with ESP32 and Seeed board

    If I understand the original post - the MEASUREMENT is for the load current range up to about 5A but the load may have a brief surge much higher than that and you don't want the surge measurement to exceed that of 5A.
    If I'm right, you have two options:
    1. increase the attenuation so the surge voltage does not exceed 3.3V, which will also decrease the available range in normal operation
    2. arrange the attenuation so it can measure 4.5A at near full scale so you get best accuracy but also clamp the input voltage so it doesn't exceed 3.3V.

    The clamp can be a simple Zener 3.3V diode but beware of it's dynamic resistance allowing too much voltage if the surge pushes too much current through it. I think as a fairly sharp cut-off voltage is needed, an active Zener clamp might be the simplest solution. An NPN transistor with a 2.7V Zener diode between base and collector and a 100K resistor between base and emitter will give a 2.7V +Vbe = 3.3V clamping and a lower dynamic resistance than a Zener alone.

    Brian.
    PLEASE - no friends requests or private emails, I simply don't have time to reply to them all.
    It's better to share your questions and answers on Edaboard so we can all benefit from each others experiences.



    •   AltAdvertisement

        
       

  8. #8
    Full Member level 3
    Points: 2,738, Level: 12
    Achievements:
    7 years registered

    Join Date
    Jul 2009
    Location
    Portugal
    Posts
    165
    Helped
    10 / 10
    Points
    2,738
    Level
    12

    Re: Measuring current with ESP32 and Seeed board

    Taking in consideration the comments I have layout a a circuit. That will give a 3,3V protection of the input? What should be the wattage of each device? And whats the best option of the NPN transistor?



  9. #9
    Super Moderator
    Points: 81,409, Level: 69
    Achievements:
    7 years registered
    Awards:
    2nd Helpful Member
    betwixt's Avatar
    Join Date
    Jul 2009
    Location
    Aberdyfi, West Wales, UK
    Posts
    13,346
    Helped
    4456 / 4456
    Points
    81,409
    Level
    69

    Re: Measuring current with ESP32 and Seeed board

    I think you probably want full scale reading to be 3.3V, not 5V as you will not be able to measure greater than 3.3V anyway. However, a more fundamental problem is the voltage from the transformer is is AC and the ESP32 can't measure below 0V. You should consider converting it to DC first or else raising the zero crossing voltage to 3.3/2 = 1.65V so the peaks fall between 0V and 3.3V and doing an AC analysis from multiple ADC measurements.

    Brian.
    PLEASE - no friends requests or private emails, I simply don't have time to reply to them all.
    It's better to share your questions and answers on Edaboard so we can all benefit from each others experiences.



--[[ ]]--