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