Yash Sanghvi has Published 220 Articles

AVR libraries in Arduino – Introduction

Yash Sanghvi

Yash Sanghvi

Updated on 24-Jul-2021 12:18:20

665 Views

AVR libraries are developed by Atmel. You might be knowing that the microcontrollers used in most Arduino boards are Atmel microcontrollers (ATmega328P, ATmega2560, etc.). AVR libraries for several specific operations (sleep, time, etc.) already exist, and therefore, we may greatly benefit if we are able to import AVR libraries within ... Read More

Watchdog timer in Arduino

Yash Sanghvi

Yash Sanghvi

Updated on 24-Jul-2021 12:14:23

6K+ Views

A watchdog timer is an essential part of any microcontroller. It resets the program if the program gets stuck anywhere. Very briefly, this is how the watchdog timer works −The timer keeps incrementing.The program has to ensure that it keeps resetting the timer, i.e. does not allow it to overflow.If ... Read More

Interfacing an ultrasonic sensor with Arduino

Yash Sanghvi

Yash Sanghvi

Updated on 31-May-2021 15:01:09

3K+ Views

In this tutorial, we will interface the ultrasonic sensor HC-SR04 with the Arduino to get the distance from a surface in centimetres.Circuit DiagramAs you can see, you need to connect the Vcc pin of HC-SR04 to 5V, GND to GND, Trig pin to pin 7 of Arduino Uno, and Echo ... Read More

Read a specific bit of a number with Arduino

Yash Sanghvi

Yash Sanghvi

Updated on 31-May-2021 15:00:22

2K+ Views

Each number has a specific binary representation. For example, 8 can be represented as 0b1000, 15 can be represented as 0b1111, and so on. If you wish to read a specific bit of a number, Arduino has an inbuilt method for it.SyntaxbitRead(x, index)where, x is the number whose bits you ... Read More

Interfacing a speaker with Arduino

Yash Sanghvi

Yash Sanghvi

Updated on 31-May-2021 14:59:20

813 Views

In this tutorial, we will interface a simple piezo-buzzer with Arduino to create beeping sounds. Such an arrangement can be used in applications like burglar alarms, or water level indicators or such similar projects.Circuit DiagramAs you can see, the circuit diagram is quite straightforward. You need to connect the buzzer’s ... Read More

Getting data from temperature and humidity sensor using Arduino

Yash Sanghvi

Yash Sanghvi

Updated on 31-May-2021 14:58:55

367 Views

In this tutorial, we will interface Arduino DHT-22 Temperature and Humidity Sensor and print the obtained temperature and humidity values on the Serial Monitor.Circuit DiagramWhen the DHT-22 is facing you, the first pin from the left, the VCC pin is connected to 5V, the next pin is the DATA pin, ... Read More

Getting data from Vibration sensor using Arduino

Yash Sanghvi

Yash Sanghvi

Updated on 31-May-2021 14:49:41

2K+ Views

In this tutorial, we will interface Arduino with the MPU6050 Vibration sensor.Circuit DiagramAs you can see, we connect Vcc to 3.3V, GND to GND, SDA to A4 and SCL to A5. A4 and A5 also serve as SDA and SCL on Arduino Uno.Code WalkthroughThe code is given below −#include ... Read More

Displaying data on OLED Screen using Arduino

Yash Sanghvi

Yash Sanghvi

Updated on 31-May-2021 14:49:17

734 Views

In this tutorial, we will interface Arduino with the SSD 1306 OLED Display.Circuit DiagramAs you can see, we connect Vcc to 3.3V, GND to GND, SDA to A4 and SCL to A5. A4 and A5 also serve as SDA and SCL on Arduino Uno.Required LibrariesThe following libraries will be required ... Read More

Interfacing GNSS receiver with Arduino to get speed

Yash Sanghvi

Yash Sanghvi

Updated on 31-May-2021 14:45:34

126 Views

In this tutorial, we will interface Arduino with a GNSS Receiver and obtain the speed. If possible, you can run this code in a moving vehicle, because otherwise you will get 0 speed if your GNSS receiver is stationary. Any GNSS receiver generally uses UART for communication. We will be ... Read More

Map a 10-bit number to 8-bit in Arduino

Yash Sanghvi

Yash Sanghvi

Updated on 31-May-2021 14:45:03

901 Views

Mappings often have to be performed in Arduino for a variety of reasons. One example would be mapping the 10-bit ADC output to 8-bit to save on storage. A 10-bit number would occupy 2-bytes for storage, whereas an 8-bit number would occupy just one byte and still preserve most of ... Read More

Advertisements