marți, 26 aprilie 2022

Arduino Thermometer with RTC Clock

  This is an update of the previous project TM1637 4-Digit Display Clock Arduino Project . I added a temperature & humidity sensor DHT11 or DHT22.

Schematics:

Source code:

Simple Arduino Project with DHT11/22 sensor and TM1637 LCD

 This is a simple Arduino project based on DHT11 or DHT22 temperature&humidity sensor and TM1637 4 digit 7 segment LCD.



 

Ultrasonic Sensor HC-SR04 Arduino Project

 

The HC-SR04 is an affordable and easy to use distance measuring sensor which has a range from 2cm to 400cm (about an inch to 13 feet).

The sensor is composed of two ultrasonic transducers. One is transmitter which outputs ultrasonic sound pulses and the other is receiver which listens for reflected waves.

How the HC-SR04 Ultrasonic Distance Sensor Works?

It emits an ultrasound at 40 000 Hz which travels through the air and if there is an object or obstacle on its path It will bounce back to the module. Considering the travel time and the speed of the sound you can calculate the distance.

For that purpose we are using the following basic formula for calculating distance:

Distance = Speed x Time

The time is the amount of time the Echo pin was HIGH, and the speed is the speed of sound which is 340m/s. There’s one additional step we need to do, and that’s divide the end result by 2. and that’s because we are measuring the duration the sound wave needs to travel to the object and bounce back.

How to Connect HC-SR04 Ultrasonic Sensor to Arduino

Here’s how we need to connect the HC-SR04 sensor to an Arduino board.



 

HC-SR04 Ultrasonic Sensor Arduino Code

Here’s a code for measuring distance using the HC-SR04 ultrasonic sensor and Arduino.

luni, 18 aprilie 2022

TM1637 4-Digit Display Clock Arduino Project

 This project shows you how to make a digital clock using a TM1637 4-digit 7-segment display with Arduino.


TM1637 4-Digit Display Clock Source Code