Categories
COMPUTER HARDWARE ELECTRICAL SCIENCE ELECTRONICS EMBEDDED HARDWARE PROGRAMMING TUTORIALS

Shift Register Modes, Use, Advantages & Disadvantages

So in this article, we will look at a piece of hardware called the shift register and their modes of operation. But we wont stop there. Because we will also look at their use case, advantages & disadvantages.

So if you are new to computer hardware or learning about what goes inside a microprocessor, then brace yourself. As this is going to be an eye opener for you on how computer works!

So are you ready? Great! Then let us go!

To start with, let us ask ourselves the basic question – What is a shift register? Because only when we know what it is, does it make sense to learn about shift register modes of operation. Right? Let us answer that first!

What Is A Shift Register?

A shift register is a piece of circuit that you will find inside a microprocessor. It is used to store and modify data. Now this is one of the simplest explanation I can give for a 2nd grade student.

But if you are some one who is studying about computers, this is just not sufficient. So I will have to explain it in a bit more detail. Alright? I will be getting a bit technical here. But it is how you will get a solid understanding of shift register. So you will have to bare it. Okay?

Technical Explanation

Technically, a shift register is made up of a bunch of Flip Flops. So as you know, a flip flop is a circuit that can store information. It can store data that is in one of the two states – 0 or 1. Right? So what happens when you connect a bunch of these flip flops together? You get a “register“.

So a register is a circuit made up of a bunch of flip flops that can store data having values in 0s or 1s. Now, if that is the definition of a register, then what is a shift register?

A shift register is a type of register where data is shifted from one flip flop to another within the register. But this shift of data does not happen by itself. Instead, it needs a clock signal to do so. So for every input clock cycle, the data get shifted from one flip flop to another. Hence the name “Shift Registers”. Aha! That name now makes so much sense. Right?

How Shift Register Works
How Shift Register Works

The above pic shows how it works. So as you can see here, for every clock cycle, a new input bit enters Bit0. But at the same time, existing Bit0 value shifts to Bit1, Bit1 to Bit2 and so on. But what happens to current value of Bit7? The register will just throw it out! Removed forever!

Now there is one thing for you to notice in the above pic. It is that the bit value here is shifting left. Right? Because of this, we call it a “Left Shift Register“.

But does that mean we also have a “Right Shift Register”? You bet! We do have a right shift register where input is fed to Bit7 & Bit0 will thrown out for every clock cycle!

Where Do We Use A Shift Register?

So now that we know how a Shift register works, let us see where we can use it.

Using Shift Register For Multiplication

When you shift bits in a byte to the left, the value of the byte is multiplied by 2! So we can use a left shift register whenever we want to multiply a byte by 2.

Using Shift Register For Division

When you shift a byte to the right, you are dividing it’s value by 2. So we can use a right shift register whenever we want to divide a byte by 2!

So with that, let us now look at the different modes of operation of a shift register.

Shift Register Modes Of Operation

A shift register will work in one these four modes:

  • Serial In Serial Out (SISO) Mode
  • Serial In Parallel Out (SIPO) Mode
  • Parallel In Serial Out (PISO) Mode
  • Parallel In Parallel Out (PIPO) Mode

So let us take a look at each of these modes one by one. Alright? Here we go!

Serial In Serial Out (SISO) Mode

In this mode of operation, the data is fed into the shift register serially for every clock cycle. That is, for every clock cycle, the data is shifted either to the right or left serially. The output is also taken out one bit at a time. So both inputs and outputs are serial here. Hence the name SISO. So then how does the Flip Flop connection look like? Take a look at it below:

SISO Mode Of Operation
Shift Register In SISO Mode Of Operation

Serial In Parallel Out (SIPO) Mode

When we use the shift register in SIPO mode, we feed the input data serially but take the output data out in parallel. But again, this happens at every clock cycle. So how does that look like? Take a look at it yourself!

SIPO Mode Of Operation
Shift Register In SIPO Mode Of Operation

So as you can see here, we are still feeding the input data serially. But the output is no more serial. We are taking all the output bits at the same time, in parallel. So what this means is that we will get full 4 bit output every clock cycle!

Parallel In Serial Out (PISO) Mode

In the case of shift register in PISO mode, we feed the input data in parallel but take the output data serially. So what this means is that we will be feeding multiple data bits as inputs for every clock cycle. But will be taking only one output bit for each clock cycle.

So then what will happen to the output of each flip flop? Well, even that will be fed as an input! So, we will be feeding two inputs after multiplexing them together. So how does that connection look like? Take a look at it below:

PISO Mode Of Operation
Shift Register In PISO Mode Of Operation

Parallel In Parallel Out (PIPO) Mode

And finally, we have the shift register working in PISO mode. So can you guess what in this mode? Yes. In this mode of operation, you have both input and output data running in parallel. So how does that work? Take a look at it first!

Shift Register In PIPO Mode Of Operation
Shift Register In PIPO Mode Of Operation

So as you can see above, there is a major change in the way we connect the flip flops. In that, you do not see them connected to each other at all. So each input bit goes to a flip flop and it’s output is directly taken out. The only connection that is common to all these flip flops are the clock and clear signal!

So there you have it. Those are the different modes in which we can design a shift register to work. In the next section let us take a look at different types of shift registers that we can use.

Types Of Shift Registers

Based on the way the data is shifted, we have 5 different types of shift registers. They are:

  • Left Shift Registers
  • Right Shift Registers
  • Bidirectional Shift Registers
  • Circular Shift Registers &
  • Linear Feedback Shift Registers

Now let explain what each of these registers work like:

Left Shift Registers

We have already talked about the left shift register. So I think you are familiar with it by now. If not, let me re-iterate. So in the case of a left shift register, the data is shifted to the left on each clock cycle.

Right Shift Registers

This is just like the left shift register. But here it is shifting the data to the right on each clock cycle.

Bidirectional Shift Registers

In the case of a bidirectional shift register, we can shift the data in both the directions. So you can shift the data either to it’s left or right!

Circular Shift Registers

In the case of a circular shift register, the last output is connected back as input. So your data will not be thrown out. Instead, will be shifted either left or right in a circular fashion!

Linear Feedback Shift Registers

In this type of shift register, the input of one flip flop will be linear output value of the previous flip flop.

Advantages & Disadvantages Of A Shift Register

It is now time to talk about the advantages & disadvantages of using a shift register. So what are they?

Advantages Of A Shift Register

  • They are very fast to use.
  • Very quick when you want to convert data from serial to parallel or vice versa. They are faster than normal serial to parallel converter circuits.
  • They are very simple in design. So you can easily rig up a circuit to create a shift register.
  • We can use them to encrypt or decrypt the data.
  • We can use them to a delay signal.
  • It is used in CDMA to generate Pseudo Noise Sequence Number.
  • We can use them to track our data!

Disadvantages Of A Shift Register

While we could see that it has major advantages, shift register has one major disadvantage. That is:

  • The strength of the output current coming from a shift register is not so strong!

So there you have it. Those where some of the advantages & disadvantages of using a shift register.

