Problem

Digital eye strain is becoming more prevalent in today’s age with screens everywhere we go. For many, it causes headaches, redness/dryness, and blurry vision since we tend to forget to blink. PalmEOG explores whether a compact EOG sensor and embedded machine-learning model can detect blinks in real time and identify changes in blink patterns while also providing us real-time feedback.

Hardware Process

Planning

Design goals

  • The initial component selection was based primarily on electrical requirements and AI assistance. From there, components were evaluated based on package size, availability, electrical validity, cost, and compatibility with PCB assembly.

  • The first step was translating the system requirements into hardware requirements. PalmEOG needed to have a small form factor, low-power, and capable of acquiring low-amplitude biopotential signals while leaving enough processing capability for on-board ML.

  • This project only needs to capture blinks so I started by defining the narrowest target that still gets the job done.

    • What our signal looks like: eyelid closure moves the eyeball slightly and adds some eyelid muscle (EMG) activity, both of which show up as a short, relatively large voltage (µV to mV) blip on electrodes near the eye, with the pulse lasting roughly 100–400 ms per blink.
    • Amplitude target: blinks are relatively high frequency signals compared to what the electrode can pick up, therefore we do not need to be strict on the amplitude of the signal since it’s higher than that of noise.
    • Bandwidth target: a single blink is a fast event, so its energy sits mostly below 20 Hz (commonly used range for biopotential signals), with a bit of headroom above that for the sharp edges of the blip.
    • Interference to reject: mains hum (50hz that comes from analog electricity) and ESD events on the electrode leads.

Choosing IC from target signal

With the ~20Hz target that we want to capture and with the small voltage signal, I need to pick ICs according to some requirements:

  1. High resolution at low amplitude
    • single digit µV-level signals need whatever digitizes them to have its own conversion error plus its own analog noise well below the signal size, or the signal is lost in the error of the measurement.
  2. A built-in gain amplifier to reduce additional noise and area from a discrete one.

  3. A digital interface simple enough to share with a wireless MCU without a bus bridge.

Upon asking AI for assistance in listing some components that would meet these requirements, I decided to choose TI’s ADS1292IRSMR since it features a 24-bit ADC (analog-digital converter), integrated PGA (programmable gain amplifier), and SPI (Serial Peripheral Interface). More specifically, the ADS2192IRSMR is rated for small biopotential signs such as EOG and ECG signals. In addition, the ADS’s internal EMI filter helps reduce high frequency analog noise to provide better resolution.

ADCs work by sampling an analog signal at intervals and quantizes those samples to form a discrete signal. Since we are working with fine resolution signals in the µV to low-mV we must ensure that we minimize our quantization noise, or the difference between the actual signal and measured signal.

Why 24-bit resolution?

An ADC chops up a continous voltage into 2^N discrete steps across the voltage range. The datasheet for TI’s ADS1292IRSMR states that the resolution is 24-bits for the ADC and operates with a ±2.4 V range, that means that our step size is :

Step size = full range / 2^N

N = 24

4.8 V / (2^24) = 0.29 µV per step

Per the datasheet for TI’s ADS1292IRSMR, the component has input-referred noise of 8 μV_(peak-to-peak). 24 bits is able to produce a detailed signal that’s 0.29 µV per step which is far below the noise floor that the component exhibits, ultimately, quantization stops being the bottleneck and an increase in resolution only results in the noise being digitizes more precisely.

In addition to making sure we receive an accurate signal, we must also ensure that we receive a signal we can correctly process. The pins to ADS1292IRSMR will be receiving a raw signal from our electrodes, however, it has no protection against shorts and broadband noise that can come from the electrodes. To mitigate this issue we have to apply an RC filter at the electrode pin inputs of the ADS. We want the filter to leave the 20Hz signal band alone to ensure signal integrity and also attenuate any broadband noise and fault currents, for this we can choose the cut-off frequency to be two to three orders of magnitude above the signal band. That would correspond to 2kHz-20kHz, however, we can choose a stricter range that we want the cut-off frequency to be, say 5kHz-10kHz.

Choosing a resistor for the filter

The job of the resistor is to ensure that a fault current from the electrode is limited, therefore it has to be large enough to resist a large current but at the same time be small enough to not interfere with the ADS1292’s PGA input impedance. A standard value for a resistor in a RC filter is 100 kΩ

Solving for capacitor value

Letting R = 100 kΩ and f_c be ~7kHz

f_c = 1 / (2πRC)  ->  C = 1 / (2π · R · f_c)
C = 1 / (2π · 100,000 Ω · 7,000 Hz)
C ≈ 227 pF -> nearest standard value: 220 pF

