The M5 Stack

M5StackThe M5 Stack looks to be a reasonable use of the ESP32 and for those who need to start from a boxed product with display, it might just have a bright future.

In a nutshell this is a pretty looking ESP32-based box with display and buttons. Do with it what you will. It needs low voltage and the basic unit comes with internal battery supply. instructions, 0.1” pin leads and a USB C lead for charging and serial connection.

The M5 Stack Extensible Micro Control Module WiFi Bluetooth ESP32 Development Kit or Core Module —  (update September 2021 – see M5Stack Core 2 article as this original M5Stack has been upgraded – and is now quite useful)
Arduino Compatible SCM & DIY Kits —

M5 stackI just HAD to order one and so I thought I’d put a note in here for people into the ESP32 and I’m already seeing responses including a useful note from Bob H and comments from others.  All in all I’m already convinced I need this gadget on my hallway wall even though I’m not yet entirely sure what to do with it. Perhaps people who are ahead of me might write in soon to save me re-inventing the wheel.

M5Stack CoreFor now I can learn all about it, in the Autumn when returning to the UK it could just end up as a useful central display for what will be a brand new Raspberry-Pi and ESP-Go based control system as we’ve moved from one house to another, 5 miles down the road.

The basic box with 320×240 colour display is around £27.48 sterling with free post (or not, depending where you live of course). Apart from Bluetooth, nothing I can’t do already with an ESP8266 but then it is all in a pretty box.

That has to be worth something as presentation is always an issue with home-brew IOT.

I’m counting on this box being able to do heavily customised MQTT messages from those 3 buttons. I hope I’m on the right track. 

For now it needs a good charge.

Original M5Stack first power up

Not sure yet what the first two errors mean but the SD error is easy enough, I’ve not inserted an SD so that’s reasonable. It clearly is picking up on my WiFi using it’s own firmware.


