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

Monday, March 20, 2017

Makers most popular HC-SR05 ultrasonic sensor



Intro

If you're starting with Arduino, you won't get past this sensor. It's a cheap, easy-to-use ultrasonic distance sensor. If you ever wanted to build your own obstacle avoiding robot, you'll need at least one of these sensors.

How it works

In simple words. There is a speaker that emits an ultrasonic impulse. The pulse is not audible for the human ear. The pulse travels with the speed of sound. And when it hits a target, it's reflected back to the sensor, where a microphone can detect it. And because we know how fast sound travels, we can calculate by the duration of the impulse to came back, the distance to the object.



Wiring

Wiring is easy. The sensor works with 5V. And both data pins are also 5V tolerant. So fist the usual 5V to 5V and GND to GND.
I attached the trigger pin to Digital 2 (D2) and the echo pin to Digital 3 (D3). But you can use any digital pins.Although I wouldn't recommend using Pin 0 or Pin 1, cos' it would probably interfere with the serial monitor.


Video


Watch the video. It probably will answer all your questions.

Tuesday, March 14, 2017

Dallas 18B20 temperature sensor



Intro

The Dallas 18B20 is probably the most common temperature sensor in the Arduino community. It's cheep, it's small and part of many Arduino startet kits.

Wiring


The left pin is the Ground (GND) pin. The middle is the data line. We connect the data line to digital pin 2 (D2). The right pin can be connected to 3V3 or to 5V. And since this sensor works on the 1-wire bus, we have to connect the data line also to VCC though a 4.7kOhm resistor.

Video


Here is the Video of the process.


Code

 Just install a library for the Dallas sensor and open the simple sketch
DallasTemperature library

The simple sketch
 If you run the serial monitor, you can see the actual temperature.

Thursday, March 9, 2017

DHT22 temperature and humidity sensor



Intro

The DHT11/DHT22 is a quite popular sensor in the maker scene. It's a temperature and humidity sensor.
Easy-to-use, quite accurate and also affordable. If you're looking for examples of self made weather stations, you'll find that many makers use exactly this sensor. There are many different temperature sensors on the market. But only few, cheap humidity sensors.

Wiring

Code

 I didn't develop any code for this. Since, when you search for DHT in the Library Manager and install a fitting library, you can load an example and it will work. (see video).

Video


1-Wire bus

While searching the internet I found several different datasheets to this sensor and many different tutorials to this sensor and how to implement a pullup resistor to this. So I tested different configuration myself. And I found out that the sensor would even work without any resistors. The sensor using the 1-Wire bus. So I would recommend using a resistor. About the correct value I'm unsure. But it seems everything between 1kOhm and 10kOhm will work just fine.

Links

Amazon
DHT22 Sensor
Arduino Nano
Breadboard
Resistors

Sunday, February 5, 2017

Controlling NeoPixels with a Webserver on an ESP8266

Esp 8266 NeoPixel Webserver

Intro

I always wanted one of those fancy LED stripes that you can control with your mobile or tablet. Should be easy to install, lightweight and customiseable.
Well, my brother-in-law is fascinated of this topic as I am. And Christmas was at our doorstep. So what better to do than try to build him a DIY-light.
Well getting started with it was quite frustrating. And it took me quite a while to figure out how it is done since this was my fist contact with the ESP8266.
After I posted a video of the result on FB, I was getting many requests for a manual to this.

Shopping List

Before soldering it to a PCB, I prototyped it on a breadboard. Here is everything you'll need.

  • 2x Breadboard 400 Pins
  • Logic Level Shifter (3V to 5V)
  • NodeMCU Esp8266
  • Breadboard Power supply
  • Jumper Wire
  • Neopixel (W2812b) Stripe

HowTo Video

Here is a step-by-step video how it is made.


Code

Posted the Code on Bitbucket (it's like Github). There you can find the source code and wiring.
https://bitbucket.org/Remnis/neopixelwebserver

Advice

The level shifter might not be necessary. The NeoPixel stripe could also work with 3.3 V on the command line. But it would be best if the difference between supply voltage and command voltage would not be so high.
And be aware not to power a whole NeoPixel stripe from your controller. On other Projects I blew up two Arduino Nano.