Difference Between Hardware Serial and Software Serial in Arduino

Yash Sanghvi
Updated on 30-Jul-2021 16:48:28

12K+ Views

A hardware serial, as the name suggests, denotes that a dedicated piece of hardware (UART) enables Serial communication. In Arduino Uno, for instance, pins 0 and 1 have UART support, and they are connected to the USB via a USB-to-UART converter. That facilitates communication between your computer/laptop and the Arduino. While Arduino Uno has a single Hardware Serial, other boards like Mega have multiple. They are accessed using Serial, Serial1, Serial2, and so on.You can have a look at an example of using Multiple Hardware Serials by going to File → Examples → Communication → MultiSerialSoftware serial is a library ... Read More

Define a Class in Arduino

Yash Sanghvi
Updated on 30-Jul-2021 16:45:34

7K+ Views

You can define a class in Arduino just like in C, with public and private variables and methods.The example below demonstrates the definition of a Student class, which has the constructor, two methods (add_science_marks and get_roll_no) and 3 private variables, _division, _roll_no and _science_marks.Exampleclass Student {    public:       Student(char division, int roll_no);       void add_science_marks(int marks);       int get_roll_no();    private:       char _division;       int _roll_no;       int _science_marks; }; Student::Student(char division, int roll_no){    _division = division;    _roll_no = roll_no; } void ... Read More

I2C Wire in Arduino Uno

Yash Sanghvi
Updated on 30-Jul-2021 16:44:08

1K+ Views

I2C stands for Inter-Integrated Circuit. It is a popular communication protocol used by several peripherals like accelerometer and gyroscopes, OLED Displays, etc. Arduino refers to I2C as Wire, which is a shorter form of the term Atmel uses (Two Wire Interface or TWI). Here are some salient features of I2C −It uses only two lines: One for data (SDA) and one for clock (SCL). I2C is synchronous because it uses a clock.The slaves are not selected via a slave select line, but via address bits.The first byte sent by the master contains a seven-bit address and a read/ write bit ... Read More

SPI Communication in Arduino Uno

Yash Sanghvi
Updated on 30-Jul-2021 16:42:44

3K+ Views

SPI stands for Serial Peripheral Interface. It is a common protocol used for communication between microcontrollers and peripherals. SD Card is a popular peripheral that uses SPI for communication. Here are some salient features of SPI −It uses four lines −Clock line (SCK), Master Input, Slave Output(MISO) for master to receive and slave to transmit, Master Output, Slave Input(MOSI) for master to transmit and slave to receiveSlave Select(SS) for selecting one among multiple slave with which communication is desired.Note that master is defined as the micro-controller which sends the clock signalIt operates in full duplex mode, meaning the master and ... Read More

Introduction to Arduino Online Editor

Yash Sanghvi
Updated on 30-Jul-2021 16:40:10

1K+ Views

Don’t have Arduino IDE installed on your machine, but still want to write Arduino code? Alternatively, don’t have access to your machine, but still want to program boards with your code? Come in Arduino Online Editor. Head on to www.create.arduino.cc/editorYou will be asked to Sign Up if you are visiting this page for the first time. Complete the Sign Up formalities, and login.You will be greeted with a screen like this one −As you can see, this is very similar to the offline Arduino IDE. You can select the board and port (more on the port later), you can write ... Read More

Arduino Uno vs Raspberry Pi

Yash Sanghvi
Updated on 30-Jul-2021 16:33:45

733 Views

We will have a comparison of the specifications of Arduino Uno and the STM32 Blue Pill Board.Arduino UnoRaspberry PiArduino Uno and Raspberry Pi are in different leagues altogether. Arduino is a microcontroller, while R-Pi is a Single Board Computer. R-Pi comes with its own operating system. Arduino has no OS, it can simply run programs compiled for the Arduino platform (which means C and C++ programs in general). There is no point comparing the two, but still let’s see the difference in specs, to drive the point home.Arduino Uno has 2 kB of SRAM. The first model of R-Pi had ... Read More

Arduino Uno vs Arduino Mega

Yash Sanghvi
Updated on 30-Jul-2021 16:30:39

835 Views

We will have a comparison of the specifications of Arduino Uno and the Arduino Mega Board.Arduino UnoArduino MegaPlease refer to the table below −Dimensions Pricing I/O PinsUnoMegaGeneralDimensions2.7¨ x 2.1¨4¨ x 2.1¨Pricing$20-23$36-39ConnectivityI/O Pins1454PWM Pins615Analog Pins616ComputingProcessorATMega328PATmega2560Flash Memory32 kB256 kBSRAM2 kB8 kBEEPROM1 kB4 kBClock speed16 MHz16 MHzVoltage Level5V5VUSB ConnectivityStandard A/B USBStandard A/B USBCommunicationHardware Serial Ports14SPI SupportYesYesI2C SupportYesYes

Components of Arduino Uno Board

Yash Sanghvi
Updated on 30-Jul-2021 16:28:31

797 Views

The important components of the Arduino Uno Board are shown below −The following table contains the description for each of the labels −LabelDescription17-12 V Barrel Jack2Voltage Regulator316 MHz Crystal Oscillator4USB - B Port5Reset Button6Digital Pins7ICSP Pins (SPI can be accessed from here)8ATmega328P microcontroller9Analog Pins10Serial Port TX RX LEDs11USB to UART Conversion IC12Built-in LED (connected to pin 13)

Interface Arduino with Gas Sensor

Yash Sanghvi
Updated on 30-Jul-2021 16:25:28

7K+ Views

In this article, we will see how to interface Arduino with the MQ-2 gas sensor. MQ2 gas sensor is used for detecting smoke and some flammable gases like LPG, Methane, etc. It changes its resistance depending on the type of the gas. This principle can be used to raise an alarm based on the concentration of the gas.An image of the MQ2 gas sensor is given above. As you can see, it has 4 pins. Out of these the Aout pin gives the Analog voltage in proportion to the gas concentration. Higher the gas concentration, higher the voltage on the ... Read More

Interface Arduino with LoRa Module

Yash Sanghvi
Updated on 30-Jul-2021 16:20:53

2K+ Views

In this article we will see how to interface Arduino with the LoRa module E32. LoRa stands for Long Range. It uses license-free sub-GHz RF bands for operation. These bands are different in different countries. In India, the permissible band is 865-867 MHz. LoRa is very ideal for IoT applications thanks to its long range and low power consumption. However, the achievable data rates are limited (0.3 to 27 kbits/second). Longer the range, lower the data rate.The E32 module that we will use looks like the one below. Depending on the frequency the module variant changes. For example, the one ... Read More

Advertisements