Articles on Trending Technologies

Technical articles with clear explanations and examples

How to define a class in Arduino?

Yash Sanghvi
Yash Sanghvi
Updated on 30-Jul-2021 8K+ 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

Introduction to Arduino Online Editor

Yash Sanghvi
Yash Sanghvi
Updated on 30-Jul-2021 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
Yash Sanghvi
Updated on 30-Jul-2021 797 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
Yash Sanghvi
Updated on 30-Jul-2021 900 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

Read More

Components of Arduino Uno board

Yash Sanghvi
Yash Sanghvi
Updated on 30-Jul-2021 904 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)

Read More

Interface Arduino with Gas Sensor

Yash Sanghvi
Yash Sanghvi
Updated on 30-Jul-2021 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
Yash Sanghvi
Updated on 30-Jul-2021 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

Interface Zigbee with Arduino

Yash Sanghvi
Yash Sanghvi
Updated on 30-Jul-2021 12K+ Views

Zigbee is a wireless communication protocol targeted for battery powered devices (it has both low power and low cost). It generally operates in the 2.4GHz range (although there are geographic variations), and supports data ranges from 20 to 250 kbits/s.The transmission distance though, is small compared to the likes of LoRa. It is 10 to 100 m, whereas LoRa can transmit over a few kilometers. Another thing to note is that Zigbee communication doesn’t work very well if there is no line of sight between transmitter and receiver.Even minor obstacles have been observed to significantly degrade the communication. Keep these ...

Read More

Send SMS using a GSM module connected to Arduino

Yash Sanghvi
Yash Sanghvi
Updated on 30-Jul-2021 11K+ Views

In this article, we will see how to interface Arduino with a GSM Module, and send SMS using the module. You will need the following −Arduino boardA GSM Module (SIM800C, SIM900A, are popular examples, but you can have any other module as well)A GSM (2G) SIM Card, or a 4G SIM Card with 2G fallback option (Jio SIM Cards won’t work for this project)GSM AntennaYou could also get a GSM Module development board, like the one below (the SIM Card Holder is on the other side of the board) −A GSM Module interacts with a microcontroller via UART (see the ...

Read More

Queue in FreeRTOS in Arduino

Yash Sanghvi
Yash Sanghvi
Updated on 30-Jul-2021 2K+ Views

Queue is a data structure that helps exchange data between different tasks or between tasks and interrupts. It holds a finite number of items (defined at the time of initialization) and operates in the FIFO mode.We will walk through an example that comes in with the FreeRTOS library, to understand queues.You can find the example in − File → Examples → FreeRTOS → StructQueue.In this code, two tasks read analog values from different analog pins, and pass these values in a queue. Another task reads the values from the queue and prints them onto the Serial Monitor. There is a ...

Read More
Showing 48501–48510 of 61,297 articles
Advertisements