Showing posts with label example project based on ardiuno or microcntroller. Show all posts
Showing posts with label example project based on ardiuno or microcntroller. Show all posts

Embedded Systems and Microcontroller Programming for Beginners

Introduction of the Microcontroller and Embedded Systems, designing of projects and Programming 

 In this post we discuss about the microcontroller, What is it?

The microcontroller is very much similar to microprocessor having its own RAM and ROM within a single electronics chip called IC (integrated circuit). There are very few external components required to start operation of a simple project like crystal and power supply.

The microcontroller production is in billions every year, it reflects their great use in many project and in many appliances. The controllers are integrated into many appliances like as follows:

  1.  The household appliances which includes microwave, washing machine, coffee machine TV, Radio, anything which is programmable or have some automatic intelligent features.
  2. The telecommunication sector like mobile phones
  3. The automotive industry like now modern vehicle have better fuel injection, ABS and other features which involve the use of microcontroller
  4. The aerospace industry
  5. The industrial automation, here many machine are now automatically operated by applying suitable programs through microcontrollers.

The microcontroller is in short a true computer in a single chip. The designing of microcontroller have all the features of a microprocessor like CPU, ALU, PC, SP and other typical register associated with microprocessor additionally have its own built-in RAM and ROM. It is very much similar to the microprocessor to perform general purpose task with very limited components, someone have to fetch data in it to perform some calculation of that data and sometimes also control the real world parameters based on that data. The basis feature of microcontroller is to control the operation of a machine or system using information feed in a form of a program in it and this task may continue over the period of years. This complex narration can be explained in the simple form as under:

Example from real world system

Lets consider a heat control system in which we want to control the temperature of system or machine then what we will do...?  

  1. We will read the temperature from a temperature measuring device or simple sensor which will be something like analog value. This analog value should be digitized using analog to digital converter and then it will be read by our microcontroller.
  2. The measured temperature should be displayed on suitable device like LED seven segment digits or LCD .
  3.  We wish to feed the required temperature by means of some input devices, for this, keys are used with it.
  4. The microcontroller will read the running temperature, displays on its suitable output device and will also compares with the set point.
  5. It will the control heating according to the temperature by turning heater on/off accordingly.

Thus we can say that the microcontroller is a type of microprocessor furnished in a single integrated circuit and needing a minimum of support of external components like other chips. The basic principal of a MCU is self-sufficiency and low cost. It is not intended to be used as a complex computing device in the conventional sense as personnel computers are or heavy duty processing units; that is, a microcontroller is not designed to be a data processing machine, but rather an intelligent core for a specialized dedicated system as described in above example. The Microcontrollers are embedded in many controls of real world physical parameters, monitoring, and processing systems. Some are general-purpose devices but most microcontrollers are used in specialized systems such as washing machines, telephones, microwave ovens, automobiles, and weapons of many kinds.

You can find microcontrollers in all kinds of things these days. Any device that measures, stores, controls, calculates, or displays information is a candidate for putting a microcontroller inside. The largest single use for microcontrollers is in automobiles—just about every car manufactured today includes at least one microcontroller for engine control, and often more to control additional systems in the car. In desktop computers, you can find microcontrollers inside keyboards, modems, printers, and other peripherals. In test equipment, microcontrollers make it easy to add features such as the ability to store measurements, to create and store user routines, and to display messages and waveforms. Consumer products that use microcontrollers include cameras, video recorders, compact-disk players, and ovens.

 A microcontroller usually includes a central processor, input and output ports, memory for program and data storage, an internal clock, and one or more peripheral devices such as timers, counters, analog-to-digital converters, serial communication facilities, and watchdog circuits. More than two dozen companies in the world manufacture and market microcontrollers. They range from 8- to 32-bit devices. Those at the low end are intended for very simple circuits and provide limited functions and program space, while those at the high end have many of the features associated with microprocessors. The most popular ones include several from Intel (such as the 8051), Zilog (derivatives of their famous Z-80 microprocessor), Motorola (such as the 68HC05), Atmel (the AVR), Parallax (the BASIC Stamp), and Microchip.

The microcontroller has periphery input output ports, timers, interrupts, watchdog timers, debuggers, communication protocols etc. The microcontroller have hardware structure too. All these will be discussed in later posts.

Steps to develop a Microcontroller Project

