A multifunctional laser tripwire.
Since the transmitter (TX) needs to talk to receiver (RX) when triggered, we need to find a way of wireless communication between the two.
There are a number of popular wireless chips. ESP8266 is for WiFi, so not relevant here. The ubiquitous 433MHz RF module is another option. They are very cheap, but take up a lot of space. Those modules are also relatively primitive in terms of functionality, as they don’t have error detection/auto retransmit/different channels. Reliable transmission is very important in this project, so not ideal.
The easy winner in this case would be the hugely popular nRF24L01 “Single chip 2.4 GHz Transceiver”. This chip is found on countless ready-made modules for Arduino projects, with vast amount of documentation and community support. This chip supports a huge amount of RF channels and communication addresses, sophisticated error detection and acknowledgement/retransmit algorithms, and a fast data rate. Those chips are also very reasonably priced, where a ready-to-use module only costs around $2.
Which leads to a fascinating question, how can a complete module costs half as much as a bare chip on mouser?
The answer is, as many has discovered, very simple, the chip on those cheap modules are actually Chinese counterfeits. There are multiple threads about this issue:
The thing is that a lot of users report that the counterfeit chip works just fine, and that made me curious. I did some digging around internet, and found that most of the counterfeit chip is actually a compatible clone called Si24R1. They could have just called it that and it would have been fine, but relabelling them as nRF24L01 is where they crossed the line.
If you dig around a bit, you can find Si24R1 for sale for as little as $0.375 each, that’s less than a tenth of the price of a genuine nRF chip! Pretty remarkable, and now you know how they make money on those cheap modules. Anyone I bought half a dozen of those Si24R1 chips for testing on prototypes to see how they really work.
With the motion sensor selected, it’s time to think more about the overall design of the transmitter (TX).
It might seem strange, but for a lot of projects, and certainly this one, the design actually starts from the battery. After all, the battery dictates a majority of space , and careful consideration about the chemistry, shape, and capacity is needed in order to achieve the best balance between cost, performance, and manufacturability.
Broadly, we have rechargeable and single-use batteries. Obviously for this application we want the TX unit to be rechargeable so the user doesn’t have to swap batteries all the time.
And for rechargeable batteries, popular ones include Nickel-based such as NiCD and NiMH. The former is very toxic, and both only provide 1.2V per cell. So that means for a 3.3V system, either a step-up converter or multiple cells are needed, not good for the cost.
And so we come to our old friend LiPo battery. Used from everything from smartphones to drones, they are available in a massive selection of shapes and capacities. I spent hours going through listings on ebay aliexpress, and ended up with two contesters. Coin-battery or a small LiPo pouch cell:
The pouch comes in a number of difference sizes, the one I have is 500mAh but there are some smaller ones around 200mAh. The coin cell comes in two sizes, LIR2450 and LIR2477, both have the same diameter but the latter is thicker. As a result LIR2450 has a typical capacity of 100mAh while LIR2477 has 150mAh.
The pouch cell seems to be more space-efficient, since it doesn’t have the metal enclosure of the coin battery. On the other hand, it does mean it is more prone to accidental damage such as crush and puncture. And for a small production run of a few hundreds, securing the battery will involve either making a proper enclosure with a battery compartment, or using adhesive to fix it to the circuit board, neither are unnecessary complexities. Additionally, the two battery terminals will need to be either soldered or mated with a connector. Former is a bit of extra work, latter adds cost and takes up valuable space on the circuit board. Plus, two battery wires dangling isn’t a neat sight to behold.
That’s where the coin cells starts to shine. The metal shell means it’s stronger and less likely to break, and since I managed to find some with attached pins, it is much easier to solder, eliminating the use of a connector and dangling wires. The spacing between the terminals also leaves an ideal amount of PCB real estate for components. Meaning the finished product will have a clean and professional look.
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.
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.
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.
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.
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 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.
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,...Read more »
Probably like all great inventions, the concept of daytripper popped up out of nowhere one day, and the more I thought about it, the more I was hooked.
The idea was to design a motion-detector that is able to hide one’s activity on a computer. There would be a transmitter (TX) and a receiver (RX), the user would put TX in the path of an incoming threat, and plug RX in their computer.
Once motion is detected by TX, it should talk to RX wirelessly, which would then act as a USB keyboard and press Win + M to minimise all the windows, leaving users dignity intact. The product should also be as small and easy to use as possible, with a long battery life.
I soon realised that it is going to be a project with great potential:
As for the name, The song by the Fab Four was stuck in my head, and it seemed like a perfect fit too, so Daytripper it is.