Categories
ELECTRONICS EMBEDDED IOT TUTORIALS

What Is An Electrical Circuit – Explained For Dummies

Have you ever tried to look inside an electronic device? If you have, then we are sure that you have come across an electrical circuit. Right? But ever wonder what an electrical circuit is? What it does and why we use them?

No? Then this is an article you should read to get a some idea about it. Since you are new to an electrical circuit, we will try to keep it simple so that it is easy for you to understand. Sounds good? Great! Then let us get started, shall we?

Introduction To An Electrical Circuit

Definition Of An Electrical Circuit

The text book definition of an electrical circuit goes something like this:

It is an interconnection of electrical elements used to transmit power.

But I know that this will not help you understand much as it is quite vague. Right? So let me explain to you about it in simple words.

Electric Circuit Explained In Simple Terms

We know what an electricity is, right? It is the energy source to run many of our every day equipment like TV, Radio, Laptops, Fans, AC etc.

But here is the problem. We don’t normally generate electricity in our houses (Unless your house is solar powered). So where is it generated then? Usually in the Power generation units located in a far off place like water falls, Nuclear plants etc.

So then how do we get this electricity delivered to our houses? Well that is when we use the power lines, right?

But even after you get your electricity to your homes through power lines, it is still not good to run your electrical devices. Why, you ask?

Well that is because the power supplied to our homes are quite high – usually between 100V to 240V. But our electrical devices like laptops or fans dont really need that much of power. Then what do we do?

That is when we make use of an electrical circuit!

Using electrical circuits, we will transfer power to our devices at the right amount that it requires. So in other words, we make use of electrical circuits to transfer the electrical power to a device at the right level.

So what is an electrical circuit made of? Want to take a guess? I did tell you about it already once. Not sure?

Well look at the definition above and tell me. What do you see?

If you said “Electrical elements” then you go it right!

What Are Electrical Elements?

So an electrical circuit contains electrical elements in it. You are clear about that, right? But what are these elements? I never told you about it, isn’t it?

Well, we have many type of electrical in use. And each one of these elements have their own purpose in a circuit. But to give you an idea, here are some examples of electrical elements in use:

  • Resistors
  • Capacitors
  • Inductors
  • Diodes
  • Transistors
  • Transformers etc

So as you can see, we have a lot of elements to use in an electrical circuit. But why do we have so many of them? Well, it is because each of the element have their own set of functionalities. So depending on what we need, we will pick up the right element in our circuit.

Sounds good so far? Great. That is all there is to it. But, before I end this article, let me show you a simple electrical circuit as an example. By looking into it, you will get a good idea about what we are dealing with. Right?

So take a look at this simple circuit where we have an LED light connected through a resistor, capacitor and few other elements. Now I will not go in detail about how it works and all. That should be a separate article by itself in the future.

But this should give you a good mental picture of how an electrical circuit looks like. Take a look at it!

A Simple Electrical Circuit Example
A Simple Electrical Circuit Example

Conclusion

So that is how an electrical circuit looks like. By now, I hope you have got a good idea about what an electrical circuit is and why we need to use it.

If you still have any doubts about it, do let me know in the comments below. I will be more than happy to help you guys out!

So until next time, happy learning! 🙂

Learn the difference between a serial and parallel electrical circuit.

Categories
ELECTRONICS EMBEDDED EMBEDDED COMPUTERS EMBEDDED PROGRAMMING IOT PROGRAMMING RASPBERRY PI TUTORIALS

WS2811 Vs WS2812 Difference In LED Strip

Are you planning to connect LED strips to your board? Then you would want to know the difference between WS2811 Vs WS2812. So read below to know more!

Most of the articles on Arduino or Raspberry Pi asks you to hook up an WS2811 or WS2812 LED strip to your board. But have you ever tried to know why these LED strips? Why not any other LED strips? What makes them so special? And what about the WS2811 Vs WS2812 Difference?

WS2811 Vs WS2812 Difference In LED
WS2811 Vs WS2812 Difference In LED

Not many tutorials out there have tried to answer these questions. So in this article, we will do just that! So brace yourself. Sit tight and join the ride to learn all about these LED strips. Alright? Cool! Here we go!

What Is An LED Strip?

