Project Log 2: Motion-Sensor Face-off

A project log for Daytripper: Hide-My-Windows Laser Tripwire

A multifunctional laser tripwire.

dekuNukemdekuNukem 08/21/2019 at 10:030 Comments

At the heart of daytripper is the motion sensor. Used to detect the presence of other people, its choice is critical for the success of this project.

Of course as anyone who had worked on an Arduino robot can tell you, there is no shortage of such sensors, with different working principles and price points. However this particular application requires the sensor to be as small as possible, power-efficient, have a reasonable range, highly directional, and cheap enough for mass production.

Thus, I explored a number of potential motion sensors during the planning phase:


Well this isn’t technically a motion sensor, but certainly can be used as one with a bit of machine learning. Modern security cameras do it all the time.

The trouble with this is obvious. It requires a lot of processing power, difficult to design with, quite expensive, power hungry, and its effectiveness depends on lighting conditions. 

Ultrasonic Sensor

Commonly used in those cheeky Arduino robots, ultrasonic distance sensor does look like a good fit for this application. It’s relatively inexpensive ($1), has a great range (up to 4m), and has a simple interface. Its main drawback however is the enormous size. Also, the power consumption of 15mA is on the high side for a battery-powered application. 

Passive Infrared Sensor (PIR)

Another popular sensor for Arduino projects. Also commonly seen in motion-activated lights. This sensor measures the infrared (IR) radiations from objects in its view. Since human gives out IR through body heat, PIR can easily tell if someone is nearby.

PIR is cheap and has a long detection range. However it does not give a quantitative distance reading, and they are usually pretty big too, so that’s another no for this project. 

Active Infrared Sensor

As the name suggests, instead of measuring existing IR, this sensor actively emits a beam of IR. Should it get reflected by a nearby object, the receiver picks it up, and the output changes accordingly. Active IR sensor can be made much smaller, but still suffers the same problem as PIR, as it can only provide a binary output, not a quantitative distance reading.

(image credit pololu)

I have actually purchased a miniature active IR sensor from pololu. As you can see, the design is very compact and well thought-out. A LED emits IR from the bottom side of the circuit board, and a receiver on the top side pick up the reflected light.  However, components on both sides is a manufacturability issue, since the boards needs to be populated and reflowed twice, increasing the cost of assembly. It was also not very directional and overly sensitive during my test. Close, but no cigar. 

Laser Time-of-Flight Sensor

(image credit Adafruit)

Laser ToF sensor works very much the same as the AIR above. However instead of infrared, it shoots out a frickin’ laser beam, which is bounced back into the receiver. Only this time, the sensor is able to measure the amount of time it takes for the laser to complete the round-trip, and thus calculating a distance.

Compared to other sensors, Laser ToF can be made very small, its simple operation principle means that very little processing power is needed, its power consumption is moderate, however since each measurement can be very fast, the average current can be rather favourable. The laser is also highly directional to avoid false triggering.

Disadvantages? Harsh ambient lighting such as direct sunlight might overwhelm the laser and affect its performance, so a lot of those sensors work best indoors. It is also a bit more expensive compared to others, but price has been coming down in recent years. 

The VL53L0X

After a bit of research, I chose VL53L0X as the laser ToF sensor for this project. ST makes a number of ToF sensors, and this one is reasonably priced, has existing library and documentations, has a suitable range (2 to 120cm), and very small and easy to interface.

When it launched in 2016, ST called it the worlds smallest laser ToF sensor, at 4.4x2.4x1.0mm. While probably not anymore, it is still perfect size for this project. And it uses I2C for communication, so basically you just need to hook up two wires and you’re good to go. Simple!