To develop a Project using microcontroller following Steps shall be perform

Here we will discuss to put together a microcontroller in a project and see following several steps:

1.       First of all define the task

2.       Focus , how it is being performed in manual way

3.       Design and build the electronics circuits

4.       Write the control program

5.       Test and debug

Sometimes the steps won’t follow exactly in this order. You may begin writing your program before you build the circuits, or you may build and test some of the circuits before you start programming. But however you go about it, each of the above steps is part of the process. There are some tolls required to program the microcontroller includes compiler, assembler and program burner or called programmer. These will be discussed later in separate post.

FAQ about Embedded Systems and Microcontroller Programming for Beginners:

The following are some of the FAQ for the beginners to understand the processing of programming a microcontroller in the start. 

what are the embedded systems?

The embedded systems are electronics processing cards or module designed using microcontroller to solve one or more human problem efficiently. An embedded system includes a perfect set of electronics devices in right combination under a specific hardware design along with a software designed to perform a specific task. The Embedded systems are sometimes work as a sub system within a larger complex electronics and electrical system. The embedded systems are programmable and reprogrammable hardware units designed to solve a simple or a complex real-world problem. The common example of embedded system are like Industrial machineries, consumer goods based on electronics, agricultural & processing industry equipment, automobiles, Bio-medical devices, instruments & equipment, digital cameras, electronics watches, household electrical automatic equipment & appliances etc.

What is the embedded systems engineering?

In the field of embedded system engineering the mechatronics-based solution are offered to serve the mankind. The manual problem solving is replaced with automatic microcontroller or microprocessor-based systems.

How and where to start the microcontroller programming?

This is not a difficult task to program a microcontroller. In the start, most of the people remain upset. But the answer is very simple. Start with very simple project like try to write a program for microcontroller in which a LED is attached with a pin or port of MCU and it is required to turn ON and OFF.

Can you please share with us the simple embedded systems examples?

Yes of course, I can share some these. The very simple example a I write above is to control a device like LED, bulb, motor etc with microcontroller to make it function like turn it ON or OFF when a switch is press or at some frequency means periodic action. Similarly Interfacing LED seven segment display unit with microcontroller or development of digital clock using seven segment display or liquid crystal display (LCD). Development of Data acquisition units or modules like acquiring temperature through analog or digital temperature sensor. Use of analog to digital converters. Measurement of current, voltages and frequency of an alternating current source etc.

What are the embedded programming languages?

The list of embedded programming languages is very long including assembly language, basic, C / C++, etc.. But normally the embedded system are programed using high level language like C/C++.

What is the methodology of programming a pic microcontroller for beginners?

It is very simple task. You have to learn any of computer programming language like basic or c. Then you have to chose an appropriate compile where the program could be converted to hex file. The methodology of programming a PIC microcontroller is much different from any of other microcontroller in the world, it included the setting up the software, creating a new project & a new file for coding, and writting some very simple instruction in appropriate syntax based on the language and compiler your using for it to run some very common functions, test the configuration & instruction set and ensure everything is working fine enough, compile the program, convert it into HEX file, burn the HEX file into microcontroller, put the microcontroller in testing board or development board, power up the development board, test the hardware & software, if there is any modification required then make necessary changes in program coding and repeat the above steps.

Which are the tools required for the microcontroller programming for beginners?

The following tools set is required for beginners to have with then to start microcontroller programming: The compile and IDE, development board, programmer, a few electronics component, a suitable regulated power supply.

which programming language is used for microcontrollers?

It is assembly language, basic language, c language used for programming a microcontroller. Any of these can be used.

Which are the software used for microcontroller programming?

The software used for microcontroller programming are compiler and text editor, usually there are some IDE which have integrated compiler/ linker and text editor all in one.

How to learn Arduino programming for beginners?

Starting with simple project and then moving/ shifting to words intermediate level and then high level or complex level projects of Arduino board. The goal should be in mind of develop or beginner be that he should focus on leanings of Basic knowledge about principles, techniques in Arduino system for developing a project based on Arduino. The initial step in starting the programming of Arduino would be the downloading and installing the Arduino IDE on the personal computer or laptop. The Arduino IDE is open source and it can run on Windows, Mac OS X, and Linux platform. The Arduino programming language is a very simple programming language focusing on hardware of Arduino and it is very similar to the C language in syntax.

