Articles on Trending Technologies

Technical articles with clear explanations and examples

Wattmeter – Types and Working Principle

Manish Kumar Saini
Manish Kumar Saini
Updated on 29-May-2021 23K+ Views

A wattmeter is an instrument which is used to measure electric power given to or developed by an electrical circuit. Generally, a wattmeter consists of a current coil and a potential coil.Types of WattmeterElectrodynamometer wattmeter – for both DC and AC power measurementInduction wattmeter – for AC power measurement onlyWorking Principle of Electrodynamometer WattmeterThe electrodynamometer wattmeter works on the dynamometer principle i.e. a mechanical force acts between two current carrying conductors or coils.It consists of a fixed which is divided into two halves which are parallel to each other and is connected in series with the load while the moving ...

Read More

Bitwise AND and OR in Arduino

Yash Sanghvi
Yash Sanghvi
Updated on 29-May-2021 1K+ Views

Bitwise AND/ OR means AND/ OR performed at a bit-level, individually. Each number has its binary representation. When you perform the bitwise AND of one number with another, the AND operation is performed on the corresponding bits of the two numbers. Thus, LSB of number 1 is ANDed with the LSB of number 2, and so on.The bitwise AND operation in Arduino is & and the bitwise OR operator is |.Syntaxa & bfor AND.a | bfor OR.The truth table for AND isPQp & q000010100111The truth table for OR is −PQp & q000011101111Since these are bitwise operators, we need to perform ...

Read More

Do-while loop in Arduino

Yash Sanghvi
Yash Sanghvi
Updated on 29-May-2021 2K+ Views

The do-while loop’s syntax in Arduino is similar to the syntax in C. It is given below −do{    //Code } while (condition);Note the semicolon at the end.Examplevoid setup() {    // put your setup code here, to run once:    Serial.begin(9600);    Serial.println();    int i = 5;    do{       Serial.println(i);       i--;    } while(i > 0); } void loop() {    // put your main code here, to run repeatedly: }OutputThe Serial Monitor output is shown below −

Read More

Timer registers in Arduino

Yash Sanghvi
Yash Sanghvi
Updated on 29-May-2021 7K+ Views

In a previous article, we used the TimerOne library to add timer interrupts to Arduino. But what if we wish to generate timer interrupts without a third-party library? In that case, you will directly have to meddle with the timer registers in Arduino. In this article, we will just introduce the registers relevant to timer operations and explain their significance. We will also provide the page numbers of the ATmega328 (used in Arduino Uno) datasheet wherein you can find detailed information on these registers.You can find the datasheet here −https://ww1.microchip.com/downloads/en/DeviceDoc/Atmel7810-Automotive-Microcontrollers-ATmega328P_Datasheet.pdfTCCRxA and TCCRxBThese are timer control registers. The x stands for ...

Read More

Square and Square root in Arduino

Yash Sanghvi
Yash Sanghvi
Updated on 29-May-2021 5K+ Views

Arduino has support for several popular math functions, square and square root being among them. Let’s look at the square root first.Syntaxsqrt(x)where x is a number of any data type. It returns a double.For square, you ideally shouldn’t need a separate function. You can just multiply the number by itself.x_squared = x*x;However, Arduino does have a separate function for calculating squares. The syntax is −sq(x) where x is a number of any data type. This again returns a double.ExampleThe following example illustrates the use of these functions −void setup() {    // put your setup code here, to run once:   ...

Read More

Timer1 based PWM in Arduino Uno

Yash Sanghvi
Yash Sanghvi
Updated on 29-May-2021 9K+ Views

In an earlier article, we have seen how PWM can be set on Arduino Uno using the analogWrite() function. Pins 3, 5, 6, 9, 10 and 11 of Arduino Uno can support PWM. The frequency of the square wave is 490 Hz (about 2 ms time period) on all pins except 5 and 6, on which it is 980 Hz (about 1s time period). With analogWrite() you get control over the duty cycle, but not on the frequency of the generated square wave.In this article, we will look at another way of setting PWM in Arduino Uno, specific to Timer1. The advantage ...

Read More

Understanding Arduino Uno pinout

Yash Sanghvi
Yash Sanghvi
Updated on 29-May-2021 769 Views

The Arduino Uno board looks like the following −As you can see, the pins are broadly divided into 3 sections. Two sections at the bottom of the image, and one at the top.Let us look at the bottom sections.Section 1The first section contains power pins.The Vin pin can be used if you are using an external power source (and not the USB) to power the board. The recommended voltage range is 7-12 V.The 3.3V and 5V pins provide 3.3V and 5V outputs respectively, and should be used to power other components using the Arduino board. The maximum current from the ...

Read More

Store a new file in SD Card connected to Arduino

Yash Sanghvi
Yash Sanghvi
Updated on 29-May-2021 825 Views

In this tutorial, we will create a new file in an SD Card connected to Arduino Uno.Circuit DiagramThe circuit diagram is shown below −As you can see, you need to make the following connections −SD Card HolderArduino UnoVcc5VGNDGNDMISO12MOSI11SCK13CS10Only for the Vcc, make sure that your SD Card Holder takes 5V as input. If it takes in 3.3V, connect it to the 3.3V pin on Arduino Uno.Code WalkthroughWe will be walking through the example code that comes in with the inbuilt SD library. You can access it from File → Examples → SD → DataloggerAlternatively, you can access the code on ...

Read More

List files stored in SD Card connected to Arduino

Yash Sanghvi
Yash Sanghvi
Updated on 29-May-2021 5K+ Views

As the title suggests, in this tutorial, we will be listing the files stored in an SD Card connected to Arduino.Circuit DiagramThe circuit diagram is shown below −As you can see, you need to make the following connections −SD Card HolderArduino UnoVcc5VGNDGNDMISO12MOSI11SCK13CS10Only for the Vcc, make sure that your SD Card Holder takes 5V as input. If it takes in 3.3V, connect it to the 3.3V pin on Arduino Uno.Code WalkthroughWe will be walking through the example code that comes in with the inbuilt SD library. You can access it from File → Examples → SD → listfilesAlternatively, the code ...

Read More

Read a file from SD Card connected to Arduino

Yash Sanghvi
Yash Sanghvi
Updated on 29-May-2021 2K+ Views

As the title suggests, in this tutorial, we will read a file from an SD Card connected to Arduino.Circuit DiagramThe circuit diagram is shown below −As you can see, you need to make the following connections −SD Card HolderArduino UnoVcc5VGNDGNDMISO12MOSI11SCK13CS10Only for the Vcc, make sure that your SD Card Holder takes 5V as input. If it takes in 3.3V, connect it to the 3.3V pin on Arduino Uno.Code WalkthroughWe will be walking through the example code that comes in with the inbuilt SD library. You can access it from File → Examples → SD → ReadWriteAlternatively, you can find the ...

Read More
Showing 49531–49540 of 61,297 articles
Advertisements