Hardware revision 5 (current version) - OMOTE-Community/OMOTE-Hardware GitHub Wiki
Hardware Overview
The OMOTE is an ESP32-based open source universal remote. Its capacitive 2.8” touchscreen provides an intuitive and snappy user interface for switching devices and settings. In addition to the touchscreen, there are 24 tactile switches. No hub or docking station is required as the remote itself features infrared, Wi-Fi and Bluetooth connectivity. And with its well-optimized power consumption, the OMOTE can run for months on a charge.
As a DIY project, all hardware parts of the OMOTE are designed to be easy to source and replicate. The main component is a 2-layer circuit board. Together with a screen and battery, this PCB is mounted inside a 3D-printed enclosure. If you want to build your own OMOTE, you will need the following components:
- OMOTE PCB
- 2.8" LCD
- Battery
- 3D-printed enclosure
- M3x5 Screws
This Wiki entry describes hardware revision 5. For revision 4, please check out the earlier state of this entry.
Circuit Board
All the electronic parts of the remote are located on a single 2-layer circuit board. A grid of 24 tactile buttons sits on the top side of the PCB next to its LCD screen. Together, these components make up the user interface for the remote. On the bottom side, an IR LED, IR receiver and an ESP32-S3-WROOM are located at the front of the device. This enables the remote to control devices via infrared, Wi-Fi and Bluetooth. An accelerometer senses when the remote is picked up, so it only uses power during active use. The brain of the remote is an ESP32-S3 microcontroller, which can be programmed using a USB-C port. The same port is also used for charging the 3.7V LiPo battery.
Electronic Components
ESP32
The ESP32 is the brain of the OMOTE. It renders the UI, processes user inputs and controls peripherals. To save space and reduce the number of components, this project uses the ESP32-S3-WROOM-1-N16R8. This is a module that includes the ESP32, 40MHz crystal, flash, PSRAM and antenna. The basic specs are:
- Xtensa® dual-core 32-bit LX7 microprocessor
- Up to 240 MHz clock rate
- 16 MB Flash
- 512 kB SRAM
- 8 MB PSRAM
- Wi-Fi 802.11b/g/n
- Bluetooth 5
Sleep Mode
The ESP32 is powered by 3.3V directly as it has very efficient low-power modes. In deep sleep with nothing but the RTC running, the ESP32 draws as little as 10uA and can be woken up by different external sources. In the case of the OMOTE, each button matrix row, as well as the accelerometer interrupt can wake up the ESP32. This feature is configured in software using a bitmask for the ext1 wakeup. But there is one hardware restriction: Only RTC GPIOs can be used to wake up the ESP32.
Antenna
The ESP32-PICO needs an external antenna for Wi-Fi and Bluetooth to work. On the OMOTE, a small chip antenna is connected to the PICO. Compared to copper trace antennas, chip antennas tend to be more robust against influences like the 3D printed case and the adjacent metallic display frame. The trace line between the ESP32 and the antenna should normally be impedance controlled which is tricky on a 2-layer PCB. This is why the ESP32 is placed very close to the antenna, to keep the trace length short. As a general rule of thumb, 1/10 of the wavelength (12mm for 2.4GHz) is usually the maximum distance where impedance matching is not absolutely necessary. To further improve the antenna performance, the PCB has a continuous ground layer below the trace line and ESP32 with vias placed along the edges. To adjust the impedance matching between the antenna and ESP there are mounting positions for a pi matching network (R36, C18 and C19).
Programming
The ESP32 can be programmed and debugged using the USB-C port. There is no need to take the PCB out of the enclosure for programming since the strapping pin IO0 and the reset pin are both wired to the CH340 USB/UART bridge.
Pin Mapping
Pin | Function | Description |
---|---|---|
TXD0 | USB_TXD | UART0 TX for Programming and Debugging |
RXD0 | USB_RXD | UART0 RX for Programming and Debugging |
IO0 | GPIO0 | Reserved for Boot Mode Strapping |
IO1 | CRG_STAT | Battery Charger Status Input |
IO2 | ACC_INT | Accelerometer Interrupt Input |
IO3 | - | |
IO4 | IR_RX | Infrared Receiver Input |
IO5 | IR_LED | Infrared LED Output (Active Low) |
IO6 | IR_VCC | Infrared Receiver Enable (Active High) |
IO7 | SD_MISO | SD-Card MISO |
IO8 | TCA_INT | Keypad Scanner Interrupt |
IO9 | LCD_BL | LCD Backlight Enable (Active Low) |
IO10 | LCD_D7 | LCD 8-bit interface D7 |
IO11 | LCD_D6 | LCD 8-bit interface D6 |
IO12 | LCD_D5 | LCD 8-bit interface D5 |
IO13 | LCD_D4 | LCD 8-bit interface D4 |
IO14 | LCD_D3 | LCD 8-bit interface D3 |
IO15 | SD_SCK | SD-Card SCK |
IO16 | SD_EN | SD-Card Enable (Active Low) |
IO17 | SD_MOSI | SD-Card MOSI |
IO18 | SD_CS | SD-Card Chip Select |
IO19 | SCL | I2C SCL |
IO20 | SDA | I2C SDA |
IO21 | LCD_D2 | LCD 8-bit interface D2 |
IO35 | GPIO35 | Reserved for PSRAM |
IO36 | GPIO36 | Reserved for PSRAM |
IO37 | GPIO37 | Reserved for PSRAM |
IO38 | LCD_EN | LCD Enable (Active Low) |
IO39 | LCD_CS | LCD CS |
IO40 | LCD_DC | LCD DC |
IO41 | LCD_WR | LCD Write |
IO42 | LCD_RD | LCD Read |
IO45 | USER_LED | User LED Output |
IO46 | SW_BL | Keypad Backlight |
IO47 | LCD_D1 | LCD 8-bit interface D1 |
IO48 | LCD_D0 | LCD 8-bit interface D0 |
USB Port
The OMOTE uses a USB 2.0 Type C Port. The CC1 and CC2 signals are terminated with 5.1kOhm resistors, signaling that the device is to be supplied by 5V and not using USB PD (power distribution). That way, none of the extra features of USB-C are used and the remote is compatible with any standard USB power supply and computer. The data lines and bus voltage feature ESD protection (using the USBLC6-2). A 500mA resettable fuse protects the PC in case there is a short on the OMOTE PCB. Since the ESP32 has no USB peripheral, a CH340C is implemented as a USB/UART bridge with an AP2112 as its 3.3V supply. The regulator and CH340C are inactive while the device is battery-powered, so their current consumption is not an issue.
3.3V power supply
The ESP32 can be quite power-hungry, especially when communicating wirelessly. That is why Espressif themselves recommend a regulator with at least 500mA. Since the display with a backlight also draws lots of current, the Torex XC6220 with up to 1A was selected for the OMOTE board. Another important feature of this LDO is its ultra-low quiescent current of 8uA. The combination of high output current and low quiescent current makes this LDO special and relatively expensive. For this reason, it is not also used to supply the CH340C.
A MOSFET and Diode make up a simple power path for automatic switching between battery and USB power. If VBUS is present, the MOSFET Q1 is turned off and the battery will not be drained. On battery power, the Diode D1 stops current from supplying the MOSFET base and USB components. That is why a diode with a low leakage current (MBR0520) was selected for D1.
Battery Monitor
A fuel gauge IC (MAx17048G) is used to monitor the battery state of charge. It measures the battery's voltage and uses battery-modeling algorithms to calculate how much juice is left in the battery. The IC ignores transient voltage changes (for example due to the ESP32 powering up and down), which would otherwise make the battery percentage jump up and down. The SOC percentage is returned to the ESP32 via its i2c interface.
This feature is only available since board revision 4! Earlier PCBs use one of the ESP32's ADCs for measuring battery voltage which is less accurate.
Battery Charger and Protection
The DW01A protects the battery against undervoltage, overvoltage and overcurrent. The IC monitors the battery voltage and disconnects the negative battery terminal from the circuit using back-to-back MOSFETs. Not that the DW01A can lock up when unplugging and reinserting the battery. Only after USB is connected, the device will turn on again.
The TP4056 is used as a lithium-ion battery charging IC. Using the resistor R8 it is set to a charging current of ca. 280mA. There are two status outputs for signaling the charging state: CHRG and STDBY. STDBY is connected to an LED. CHRG is connected to the ESP32 to enable USB detection.
Board revisions 3 and earlier use a different charging IC and feature no protection. It is recommended to use batteries with integrated protection (BMS) in any case. LiPo batteries are dangerous, even when they are small!
Button Matrix
Because the ESP32 has very few GPIO pins, a dedicated keypad scan IC - the TCA8418 - is used. The 24 buttons are laid out in a grid of 5 rows and 5 columns, with only the power button having its own pin on the TXA8418. The TCA8418 handles scanning the keys and outputs an interrupt. That way, the ESP32 can be woken up from deep sleep with a button press. Until revision 4, the keypad scanning was entirely done on the ESP32 itself.
A total of 11 LEDs are spead over the keypad to backlight the buttons. Because of their low current consumption, the LEDs are driven directly by a GPIO of the ESP32. To make full use of the keypad backlight, translucent keys should be used.
IR LED
The infrared LED is powered by 3.3V and controlled by the ESP32 via MOSFET. IR LEDs are designed to be very bright for a short time. That is why the current is only limited by a 3.3Ohm resistor. Some Commercial remotes even use their LEDs without any current limiting resistor. Then the battery is the only limiting factor. As long as the IR library is correctly used with OMOTE, the LED will not get damaged. But the LED should not be turned on outside the library or it could get destroyed. Because infrared light is not visible to the human eye, a second LED (D5) is placed nearby on the PCB for visual feedback.
IR Receiver
An infrared receiver enables the OMOTE to scan the signals from other remotes. The TSSP77038 is an IC that integrates a photodiode and a demodulator for 38kHz signals. This makes it easy to read IR signals with the ESP32 using a single GPIO. Because the receiver has no low-power mode it is directly powered by a second GPIO of the ESP32.
Accelerometer
The LIS3DH is a simple accelerometer that measures the orientation of the OMOTE. It is mainly used to detect if the device is moving or stationary. The accelerometer has two interrupt outputs of which one is connected to the ESP32. Via i2c the interrupt settings can be configured, so the LIS3DH wakes the ESP32 when it detects motion. The IC is connected to 3.3V and always on, but it only consumes a few uA of current.
Display
The display is one component, but it actually consists of three parts: a liquid crystal screen, a touchscreen and an LED backlight. The backlight can be turned on and off by the ESP32 using a MOSFET. Using PWM, the ESP32 can adjust the brightness of the display. Four 10 Ohm resistors limit the current to the backlight LEDs. The touchscreen controller communicates with the ESP32 via i2c. Since the interrupt output is not connected, it needs to be polled continuously. The LCD itself is connected to the ESP32 via an 8-bit parallel interface. Until revision 4, the slower SPI interface was used.
Both the display and the touchscreen need to be turned off during standby because they draw too much power. This is done by switching their power supply off with a MOSFET controlled by the ESP32. This also turns off the 3.3V supply to the i2c pull-up resistors as they leak some current to the touchscreen controller. The side effect of this is, that all other i2c devices on the board cannot be used while the display is powered off.
SD-Card Connector
The board features a Micro-SD card connector, which is connected to the ESP32 via SPI. To save power in sleep mode, the ESP32 can turn off the card via a MOSFET.
Power Management
The OMOTE is powered by a 3.7V lithium-ion battery. From board revision 4, integrated protection against under- and overvoltage, as well as overcurrent is built in. Nevertheless, it is recommended to use batteries with integrated protection (BMS). From the battery voltage, a low drop regulator creates 3.3V, which is used to supply the accelerometer and ESP32. The IR receiver, display and backlight can be switched on and off by the ESP32 using MOSFETs (or in the case of the IR receiver by directly powering the IC from a GPIO). If a USB cable is inserted and 5V is present, the board will automatically be powered from USB and the battery will be charged. A 500mA resettable PTC fuse protects the USB input against overcurrent.
The ESP32 and the illuminated screen consume up to 240 mA, which means that even a 2000 mAh battery will only last a few hours. To still achieve a long battery life, the OMOTE has to cleverly save power in standby mode. This is achieved through various measures:
- The device is automatically switched off as soon as it is no longer moved.
- A 3.3V LDO with very low quiescent current is used
- Unnecessary consumers can be switched off completely during standby. The display and backlight can be switched off via MOSFETs, while the IR receiver is supplied directly by a GPIO of the ESP32.
With the final software, the board draws around 32uA in sleep mode and 150mA in active mode with the display and ESP32 turned on. Using Wi-Fi adds another 80mA to the active mode consumption. Assuming the remote wakes up once every hour for 10 seconds, the 2000 mAh battery will last around 100 days.