Tech Note 055 - Using ePaper SPI Displays with an ESP32/ESP8266

Поделиться
HTML-код
  • Опубликовано: 28 авг 2024

Комментарии • 97

  • @deangreenhough3479
    @deangreenhough3479 6 лет назад +1

    Brilliantly explained, thank you, learnt a lot and feel inspired

    • @G6EJD
      @G6EJD  6 лет назад +2

      Thank you they are excellent screens for contrast and take zero power when asleep and open the door to ultra low power projects. I’ve had a weather station based on an ESP8266 running for 8-months now using 3 AA cells but I power the board with 3.3v via the 3.3v pin to remove the UART and other circuits from the power load this gives much increased battery life.

  • @G6EJD
    @G6EJD  7 лет назад +9

    Just added an ESP32 code version for you.

  • @leythecg
    @leythecg 2 года назад

    Thanks a lot, David!

  • @TommyGx69
    @TommyGx69 5 лет назад +1

    WU Api keys are sadly no longer available, can you make an alternative version with another service?

  • @Frickelpiet
    @Frickelpiet 6 лет назад

    Very nice tutorial! Thank you! I have one question: How did you include that nice symbols for temperature, humidity etc.?

    • @G6EJD
      @G6EJD  6 лет назад +2

      Thank you, you can either draw the symbol with drawLine and drawCircle or fillRect or fillCircle or you can create a bit map image (2-bit) B/W image then transfer to flash memory format then you can draw. On balance I now prefer to draw the images using commands as getting a bit image in the correct format is quite difficult. If you check out some of my later videos and code you will find examples of scalable icons.

  • @CollinSale
    @CollinSale 6 лет назад

    Thanks a Lot. GxEPD was the hint I needed to get my displays running.
    Of course I tried your code and it works like a charm once the pinning was correct and after I managed to get the key from "api.wunderground.com" :-)

  • @MPElectronique
    @MPElectronique 7 лет назад

    How did you manage to convert the icon for the e-paper display ?
    thank you.
    Marc.

    • @G6EJD
      @G6EJD  7 лет назад +2

      lcd-image-converter-20161012 which is a free download. Select 'new image', then import your image, go to 'Options' then Conversion, then at the top select monochrome, then 'show preview' and select the data for the .h file. Check for orientation, the data format for the library appears to be little-endian, so you have to flip the image in the vertical plane using the lcd-image tools. So for example an arrow pointing to the left is displayed pointing to the right so you have to flip it around before conversion! Images consume RAM very quickly...OK on the ESP32 until the extra is consumed too.

  • @mheys1
    @mheys1 7 лет назад

    Waveshares own library on their wiki supports partial updates, at least it does for the 1.54" model, I don't know if they are different.

    • @G6EJD
      @G6EJD  7 лет назад

      +mheys1 only two displays support partial updates the 1.54 and 2.9” variants.

  • @andyr6959
    @andyr6959 6 лет назад

    IN the figure at 1:50 the circuit is very similar to a nodemcu 32, but the pins are totally flip down, me think is a mistake, is it ?

    • @G6EJD
      @G6EJD  6 лет назад

      Hi, I have just checked the wiring diagram on Github and that is correct. And I have an ESP32 Node MCU here and the pins are correct. If your using an ESP8266, then the best thing to do is to write a small programme that prints out your pins: e.g.Serial.println(MOSI);Serial.println(SS);Serial.println(SCK)all other pins are user settable. If you have any problems just give me a call here or via email.Yes the pins are as labelled from the rear.

    • @andyr6959
      @andyr6959 6 лет назад +1

      3.3V is on the other side if you flip it horizontally, but the other connections also aren't the same, got mine in dx

    • @G6EJD
      @G6EJD  6 лет назад

      On my NodeMCU ESP32 as per the drawing, if I hold the board so it's vertical and the ESP32 is at the base and micro-USB at the top so to speak, then I flip it to the right, I see in the bottom-right corner GND then P23 then P22, etc. Nearly every board on the market uses the same SPI pins of:
      CS/SS = 5
      MOSI = 23
      SCK = 18
      The rest you can define yourself to what ever you need
      //static const uint8_t CS = 13; // ORANGE//static const uint8_t MOSI = 23; // BLUE//static const uint8_t SCK = 18; // YELLOW//static const uint8_t MISO = ;//static const uint8_t DC = 12; // GREEN//static const uint8_t RST = 14; // WHITE//static const uint8_t BUSY = 22; // VIOLET

  • @SvenAdlung
    @SvenAdlung 6 лет назад

    Hi David, thanks for the great tech note! I am using your source code for the ESP8266. Unfortunately the icons are displayed inverted. The background is black and the icon strokes are white. I guess that's not how it's supposed to be... am I right? Any ideas, why it's like that?

    • @G6EJD
      @G6EJD  6 лет назад

      Interesting, if you look at the icon data you can see it comprises mostly 0xFF or 0x00 values denoting white and black areas, with occasionally variations in black white, most should be 0xFF for white, now I'm wondering if the library has changed recently. I have a new quickly created a new version that uses drawn icons, so no memory hungry icons, that makes the ESP8266 unstable with low memory, it's from an ESP32 project, but it should work OK. You may need to adjust the size with the scale variable. int scale = 10; // Adjust size as necessary on line 177
      See github link above for the 04 version.Alternatively you'd need to invert all the bits for each icon, either manually (will take a long time) so 0xff becomes 0x00 and all the combinations in-between or there is a utility called lcd-image-convertor that has an invert function, but be careful on image types just do a simple inversion of the data.
      This is why I dropped the bitmap icons in favour of drawing the icons.

    • @SvenAdlung
      @SvenAdlung 6 лет назад

      Yeah, I was wondering the same but I didn't find any informations on that. Thanks, I'll give it a try in the next days, for now I am using "bm_invert" mode to invert it: display.drawBitmap(nodata_icon, x, y, 56, 48, GxEPD_BLACK, GxEPD::bm_invert);

    • @SvenAdlung
      @SvenAdlung 6 лет назад

      Unfortunately the screen doesn't update for me. Just initially once but not after 15 mins or even later. I changed postingInterval to a lower value like 120000, but it doesn't do anything. Do you have any idea?

    • @SvenAdlung
      @SvenAdlung 6 лет назад

      Sorry, I was just missing to connect pins for wake up from sleep mode :)

    • @G6EJD
      @G6EJD  6 лет назад

      When the ESP goes to sleep it releases the gpio pins used on the display and in some instances gives the effect of a transition on wake-up or reset and that wakes the display consuming power, so if you have any problems with random wake-ups try fitting a pull- down resistor of about 2k2 to 2k7 so this can’t happen. If you have no problems then no need.

  • @amir0ff
    @amir0ff 6 лет назад

    Any info on hot to install on a ESP8266 NodeMCU 1.0 version Amica/LoLin versions?

    • @G6EJD
      @G6EJD  6 лет назад

      Ok, these are the pins for a Node MCU Lolin board
      MOSI=13
      SCK=14
      CS=15DC=2BUSY=4 RESET=5You can use nearly any other pins for DC and Busy
      // GxIO_SPI(SPIClass& spi, cs, dc, rst);GxIO_Class io(SPI, 15, 2, 5); // GxGDEP015OC1(GxIO& io, rst, busy);GxEPD_Class display(io, 5,4); www.google.co.uk/search?q=node+mcu+pin-out&tbm=isch&source=iu&ictx=1&fir=47r_W2A31iOr9M%253A%252C6wYZ0JekiP7sjM%252C_&usg=__sOm34KaAh2u6dkFC0I7DVE12icw%3D&sa=X&ved=0ahUKEwj1k--J8-HYAhUBYlAKHQ57C8gQ9QEIKzAA#imgrc=92SpkL9NUDewjM:&spf=1516291786943

  • @ipodmaurits
    @ipodmaurits 7 лет назад +1

    What type of connector does the display use?

    • @G6EJD
      @G6EJD  7 лет назад +2

      +Maurits Muis it uses the JST standard type,8-P (8-pin) and comes with pre-cabled connector, so quite useful.

    • @CollinSale
      @CollinSale 6 лет назад

      The Displays mentioned in the GxEPD use this connector to interface the displays:
      www.good-display.com/products_detail/productId=362.html
      you could build your own interface. check out hackaday.io/project/20466-wifi-epaper/log/59098-testing-the-new-42-black-white-red-epaper-display FrankBuss redesigned the Interface from jarek319 to make it easier to solder

  • @valentingehmacher6686
    @valentingehmacher6686 5 лет назад

    Hi, I am new to all this and maybe my question does not even belong to this topic, but I just set up a ESP32 with a 1.54inch 3-color e-paper display and tried to run your code.
    I choose the right GxEPD version and plugged the pins in, like in the provided picture.
    Now I get like 1000 error messages like "multiple definition of `GxIO::transferTransaction(unsigned char)'" and the information where it was first mentioned.
    Can anybody help me? I really don't know what to do :/

    • @G6EJD
      @G6EJD  5 лет назад

      Valentin Gehmacher, use GxEPD 2 would be easier and look at the setup of the examples

    • @G6EJD
      @G6EJD  5 лет назад

      Valentin Gehmacher, there are examples too with GxEPD

    • @valentingehmacher6686
      @valentingehmacher6686 5 лет назад

      @@G6EJD I just contacted the manufacturer and it seems that my Display is broken.
      When the new one arrives I will try it that way, thank you!

    • @G6EJD
      @G6EJD  5 лет назад

      Valentin Gehmacher, the errors you were listing were compilation errors resulting from an incorrect configuration. Assuming you tried a library example and had the SPI wiring and connections correct and it still wasn’t working then yes probably faulty.

  • @circuitdotlt
    @circuitdotlt 6 лет назад

    Is there a frontlight off the shelf solution available? Could not find any...

    • @G6EJD
      @G6EJD  6 лет назад

      Interestingly Waveshare are advertising their displays and saying explicitly 'no backlight' so I'm thinking they are making a point that e-paper cannot be backlit or they about to launch a backlit version. I Have seen front-light kits for TFT screens a row of LED's that shine across the screen and you'd stick them down one side of the display edge, but to be honest I have not looked. I wonder what e.g. the Kindle e-paper version does for illumination. The contrast on the displays is very good, so not much light required. Perhaps a strip of LED's that are freely available now stuck along the edge.

    • @circuitdotlt
      @circuitdotlt 6 лет назад

      Kindle has 4-6 LEDs and a special light guide on top of display. They say it's their (or subcontractor's) proprietary technology. I am looking for off the shelf solution for months now and will probably end up salvaging frontlights from kindles, at least for prototype stage... But there does not seem to be a solution for real product.
      Or you can simply buy replacement e-paper displays for readers... In my case, I want to use Sharp 4.4" memory LCD.

    • @G6EJD
      @G6EJD  6 лет назад

      I've got a 20x4 LCD display that has a piece of Perspex on one edge and one LED that is refracting down the Perspex and along the way light escapes through the edges and across the surface, it works quite well, but I've not seen them for sale for a long time, other than an after-market product that is no-longer available. Good luck in your design. I was thinking about these LED tapes: www.aliexpress.com/item/DC12V-LEDs-Lamp-ribbon-5050-SMD-non-ip65-waterproof-LED-strip-light-12V-1m-2m-3m/32656650236.html?spm=2114.search0104.3.211.cZfYYJ&ws_ab_test=searchweb0_0,searchweb201602_4_10152_10065_10151_10130_10068_10344_10345_10547_10342_10343_10340_10341_10548_10192_10541_10190_10307_5670020_10301_10303_10060_10155_10154_10056_10055_10539_10537_10536_10059_10534_10533_100031_9912_10103_10102_10142_10107_10324_10325_10562_10084_10083_10561_5650020_5740017_10179_10312_10313_10314_10184_5660020_10550_10073_10551_10552_10553_10554_10557-10550_9912,searchweb201603_2,ppcSwitch_4&btsid=53827382-7a58-4c04-b157-83f00139825f&algo_expid=5ab7b80d-777c-4db2-b20c-22a6f75eab8c-27&algo_pvid=5ab7b80d-777c-4db2-b20c-22a6f75eab8cThere are many sizes on the market.

    • @CollinSale
      @CollinSale 6 лет назад

      Unfortunately not for 4.2" but there are some checkOut this -> www.good-display.com/products_detail/productId=368.html
      The Library: github.com/ZinggJM/GxEPD is based on GoodDisplay-Components

    • @G6EJD
      @G6EJD  6 лет назад

      Yes, Waveshare displays are GoodDisplay products. Looks like the additional of a backlight will be the next release.

  • @atata0215
    @atata0215 5 лет назад

    thanks for this video, how you have reduced the current consumption of display until 5 µA during deep sleep Mode , in my project the current will be around 45 µA .
    i have tried alot to reduce it through free the Ram, Disable Clock Signal then put the display in deep sleep
    in datasheet they have put the Deep sleep mode current should be 2 until 5 µA with this conditional:
    1.DC/DC off 2. No clock 3. No input load 4. Ram data not retain,
    but it is not understandable

    • @G6EJD
      @G6EJD  5 лет назад

      Your almost certainly not measuring display current, to do so place an ammeter in series with the display Vcc. It sounds like the value your getting also includes the ESP?

    • @atata0215
      @atata0215 5 лет назад

      @@G6EJD actually i am measuring the current only the display not Including ESP32
      like that: ibb.co/ZfQmtpZ

    • @G6EJD
      @G6EJD  5 лет назад

      Well if you remove power the display remains as is, I can’t explain why it’s operating outside of its design specifications have you asked waveshare?

    • @atata0215
      @atata0215 5 лет назад

      ​@@G6EJD yes i have asked them, the answer was" The datasheet is only for raw panel, Maybe the circuit on driver board cause this problem", actually the driver Board with the disaply came together from waveshare
      what about your weather station project, have you measured the current for the display during deep sleep?

    • @G6EJD
      @G6EJD  5 лет назад

      AT ATA021, I haven’t measured sleep current because I don’t take any regard of it anymore because say the sleep current is 50uA and I use 18650 2600mAHr battery then at sleep the battery life will be 6-years but in practice the weather station lasts for about 4-5months because it is cpu on time that consumes the dominant power.

  • @MPElectronique
    @MPElectronique 6 лет назад

    Can i use it with an Arduino UNO Wiyh 5 v DC ?
    THANKS.

    • @G6EJD
      @G6EJD  6 лет назад

      Marc Paradis Yes, in fact Waveshare show UNO examples, but you need to supply the display with 3.3v not 5v from the UNO 3.3v pin.

    • @MPElectronique
      @MPElectronique 6 лет назад

      G6EJD do i have to use a logic level converter ??

    • @G6EJD
      @G6EJD  6 лет назад

      There is nothing in the Waveshare data sheet that says you must convert down to 3.3v, I checked and found no mention of the need. Ideally include one or only use an ESP or DUI, etc that use 3.3v logic.

    • @G6EJD
      @G6EJD  6 лет назад

      In the Waveshare Q&A section for the display they say: The I/O level of Arduino is 5V, and the e-Paper should be driven with 3V3. If your Arduino cant drive the e-Paper successfully, please try to convert the level to 3.3V
      You can also try to connect the Vcc pin to the 5V of Arduino to see whether the e-Paper works, but we recommend you not to use 5V for a long time. Use 3.3V

  • @alexeyk8460
    @alexeyk8460 7 лет назад

    Could you please advise how you resolve an issue with min() and max() functions in ESP8266 example. The compiler gives an error message that 'min' was not declared in this scope and same for 'max'. Thanks in advance.

    • @G6EJD
      @G6EJD  7 лет назад

      +Alexey K What’s happening is the macros for min and max are being undefined by one of your libraries, which IDE are you using? And have you included any other libraries? You should see in the libraries min and max being defined and usually the libraries do this for the ESP8266? You can define min and max too outside of the libraries.

    • @G6EJD
      @G6EJD  7 лет назад

      #define min(a,b) ((a)(b)?(a):(b))

    • @alexeyk8460
      @alexeyk8460 7 лет назад

      Thank you very much for quick reply. Your videos are very interesting. And examples are really awesome. I started coding in Arduino IDE digging your examples. Thank you for sharing your code. I am going to use same e-Paper screen in my own project. And I just stucked because of this problem. Ok I will try to look throwgh the libraries. Thanks again.

    • @G6EJD
      @G6EJD  7 лет назад

      It's a pleasure to help out. It's a problem with the ESP8266 compiler in that they did not implement 'min' 'max' functions as found in the Arduino, I think they were trying to 'move-on' to a newer generation of functions/symbols. So the easy way to resolve it is include the two definitions above, effectively macro's.

    • @alexeyk8460
      @alexeyk8460 7 лет назад

      Thank you very much. I will try. What IDE do you use?

  • @MPElectronique
    @MPElectronique 6 лет назад

    On ESP32 i got Busy timeout! :(
    Thank You.
    Marc.

    • @G6EJD
      @G6EJD  6 лет назад

      At what stage?

    • @G6EJD
      @G6EJD  6 лет назад

      Check the serial port for progress and diagnostics if necessary adding temporary print statements so you can see progress and also see where it goes wrong. On the whole the displays are very reliable

    • @MPElectronique
      @MPElectronique 6 лет назад

      G6EJD how ?

    • @MPElectronique
      @MPElectronique 6 лет назад

      G6EJD esp8266 works just fine..

    • @G6EJD
      @G6EJD  6 лет назад

      OK, have you assigned the pins correctly for the ESP32? SO determining which pins are used for SDA, SCL and then assigning usable pins for DC, CS, RST and BUSY?