5V input concern on M5StickC



  • Thanks on BAT. Why is the grove port 5v I wonder? Seems like a really bad choice in designing this since one ends up connecting a 5V grove device to an 5V intolerant ESP32.



  • @wikistik It is because the grove standard uses 5v power lines but each unit contains a 5v to 3v3 step down power supply where needed.



  • According to the M5Stack schematic, the ESP32 I/O-lines are clamped to 3,3V by Zenerdiodes of the diode array RLSD52A031V.
    Just make sure, that the current from the 5V-line thru the diodes does not exceed the rated continious value.
    As I want to connect several DS18B20 temperature sensors via Grove B port, I will have to connect a 4,7 kohm resistor between 5V-line and data-line (which is connected to GPIO 26 of the ESP32).
    Although I didn't find the continious current rating of the DS18B20, I think it will be ok: I = (5V-3,3V)/4700 ohm = 0,36 mA. P-Diode = 3,3V*0,36mA=1,2mW.!

    ADDENDUM/NOTE: the attached schematic is an extract of the M5STACK schematic and my comments are therefore valid for the M5STACK only. Unfortunately I have not found the Schematic of the M5STICKC and therefore I don't know if there are clamping-Diodes build in.

    0_1560408590015_M5Stack-3.3V-Clamping-Diodes.jpg



  • @wikistik never connect a bare switch to modern devices as they will have trouble reading them. Always use a voltage divider to connect a button. For an example if this, look in the projects forum for the UIFLOW Hand book and you will find the schematics for the button units made by M5Stack reproduced inside.



  • @ajb2k3 If every unit from SEEED steps down power to 3v3 for the return data then there is no problem and I will retract my complaint about giving the stick connector 5V out. I guess I will have test them one by one, which will be kind of fun :). The appeal of the grove connector in a educational setting is that a student can just connect a grove module to the Stick and use it without additional circuitry. So this is the sort of thing I am concerned about getting 5V back from from the grove module on the Stick input:
    https://www.seeedstudio.com/Grove-Button-p-766.html
    https://www.seeedstudio.com/Grove-Slide-Potentiometer-p-1196.htmllink text

    I know how to use a voltage divider when working with the header pins and a bread board setup.

    I am very interested in using bunches of these Sticks in the classroom and want to find all the gotchas now. Current doing battery rundown testing.



  • @wikistik don’t worry about it we learn from asking. What confused me was the esp32 specs say that analogue in is supposed to be between 0&1 volt which has left me head scratching. Grove doesn’t require a 5 v signal only a 5v supply to devices. The system allows for both 5&3v3 device but it’s up to the manufacturers to specify if there device is 5v or not.



  • @ajb2k3 ESP32 ADC takes up to 3.3v. Tips for tuning when reading that full scale be found here: https://www.youtube.com/watch?v=RlKMJknsNpolink text



  • @grelm If you find out anything more about the ability of the M5StickC to handle 5v IO please post it. Once I have a second unit I will probably disassembly one to see if I can identify any protection on the board. Meanwhile I am looking at level shifters but there is nothing on the market that is easy to interface with the grove connector. May have to resort to making up something inline that uses only 5v to power both the high and low side (with a regulator from the 5V) and see if that works.



  • @wikistik said in 5V input concern on M5StickC:

    @grelm If you find out anything more about the ability of the M5StickC to handle 5v IO please post it. Once I have a second unit I will probably disassembly one to see if I can identify any protection on the board. Meanwhile I am looking at level shifters but there is nothing on the market that is easy to interface with the grove connector. May have to resort to making up something inline that uses only 5v to power both the high and low side (with a regulator from the 5V) and see if that works.

    New product idea here, you better go and develop it before someone else does!
    There isn't any protection, 5v on the io will go directly into the esp32!



  • @ajb2k3 Yeah it would be awesome if someone put a level shifter with the grove connectors on the market. I'm not interested in manufacturing. I may make a few up for the people I work with though.



  • Just providing a bit of information on this topic. I have a project that uses the XKC Y25 T12V liquid level sensor (5-24V). I feed the sensor with 5V and GND from the M5stickC pin extension headers on top. I'm reading the sensor's digital status (LOW/HIGH) on pin G36. When I disconnect the wire from pin G36, the sensor reads ~4.9V during a HIGH state (as expected). When I connect the wire to pin G36, the sensor reads ~3.7V during a HIGH state. So I can only assume the I/O-lines are clamped to 3.3V somewhere inside. It would be good to see the schematic to confirm this though.



  • Thanks for the info @world101. I have posted my notes on the 5 volt concern with the M5StickC here: http://tinkerfarm.net/projects/the-m5stickc/the-5-volt-danger-with-the-m5stickc/.
    I will update these if new data emerges.



  • It seems that the ESP32 (M5Stack and M5Stick) Groove I2C pins (and all GPIO pins of the ESP32) are 5 Volt tolerant.

    1. The M5 16-Key Capacitive Touch Unit uses a MEGA328 Chip directly connected to the Groove I2C connector of the M5Stack/Stick. The 328P runs on 5 Volts. The SCL / SDA connectors are protected with inline 470 Ohm resistors limiting the current to the ESP32 GPIO Inputs (21,22 resp. 32,33). You will find the full schematic in https://m5stack.com/collections/m5-unit/products/makey-unit under the "More information" tab. (The 328P is programmed to behave as an I2C slave).

    2. Baoshi in his blog (https://www.ba0sh1.com/blog/2016/08/03/is-esp8266-io-really-5v-tolerant/) found some old datashees from expressif describing the ESP8266: "All digital IO pins are protected from over-voltage with a snap-back circuit connected between the pad and ground. The snap back voltage is typically about 6 Volts, and the holding voltage is 5.8 V".

    Conclusion: If you are using external 5 Volt devices with an I2C Groove bus attached to the M5Stack, you will be on the safe side by limiting the current to the SCL/SDA inputs to the M5 Stack passing through 470 ohm resistors. There is no need to implement level shifters. You may even put 4K7 resistors on the SDA/SCL lines as pull up resistors to 5 Volts.



  • @crami25 said in 5V input concern on M5StickC:

    It seems that the ESP32 (M5Stack and M5Stick) Groove I2C pins (and all GPIO pins of the ESP32) are 5 Volt tolerant.

    1. The M5 16-Key Capacitive Touch Unit uses a MEGA328 Chip directly connected to the Groove I2C connector of the M5Stack/Stick. The 328P runs on 5 Volts. The SCL / SDA connectors are protected with inline 470 Ohm resistors limiting the current to the ESP32 GPIO Inputs (21,22 resp. 32,33). You will find the full schematic in https://m5stack.com/collections/m5-unit/products/makey-unit under the "More information" tab. (The 328P is programmed to behave as an I2C slave).

    2. Baoshi in his blog (https://www.ba0sh1.com/blog/2016/08/03/is-esp8266-io-really-5v-tolerant/) found some old datashees from expressif describing the ESP8266: "All digital IO pins are protected from over-voltage with a snap-back circuit connected between the pad and ground. The snap back voltage is typically about 6 Volts, and the holding voltage is 5.8 V".

    Conclusion: If you are using external 5 Volt devices with an I2C Groove bus attached to the M5Stack, you will be on the safe side by limiting the current to the SCL/SDA inputs to the M5 Stack passing through 470 ohm resistors. There is no need to implement level shifters. You may even put 4K7 resistors on the SDA/SCL lines as pull up resistors to 5 Volts.

    A point of notice here that the signal lines are not always 5v as the units often have their own 3v3 voltage regulator fitted to them.
    A second point of notice with the makey makey, it is possible to "Short Out" some of the pins which can cause the M5Stack to restart or just shut down.
    First time I did this i though i had killed my M5Core.



  • @ajb2k3 Until Espressif changes their datasheet on the ESP32 this is officially not a 5V tolerant device. Many devices will work with it, but I will continue to test each one before telling people it is OK.



  • @wikistik It would be nice to have a list of compatible "Safe" addons
    As I said before, M5Stack units have internal 3v3 regulators to reduce the 5v down to safe voltage.
    I have mentioned this in my UIFLOW book with the circuit diagram of the regulator.