And with that, I will end this article now. But if you have any doubts, do let me know. Because I will be more than happy to answer them! Alright? So see you and take care until next time! 🙂

Categories
COMPUTER HARDWARE ELECTRONICS REVIEWS SMARTPHONES TUTORIALS

Asus ROG Phone 3 Review & Specification

The Asus ROG Phone 3 is the third and latest iteration of the ROG Phone series of gaming smartphones from Asus. It is an upgrade over the ROG Phone 2, and is geared toward serious gamers.

Why are we reviewing the Asus ROG Phone 3?

The ROG Phone 3 features a very high-end processor, along with a large display and a lot of RAM. It also features a very unique design that differentiates itself from other gaming smartphones on the market.

The Asus ROG Phone 3 has a lot going on in the spec sheet. So We’re going to take it in bits and pieces to get through it all. Sounds good? Great! Then let us begin the review!

Asus ROG Phone 3 Feature Review

What is the physical size of ROG Phone 3?

The ROG Phone is an Android smartphone that is 9.9mm thick and weighs 240g, which is pretty hefty for a phone with a 6.5-inch display. This gives the device a screen-to-body ratio of just above 78.2%, which is on the lower side of the spectrum, but not that bad.

Asus ROG Phone 3 Review
Asus ROG Phone 3 Review

When it comes to it’s dimensions, the ROG Phone measures at 171.0 x 78.0 x 9.9mm, which is not too big, not too small. It has a rather unique design, which resembles the new HTC U12+ and even the Razer Phone 2. But most importantly, it is comfortable to hold in our hand and easy to use!

What kind of display does this phone use?

The Asus ROG Phone 3 features a 6.59-inch AMOLED display with a resolution of 1080 x 2340 pixels and an aspect ratio of 19.5:9. But talking about the display PPI, it also has a pixel density of 391 pixels-per-inch.

While the ROG Phone 3 has a 19.5:9 aspect ratio, the AMOLED display itself is curved on all four sides, and has an overall screen-to-body ratio of 79.9%.

It also comes with HDR10+ support, which should be good enough for most. However, one missing feature is that it doesn’t support Adaptive-Sync. But it can display up to 90% of the DCI-P3 color gamut.

Additionally, the display has a refresh rate of 144Hz, which is extremely high, so the animation is smooth and there’s no lag whatsoever.

How Good Is ROG Phone 3 For Gaming?

If you’re into gaming, then you will really appreciate the added refresh rate. The high refresh rate will give gamers an edge over their competitors as there will be no lag and input lag is less noticeable.It is also a low-persistence panel, which helps cut down on ghosting when moving between frames.

What is Ghosting?
Ghosting is a phenomenon that occurs when the display does not completely refresh, causing a moving image to leave a faint, lingering image behind.
It is caused by slow response time, and can occur in CRT monitors, plasma displays, and LCDs.

It also means there will be no screen tearing.

What is screen tearing?
Screen tearing is a graphical issue in video display systems in which a display device shows information from multiple frames in a single screen draw. It occurs when the graphics chip and the display screen cannot sync up with their display refresh rates, causing parts of two or more different frames to be shown on the screen at the same time.

There’s a special technology that also helps improve the experience. The display is also protected by Corning Gorilla Glass 6. Asus claims that it is one of the brightest displays at 650 nits. The company also mentions that it has a 10,000:1 contrast ratio.

Which processor does the Asus ROG Phone 3 use?

The new Asus ROG Phone 3 uses the Qualcomm Snapdragon 865+ chipset, the latest from Qualcomm and the successor to the Snapdragon 845.

This gaming smartphone may not be the world’s first to be powered by the Snapdragon 865+ chipset, but it has the fastest clock speed of 1.9 GHz on a 7 nm process.

So let us talk about what is inside this processor now, alright?

To begin with, the SoC comes with a new set of Kryo 585 cores and an Adreno 650 graphics unit. It’s an octa-core chipset with one 3.1 GHz Kryo 585 Gold CPU and three 2.42 GHz Kryo 585 Silver CPUs, plus a four 1.8 GHz Kryo 585 CPU.

But it doesn’t just end there! Because the Snapdragon 865+ is also an SoC that comes with a separate core to handle the artificial intelligence (AI) workload. In addition to that, we can also see tht comes with a new NPU for faster AI performance.

Since there’s a good amount of RAM and the ROG Phone 3 should be able to handle pretty much anything you throw at it, although it does get warm when you push it to the limit!

Graphics Processing Unit (GPU)

But the real juice for this smartphone which is designed specfically for gaming, lies in it’s graphic power. So naturally, you will be looking for what that looks like, Right? So here we go!

The ROG Phone 3 has an Adreno 650 GPU built into it. So what does that mean? It means that it is having better graphics that is also capable of HDR gaming! This makes the ROG Phone 3 a solid choice for mobile gamers.

But having said that, let us now talk on the software side!

This smartphone runs the latest version of Android 10 with the ROG UI on top of it.

But how does this perform?

Well, for one we found it to be incredibly powerful and the ROG UI offers so much customization that it’s a bit overwhelming. But also the gaming-focused interface is really slick and very fast!

But what about the storage?

So Yeah! I can hear you screaming in my ears asking this question. How does the memory part of this smartphone looks like.

Since this is a smartphone designed for gaming, you want it to have good memory space right? Well, we are happy to say that this smartphone doesn’t dissapoint you in that area! Because here is how it looks like:

Asus ROG Phone 3 has a memory of 128 GB of internal storage with 12 GB of RAM, 256 GB with 12 GB RAM, 512 GB with 12 GB RAM, and 512 GB with 16 GB RAM.

The flash storage is based on the latest storage technology – UFS 3.1. Asus has chosen to go with 128GB of internal storage as it’s base class and has not opted for the microSD card expansion slot. A trend that we are seeing in more and more phones these days for better or worse!

Let us talk about Camera!

If there is one thing that delights non gamers about this phone for sure, it has to be the camera!

But why? Because I see that this smartphone comes with a myriad of sensors that will work for every occassion! Hmm…not sure what I mean? Well take a look at it’s specs for yourself then!

The ROG Phone comes with a triple-camera setup on the back. The primary one is the 64-megapixel sensor while the secondary one is a 13-megapixel sensor with a 125-degree field of view and a gyro-EIS module. Finally the third one is a 5-megapixel depth sensor.

But it doesn’t end there. Because this triple camera setup comes with a dual-LED flash as well.

Front Camera

On the front side, the ROG Phone also comes with a 24-megapixel selfie camera. This selfie camera on the Asus ROG Phone 3 comes with a 1/2.6″ sensor, an f/2.0 aperture and an 84-degree field of view.

The camera software is also customized by Asus, with features like Anti-shake, AIS and AR effects. So this will ensure that you will never have a bad time taking amazing selfies! Now that is cool, right?!

Hello boss! But what about the video?

Surprisingly, this smartphone does a great job on the video recording front as well!

The main camera can shoot video at 8k resolution at 30fps and 4K resolution, at 60fps. You also have the option to record at 4K resolution, at 120fps, which can be used to create slow-motion videos. You can record 1080p videos at 30fps, as well as 720p ones at 480fps.

