Office nameplate with ESP32 and e-ink display

In this video, I show you a little gadget I built to make my life a bit easier. It is an ESP32 (Lolin32 lite)-based circuit with an e-ink display, an 18650 battery and some other small stuff. It is a nameplate that you can put on your desk or on your door at the office. It can be used to indicate your status, location and so on.

Description

The goal of this project is the following: I want to have a small display where I can indicate my status and location at work. I have a small whiteboard right next to my door, but I wanted something cooler. Since I wanted to put the device outside my office, I had to find a battery-operated solution because there are no outlets available nearby.

So, I picked this Lolin-32 board because it has wireless connectivity (WiFi and Bluetooth), supports 18650 batteries, has enough GPIO pins and is also cheap! It has an onboard charging circuit, so one can connect a battery to it directly which is nice because one does not need to worry about picking the right power regulator and so on.

Note: This is not the most power-efficient solution, I know. I could have used an Arduino Nano 33 BLE instead, for example. However, I could build the whole system I present from the price of such an Arduino!

The circuit can receive instructions via Bluetooth and can update the e-ink display based on the instructions. It also monitors the battery voltage, and based on the measured voltage, it dynamically draws a battery charge status indicator icon. I added an ON/OFF switch to the circuit that directly cuts off the battery. Despite my efforts*, the circuit still consumes quite some power, so turning the power off when I am not working (~15 hours each day) saves a lot of battery. Since I use an e-ink display in the project, the most recent information will remain in the display anyway.

*: I tried my best to make the Bluetooth work in light sleep mode, but after half a day of attempts, I gave up. So, if anyone has a solution for this please contact me! :)

Finally, I added an RGB LED (PWM version) to the circuit that compliments the statuses (busy, away, out of office, available…etc) shown on the display. The RGB LED has 2 different forward voltages: the red colour has 1.8 V, and the green and blue colours have 2.8 V. I wanted to run them at 10 mA, so according to this current and the forward voltages, the red colour has a 150 Ω resistor and the other colours have 50 Ω resistors.

The circuit, when started peaks at around 115 mA for a few seconds. Then it consumes around 51 mA while it is running. This consumption is achieved by turning the WiFi off and lowering the CPU frequency to 80 MHz. I could not go below 80 MHz, otherwise the Bluetooth would not work. So, every 9 hours, the circuit draws about 450 mA. I used a 3500 mAh battery, so ideally, this would be enough for a bit more than seven days. Basically, I can use it during the week and charge the battery during the weekend. It is a good compromise. Probably, I could further decrease the power consumption by sleep modes but the thing is that I am not sure how to solve it when it comes to Bluetooth communication.

Another issue I want to highlight is the dodgy ADC of the ESP32. I have never experienced anything similar with STM32 or ATmega chips, but the ESP32’s ADC readings are quite inaccurate (non-linear). When I compare the readings to a multimeter, it is quite off. I searched the internet on this topic and it turned out that this is not an isolated issue and in fact, it is a known “flaw” even within the devs for the ESP32. There are workarounds for this issue. I chose a simple one which is building a voltage divider where the maximum output voltage with my known maximum input voltage will not be greater than 2.4 V. The non-linearity of the ADC seems to kick in from 2.5 V and above. So, I added a little margin, hence the 2.4 V “cutoff”. Actually, the final numbers ended up being even lower because I was too lazy to pick the components carefully. I used R1 = 1.5k and R2 = 1k resistors which gave me about 2.5x multiplication factor. So if the real voltage was 3.8 V, the ADC showed 1.52 V without the multiplication factor. However, even with the factor, the voltage was still not correct due to an offset. So, again, with a lazy approach, I measured the voltage differences both at the low end and the high end and compared the ratio of the observed and calculated voltages. It turned out to be around 1.148. So, I added this additional 1.148 as a multiplication factor. The final formula for the battery voltage became: ADC reading / 4096 * 3.3 * 2.511 * 1.148. I did not “merge” the factors together, so the reader can understand the formula better.

Additional resources

 

Simple schematics. All the connections and pins are stated in the Arduino source code as well. The voltage divider for the battery voltage monitoring could be used with R1 = 1.2k resistor as well, but in that case, you will have to recalculate the correction factor!

Previous
Previous

ATmega32u4 microcontroller - revisited/revised!

Next
Next

Upgrading my microscope with long working distance lenses