Friday, April 21, 2017

Shooting Laser to measure distance



Intro

This time-of-flight sensor is a laser distance sensor, that emits a 940nm laser. It can measure distance up to 125cm quite accurate. Adafruit delivers a ready-to-use library and a functional example you should try.

Wiring


The sensor is connected via I2C. So you have to use pin 4 and 5 on the Arduino Uno/Nano (other Arduinos may have different pins for I2C). It works with 3.3 volts. But since the breakoutboard has a voltage regulator implemented, you can connect it also to 5 volt.

Video


Casing

=> work in progress

Where to buy?
You can find it on eBay, if you search for "Time of flight"
Or directly from Amazon: Time of flight
Arduino Nano

Thursday, April 20, 2017

Raspberry Pi Zero W(ireless)





Intro

On the 28.02.2017, the fifth birthday of the Raspberry Pi, a new version was released. The Raspberry Pi Zero W. The W stands for wireless and indicates that Wifi and Bluetooth is already integrated on this board. Finally.
The 'old' Raspberry Pi Zero costs about 4£ plus shipping, while the new version costs about 9.60£ plus shipping.

Difference in power consumption

One thing that was on my mind is: does the integrated solution draws more or less power other than attaching external Wifi and Bluetooth.
The solution I found most similar to the configuration on the new Pi Zero W was the HAT from Redbear. It also extends the Pi Zero with the same connectivity as the new one has now.
So I installed the same Version of Raspian on both models (Kernel 4.4, Release Date: 2017-03-02), turned Bluetooth on and connect with active Wifi to my home network.

Pi Zero + Redbear HAT Pi Zero W
... ...
140-160 mA 130 mA

More expensive or cheaper?

Well, kind of a tricky question, isn't it? On the first sight, you see the same-sized board with identical specs for more than the double of the price. But think about it. If you want to use it, as a streaming-client, a home cloud server, a broker for IoT projects or even a small PC, you need what? Internet connection. So you need a Wifi dongle. And since it wouldn't fit, you also need a OTG adapter. And a small USB hub would be also nice. Oops! That's a lot of extra to buy.


Watch the Pi Zero W


Worth it?

If you are looking for a small single board computer as a replace for a Lunix based desktop computer, you should probably go for the Raspberry Pi 3.
But if you want to buy a Pi Zero anyway, you should go for the version with the integrated connectivity. Because if you are a maker and want to build your own IoT device, a Webserver or even a autonomous robot, you wish earlier or later that you can communicate with your Pi.

Monday, April 3, 2017

Coolest motion detection sensor


Intro

Ever want to build an alarm system?
The RCWL-0516 is a human body motion detection sensor. A sensor, that detects, through induction, human body movement. So it should only react if a body movement is detected. Moving objects should be ignored. How cool is that?

Wiring


Straight forward. 
GND => GND
5V => VIN
D2 => OUT

Pin 3V3 on the RCWL-0516 is an output. And the CDS-pin you can attach a light sensor. I will cover it in a later video.


Videos

Wiring & Use


ESP & detection tests





Code

Seriously? You set the pin, the RCWL-0516 is attached to, as an input. And if you register a 'HIGH' signal, you do stuff. Watch the video. Coding is done in 2 minutes.

Q&A

Update 29-05-2017
This sensor seems to get quite an attention. There are some questions that some of my viewers asks. Here is what I found out.

Q: Can you use the RCWL-0516 with an ESP8266? Or will you get randomly false positive results?
A: I've done a short term test with the ESP8266 on a NodeMCU board. It seems to work just fine. 
The ESP greater Version 12-E is shielded and is FCC certified. So it should, by definition, not interfere with other electronics.
 However one viewer reported randomly false positive results on a long shot.

Q: Is the water in the human body responsible for the detection?
A: Probably. I tested it with an empty and with a water filled bottle. And even with a cat. And it seems that the bigger the object the further away it can be detected.

Q: Can it be mounted mobile to detect persons? 
A: No. The sensor seems to be quite sensible to movement itself. Any movement of the sensor itself seems to trigger the output.

Q: Does the radiation of the sensor harm you in long term?
A: No. The Sensor uses about 30 milliwatts (mW). The radiation output is limited to that value. That is far less than your smartphone emits.

Links

Amazon

RWCL-0516
NodeMcu
Arduino Uno