But how good is the sound quality on Asus ROG Phone 3?

Asus has focused on the audio capabilities of the ROG Phone 3 really well! So let us take a look at it in detail:

3.5 mm Audio Jack

First up, the 3.5mm headphone jack. I’m glad it’s there. There are still a lot of games and other content that comes out in analog format and I appreciate being able to use my wired headphones when I want.

The earphones bundled with the smartphone are equipped with great amplifiers, which boost the audio signal from the smartphone. It’s a unique solution that could be particularly interesting in a home theater context.

Next, A 24-bit/192kHz audio output is a first for this smartphone. It’s a direct consequence of the DTS:X support in the loudspeaker. DTS:X is an extension of DTS which is able to send different audio tracks to each speaker, creating an immersive audio experience. So for an audiophile like me, this is niravana!

Speakers

But the other feature important for me is the speakers. Because there are times when you don’t feel like plugging in an earphone and block your ears completely. Right? So how does the ROG Phone 3 fare in this front? Here is my experience:

Luckily, the front-facing stereo speakers produce some of the loudest and most dynamic audio we’ve ever heard from a phone. The surround sound-like effects that come from having two speakers makes gaming and watching movies an unforgettable experience.

But there is more! The external speakers are also good for hands-free calls. The bundled ROG Audio Wizard app allows users to fine-tune the audio settings to their liking.

So all in all, I feel this phone is perfect for gamers and audio buffs alike.

How About Wireless Connectivity

Next, we have the rest of the phones communication bits. You’ll get the normal Wifi, Bluetooth, GPS, NFC, and the FM radio. For the Wi-Fi, Asus is using the latest 802.11 a/b/g/n/ac with 2.4GHz and 5GHz bands.

It also has Wi-Fi Direct and Hotspot functionality. This means that you should have no trouble connecting to a network and using the internet on the go.

Okay! That is all good. But what can I do if I want to connect it to my car? I need to use other wireless connection then, right? So how do I go about doing that? Well that is when I use my Bluetooth!

Bluetooth

The ROG Phone 3 features Bluetooth 5.1. Now this version of Bluetooth has a higher bandwidth than the previous versions, which makes it perfect for watching videos, using wireless headphones, and transferring data. It is also backwards compatible with previous versions of Bluetooth, so you can use it with all of your devices.

Bluetooth is no longer limited to file transfer and can be used for wireless speakers, headsets, keyboards, mice, and more. It is also the new AptX standard, which is supposed to give a better quality of sound over Bluetooth.

Okay! But what about my mobile payments? What can I do to look cool paying money from my smartphone? Like that Apple fanboy standing in front of me flaunting his iPhone to pay the bill?

Near Field Communication (NFC)

There is NFC connectivity on the ROG Phone 3 as well. So you can use NFC pay as well!

But it does not end there. Because NFC is great for sharing data between phones and sharing links with people that don’t have data on their phones as well. But if you want to transfer a lot of data, you can do so with a cable.

Radio

Moving on to the radios, we have a few that have been announced and some that haven’t. First up, is the aforementioned FM radio. This will be available in the US. It will also support GPS with GPS, GLONASS, and QZSS for Russia. This allows you to find your location, and navigation is also possible with the GPS.

Then we have BeiDou Navigation Satellite System or BDS. This is the Chinese satellite system that is slowly being adopted by more and more countries. Then we have GALILEO, which is the European system that has been adopted by more countries as well. The last one is QZSS. QZSS is the Japanese satellite system that is also slowly being adopted by more and more countries.

The Good Old USB

Finally, we have the ports. The right side has the a USB 3.1 Type-C port. This is just like the OnePlus 6T and Razer Phone 2, but it is backwards compatible with 3.0. USB-C is great because it is reversible, and it is becoming the standard for charging phones. You’ll also get an adapter for USB-C to USB-A and USB-C to HDMI. This is also the way to charge the phone. At the bottom is another USB port but this time it is USB 2.0.

What About Sensors in ROG Phone 3?

The ROG Phone 3 has a unique solution to a very common problem in modern smartphones. The ROG Phone 3 offers fingerprint scanning technology embedded directly into the display. The process works like this: the user places their finger on the screen and the smartphone then flashes an image of the user’s fingerprint, which the phone’s built-in scanner then uses to identify the user and unlock the device. In addition to this, it has the standard array of sensors such as accelerometer, gyroscope, proximity sensor and compass.

How Good Is The Battery On This Phone?

The Asus ROG Phone 3 battery at 6000mAh is the largest capacity battery in our list of best gaming phones. This helps the ROG Phone 3 to rank high in all three of our battery tests, coming in at number two in our web browsing test, number three in our video test and number four in our talk time test. While the Asus ROG Phone 3 has a massive battery, the phone is not designed to be charged wirelessly, which is disappointing considering it is one of the few features that you might have expected on a gaming phone. This does mean that the ROG Phone 3 does support Quick Charge 4.0 and USB Type-C, so you can expect to see this phone charge fast when you use the right cable.

Network Support

The Asus ROG Phone is an odd beast – a gaming phone with 5G connectivity in tow, even if it is just for show right now. The 5G version has support for the full set of sub-6GHz 5G bands, as well as a wide range of LTE bands – though some of them are not available in the US. It has a Cat.20 LTE modem, which theoretically offers speeds up to 2000Mbps downlink and 150Mbps uplink. It also supports 5G NR on its newest 5G bands, with the B version having 5G NR on bands 34 and 39 and SA support.

Conclusion

All in all, we feel that this is a great smartphone for gamers and audiophiles alike! So if you fall into any of these two categories, you should definitely check this smartphone out!

Categories
ARM COMPUTER HARDWARE ELECTRONICS EMBEDDED TUTORIALS

What Is A Microprocessor?

Before I answer your question of what a microprocessor is, let me ask you this question first. Have you ever used an electronic gadget such as a mobile phone, a calculator or a computer?

If you answered yes to any of these, then you have already used a microprocessor! Because microprocessor is at the core of each one of these devices. It is what is running these devices!

So what is a microprocessor?

A microprocessor in simple terms can be seen as just a tiny little electrical circuit system. It takes in one or more electrical voltages as input and in turn produces one or more electrical voltage signals as output. You can then use these output electrical signals to control external devices.

Now that sounds like just about any other electrical circuits then, right? Well, not really! Because a microprocessor is not your ordinary electrical circuit. But instead, it is an electrical circuit that you can program to make it behave differently!

So what does that mean? It means that you can make a microprocessor do different thing at different times. And all you have to do to achieve this is to program it differently!

You cannot do that with any electrical circuit right? That is the main difference between a microprocessor and any other electrical circuit! That it is programmable!

So what does that mean? It means that you can take two or more microprocessors and program it to behave differently!

Alright, if you now got an idea of what a microprocessor does, let us now see how it looks like!

How does a microprocessor look like?

Thanks to advancing technology, a microprocessor circuit has been made so small that you can’t just connect it to external devices by hand. So to facilitate this, a microprocessor circuit is put inside a plastic case and pins are pulled out of its input and output connection points. So using these pins, you will be able to connect the microprocessor to external devices.