So before we dwell into learning the WS2811 Vs WS2812 Difference, let us try to answer this question first.

What is an LED?

An LED is a simple semiconductor device that will emit light when electric current flows through it. Now notice how I used the term “semiconductor device“. But what type of device is it? Well to be precise, it is a semiconductor diode.

So in short, LED stands for Light Emitting Diode. So what do we mean by that? It means that when electricity passes through this diode, it emits light!

So now that we know what an LED is, it is time to answer our next question.

What Is WS2811 LED Strip?

A WS2811 LED strip uses WS2811 LED driver chip to control the LED strip. Uhh… Got confused by what I just said?

Well, let me clear that for you by answering this question.

What is an LED strip?

You see, an LED strip is just a fancy way of connecting a bunch of LED lights together along a strip of wire. So an LED strip will have more than one LED lights in them.

But what makes them great is that you can address each of these LED lights separately.

Wait what? How can we do that, you ask?

Well that is where LED driver IC like WS8211 comes into picture. It is these chips that will help us connecting to each of the LED and controlling them to turn then ON or OFF.

Are you with me until here? Great! Then let us find answer to the next question

How Does WS8211 Chip Control LED?

So here is the thing. To control individual LEDs in a strip, LED driver chips like WS8211 is used. These chips sit alongside the LED and control their light intensity.

So by makes use of serial protocol in your microcontroller and assigning unique addresses to each of the LED driver chip you can control each of the LEDs.

So this way, when you want to control an LED, your board’s microcontroller will send out the address of the LED driver chip to be controlled. This will make the respective LED chip accept the next set of commands to be sent for itself.

And this way, your board will be able to control every LED to be turned ON or OFF!

Pretty neat, isn’t it? 😉

So now that we know what an LED driver chip like WS8211 does, it is finally time to ask the important question of this article.

WS2811 Vs WS2812 Difference

While both WS2811 & WS2812 are LED controller ICs, there are a few notable differences between them. Here are few of them that we listed out for you:

WS2811 Vs WS2812 Difference In Power

WS2811 LED chip uses 12V to work. Where as a WS2812 chip which uses only 5V. But then how will this impact you?

Well you see, if you are going to use along LED strip with many LEDs in them, you are going to see quite a bit of voltage drop along the strip.

Which means that the last few LEDs that is present at the far end of the strip from the board will get lower voltage. Now, if this drop is significant, your last few LEDs might not be glowing as well as its should be.

You do not want that. Right?

So for example you have 30 LEDs in your strip and the voltage drop is 2V towards the end of the strip. Well in that case, if you are using a WS2811 chip, the last few LEDs will get around 10V. This is still reasonably OK for an LED supposed to operate at 12V.

But on the other hand, if you are using WS2812 that works at 5V. the same voltage drop will be down to 3V from the supposed 5V. Now that is quite a significant voltage drop there. Right?

So you need to keep this in mind while choosing between WS2811 Vs WS2812.

WS2811 Vs WS2812 Difference In LEDs Controlled

WS2811 actually do not control one LED. But instead it controls a cluster of 3 LEDs together. So that means that you cannot go below a granularity level of 3 LEDs to control them.

But on the other hand, WS2812 can control 1 LED each. So, if you need a control granularity of 1 LED, you should be going for WS2812 instead of WS2811.

WS2811 Vs WS2812 Difference In Power Consumption

As WS8211 operates at 12V, the amount of power consumed by it is significantly more. On the other hand, as WS8212 uses 5V, it can operate at a much lower power consumption.

WS2811 Vs WS2812 – Pros & Cons Of Each

WS8211 Pros

  • Operates at 12V. So it can control more number of LEDs in a strip.
  • Ease of use when dealing with mass LED controls.

WS8211 Cons

  • It cannot control lower than 3 LEDs at a time. So its lower granularity level of control lies at 3 LEDs.
  • Consumes significantly higher power because of 12V of operation.

WS8212 Pros

  • Can control single indiviudal LEDs.
  • LED control graularity lies at 1 LED.
  • Lower power consumption.

WS8212 Cons

  • As it operates at 5V, its voltage drop becomes significant as the number of LEDs in the strip increases.

Conclusion

So in conclusion, whether to choose WS2811 or WS2812 entirely depends upon the type of use cases you are dealing with. If you want to control a long LED strip then WS2811 is the obvious choice for you.

