Detecting obstacles using an ultrasonic sensor HC-SR04

Detecting obstacles using an ultrasonic sensor HC-SR04

1 HC-SR04: a cheap ultrasonic sensor

1.1 Description

HC-SR04 front view
Fig.1 – An HC-SR04 seen from front side.

HC-SR04 is a commonly used ultrasonic sensor which is capable to detect obstacles in a range of 2-300cm. The sensor looks like a small PCB having two metal cylinders on the front-side and a small circuit on the back-side (see Fig.1).

1.2 Documentation

In this article we will provide a simple demo to use HC-SR04. This requires a preliminary read of the sensor user manual:
HC-SR04 User Manual

1.3 Pinmap description

The sensor has 4 PIN:

  1. VCC, which must be connected to 5V;
  2. Trig, which is an input PIN to trigger the measurement;
  3. Echo, which is an output PIN which sent out a square wave;
  4. GND, which must be connected to ground.

Note that user manual specifies which GND must be connected first since a floating 5V could permanently damage the sensor.

2 How it works

The two cylinders are actually an ultrasonic receiver (R) and an ultrasonic transmitter (T) which are driven by the circuitry. The working principle is quite simple: when triggered the transmitter shoots some pulses. When sound encounters an obstacle it is echoed back and detected by the receiver. continue reading…

Review of WeSU: a development board for wearable applications.

Wesu Review

1 Introduction

At the recent event “ST = Life Augmented”, held in Milan during the Class Digital Experience Week, STMicroelectronics has raffled various development kits, for attendees who enrolled to the event through the Pepite blog. Apart to the famous STM32 Nucleo-64 board and some of its Expansion Board (the STM32 x-Nucleo), the most interesting thing was the development kit for wearable applications, the STEVAL-WESU 1, valued at approximately 50€ and we were lucky to get one for free.

STEVAL-WESU1 stand for ST EVALution WErable Sensor Unit, and is an evaluation kit to test various sensors brought by ST for a large number of products such as mobile, tablet and now proposes they to build personal wearable devices. On top of the box there is little information about its contents, as to hide the little treasure that encompasses inside, as you can see in Fig.1. We read that the device is compact, which has a dedicated firmware for wearable devices and an APP available for both Android and iOS, but no mention about the hardware components. continue reading…

STM32 Nucleo-144 review

STM32 Nucleo-144 Review

1 Introducing new Nucleo-144

The STM32 Nucleo-144 is a new series of development board by STMicroelectronics. It is the third announced series titled Nucleo. Each Nucleo-144 share the same pin map for each board and features a new connector named ST ZIO which is compatible with Arduino Uno Rev3 connector.

This new series takes his name from the number of pads exhibit by its different MCUs which are all a LQFP144 package. Indeed, the STM32 Nucleo is currently available in 5 configurations we will discuss later. continue reading…