Here is how a microprocessor looks like with its plastic casing and connector pins.

A Texas Instruments Microprocessor IC chip
A Texas Instruments Microprocessor IC chip

So as you can see from the pic above of a TI microprocessor chip, there are a number of input and output pins present in it.

To know what each of these input does and what voltage it works at, we will need to take a look at it’s Datasheet.

So that’s it. That should give you a gist of what a microprocessor looks like. We will go more in depth on how a microprocessor works in the future articles. But this should hopefully be now be a good starting point for you to start exploring more about it.

But if there is something that is not clear or you have any more questions about it, do not hesitate to ask. I will be more than happy to help.

So with that I will end this article here. See you around! 🙂

Categories
ANDROID APP COMPUTER HARDWARE PROGRAMMING SMARTPHONES TUTORIALS

Turn Android Phone Into A Bootable USB Drive

In this article, we will learn how we can turn our Android phone into a Bootable USB drive. So by doing so, we can just use our Android smartphone to install OS on our computers.

But are you now wondering why do we even want to do that in the first place? What are we going to gain by doing so? Well I agree! These are all valid questions you are asking. So let me first explain to you about the advantages of that.

Turn Your Android Phone Into A Bootable USB
Turn Your Android Phone Into A Bootable USB

Sounds good? Great! Then let us get started!

Advantages of turning Android smartphone into a bootable USB drive

So here are some of the advantages I can think of in turning our Android into a bootable USB drive:

  • As we carry our smartphones with us every where we go, a bootable USB drive will be there with us all the time.
  • Chances of losing a bootable USB drive becomes less – If we created a separate bootable OS USB drive, there is a high change of us losing it. But if we have it on our smartphones, chances of losing it reduces greatly. Right?
  • Download new OS ISO images on the fly – Now what do we mean by that? You see, if we are using a USB pen drive as a bootable device, we can boot only those OS images that are already stored in it. But if we want to install a new OS, we cant, right? But on the other hand, if we use our Android smartphone as a bootable drive, we can download new OS ISO images from the internet on the fly, directly onto our smartphone. Now, that is a cool thing to be able to do, right? 😉

So now that we know how an Android smartphone bootable USB drive is beneficial, let us see how we can create one.

How To Turn Your Android Phone Into A Bootable USB?

There are many Android apps on the Google Playstore that we can use to turn our Android Phone into a bootable USB drive. But the most famous one is called the DriveDroid.

The main advantage of this app is that it provides you with many ISO images that you can download directly. Some of the ISO images that DriveDroid provides includes – Arch Linux, Debian, Fedora, FreeBSD ISOs and many more.

So we will be using this Android app to use our smartphone as a bootable USB drive.

Here are the steps you need to take to turn Android Phone into a Bootable USB:

  1. Install The App From The Google Playstore: Now, as we discussed earlier in the article, go ahead and install the app from the Android Playstore.
  2. Connect The Android Smartphone Into Your Computer Using USB: Make sure that your smartphone is connected in USB MTP mode.
  3. Open the App On Your Smartphone: Click and open the Android app on your smartphone.
  4. Click On the ‘+’ button and select “Create Blank Image”: This is where you will be creating your bootable USB Drive space.
  5. Set A Bootable Image Name & Its Size: This is where you will be setting the name and size of the boot space. Make sure that the size you set is equal to or greater than the ISO file size. Click the Create button at last.
  6. Select An OS ISO Image To Burn Into The USB Space: This is the final step where we choose the OS image we want to burn into our bootable USB space.

Once you have followed the above steps, you should a bootable USB drive as part of your Android smartphone.

How To Boot An ISO Image From Android Smartphone

So that is it! Those were the only steps you had to take to create a bootable OS on your smartphone. Now anytime you want to boot a computer using this USB bootable drive, just follow these steps:

  • Plug in your smartphone to the computer you want to boot, using a USB cable.
  • Power ON the computer and go to its BIOS menu by pressing F2 or the F10 key as mentioned on the computer screen.
  • Go to the Boot Priority and change it to Boot From USB to select your Android smartphone.

That is it. From here on, your PC should boot just like how it would from any USB bootable device.

Conclusion

So these days, your Android smartphone has become the swiss army knife of technology. You can use it to do many things that required several gadgets earlier.

In this blog, we try to explore all the different ways we can use our smartphones to make our lives better. So if you liked what you read, bookmark muddoo.com on your browser and visit it regularly to read more content like this.

Also, if you have any questions or suggestions for our website, please do leave a comment below. We will be delighted to know what you think! So until next time, cya and take care!

Categories
ARDUINO ARM ARM ARCHITECTURE ARM PROGRAMMING COMPUTER HARDWARE ELECTRONICS EMBEDDED EMBEDDED COMPUTERS EMBEDDED PROGRAMMING HARDWARE IOT MACHINE LEARNING PROGRAMMING TUTORIALS

Buy Arduino Nano Online At A Low Price

In this article, we will learn how you can buy an Arduino Nano online. We will learn how to buy it online in India at a low price. But before we do that, let us first learn what an Arduino Nano is in the first place. So are you ready to dive in? Then let us go!

What Is An Arduino Nano Board?

If you are still a beginner in the embedded world, chances are you may have not heard about Arduino Nano until now. So what is it?

Well, the Arduino Nano is a small computer board that one can buy to learn more about computers. It is a computer on a single PCB board that contains all the circuitry needed to run the software code on it.

Oh wait a second here! So we are learning that it is a single board computer, right? Cool! But then you may be wondering how does this Arduino Nano look like?

I am glad you asked this question! Here is a picture of an Arduino Nano board I will share with you for your pleasure. Take a look at it.

Arduino Nano Board Available To Buy Online
Arduino Nano Board You Can Buy Online

Woah! That is one weird looking single board computer out there! But what are all those pins coming out of it?! Looks scary isn’t it?

But don’t worry. Even though the Arduino Nano board looks like that, it is actually easy to use. There are many tutorials we have that will teach how to use it. So learning how to work with it will never be a problem at all.

So with this introduction to Arduino Nano, it is time for us to move on to know how we can buy it online.

How To Buy Arduino Nano Online?

There are many sellers who are selling the Arduino Nano hardware board. They are selling these Arduino Nano boards in online stores as well as in the offline stores. However, when you try to buy the Arduino Nano board, you will realize that the price differs a lot from one seller to another!

Now this is happening because there they are all not original Arduino boards. You see, the thing is Arduino boards are all launched as open source hardware boards. So, their circuit as well as their board designs are all available for free for anyone to use.

So, what happened because of this is that there are many Arduino Nano clones as well. Since these Arduino clones are coming from China, they will be of cheaper cost.

So in that case, who is the original manufacturer of Arduino Nano?

Arduino is the company that designs and manufactures the original Arduino boards. But as this company is from Italy, the products it makes are costlier than their clones.

So now this begs us with our next question which is:

Who manufactures the Arduino clones?

Most of the Arduino clones manufacturers are from China. So since the manufacturing cost of these boards are cheaper in China as compared to Italy, the clones are always cheaper.

