Yash Sanghvi has Published 220 Answers

How to Use Light Dependent Resistor (LDR) with Arduino?

Yash Sanghvi

Yash Sanghvi

Updated on 24-Jul-2021 13:16:00

The resistance of a Light Dependent Resistor (LDR) changes depending on the intensity of the light falling on it. Interfacing an LDR with Arduino is quite straightforward. You just create a voltage divider as shown below −One end of the LDR is connected to 5V, the other end to a ... Read More

CAN Bus with Arduino

Yash Sanghvi

Yash Sanghvi

Updated on 24-Jul-2021 13:11:34

Communication protocols like UART (Serial), I2C and SPI are very popular because several peripherals can be interfaced with Arduino using these protocols. CAN (Controller Area Network) is another such protocol, which isn't very widely popular in general, but find several applications in the automotive domain.While going into the details of ... Read More

Interface touch sensor with Arduino

Yash Sanghvi

Yash Sanghvi

Updated on 24-Jul-2021 13:03:19

A touch sensor looks like the one below −It has 3 pins − Vcc, GND and Signal. Whenever someone touches the sensor, the signal pin goes HIGH (it generally outputs LOW when not touched). Thus, we just have to digitalRead the Signal Pin and determine if the sensor is being ... Read More

Interface proximity sensor with Arduino

Yash Sanghvi

Yash Sanghvi

Updated on 24-Jul-2021 12:59:28

There are various types of proximity sensors available. Ultrasound sensor, which we discussed in another article for measuring distance, can also be used as a proximity sensor. In this article however, we will consider IR proximity sensor.A typical IR proximity sensor looks like the one below −There is an IR ... Read More

Understanding memory types in Arduino Uno

Yash Sanghvi

Yash Sanghvi

Updated on 24-Jul-2021 12:51:38

Arduino Uno, or any other microcontroller for that matter, generally has 3 types of memory −FlashThis is where Arduino sketch is stored.Any variable defined using PROGMEM or the F() macro is also stored here. Note that such variables are immutable by default, i.e., their values can't be changed at runtime.Flash ... Read More

How to use F() macro in Arduino?

Yash Sanghvi

Yash Sanghvi

Updated on 24-Jul-2021 12:48:45

Often, you may have a lot of print statements in your Arduino code. These are generally stored in the SRAM.However, if your sketch has too many of these print statements, they can fill up the SRAM very quickly. In such a scenario, it may be wise to store these print ... Read More

How to use PROGMEM in Arduino to store large immutable data?

Yash Sanghvi

Yash Sanghvi

Updated on 24-Jul-2021 12:45:54

PROGMEM is the keyword you use when you wish to store data in the program memory (flash) instead of the SRAM. While you can use PROGMEM for a single variable, it won't make much sense to do so. After all, the SRAM would have more than enough space to accommodate ... Read More

Cyclic Redundancy Check (CRC) in Arduino

Yash Sanghvi

Yash Sanghvi

Updated on 24-Jul-2021 12:37:57

CRC stands for Cyclic Redundancy Check (CRC). It is, in simple words, an algorithm used to detect errors in received messages. The idea is similar to parity, but this is much more robust.If a transmitter is sending a packet to a receiver, the transmitter will calculate a CRC code based ... Read More

AVR libraries in Arduino – Introduction

Yash Sanghvi

Yash Sanghvi

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

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

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

Previous 1 ... 6 7 8 9 10 11 12 ... 22 Next
Advertisements