Which is more often programming language used for microcontrollers?

The programmers or personnel working on microcontroller use a variety of programming languages to program a microcontroller in embedded systems. The most common used languages for microcontroller include C, C++, Python, basic, and Java. Therefore, we can say that the programming languages used for microcontrollers are often assembly, basic, C/C++ etc., but it does not mean that one have to expert of these all languages at a time. If a developer knows any of above said programming language, then it is enough, he can do start microcontroller programming and he can develop projects based on microcontroller.

Can we do the programming embedded systems in c and c++?

Yes, we can do programming of embedded system in C/ C plus plus language with suitable complier and linker.

What is embedded system development board?

It is an electronic board having all necessary electronics devices and components mounted on it along with microcontroller or microprocessor to work together for doing various general-purpose lab experiments using microcontrollers or microprocessor. The embedded system development boards are normally the printed circuit boards which includes some hardware components like central processing unit (CPU), memory (optional), input/ output device and their interfaces, data likes & data buses, and provisions of interfaces to external resource for controlling or acquiring data to and from the board. The microcontroller or embedded system development boards are more often customized keeping in view the solution of some specific problem and the need of user. The engineers or hobby person can design a development board by themselves very specific to current assignment. It is considered that the development boards are designed by some experts for beginners to do some experiments for learning the hardware and software of the microcontrollers. The Common development boards are based on microcontroller of 8051family, ARM, FPGA, Atmel AVR, MicroChip PIC Microcontrollers, Arduino and DSP etc.

Blog for Micro-Controller for Electronics Hobbyist

Introduction of Hobby Projects based on Microcontroller:

 This blog: The Microcontroller Programming Solutions is a good source of literature related to electronics projects mostly based on the use of Embedded system i.e. the use of Microcontroller or Microprocessor as the main central processing units along with the other electronics devices, instruments, equipment and components which may includes the sensors, the display units, LED seven segment displays, The Liquid crystal displays, the moving message displays, computer screens etc. This is an open form blog for the interested people like scientists and engineers which have keen interest in the field of Embedded systems. Here we can help each others to develop various interesting projects based on microcontrollers of all kinds like microcontrollers of Atmel, MicroChip Microcontrollers and AVR microcontrollers. Here any one hobbyist can submit his project for the use of other and as well as any one interested can ask for help to develop his project successfully. Thus This blog is for following :

  1.  Hobbyist
  2. Students
  3.  Engineers
  4.  Industry

Here we will provides best solution based on micro-controllers. 

The projects will be developed using MCU and associated electronics.

It will be the extension of one of the very famous blog on microcontroller named microcontroller51.blogspot.com

What is about this Microcontroller Blog:

In the beginning, as I am starting to write my First Post on this blog which is related to Microcontroller, my desire is to put my practical project one by one on this blog to technical assist the beginners in the form of tutorial of microcontroller. Thus, I name this blog for the hobbyist and learner of electronics and microcontrollers. This article is just introductory nature. Later post will be focusing of the microcontroller projects on this blog. This is platform where hobbyist and learner will get practical example projects of microcontroller, thus we can say that this blog is about the Best blog for the microcontroller on hobby projects.

Why we need Microcontroller Development Board in the start:

To develop microcontroller projects quickly, the best optimum choice is I think to use readily available but not much costly development boards offering all suitable capabilities and features. One we are going to choose a Development Board for Microcontroller, what we have or we should have questions and what we should have to think about like considering to buy Microcontroller Development Board, as many are available over internet to buy online. Usually I prefer the Microcontroller Development Board which has all necessary features for beginners like some electronics components shall be mounted on it along with availabilities of ports to connect something externally with the board, if need to connect a device with microcontroller.

To develop a Microcontroller Hobby Project; What are basic components required to be available on Development board for beginners:

The components which are necessarily required at the start of hobby project based on microcontroller are Push buttons, section buttons, resistors, capacitors, potentiometer, variable resistors, reset button, touch button, LEDs, port status LEDs, Alpha-numeric LCD, provision of connection for general purpose graphic LCD, Mikro-BUS header, programmer attachment, relays, optocouplers, Bluetooth module, finger print sensor, touch pad for graphical LCDs, to avoid the need of external hardware for programming there should be Integrated programming interfaces through USB port or at least using RS-232 serial communication although the use of serial programmers are now limited,  power supply connections with 05V regulator,  etc.