So here is the real reason then! This clearly tells us why we see so much difference in the price for the same Arduino Nano boards across different online websites!

So depending on how much you can spend, decide which Arduino Nano board you want to go for.

What is the difference between an original Arduino Nano Vs a Nano clone?

Now as I told earlier, both the original and the cloned Nano boards use the same circuit design. So nothing is different over here. But there is one difference between the two. And this difference is in terms of the quality of components used.

So if you want a higher quality board, you pay more and go for original Nano module. But on the other hand, if you want to spend less, just go for a Nano clone. It really doesn’t matter at all. Trust me!

What Is The Price Of Arduino Nano Online In India?

If you are from India, you can buy the original Arduino Nano online at a low price of Rs.1449. But if you are OK to buy a cheap Arduino Nano clone, you can buy it at a low cost of Rs.200!

What Is The Price Of Arduino Nano Online In The US?

In the US, you can buy an original Arduino Nano at a cost of $22.00. But on the other hand, a cloned Arduino Nano will only cost you around $9! It’s as cheap as that!

What Is The Online Price Of Arduino Nano In The UK?

But if you are in the UK, you can buy the Nano board at just GBP20!

Have you looked at the new Arduino Portenta?

Conclusion

So there you have it. We just looked into the price of an Arduino Nano in 3 different regions. I also explained to you why its price changes so much when you want to buy it online. It is because of the clones that has reduced the price of these boards.

I hope you have got what you were looking for in this article. If you still have any more questions on it, ask me right away and I will answer you.

I hope you will have fun working with them. These are the best things you can work on to gain good knowledge. It is also one the best hobby that will keep you busy for some time! So enjoy with your new toys! Until next time, ciao! 🙂

Categories
ARDUINO ARM ARM ARCHITECTURE ARM PROGRAMMING COMPUTER HARDWARE ELECTRONICS EMBEDDED EMBEDDED COMPUTERS EMBEDDED PROGRAMMING HARDWARE IOT PROGRAMMING TUTORIALS

Arduino Portenta Technical Specification & Price

In this article, we will take a look at the technical specification of Arduino Portenta. But along with this, we will also learn about its price during its release date.

Just today, Arduino launched its new product called “Arduino Portenta” at CES 2020 show in Las Vegas. So far from what I have learnt, it is an IoT device. Which means that you can use it to connect things in your house to the internet!

But not just that! The company is also claiming that we can use Arduino Portenta even in industrial applications.

Ok, all this is fine. But why do we even need this device in the first place? To answer this question, we first need to discuss the technical details of Arduino Portenta. So let us first do that!

Arduino Portenta H7 Technical Specification

Arduino Portenta H7 Processor

The Arduino Portenta H7 is driven by the ST Microelectronics’ STM32H747XI low power processor. This processor is made up of dual ARM Cortex cores.

The first ARM core present in it is a Cortex-M7 running at 480 MHz. On the other hand, the second ARM core is made up of Cortex-M4 and running at 240 MHz. So with these two cores together, this ARM processor is able to run Arduino code, Python and Javascript code as well!

Now this is very interesting! Since it can run Javascript, many of the web developers will be able to work on it!

What OS does the Portenta H7 run?

We got to know that Portenta H7 is running on Arm’s Mbed OS! This is amazing! Being able to run an embedded operating system will mean we can make use of all the resources efficiently!

What type of connectivity does the Portenta H7 have?

Arduino mentioned that they support all the standard connectivity we can expect. So that means it has support for Bluetooth Low Energy, WiFi and LTE as well!

UPDATE On The Radio Module Of Arduino Portenta

We just got to know that the Arduino Portenta features a Murata 1DX dual WiFi 802.11 chipset. This chipset also has support for Bluetooth 5.1 BR/EDR/LE!

Arduino Portenta H7 with Technical Specification and release date
Arduino Portenta H7 IoT Module

What GPU Type Can We Find In Arduino Portenta H7?

The technical specification of the Arduino Portenta H7 mentions that it features a Chrom-ART graphical hardware accelerator.

What does the technical specification say about Timers in Arduino Portenta H7?

Alright guys. We know that in order for us to work with any time sensitive operation we need support of timers. So how does we score here? Well luckily on the timer front, the board has a total of 22 watchdogs and general purpose timers in it. So we have all the room to take its advantages!

But what about the UART ports in Portenta H7?

Ofcourse even though we have moved towards wireless connectivity, we still need good old UART ports for many reasons. So how do we fare on this front? Well the Arduino Portenta H7 strikes back once again! It is exposing a total of 4 UART Ports. And among these 4 ports, two of the UART ports have support for flow control.

How many connectors are exposed on the Arduino Portenta H7 board?

The Arduino Portenta H7 board exposes a total of 160 pin connectors. These connectors are grouped into two 80 pin sets and will expose all the peripherals present in the Portenta H7 board.

What type of USB does Arduino Portenta H7 support?

On the USB front, Arduino Portenta H7 exposes a USB Type C connector. This USB-C connector has support for host/device, displayPort out. It can operate at high speed or full speed USB protocol configuration. The Portenta H7 USB-C also supports Power delivery.

What is the operating temperature range of Arduino Portenta H7?

Arduino Portenta H7 can operate at a temperature range lying between -40 °C to +85 °C when running without the wireless module. But with the wireless module, Portenta H7 can operate in the temperature zone of  -10 °C to +55 °C.

What is the operating voltage of Arduino Portenta H7 acccording to its technical specification?

Arduino Portenta H7 works at 3.3 Volts.

What type of battery does Portenta H7 support?

The Arduino Portenta H7 runs on a Li-Po battery. This battery has an operating voltage of 3.7 Volts and a discharge rating of 7000mAh.

Does Arduino Portenta H7 support an SD Card?

Yes it does! The Portenta board has an SD card interface support. However, this SD Card interface is available only through an expansion port. So that is a bit of a bummer! 🙁

But now that we know the Arduino Portenta H7 technical specification, when will it Release?

I know I know. No matter how good the device is, we cannot take advantage of it until it gets in our hands, right? So we can understand when you are eager to know when this module is going to be released.

So from what we got to know, Arduino Portenta H7 is already made availale for beta testers. But it is going to become available for everyone by February 2020! Guys, that means we are just a month away from getting hold of it in our hands!

Now that we went through it’s technical specification, What will be the price of Arduino Portenta H7?

Cool! So now that we know we can get hold of Portenta by next month, our next question is obviously this.

How much it is going to cost?

Unfortunately at this point in time, I could not find an answer (Look for update at the end of this article for pricing information) for this. So I will continue to look out for this information. Once I find it, I will revisit this article and update it with the latest price. But until then, I can only leave you guessing about it.

But on the other hand, if you have any idea about it, let me know in the comments below. And not just that, if you have any other information about Portenta H7 in general that I have missed here, do let me know. In this way, I can update this article in the future for others to benefit out of it.

So there you have it. I have shared all the information I had about Arduino Portenta H7 here. While for me this device is something I am eagerly looking forward to, I wish it had a better name. Somehow for me, the name Portenta H7 is becoming difficult to remember. But may be it is just me I guess.

