Arduino thermometer & hygrometer with E-PAPER on nRF52832 - or what manufacturers forgot to release

    Greetings to all Habr readers! In my next article, I’ll talk about ARDUINO again. I want to share with you my next project, implemented on the nRF52832 microcontroller. This is a temperature and humidity sensor on sht20 | ( datasheet ) with a monochrome electronic ink display (E-INK | E-PAPER), which is part of the MySensors ecosystem.

    Its main functionality is monitoring the temperature and humidity in the room, sending data to the controller of a smart home or directly to the actuator. Well, the additional functionality is just the output of data from the sht20 sensor, network information and battery level to the monitor. In my implementation, this is just direct interaction directly with the actuator (controller of the heating system circuits). The implementation is non-canonical from the point of view of MySensors, I added the functionality of the master-slave modes, types of sensors, and air snap. Also, in my implementation, the procedure for initializing the transport layer was changed, because MySensors logic is not very good for standalone devices. But all this is a slightly different story, perhaps worthy of a separate publication, but for now an article about the device in the tradition of the MySensors protocol.

    The idea of ​​a device with such functionality has ripened in my head for a long time, the first attempt to implement this idea was made on the atmega328 microcontroller. And in principle, this was done, but I wanted more energy efficiency, more colorful display of information on the display.

    version on atmega 328

    When presenting the sensor, the community sometimes referred to the Xiaomi company device, they say it already is. But there is a slight difference, Xiaomi has a display device, in my case it is a smart home system sensor with a display function. Why display? I just sometimes want to just turn my head in the direction of the sensor and look at the temperature in the room :).

    The sensor was implemented on two boards, the basis of the circuit for the display was taken from the common waveshare displays | Datashit. True, minor changes were made later. The sensor's brain is the nRF52832 chip in a modular implementation from HOLYIOT. The modules themselves deserve special attention, this is the most problem-free implementation in terms of work in the Arduino IDE. The device used modules - YJ-16048.

    The basis of the software implementation of the work with the display was taken "instance" distributed on the website Waveshare Electronics. True, and here it was not without refinement.

    Measurements of the display consumption correspond to those stated in the datasheet, the most important thing is that this display can sleep and the data remains on the screen. True, turning the display to sleep did not work right away, the implementation from Waveshare did not allow this.

    The power in the sensor is implemented on two cr2450 batteries, lowers the TPS62745DSSR1 chip with pretty good characteristics to a working 3.3V | datasheet . At the moment, we can confidently say that this device (the described version) is capable of working for 1 year.

    Consumption in deep sleep mode - ~ 25 μA (with a test program). Average consumption in operating mode ~ 9mA.

    The project is open, gerber files are available on the OpenHardVar website , the program code and library are available here ( google drive ) Why not GitHub? It just so happened, in the final re -ization (v2) it will be there too.

    A separate conversation for those who decided to repeat this device deserves the topic of converting the characters of the desired fonts into C arrays. My experience is converting using TheDotFactory.

    I will try to describe the process with pictures :)

    Absolutely any font, you are limited only by the capabilities of the nRf52 memory. ... And it makes no sense to store all the characters. If you only need numbers, this saves space very well.

    Another problem encountered is updating the information on the screen. On these displays, a partial update of the desired area on the screen is available, which is an unconditional plus from the side of power consumption, but the minus is the appearance of artifacts in the area of ​​updating data from previous characters.

    But this problem was solved (see program code). As a result, it turned out like this:

    The video demonstrates the operation of the display.

    This demonstrates the update of data on the screen, after refinement:

    This implementation is not final, this project is left for repetition in the form of an Arduino module. A corps to it is not planned. Now, from this project, several were born at once as a logical continuation. The main differences of future V2 are powered by a single battery, a three-color display, the presence of a housing.

    Example of triggering a tri-color display:

    It is strongly recommended (for those who wish to repeat) to read my topic on the .org forum on this project (in English). If the language is a problem, I’ll always be happy to help everyone chat (installing boards, working with nRF5 microcontrollers in an arduino ide environment, tips on working with the mysensors protocol - @mysensors_rus

    Also popular now: