Typical simple gestures to wake up the best design for portable devices

This article discusses how to wake up touch devices such as tablet computers without touching the device. Instead, it uses basic gesture recognition and a novel proximity detection sensor. This article discusses the physical layout, speed limit, detection threshold, system integration, and human factors of the relevant design; the real-time routines of the software are given.

Sudden whim in the kitchen

If you use a touch device when cooking, you may notice that cooking according to the recipes listed on the device is not as simple as imagined. Technologists (such as scumbags) like to look at recipes on a tablet or smartphone when they walk into the kitchen. You might say, "Well, what's the difficulty?" Because the screen always turns on and consumes a lot of power, usually the handheld device will automatically go to sleep when it is not operated after 1, 2 minutes. Then, when you need to refer to the recipe, the device has entered the sleep state. In this case, you are faced with two options: either force the screen to remain on permanently; or turn on the device with a hand covered with food and leave a greasy stain on the screen. Of course, you can clean your hands every time you look at it, but repeatedly washing your hands and drying them is cumbersome and water-consuming.

I often ask myself: "How can I keep the screen on and not dirty the device?" In fact, there is a way to do two things with one stone, that is, turn on the display with one gesture (without touching the screen). Sounds complicated, doesn't it? Fortunately, it may be easier than it sounds.

Proximity detection sensor

Many touch screen devices, especially smartphones, have installed infrared (IR) proximity detection sensors inside. These sensors generally turn on / off the screen automatically during a call to avoid accidentally operating the phone's input interface. This sensor, coupled with smart software design, can realize the function of awakening the device with a gesture.

The basic design idea is: when the device enters the sleep state, the touch screen is turned off, the application processor is in a low-power mode, relying on the proximity detection sensor to "observe" background changes, and respond appropriately when the received signal is large enough. This is almost the same as the function of the proximity sensor to turn off the screen during a call. However, our application has a different interpretation of the data.

First record the count value of the sensor in the "normal" background, the value obtained at this time may be zero, but the actual design needs to consider the system offset (for example: scattering or crosstalk). Then set the obtained value as the detection threshold, when the received signal exceeds the threshold, trigger an interrupt or send a signal to the application processor to wake up the system and open the screen. Overall, this method is very simple and intuitive, and can be implemented using ambient light detectors and IR proximity detection sensors.

The solution described in this article uses the MAX44000, and the data reading interval for proximity detection can be set from 1.56ms to 100ms (in turn reading data with the ambient light detection sensor). Assuming that the maximum detection distance is 10cm and the radiation angle of the LED is ± 15 °, then the area that can be covered is about 22cm2 or the span is about 5.35cm, and only moving targets in this area can be captured. Therefore, the fastest gesture that can be reliably detected at the slowest (ie, lowest power consumption) sampling speed is about 0.53mps. Here, we also assume that the sensor only needs to collect a signal above the threshold to recognize Cover the target area.

Hands up ...

In theory, the implementation of this program is very simple. When the device enters the sleep mode, the proximity detection sensor is set to the environmental scanning mode, and an interrupt signal is issued when a target is detected, indicating that a signal exceeding a preset threshold is captured. The status of the sensor can be polled through the I2C interface. Unfortunately, this method consumes too much power and exceeds the expectations of most users.

This is also the design focus of the proximity detection sensor. The MAX44000 sensor can get rid of the application processor's intervention in many ways, reducing processor load (reducing power consumption).

Enable the MAX44000's internal proximity detection interrupt (register 0x01, bit 1), and write the wake-up threshold to the internal registers (0x0B and 0x0C). When the reading of the proximity detection sensor exceeds the threshold, the interrupt flag is set and the MAX44000 / INT pin is set to low level. When the application processor detects that this pin is driven low, it can wake up the device to exit low-power mode, turn on the screen, or complete other required actions.

… But not to be ignored

The actual application is often not as easy as theory, and the specific implementation of non-contact wake-up is not simply to detect signals above the threshold. In fact, the specific design needs to consider many factors.

Signal level and circuit layout

The most critical consideration should be the signal level that triggers the wake-up condition, and there is a trade-off between system response sensitivity and false alarm probability. If the threshold is too low, it is easy to detect the input (gesture work), but it will increase the probability of false alarms caused by transient noise or sudden conditions. Conversely, an excessively high detection threshold can reduce the probability of false positives to almost zero, but it can only detect very close targets, and even become unresponsive to any input (even if you shake your arm crazy).