So any case, I will end this article at this point. So see you guys again in the next article. Until then, take care! 🙂

Latest Update On Arduino Portenta Price

We just got to know that Arduino Portenta will cost USD 99.90 + Tax.

So the cost of Arduino Portenta in the US will be $100 + taxes

The cost of Arduino Portenta in the UK will be around GBP 77 + taxes

The cost of Arduino Portenta in the European countries will be around 90 + taxes Euros

And finally the cost of Arduino Portenta in India will be around Rs.7200 + taxes

Categories
Android ARM COMPUTER HARDWARE ELECTRONICS EMBEDDED EMBEDDED COMPUTERS PHOTOGRAPHY SMARTPHONES TUTORIALS

Huawei P40 Pro Specification, Release Date & Price In India

We just came across some leaked information on Huawei P40 Pro specification. We got to know some details on its specification, release date and price in India. Since it is one of the most awaited Android smartphone, we thought we would write about it here.

Huawei P40 Pro Specification

What OS Does Huawei P40 Pro Use?

So Huawei P40 Pro is an upcoming smartphone that runs on Android OS. But more specifically, it will be running Android 10 OS. However, it will not be a pure Android 10 OS, but come with EMUI skin running on top of it.

But Wont Run Google Services!

But what is even more interesting is the news that it will not have Google services running on it. Instead, it will be replaced by Hauwei Mobile Services.

What Processor Does Huawei P4 Pro Have?

Moving further with Huawei P40 Pro Specification, let us look at its processor. We have learnt that Huawei P40 Pro will use Kirin 990 SoC.

Huawei P4 Pro Smartphone Specification
Huawei Logo

Huawei itself is the manufacturer of this SoC. Kirin 990 supports 5G, so that is good as most of the operators will be moving to 5G soon.

What Is The Display Size Of Huawei P40 Pro?

The next item in Huawei P40 Pro specification to look at is its display. From what we know so far, it looks like Huawei has taken a good decision over here too. Instead of going crazy on the display size, they have kept its size at 6.5 inches. It is also said that the screen will curve on its edges, giving it a premium look. It will also have a 120Hz refresh rate.

What Is The Battery Capacity Of Huawei P4 Pro?

On the battery front, the leaks says that Huawei P4 Pro could have a battery capacity of up to 5500 mAh. We can be pretty sure that it will also include a super charger for fast charging.

What USB Connector Type Will Huawei P4 Pro Sport?

The leaks tell us that this Android smartphone will sport the latest USB Type-C connector. This is really good, because we dont have to worry about the problems we had with older USB types anymore, If you are not sure what benefis USB Type-C brings in, read our earlier article that explains this in detail.

What About It’s Camera?

We know that you have been waiting for an answer to this question. From the information we have gathered so far, we think that it will have a penta-camera setup. We are told that it will have a 20MP ultra-wide angle camera, a 12MP periscopic camera, a dedicated macro camera and a 3D camera. While this all looks nice, we will need another confirmation about it for it to be sure. So fingers crossed at that.

Hauwei P40 Pro Release Date

So that was all that we know about the Huawei P40 Pro Specification. But moving beyond that, let us look at its release date. We learn that P40 Pro will be launched around March 2020. So, not too far away if you were planning to buy a new smartphone anytime soon.

Huawei P40 Pro Price In India

So finally, let us discuss about P40 Pro price now. We are getting an estimated price of this Android smartphone in India. We think that Huawei P40 Pro will retail at a price of around Rs.74,000. Please note that this is just a speculated price. We will get to know its real price only during it’s launch time. So take this price with a grain of salt.

Conclusion

So that was about Huawei P40 Pro specification, price and release date. We will further continue to update this article as and when more information becomes available. So watch out this place for more. But until then, take care! 🙂

Categories
COMPUTER HARDWARE ELECTRONICS EMBEDDED COMPUTERS SMARTPHONES

Asus ROG Phone 1 Specification, Features & Price

In this article, we will take a look at the Asus ROG Phone 1 specification, features and its pricing. The Asus ROG Phone 1 is an Android based gaming smartphone by the Taiwanese smartphone manufacturer – Asus Computers Inc. The Asus ROG Phone 1 smartphone was first demoed in June 2018 and later went on sale in October 2018.

Asus ROG Phone 1 Android Gaming Smartphone

Asus ROG Phone 1 was Asus’s answer to its competitors who had recently launched new smartphones in the gaming category.

Before discussing the features of Asus ROG Phone 1, let us take a look at its specification first.

Asus ROG Phone 1 Specification

What Operating System (OS) Does The Asus ROG Phone Have? Android 8.1 (Oreo)

Asus ROG Phone 1 was released in October 2018 with the latest Android Operating System available then – Android 8.1 (Oreo). Some of the new features included in this version of Android i.e. Android Oreo includes – Picture In Picture (PIP) support for videos, Improved battery power optimization, Bluetooth 5 support, Color Gamuts, Autofillers and WiFi Aware functionalities.

What Processor (CPU) Is Used In The Asus ROG Smartphone? Qualcomm Snapdragon 845

Asus RPG Phone 1 runs on a Qualcomm’s Snapdragon 845 processor. This Snapdragon 845 is an Octa-core SOC composed of 8 different ARM cores. It has 4 Kryo ARM cores running at 2.96 GHz and another 4 Kryo ARM cores running at 1.7GHz.

What GPU Does The ROG Phone Come With? Qualcomm Adreno 630

Being a gaming smartphone, the Asus ROG Phone 1 sports an Adreno 630 GPU processor from Qualcomm. The Adreno 630 GPU provides excellent graphic rendering capabilities and games such as PubG plays very smoothly.

The Asus ROG Phone 1 also features ‘vapor-chamber’ cooling technology called GameCool to keep the smartphone from heating up. This helps in clocking the Qualcomm Adreno 630 GPU to its highest performance level, thereby rendering excellent graphics and animation.

What About The RAM Size Of The Asus ROG Smartphone? 8 GB LPDDR4 RAM

For an Android gaming smartphone launched in 2018, Asus ROG Phone 1 sports an excellent 8 GB of RAM. This is exceedingly good for its time when most of the smartphones launched around that time featured 4GB RAM. This additional RAM availability will come in handy for all the game applications for better rendering & providing smoother experience.

How Much Storage (ROM) Does ROG Phone 1 have? – 128 GB or 512 GB

On the storage front, Asus ROG Phone 1 comes up in two variants. The first variant of this Asus Android gaming smartphone comes with storage of 128GB while the second one at 512GB. Both these variants of ROG Phone 1 uses UFS 2.1 Nand Flash memory storage technology. UFS here stands for Universal Flash Storage and is a new storage format technology developed by Samsung.

The UFS technology provides a data transfer rate that is five times that of other flash technologies. This helps in quick data transfer rate when moving data between devices such as ROG Phone 1 and the computer. UFS also helps in increasing data transfer between UFS and the RAM, thus increasing performance of the phone in general.

What About Its Battery? 4000 mAh Li-Po. Non Removable.

The Asus ROG Phone 1 comes with a non removable 4000 mAh Li-Po battery. This big of a battery is sufficient enough to power the device for a long gaming session. Most of the smartphones designed for gaming these days comes packed with similar battery capacity.

List Of Sensors Present In Asus ROG Phone 1

Asus ROG Phone 1 is packed with a list of sensors that makes gaming on this smartphone a great experience. It features a finger print sensor for quick unlock (mounted on the rear end side). It also features the standard accelerometer to recognize movement, Gyroscopic sensor for orientation detection, proximity sensor to control thr brightness of the display, a magnetic compass to asist in navigation, a half-effect sensor and barometer to detect pressure.

The sensory inputs from all these sensors should mean a great immersive gaming experience that one cannot find in other smartphones.

Display Size and Type In Asus ROG Phone 1 – 6 inch AMOLED FHD Display

For a great gaming experience, one need to use a display that renders excellent colors on the screen. Asus ROG Phone 1 does not fail on this front to say the least. The Asus ROG Phone 1 comes with a 6 inch AMOLED Full HD display having a screen resolution of 1080×2160 pixels.

Camera On Asus ROG Phone 1 – 13MP + 8 MP Rear Camera, 8 MP Front Camera

For a gaming smartphone, Asus ROG Phone 1 packs quite decent camera sensors within itself. It features dual camera on the rear end side and a single camera on the front. The dual rear cameras include a 13MP sensor and an 8 MP sensor with an F-ratio of f/1.8.

The front camera also features an 8MP sensor with an f rating (aka aperture rating) of f/2.0

Sound Quality Of Asus ROG Phone 1 – Stereo speakers, front facing

On the audio front, the Asus ROG Phone 1 features front facing stereoscopic speakers providing excellent sound and music complementing the gaming experience.

What Type Of USB Supported In Asus ROG Phone 1? USB 2.0 with USB Type-C Connector

As mentioned in the title, Asus ROG Phone 1 comes with a type C USB connector and can be used in either direction. The USB controller runs on USB 2.0 specification.

Not sure what a USB Type-C is? Checkout this article.

What Bluetooth Technology Is Used In Asus ROG Phone 1? Bluetooth 5.0

The Asus ROG Phone 1 comes with a Bluetooth 5.0 sensor module. With Bluetooth 5.0 support, you can connect different Bluetooth gaming accessories to your Asus ROG Phone 1 smartphone. Bluetooth 5.0 can provide connectivity and transfer upto 400 meters in distance, making it one of the most versatile connectivity stack to be used in smartphones.

Connectivity In Asus ROG Phone 1 – WiFi, NFC, GPS

In addition to Bluetooth 5.0 and USB, the Asus ROG Phone 1 also provides other standard connectivity such as WiFi, Near Field Communication (NFC) and GPS connectivitiy. These are all the connectivity types that you typically find in any other smartphone these days so nothing new to add here.

Asus ROG Phone 1 Price In India

With all its excellent features, we expected the price of Asus ROG Phone 1 to be critically high. However to our surprise, the Asus ROG Phone 1 is competitively priced at Rs.69,999 for an 8 GB RAM and 128 GB ROM. This price should place the smartphone at a competitive position with other gaming smartphones out there.

All in all the Asus ROG Phone 1 is an excellent smartphone bundled with all the electronics and features that would make your gaming experience an excellent one.

The official website link for this smartphone is: https://www.asus.com/us/Phone/ROG-Phone/

So, what do you guys think about this Android gaming smartphone? Do you find it worth it the price? Do let us know in the comment below!

Categories
ARM ARM ARCHITECTURE ARM PROGRAMMING COMPUTER HARDWARE ELECTRONICS EMBEDDED EMBEDDED COMPUTERS EMBEDDED PROGRAMMING HARDWARE PROGRAMMING PYTHON RASPBERRY PI RASPBERRY PI PROJECTS TUTORIALS

Blinking An LED Connected To GPIO Pin Of Raspberry Pi Using Python

Introduction

If you are just getting started with Raspberry Pi, connecting a simple LED to one of the GPIO pins of a Raspberry Pi and controlling it using software program that you write will give you a very good grasp of how a computer hardware and its program works internally. You will realize how you can control various aspects of a computer hardware using software, how a computer works at the bit level, how to write Python programs to control hardware and more.

In summary, working on getting an led connected to a GPIO pin of your Raspberry Pi will help you in understanding the fundamentals of a computer architecture and computer science in general.

Raspberry Pi 3B

What You Will Learn From This Project?

Connecting an LED to the GPIO pins of a Raspberry Pi to control it is a simple Beginner Raspberry Pi Project that lets you learn more about:

  • Raspberry Pi hardware internals
  • General Purpose Input/Output (GPIO) pins of a Raspberry Pi
  • Raspberry Pi Register Set
  • Ohm’s Law
  • Python Programming
  • Python Library – Raspberry Pi GPIO library
  • The working of an Light Emitting Diode (LED)

What Hardware Is Required To Set Up A Blinking LED Project?

This a very simple, beginner friendly Raspberry Pi project that can be set up by anyone with minimal hardware or software knowledge. The hardware components required to set up this blinking LED project is also quite minimal. You need the following hardware components available with you to get it going:

  • Raspberry Pi Module
  • Solderless Breadboard
  • Keyboard
  • Monitor
  • Raspberry Pi Power Supply
  • SD Card with working Raspbian OS
  • Jumper wires for rigging up the circuit
  • LED
  • Resistor (1K Ohm)
  • Multimeter

Theory Behind How The Raspberry Pi Blinking LED Project Work

When you look at the Raspberry Pi board, you will see a bunch of pins protruding out. Among these, there is a row of 40 pins located on one side of the board as shown in the image below.

If you look closely enough in the above image, you will notice the label “GPIO” written right under it. These pins are called the GPIO pins or General Purpose Input Output pins. What the name GPIO implies is that these pins do not have any fixed functionality within the board and hence can be used for general purposes. It means that we can connect our LED into one of these pins and can turn it ON or OFF using these pins. But how?

How to control the Raspberry Pi GPIO pins programmatically?

Raspberry Pi 3 board runs on Broadcom’s ARM CPU chipset BCM2837. Among many other things, this processor chipset has a built in GPIO controller aka General Purpose Input Output controller. The 40 GPIO pins header shown in figure 1 is connected to 40 controllable pins of the GPIO controller. Now, we can control each of these pins individually by programming the appropriate registers inside this GPIO controller.

To understand how to program each of these pins using GPIO controller, we need to look into the Technical Reference Manual or datasheet of the Broadcom ARM chipset BCM2837.

In the BCM2837 SOC (System On Chip aka CPU) datasheet linked above, if we jump into page 89 we come across a dedicated chapter talking about General Purpose Input Output (GPIO). If we go through this chapter, we can learn about all the GPIO registers available and figure out the GPIO registers we need to program to turn ON or OFF the LED we are going to connect to the Raspberry Pi 3 GPIO pins.

