Found 387 Articles for Hardware

Arduino Uno vs Arduino Micro

Yash Sanghvi
Updated on 24-Jul-2021 13:30:14

792 Views

We will have a comparison of the specifications of Arduino Uno and the Arduino Due BoardArduino UnoArduino MicroRefer to the table below for a detailed comparisonUnoMicroGeneralDimensionsPricing2.7'' x 2.1''$20-231.88'' x 0.7''$20-21ConnectivityI/O PinsPWM PinsAnalog Pins146620712ComputingProcessorFlash MemorySRAMEEPROMClock speedVoltage LevelUSB ConnectivityATmega328P32 kB2 kB1 kB16 MHz5VStandard A/B USBATmega32u432 kB2.5 kB1 kB16 MHz5VMicro USBCommunicationHardware Serial PortsSPI SupportI2C Support1YesYes2YesYesArduino Micro is very similar to Leonardo. The biggest difference between Micro and Leonardo, perhaps, is the form factor. Apart from the differences mentioned in the above table, one other major difference that I'd like to highlight −Micro's ATmega32u4 has in-built USB communication, thereby eliminating the need for a ... Read More

Arduino Uno vs Arduino Leonardo

Yash Sanghvi
Updated on 24-Jul-2021 13:19:49

523 Views

We will have a comparison of the specifications of Arduino Uno and the Arduino Leonardo Board.Arduino UnoArduino LeonardoRefer to the table below for a detailed comparison −UnoLeonardoGeneralDimensionsPricing2.7'' x 2.1''$20-232.7'' x 2.1''$20-21ConnectivityI/O PinsPWM PinsAnalog Pins146620712ComputingProcessorFlash MemorySRAMEEPROMClock speedVoltage LevelUSB ConnectivityATmega328P32 kB2 kB1 kB16 MHz5VStandard A/B USBATmega32u432 kB2.5 kB1 kB16 MHz5VStandard A/B USBCommunicationHardware Serial PortsSPI SupportI2C Support1YesYes2Yes (master only)YesApart from the differences mentioned in the above table, two other major differences that I'd like to highlight −The SPI pins on Leonardo are not exposed via digital pins, but via ICSP headers.And the slave select pin is not exposed at all. Therefore, the Leonardo ... Read More

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

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

427 Views

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 resistor (whose resistance should be approx. the same order of magnitude as the max resistance of the LDR). For instance, we are using an LDR with a resistance of 90K and the resistor has the maximum resistance of 150K. The other end of the resistor is connected to GND, and ... Read More

CAN Bus with Arduino

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

10K+ Views

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 CAN bus is beyond the scope of this article, you can find the relevant information here. However, here are a few things you should know −CAN is a message-based protocol (i.e., the message and content are more important than the sender). A message transmitted by one device is received by ... Read More

Interface touch sensor with Arduino

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

521 Views

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 touched.Circuit DiagramThe circuit diagram is quite straightforward as shown belowAs you can see, the GND pin of touch sensor is connected to GND pin of Arduino, the Vcc pin to 5V and the SIG pin to pin 7 of the Arduino.Example CodeThe code is also quite straightforward, as you can ... Read More

Interface proximity sensor with Arduino

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

2K+ 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

393 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

1K+ 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

6K+ 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

4K+ 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

Advertisements