Posts

Showing posts with the label Microcontroller

Sensors for Embedded & IoT Applications

Image
In Electronics, the basic definition of a sensor is a device or a module that senses a physical parameter in the environment and converts the measured parameter into information that is usually understandable by a processor or a micro-controller. The electronic sensors we use with respected to Embedded Systems and IoT convert the physical parameter into electrical voltage or a digital logic level(which is same as voltage but only allowing 2 levels i.e. 0 and Vcc). It is very important to understand that as we human beings have senses that help us obtain information and process it, the micro-controller or processor can obtain such physical information through these electronic sensors.  So knowing and understanding these sensors is very important if we want to build an application or a smart device using IoT. Our device or application via the sensors can obtain all sorts of information from the real world like temperature, pressure, concentration of variety of gases, infrared s...

Understanding the Input and Output in a Microcontroller/IoT based System

Image
As the title suggests, understanding what and how the input and output can be given and obtained from a system respectively is very important. The Microcontroller or IoT based systems do some processing on the input they receive and give us some kind of output. Yes, its that simple!!Obviously, how we give the input and how we get the output is a huge subject. Let us take some basic examples and understand this concept: Blinking LED : This is the basic "Hello World" of Hardware design and Programming. Here, we are just letting the processor process without giving any input. We obtain the output on LED's where we observe their blinking in various forms. So here, we are basically letting our system do the processing based on our application and just observing the output.  Controlling LED via a switch :  Here, we are giving input via a switch and controlling our LED. Thus, input element is the switch, the output element is the LED and the processing is being done by ou...

Blink LED-The First Program on Arduino

Image
Now, with the upload successfully done, lets write the basic "Hello World" Program of electronics world. In electronics, the basic program that's written is testing a LED. Before proceeding with this program, i would suggest a quick read on  GPIO pins of arduino. Fortunately, there's an on-board LED attached to the pin 13 on Arduino board. So in a nutshell, we will be controlling this LED attached to the pin 13 on Arduino. You can find a rough schematic of our little experiment here. This schematic is inbuilt in the arduino board and is just for our understanding. Later on, we can extend this concept to controlling an external LED. I am simply posting the entire code snapshot here as it is a very basic code and is available everywhere. You can also find the blink example in the examples under File Menu. Now, lets go over the different sections of the program. This will also explain the basics of arudino programming and the functions being used. The Setup o...

Microcontroller GPIO

Image
A general-purpose input/output (GPIO) is a digital signal pin on an integrated circuit or electronic circuit board(In our case, a microcontroller or arduino board) whose behavior—including whether it acts an input or output—is controllable by the user. GPIOs have no predefined purpose and are unused by default. If used, the purpose and behavior of a GPIO is defined by the user or the developer. These pins basically act as bridges to interface with the outside world. For instance, a LED can be connected to these pins as an output device or a sensor can be connected to GPIO for obtaining some input which can be processed by the microcontroller. However, these pins should be made available by the board manufacturer so that they can be used by developers and prototypers. Arduino also has many GPIO pins available for users to program and interface. The pin number and location can be found on multiple diagrams available on the internet. You can see the different pins as well as ...

Uploading your first Dummy Program on Arduino

Image
Now, with everything setup, plug in your Arduino Board. If the drivers have been installed successfully, the PC should detect the board. Under the "Tools" option in the IDE, select the "Board" option and from the sub menu, select Arduino UNO as the board. Again, select "Port" option from the "Tools" menu and select the com port that is present there. In case of  multiple com ports, you will need to check in the Device manager to which port the arduino is attached to. Now, Simply Click on "New" under the "File" menu to open a new sketch. Alternatively, click on the "New" button below the toolbar. Don't worry about writing anything in your sketch. Let's first upload the blank sketch and check if the upload is successful or not. You can follow the video below to see a video guide for uploading the program. When you click on Upload, first an operation called compiling takes place. Compiling basically checks...

Getting Started with Arduino & Arduino IDE

Now, that you have Arduino IDE downloaded and installed, fire it up by clicking the icon that must have appeared on your desktop. When you first open the IDE, a window will open up that shows something called as a sketch. Every program that we write in the IDE is called a sketch. On the toolbar, you can see a variety of options similar to every windows program. You can click File   to open a menu that gives variety of options like "New", "Open", "Open Recent" etc. There are several other options that can be explored as you get familiar with the tool. Go ahead, and click on the "New" option in the File menu. This will open a new sketch with some default codes present in your sketch. Also, you can notice some buttons below the toolbar. These are shortcut buttons for : Verifying the Sketch Uploading the Sketch Create a new Sketch (What we did just now) Open an existing Sketch Save the current sketch The above options are self explanatory...

Arduino-A cheap and efficient Micro-controller Board

Image
Today, let me tell you about an efficient and low cost Microcontroller Board called Arduino. Some of the salient features of Arduino are : Microcontroller: ATmega328. Operating Voltage: 5V. Input Voltage (recommended): 7-12V. Input Voltage (limits): 6-20V. Digital I/O Pins: 14 (of which 6 provide PWM output) Analog Input Pins: 6 Now, A micro-controller is basically a small chip that has a processing element, memory elements as well as different peripherals on a single chip. We generally program the micro-controller by writing instructions either in assembly language or Embedded C, compiling that program and then burning the program on the micro-controller so that we can observe our results. Now, learning these languages in itself is a big task. Then, we additionally need a programmer to transfer the programming file onto the micro-controller. We also require some GPIO(General Purpose Input Output) pins so that we can interact with the Micro-controller. Arduino i...