69 thoughts on “The M5 Stack

  1. Howdy and hope you are well. The M5stack has a smaller format version available with colour screen battery etc. The price is the best part. Only 13 NZ dollars at the moment – the same as a bare esp32 module. Search for the M5stickC on Banggood.

  2. Finally got round to trying out the Ulflow online development IDE and it’s really great to use…….. apart from the lack of documentation as per the rest of the site, I’m struggling to get MQTT working but as it links up via WiFi you can upload and run your code straight away.

  3. I got my hopes up when I saw “USB-C”, thinking I’d finally found something with a *proper* USB port (not just fixed to serial port) that I could implement gadgets on, and maybe also use as a host. Oh well. The search goes on.

  4. If I’m reading the version 2.0 release features correctly, registering user function in the M5ex idle loop should fix the blocking problems.

    “M5ez 2.0 will also have backlight setting, a clock in the header bar as well as definable header widgets and the ability to register functions to be part of M5ez’s idle loop.”

    1. I have the 2.0 beta and will be checking it out tomorrow.
      With idle loop function calls, the menu object seems to be turning into an operating system. Maybe that’s better left to the experts.
      I’ve had good luck with a two core approach with RTOS. One core just for the UI.
      Also, M5Stack—SAM is non-blocking. But not as complete as M5ez.

  5. Some of the M5 stack “Fire” units (with 4M PSRAM) shipped defective.
    They claim the problem has been fixed for new shipments.
    The official test for this is found at>download->M5Burner-for-Windows
    Unzip/run the M5Burner app on Windows. Has a little M5 icon.
    Enter COM: Port, Baud 115200, Firmware: M5Fire-psram-test
    Connect then Run
    On the M5 Fire unit, read results.
    I have two units.
    Unit 1– PSRAM NOT Found
    Unit 2 – PSRAM OK

  6. What I’m seeing are some awful demos – simple display etc. Anyone know of a sketch with WIFI+MQTT+display+buttons as a starting point?

    1. I just used an ESP8266 MQTT sketch and added the M5 library to add the buttons and screnn control, it works fine apart from the readVCC function. I can post my code if you ant as long as you don’t laugh at it! 🙂

    2. I’m working on it. 🙂

      I’ve used the M5ez library to give me a kickstart but menu’s are loop blocking which isn’t good for MQTT use. I’ve implemented a simple FreeRTOS background task though and that works really well. These things actually multi-task!

      The M5ez library also has a very nice WiFi manager and a WiFi signal strength display for the header. Also has nice button management.

      Power off and button wakeup also REALLY easy thanks to the M5stack library.

      One thing not mentioned in the official docs. The basic unit has a 150 mAh built-in battery in the bottom cover – it will operate happily for about 10 minutes with no power management.

      I really like this thing and will probably have to buy a second one for development and testing because I think a unit will be going “live” as a family-friendly home controller before too long.

        1. Good find there! Thanks for sharing. Just a shame they don’t come with a case – it would only add a few pennies to the price in China and would make a nice little setup. Likewise if there was an ESP8266 version, particularly given the ever decreasing cost of the ‘8266. The ESP32 is overkill for pretty much everything I need for my two IoT setups.

          edited to say – I give in..I’ve bought one …the 2nd one you posted. It always happens on here…I end up buying stuff I don’t actually need! Cheers

  7. Right, I have the Arduino IDE Boards Manager add-ons file with ESP-32 support. Anyone know which board option to use to work with basic M5-Stack?

  8. Anyone know of any prebuilt cases for ESP8266? Especially with LCD – and maybe battery too (though that’s less important)

    Not all of us have the space, time or money for our own 3D printers.

    1. Have you looked on Thingiverse or maybe try to design your own and get someone else to make it for you, I wouldn’t mind printing something for you or there’s a few on-line services like Shapeways or ITEAD.

      1. Thanks for the offer Phil. I realise that I can get someone to print something for me. I was more thinking about something like the M5 stack but for an ESP8266 rather an an ESP32.

        Just wondering really.

        1. No problem, I suppose to get something similar you would just need a PCB design with a layout to attach the the esp8266 and the display in the right place to match a box but you probably already know all that😁

            1. I’ve been making or modding little boxes since I was a teenager – mind you they usually still look home made.

        1. Currently on special “back to school” offer on AliExpress plus I got a loyalty code from AE so I ordered one 🙂

          When you factor in the case with buttons and colour display, tf-card slot, speaker, definitely cheaper than doing it yourself I think.

          Anyway, I can think of a couple of projects I’ve been meaning to get to for a while to make the HA system more family friendly, this will be nice for that.

          1. Well, that was interesting. It arrived today, 20d delivery, would be pretty good for a China delivery though the packaging seems to show that it came from a unit in the UK. So maybe they have a deal on delivery with someone ordering in bulk.

            Time to dust off the Arduino IDE!

    2. What type of screen? I made this from a WiFi extender that broke so I used the plug case with 5V supply and added an ESP8266 and an OLED display and a 3D printed front plate, it runs Pete’s ESP-GO software and subscribes to MQTT message for my hot water tank.

      1. Thanks. I have been collecting boxes and old cases like Phil’s suggestion above. I was just hoping someone might be selling something pre-made like this unit but with an ESP8266 in it.

        No matter, I’m sure I’ll be getting one of these. They actually look a little like the roomstat on the Drayton Wiser smart heating system I got earlier in the year.

        1. This might be the post on boxes

          I bought a boat load of them thinking that I could use that existing hole for a Power Barrel Connector Jack 2.10mm. But with the pc board on the standoffs, it won’t align. I have no mechanical aptitude. None. And all my projects end up looking like the box on the right.
          So the plan is: the M5stack is where people might see it and the project box (the thing controlled or sensor) is somewhere else–hidden..

  9. Nice little 3D printed back and stand containing a 1000mAH battery, the buttons turn off/on the display backlight or alter the brightness the display receives MQTT data on hot water temp and outside temp.

      1. Thanks,
        I’ve not done any testing yet but it runs for more than a couple of hours, I was trying to get the battery level so I could log it to the SD card but it’s not as simple as the ESP8266 apparently so I need to setup up a voltage divider to an ADC channel or maybe monitor it externally via the pins on the side.

        1. Talking about battery level , are you using the on board battery charge IC ?
          You can get an approximate level from it with the following function in Aurdrino

          int8_t getBatteryLevel()
          if (Wire.endTransmission(false) == 0
          && Wire.requestFrom(0x75, 1)) {
          switch ( & 0xF0) {
          case 0xE0: return 25;
          case 0xC0: return 50;
          case 0x80: return 75;
          case 0x00: return 100;
          default: return 0;
          return -1;

          M5.Lcd.print(getBatteryLevel()); // in loop()

          function returns % charge in 25% increments from the onboard battery charge IC IP5306 in most core and the fire
          if return= -1 then it may be an old revision.

          I am trying to get the charge status also , but the data sheet is in Chinese , it is there tho

            1. If you scan the I2C buss and see address 0X75 respond it should work.
              My M5 stacks are the basic module. I think some old revisions don’t use the I2C version of charger IC ( IP5306 ).

              I2C bus scan can be found in M5stack>Examples>Advanced>I2C_tester

    1. You’ve gotta admit – that’s a neat looking setup there. I’m really tempted but it’s just a little bit more expensive than I’d like (which is silly really as it’s all good to go and I’ll spend more time and money casing up a bare board alternative…).

  10. One problem I’ve found, you can’t get a nice quiet beep, it’s a full volume LOUD beep and the volume control doesn’t seem to work! so be aware if you want it to give audible feedback it may be a problem.

    1. Be careful with this library. It seems to block.
      I’m trying to put M5EZ on the second core for my remote control.

  11. I have a couple – excellent for projects and very attractive case with many options.
    If you want something that is visible and you need interaction, it is the best esp32 option. For general sensors, just use an esp8266 and box.

  12. If you get a Fire M5GO version with M5Cloud web IDE and want to replace it (like with Sonoff), I had to do a command line “make erase_flash” to get WiFi to completely work.
    Double click the power switch to turn it off.
    I find the magnetic base is very useful for a remote control to keep it from getting lost.
    I like this thing.

  13. Yep, already did that but mine wasn’t as nice looking as this one and I also have plans for using the Bluetooth and the built in speaker.
    Don’t get me wrong it’s a bit pricey (got it from Amazon) and mine was an impulse buy but at £30 from China it’s just about worth it for a from ‘WAF’ perspective, IMO.

  14. I’ve bought one of these and it’s really good, I’m using it at the moment to display MQTT messages from other ESP8266s. There are quite a few really nice projects ou there for this device like a thermal camera and an oscilloscope and many ready to go projects.
    But I’ve found that there doesn’t seem to be any really god support documentation all in one place/document there’s info out there but it’s quite fragmented and the M5 stack site itself is very flashy but doesn’t seem to have been finished off.

      1. People keep underestimating the ESP8266. However this does solve a long term issue if needing the lot put together in a nice box.

        1. Or are just not so skilled in programming and tend to go where most of the development (and examples to copy from…) is: on the arduino ide… Which is good but does not allow the kind of optimizations you reached with your firmware, written in C 🙂

          1. Yes it does, Arduino is built on top of the C SDK for the 8266. You can do the same things by doing native calls to the SDK functions or writing lower-level code while using Arduino if you want to mix and match. There is some overhead with the memory consumption of course, but otherwise not really.

            ESP32 is similar, except that the native SDK (ESP-IDF) is way better than on the 8266.

      2. Funny enough I’ve just spent 2 days updating the ESP-GO code ILI9340 and QD-TECH board handling to provide a half decent display with 3 buttons – using both on my walls right now.

    1. It would not be the first software with less than ideal documentation. Maybe they are hoping users will contribute and I agree this is not ideal.

  15. Is there something like tasmota or espurna firmware for this? I run tasmota on all my esps because it does everything I need it to but would not be able to code it myself.

    If this has a firmware like tasmota, I’d have a couple of use cases around the house already.

    1. Sadly it has Arduino lookalike code. If it turns out to be any good I may port ESP-GO to it.

  16. That is pretty cool and useful for those of us without the kit or the design skills for 3D printing an enclosure. I would be more interested in an ESP8266 on as I haven’t found a need to use an ESP32 yet despite having a couple in my geek box as the ESP8266 is capable enough for most of my IoT node requirements.

    Nice find though. I like stuff like this. The NanoPi Neo case with OLED is another example. OLED plus some GPIO buttons. Ace. I bought one of those. Will hold back on this ESP32 one though unless I think of a project that would suit it…

Comments are closed.