Example of an inexpensive Microcontroller board to develop hobby projects for learner:

One of the best choices I think would be the development board for PIC microcontrollers which I like to use is the Microchip’s 8-bit Curiosity Development Board. The microcontroller used at this board is a PIC16F1619 which developed by MicroChip. The board has a DIP socket for the placement of microcontroller consisting of 20 pin. The advantage of provision of this DIP socket on development board is to give provision to learner to change the microcontroller easily and to update the board with any microcontroller which has similarly PIN configurations. As we know that in 20 PIN package there are several Microcontroller developed by MicroChip have different features but same PINs for power supply and other connections. Thus the developer cab switch from one microcontroller to any other of similar number PINs very easily.

Hobby Project Development board features offered by 8-bit Curiosity:

The important features of microcontroller board are summarized as ; PIC16F1619 compatible microcontroller usability, this microcontroller has some important features which are not common in many other 8-bit microcontrollers made by other manufactures like it has 1 KB of RAM, 8K 14-bit words (14 KB) of program storage, four Configurable Logic Cells, Multiple serial communications: EUSART, SPI, I2C, Complementary Waveform Generator, two Capture or Compare or PWM modules, Math accelerator with PID controller, two Signal measurement Timers which offers 24-bit timer or counter with Pre-scaler, Cyclic Redundancy Check, angular timer, three 8-Bit Timers/ counter and many more features. There are a lot of facilities which can be programmed to have interesting experience.

Other suitable options to start a Microcontroller Hobby Project:

There are many options available over internet which can be considered like development board which are made to use Atmel microcontrollers like 8051 family, the development board made for the use of AVR microcontrollers. The Arduino boards are also good choice, these boards normally use AVR microcontroller like Atmega8, atmge16 or atmge32. There is an important parameter which is called coast. Thus, one should consider his budget also. The PIC microcontroller 16F84 is also a good choice and I like it also to develop some tiny or small microcontroller projects.  It is a low cost and basic microcontroller in a 14pin package. It can be purchased anywhere for less than $2. I have developed many small microcontroller project using PIC16f84 processor, similarly I have used a variety of Arduino boards like Arduino Trinket, Arduino RS232, Arduino Diecimila, Arduino Duemilanove, Arduino Uno SMD, Arduino Leonardo, Arduino pro micro, Arduino Mega, Arduino Nano, Arduino UNO, Arduino Ethernet, Arduino Due, Arduino LilyPad, many of more.

Common Uses or General Application of Arduino or any Microcontroller:

There are a variety of application which can be developed using microcontroller made of Atmel 8051 family, PIC by MicrChip or Atmel AVR, etc like some are listed below which will be constructed and developed in later post of this microcontroller blog:

  • Development of a handheld game console
  • Designing the project based on microcontroller to control the graphical LCD
  • Construction of a MIDI controller device like mimics the Monome
  • Digital Thermometer
  • Autopilot for drone
  • Microcontroller based weather station
  • ArduSat, a cubesat based on Arduino
  • Microcontroller based event counting machine
  • C-STEM Studio, a platform for learning of computing, science, technology, engineering, and mathematics Development of robots, toy cars, helicopters etc
  • Industrial use of microcontroller, like development of various type of panel meters for the measurement of voltage, current and frequency of power sources.
  • Yard-meter (Ghazana Meter) to measure the length of cloth being produced in textile industry
  • Data loggers for scientific research
  • Development of a trip computer that uses the on-board diagnostics interface found in most modern cars
  • Fabrication of electric vehicle
  • Construction of automatic wheel chair
  • Construction of incubator

Point under consideration while Designing of a Microcontroller Project:

The designing a project based on microcontroller needs proper homework which start from thinking and ends on thinking, the important steps involved in this procedure are as under:

  • Identification of problem
  • Think about how it is being done manually
  • Try to automate it on paper
  • Try to choose the electronics components
  • Try to develop its schematic circuit diagram,
  • Try to write its program
  • Build the program into Microcontroller using suitable programmer
  • Test the program with real parameters and modify it.
  • Finalize the project on standard PCB.
Good luck to all learner and hobbyist coming on my microcontroller blog, you can explore the hobby project based microcontroller by looking at different post. I will usually put one project in one post. You are welcome to comment and please give feedback. Thanks

Popular Post (All Time)