But on the other hand, if you want to control LEDs at the granular level of a single LED, then WS2812 is the option for you to go for.

So hope this article was helpful for you in understanding the WS2811 Vs WS2812 difference. If you still have any more questions in your mind, do let me know in the comments below and I will try to give you my best help.

So with that, I will end this article here. Until next time, take care and happy learning! 🙂

Categories
100DaysOfCode DATA MINING DATA SCIENCE DJANGO EMBEDDED PROGRAMMING IOT MACHINE LEARNING PROGRAMMING PYTHON TUTORIALS

Python Init Function Example, Syntax & Best Practices

In this article, we will take a look at the Python Init Function using an example. At first, we learn about it’s syntax and how we can use it. But once we are comfortable with it, we will then learn the best practices to use when we want to call it!

So, does this plan sound good? Yes? Then let’s do it! 😉

Python Init Function Example and its syntax
Python Init Function Example and its syntax explained in 5 minutes

What Is The Syntax Of Python Init Function?

So first, let us start with how the syntax of a Python Init function looks like. Now, for us to know about it, we will have to take a look at the Python’s official document. From this, we now get to know that the init function is a method of a class and it looks like:

def __init__(self)

From the above code, we can see that the init function takes at least one argument. This is called as ‘self‘ and it has got a special meaning to it. But before we learn about it, let us first know how Python’s Class works.

You see, in Python a Class can have many methods in it. But it will have one method in it for sure. It is called the init() method. Now this method will be present in a Python Class even if you have not declared it yourself!

So, in other words, init() is a function that you will always find in any Class of Python. If you declared it yourself, it is an explicit init() function. But if you did not, it will be an implicit init() function!

Alright, so we now that an init() function is always present in any Python Class, what does it do? We will answer this question next!

Why do we need an init() function in Python?

So to answer this, we need you to have some knowledge about Object Oriented Programming (OOP). So if you are not so familiar with it, please go and learn about constructors in OOP. But for now, I will assume that you do know about OOP.

So as you know in OOP, we have a constructor method in every Class. So whenever we create an object using a Class, its constructor method will get called. Right?

In the same way, in Python the init function acts as a constructor. So it will get called whenever we create a Python’s Class object.

So this is why I said that the init() function is always present in a Python Class. So, the syntax of the init() that you saw above is how it looks like when it is implicit.

What does the self parameter do?

In order to answer this, let us take a look at the syntax once again

class Test:
    def __init__(self)

Here, we are looking at the code of an example Python class called Test. So here we can see that the init function has one argument called self.

Now, in order to for us to understand what this self argument does, let us first create an object of the Test class type.

t = Test()

So in the above code, we created a new object instance of the Test class. Now, as soon as this code runs, the init() function of the Test class will get called. But what is getting passed as the self argument here the variable t itself.

So, we now see that the self argument of the init() function points to the instance of the object itself!

Are you clear until now? Good! Then let us now look into an example of Python Init() function.

Python Init Function Example

So, let us take a look at this Python Init function example code

class Point:
    def __init__(self, x, y):
        _x = x
        _y = y

p = Point(1,2)

From the above code, we can see that we now have a new Class called Point. We also have an init() function that we have defined explicitly. This init() function takes in three arguments self, x & y.

Is it all clear? Good!

So we can quickly see the advantage of using init() function here. With the help of this function, we are able to set the initial values of x & y variables!

So when we created an instance of Point class using the code:

p = Point(1,2)

we were able to set the p object’s x & y values to 1 & 2 right away!

So, if things are clear until this point, we will then move on to the last part of this article.

Best Practices With Python Init Function

So here is a list of best practices you should follow when writing an init function:

  • Always use Init() function to initialize values to object parameters
  • Reduce the number of parameters passed to the init() if possible. Do not over use it.
  • Keep the init() function simple. Do not abuse it!

Conclusion

So that is about it! That is all you need to know about Python init() function. We have discussed everything there is to know about Python’s init() function with an example. We also went through the best practice we should follow when making use of it.

So with this, I will end this article here. If you still have any more questions, please ask it in the comment section below!

Know the difference between an expression Vs statement in Python

So until next time, have a nice day! 🙂

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