The best way to solve this problem is: first reduce the system noise, which can be achieved by optical methods or rigorous circuit layout. The reduced noise floor helps reduce the probability of false alarms; second, choose the "average" detection distance (for example: 4cm To 5cm) and using the reference target to measure the signal, an 18% gray board is ideal, but if black glass is installed above the touch screen, such glass should also be used for measurement. The measured signal level can be used as the best setting threshold reference. Generally, you can follow the principle that the level is set at 8% to 15% of full scale, even if the level changes.

The proximity detection threshold register of the MAX44000 sensor can be set according to the above empirical data. Figure 1 shows the relationship between the signal strength and the distance. The 18% gray board is used, the drive current is 100mA, and there is no glass cover above the sensor. The blue line is the selectable wake-up threshold.

Figure 1. The relationship between the signal strength of the MAX44000 proximity detection sensor and the distance, using an 18% gray board, 100mA drive current, and no glass cover

Figure 1. The relationship between the signal strength of the MAX44000 proximity detection sensor and the distance. It uses an 18% gray board, 100mA drive current, and no glass cover.

Noise and low-pass filtering

When you need to consider noise, you can use a low-pass filter to process the signal; in addition, the MAX44000 has several control bits that can be used as a mask before triggering the interrupt flag. When using this setting, you need to detect a certain number of sampled values ​​that exceed the threshold Only when the interrupt flag is triggered can the noise impact be reduced to a certain extent.

A slightly more complicated method is to store the sensor readings in a data queue, and then filter them using custom FIR software. But this method needs to increase the sampling rate of the proximity detection sensor, otherwise it will reduce the gesture action rate within the visible range of the sensor that can be captured, especially when the sampling rate is set at 100ms. When using the device's control bit mask detection, the rate can be reduced by up to 16 times (usually select 4x mask).

Gesture speed

The speed of gestures is another factor we need to consider. The maximum speed depends on: 1. The visible range of the sensor; 2. The distance between the hand and the sensor; 3. The sampling rate; 4. The detection threshold. The first two items are easy to determine: the detection angle of the sensor, combined with the distance between the sensor and the target, can use the basic triangle to calculate the moving distance of the target within the visible range of the sensor. For example, if the angle of view of the sensor is 30 degrees and the maximum effective detection distance is 10cm, then the allowed moving distance of the target within the visible range of the sensor is 5.35cm and the coverage area is approximately 78cm2. The linear distance combined with the sampling rate can determine the speed limit . Specifically, if the sampling rate is T, the time for the target to cross the visible area must not be less than T. For example, if T is 100ms (the minimum sampling rate of MAX44000), then according to the above example, the theoretical maximum allowable rate is 1mps ( This is actually quite fast). You may want to capture multiple samples to confirm the trigger wake-up. In this case, the lower limit of the allowed rate will be reduced.

The detection threshold also affects the maximum allowable rate. Generally speaking, the lower the threshold, the faster the gestures that can be captured. As mentioned above, the threshold should be chosen carefully to avoid false alarms.

Human Factors

This kind of application will also be affected by human factors such as the hand and waving. Some cases should be used to determine the general habits of most people, including the speed at which they wave their palms in front of the screen and the distance from the screen. In addition, whether they wear gloves will also have a certain impact. Different applications (different devices) will also affect the design requirements, such as smartphones, tablets or car dashboards, there are specific design considerations. Of course, the user interface and empirical parameters should also be considered during the design process.

Finally, it is necessary to make a judgment on the true and false gestures, that is, the device needs to judge whether the received signal comes from a gesture action or a simple device movement (for example: placed in a coat, pocket or backpack, or placed with the screen facing down ). Relying solely on the above detection principle, it is difficult to make correct "authenticity" identification unless more background information is provided in the device. Discussion on this issue is beyond the scope of this article.

The design can choose to start the wake-up solution only when the device enters a specific application, or it can be manually enabled by the user. In addition, many of these devices have an acceleration sensor that can detect whether the screen is placed face down. If the user manually puts the device into sleep mode, the function can be disabled (for example, off).

Design example

For convenience, this article is accompanied by three sections of demo program code. The first piece of code is used to manually read the proximity detection data of the MAX44000, which is conceptually simple to implement the wake-up function; the second piece of code is expanded on the basis of the first piece, adding the filtering function discussed previously; Use the MAX44000 interrupt to wake up the touch device.

Medical Atomization

The utility model relates to a medical atomization treatment and humidifying device belonging to the technical field of medical equipment and household appliances.


Professional Medical Atomization manufacturer is located in China, including Medical Vape,Dose Control Vape Pen,Supersonic Wave Vape, etc.2-2

Medical Atomization,Medical Vape,Dose Control Vape Pen,Supersonic Wave Vape

Shenzhen MASON VAP Technology Co., Ltd. , https://www.masonvap.com