This puts us within spec to let our EOG signal through and attenuates higher frequencies.

Does this address mains hum?

No, the ADS1292’s amplifier is tasked with rejecting the common-mode signal of both electrode leads and letting the EOG signal pass through.

Why are we stacking the on-chip EMI filter with the RC filter?

Stacking the external RC filter with the on-chip EMI filter in series gives steeper attenuation of high-frequency noise and also filters out noise picked up between the external filter and input pins.

Choosing IC for power supply

To keep the small form factor I will be using a rechargeable 3.7V 650mAh LiPo battery cell as this is a typical spec for boards that need to be recharged. Ideally I will be using an ESP32-S3 for the processing of the signal.

I need to convert the unregulated 3.7 V from the battery to a regulated 3.3 V which the board can handle, for that I will need a LDO (low drop out regulator).

The two loads on the 3.3 V rail will be the ESP32-S3 and the ADS1292. Out of the two, the ESP32-S3 has the potential to draw the most current, especially when transmiting through Wi-Fi with the current reaching 250-290 mA.

In order for the LDO to operate properly in maintaining the 3.3 V signal and prevent voltage sagging, we must choose an IC that has a current rating well above the max current draw we expect to see from the board. To be safe, we can go with an IC that has double the max current draw, which is roughly 600mA.

Upon asking AI for assistance in listing some components that would meet these requirements, I decided to choose Diodes Inc.’s AP2112K-3.3 which is rated for 600 mA continuous, which meets the target, and its 250 mV typical dropout at full load means it keeps regulating 3.3 V down to a nearly depleted battery (~3.55 V).

Ensuring portability and charge

We need to be able to recharge the battery efficiently while also maintaining portability. When it comes to charging we need to balance thermal load and battery health, so picking a reasonable C-rate (rate at which the battery charges/discharges relative to battery capacity) is imperative. A standard C-rate for a small board is around 0.3 C.

For the IC we need to pick a charge management controller that hits 0.3 C on a 650 mAh cell, this is roughly equivalent to a current of 195 mA. Upon asking AI for assistance in listing some components that would meet these requirements, I decided to choose Microchip’s MCP73831T-2ACI/OT since occupies minimal board area and charges dirrectly from USB VBUS which allows a USB-C to send data and charge.

To reach a C-rate of 0.3 I have to choose a programming resistor value for the MCP.

R_PROG = 1000 / I_REG(target) = 1000 / 195 ≈ 5.13 kΩ -> nearest standard value: 5.1 kΩ

Communicating from computer to ESP32-S3

We will be using USB-C to plug into the board which will be sending data through USB protocol. While the ESP32-S3 can process USB protocol, it does so on the chip’s firmware, creating a dependency on the firmware running correctly. With this, it would be imperative to have a dedicated USB-serial chip that’s independent of the ESP32-S3’s firmware to allow for serial debugging and flashing. The ESP32-S3 has UART TX/RX peripherals that we can utiilize to communicate from the computer to the USB-serial chip to the microcontroller.

Flow:
USB protocol -> [USB-serial chip] -> UART asynchronous  serial data (RX/TX)

After some research I was able to find that Silicon Labs CP2102N was suited for the tasks I needed it to do. One key feature of the component is the virtual COM port which appears as a serial COM port for easy connection between computer and microcontroller.

PCB Design/Assembly

Design

Schematic

Layout

Key takeaways

  • Size constraint was 50 x 50 mm
    • Required to be a hand-held
  • Choosing footprints
    • Selected appropriate footprints and size for passive components.
    • Adjusted pad spacing for ADS1292 footprint which caused clearance conflicts in the DRC.
  • Ground plane was made to reduce noise and ensure signal integrity
    • Provided low impedance return path for ICs.
    • Used grounding to shield sensitive analog portion.
  • Analog section was kept as far from the digital/power sections on the board to prevent signal interference.
  • Verification
    • Using KiCad’s Electrical Rule Checker and Design Rule Checker, violations, such as clearance issues and unconnected nets, were identified and resolved.
  • Ordering the board
    • After creating the Gerber and drill files from the pcb layout, I decided to utilize JLCPCB to handle the fabrication of the PCB.

Assembly

Bare metal PCB
Initial attempt: reflow via hot plate. Result: solder bridging, tombstoning, and passives clumping together, most likely from too much flux or too much solder paste
Rework: hand soldering to fix bridges and reseat tombstoned/clumped components

note i might have swapped 0.1u and 1u capacitor on the north end of the ADS.

  • Final result after rework

  Software Side