Found 381 Articles for Hardware

Interface proximity sensor with Arduino

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

3K+ Views

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 Emitter LED and an IR Receiver (photodiode). As you can see, the sensor has 3 pins (VCC, GND and OUT). The OUT pin gives a LOW signal when the there is an obstacle which acts as a reflecting surface, and the light from the LED is reflected back to the ... Read More

Understanding memory types in Arduino Uno

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

630 Views

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 memory is non-volatile (i.e., the stored content is not lost even after power is turned off)It is slower to access than SRAM, but since it is much larger in size than SRAM, some immutable strings/ arrays can be stored here to avoid overflow of SRAM.It generally has 10, 000 read/write ... Read More

How to use F() macro in Arduino?

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

2K+ Views

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 statements within flash memory (flash memory is generally much larger in size than SRAM). This is assuming that your sketch doesn't occupy the entire flash memory (which it generally doesn't).ExampleA print statement like −Serial.print("A typical constant string to be printed");Can be replaced with the following −Serial.print(F("A typical constant string to ... Read More

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

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

8K+ Views

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 your single variable, and it will be faster to access the variable stored in SRAM.PROGMEM is primarily used for large chunks of data (an array mostly), which can overwhelm the SRAM (which is generally much smaller in size than the flash memory, but faster to access). The implication of storing ... Read More

Cyclic Redundancy Check (CRC) in Arduino

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

5K+ Views

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 on some polynomial calculations on the packet, and append it to the packet. The receiver will perform the same calculations on the packet, and check if the generated CRC matches the CRC that came in with the packet. If the two match, there were no errors introduced in the transmission, ... Read More

AVR libraries in Arduino – Introduction

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

866 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 Arduino. The good news is that we can!As per Arduino's website, "AVR libraries have the potential to greatly extend the Arduino language. The Arduino system is based on the avr-gcc compiler and makes use of the standard AVR libc libraries, which are open-source C libraries, specifically written for Atmel hardware, ... Read More

Watchdog timer in Arduino

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

7K+ 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 the timer overflows, it means that the program was stuck somewhere and therefore was unable to reset the timer. An interrupt is generated on timer overflow which resets the microcontroller.To implement watchdog timer in Arduino, we use the avr wdt library.The code is given below −#include void setup() {   ... Read More

tone() and noTone() in Arduino

Yash Sanghvi
Updated on 30-Jul-2021 12:45:59

6K+ Views

The tone function can be used to generate a square wave (50% duty cycle) of a specific frequency on a pin.SyntaxThe syntax is −tone(pin, frequency)pin is the pin number on which to generate the tone. The frequency is specified in Hz.This function can also take in a third optional argument − the millisecond duration for which the tone should be generated on the pin.tone(pin, frequency, duration)If you don’t specify the duration, the tone will continue till the noTone() function is called on the same pin. The syntax of the noTone() function is −noTone(pin)where pin is the pin number on which ... Read More

Difference Between Microprocessor and Microcontroller

Kiran Kumar Panigrahi
Updated on 31-Aug-2023 01:46:56

221K+ Views

Both microprocessors and microcontrollers are types electronic devices that come in the form of integrated circuits (ICs) and are used in different modern electronic equipment such as computers, laptops, washing machines, air conditioners, and many other automated electronic gadgets. The primary function of both microprocessors and microcontrollers is to automate the processes. Read this article to find out more about microprocessors and microcontrollers and how they are different from each other. What is a Microprocessor? As its name implies, it is a processing device that converts data into information based on some sets of instructions. It is a very ... Read More

Difference Between SATA and PATA

AmitDiwan
Updated on 24-Apr-2021 07:34:43

839 Views

In this post, we will understand the difference between SATA and PATA −PATAIt stands for Parallel Advanced Technology Attachment.It is a 40 pin connector.It is expensive.The speed of data transfer is low.It consumes more power.The size of the cable is big.It doesn’t come with hot swapping feature.External hard drives can’t be used with PATA.SATAIt stands for Serial Advanced Technology Attachment.It is a 7 pin connector.It is cheap.The speed of data transfer is high.It consumes less power.The size of the cable is small.It comes with the hot swapping feature.External hard drives can be used with SATA.Read More

Advertisements