As the name implies, GPIO pins can be configured as either an Input pin or an Output pin. When we configure a GPIO pin as an input pin, we are sending data bit (either 0 or 1) into the Raspberry Pi BCM2837 SOC i.e. data signal is sent from outside the board to inside the board (hence the name input). On the other hand, if we configure the Raspberry Pi GPIO pin as an output pin, the board will send the data bit signal (either 0 or 1) from inside the board to the outer world where any device connected to it will receive this signal.

So, if we want to control an LED that is connected to one of the Raspberry Pi’s GPIO pin, we need to configure that pin as a GPIO OUT pin (aka output pin) so that we can send an electrical signal from the Raspberry Pi board to the external LED connected to this pin.

The configuration of a GPIO pin to be an INPUT or OUTPUT pin is controlled by programming the GPIO Controller Register called GPIO Function Select Register (GPFSELn) where n is the pin number.

So for example, if we choose to use the GPIO8 pin to control the LED, i.e. we connect our LED to GPIO 8 pin, we need to program the GPFSEL register for the GPIO 8 pin and configure it as an Output pin. When we check the datasheet at page 91 and 92, we notice that GPIO pin is configured by setting the bits 26 to 24 in the GPFSEL register (that is field name FSEL8). And from the datasheet, we also find that to set the pin as an output pin, we need to set its value as 001 i.e. bit 26 is set to 0, bit 25 is set to 0 and bit 24 is set to 1.

So, if we can somehow set these values in the GPFSEL register using a programming language such as Python, we will be able to start controlling the LED connect to this pin!

If this is all overwhelming to you, do not worry. We will not have to scratch our head a lot for now as we can simply make use of Raspberry Pi’s GPIO Python library that helps us in making most of this work for us. But I just wanted to explain to you as to what this GPIO Python library is doing under the hood.

How To Connect An LED To Raspberry Pi GPIO?

Designing The Circuit

In order to connect an LED to GPIO pin 8 of Raspberry Pi, we need to first design and understand how the circuit is going to work.

Can we connect an LED directly to a Raspberry Pi GPIO pin without a resistor?

The answer is No. Raspberry Pi provides 3.3 Volts of power on its GPIO output pin according to Raspberry Pi datasheet specification. However, if we take a look at a standard LED, we notice that it normally operates at a much lower voltage. If we look at an LED specification, we notice that a typical LED usually operates at just 1.7 Volts and draws 20 mA. So, if we need to connect this LED to the GPIO pin of our Raspberry Pi, we need to bring down the voltage delivered by the pin to our LED to operate at or under 1.7V. How to do that? We connect a resistor in series with our LED so that the 3.3 Volts GPIO output of Raspberry Pi gets split between the resistor and our LED. By choosing a right value of the resistor such that it consumes 1.6 Voltage, we can ensure that LED finally gets only 1.7 Volts.

Calculating the resistor value to connect with LED and Raspberry Pi GPIO

In order to calculate the value of resistor that we should be using, we make use of the Ohm’s Law.

Ohm’s Law is defined using the equation:

V = I/R where V is the voltage, I is the current and R is the resistor value.

So, if we want to have V=1.6 Volts consumed by our resistor so that the current coming from GPIO pin is at I=20 mA, we need to connect a resistor whose value is:

1.6 = (20 mA)/R

or R = 80 Ohms (or approx 100 Ohms)

So, we choose a resistor of value 100 Ohms connected in series with our resistor to ensure that we only get 1.7 Volts and 20 mA of current, the optimum operating values as required by our LED.

A 100 Ohm resistor is identified by the color bands: Brown, Black & Brown.

Hook up the led through 100 Ohm resistor to GPIO 8 pin of Raspberry Pi as shown in the figure below:

Note that when you are hooking up the LED, the terminal pin that is longer is positive. Once you have connected as shown in the figure, it is now time to program the Raspberry Pi GPIO controller to start controlling the LED to turn ON or OFF.

We will be using Python to program our Raspberry Pi GPIO controller. Now, the simplest way to program this is by making use of the Python GPIO library.

To install the Python Raspberry Pi GPIO module, open up your linux terminal and type the following command.

sudo apt-get install python-rpi.gpio python3-rpi.gpio

Now the above command will install the required Python GPIO library module onto our Linux development machine. Once successfully installed, It is now time to start programming the Raspberry Pi GPIO controller.

We will be toggling our GPIO pins at 1 second intervals such that our LED will turn ON and OFF forever until the Python program we write will be terminated i.e., we will be running the code to perform infinite loop of toggling the GPIO 8 pin ON and OFF.

Create a new file on your computer by typing the following command in the terminal:

touch blinky.py

This should create our new program file called blinky.py

Open up this file using nano editor by typing the following command in the terminal:

nano blinky.py

Now that the file is opened, it is time to start writing our program to control the GPIO Pin 8 using Python GPIO library module.

First thing first, we will import the Python GPIO library module using command:

import RPi.GPIO as GPIO

Next, we will import python time library to perform 1 sec sleep operation between each GPIO toggle

from time import sleep

Next, we need to configure our GPIO library to use our GPIO physical pin numbering as seen on the Raspberry Pi board physically:

GPIO.setmode(GPIO.BOARD)

This ensures that when we say GPIO pin 8 in the program, it actually maps to the GPIO Pin 8 seen on the Raspberry Pi board.

Next, configure GPIO pin 8 to be a GPIO Out pin and set its initial output value to be low:

GPIO.setup(8, GPIO.OUT, initial=GPIO.LOW)

Finally we will start an infinite loop in Python such that we turn ON the GPIO 8 (by setting it HIGH) or turn it OFF (by setting it LOW) after every 1 second delay. This is achieved using the program below:

while True: # Infinite loop
    GPIO.output(8, GPIO.HIGH) # Turn GPIO 8 pin on
    sleep(1)                  # Delay for 1 second
    GPIO.output(8, GPIO.LOW)  # Turn GPIO 8 pin off
    sleep(1)                  # Delay for 1 second

That’s it, this should be all the program that we need to type in our blinky.py file and run it using the command:

python3 blinky.py

This should start turning your LED ON and OFF every second!

Here is the full code for your reference:

import RPi.GPIO as GPIO
from time import sleep

GPIO.setmode(GPIO.BOARD)
GPIO.setup(8, GPIO.OUT, initial=GPIO.LOW)

while True: # Infinite loop
    GPIO.output(8, GPIO.HIGH) # Turn GPIO 8 pin on
    sleep(1)                  # Delay for 1 second
    GPIO.output(8, GPIO.LOW)  # Turn GPIO 8 pin off
    sleep(1)                  # Delay for 1 second

This should conclude our tutorial on how to get a simple LED connected to a General Purpose Input/Output (GPIO) pin turning ON and OFF using a Python program that makes use of Python Raspberry Pi GPIO library. There can be many variants to this such as using other GPIO pins, connecting more than one LEDs to multiple GPIO pins and controlling them all in different ways to display interesting patterns on the LEDs. If we are even more curious, we can also figure out a way to control the BUILT-IN LEDs that are already present on our Raspberry Pi boards to bypass their current usage and be used for by own programs for our purposes.

We will dwell into these and many other interesting ways to make use of our Raspberry Pis to understand and learn more about the computer hardware, its architecture and much more in our future articles.