Random number generator using 8051

Random number generator using 8051. A  random number generator using 8051 that  displays a random number between 0 & 99 is shown in this article. The circuit it self is very simple and may not find any applications in serious embedded projects and this article is just an illustration. The circuit is based on AT89S51 microcontroller, two seven segment LED displays, two transistors and few passive components. Circuit diagram. The two seven segment LED displays are multiplexed together and their data lines are connected to Port0  of the microcontroller. Transistors Q1 and Q2 drives the corresponding displays D1 and D2….

Read More

Digital thermometer using 8051

Thermometer using 8051. This article is about a simple 0-100°C digital thermometer with 1°C resolution using 8051. The circuit is based on LM35 analog temperature sensor, ADC0804 and AT89S51 microcontroller. LM35 is an analogue temperature sensor IC which can measure a temperature range of -55 to 150°C. Its output voltage varies 10mV per °C change in temperature. For example, if the temperature is 32°C, the output voltage will be 32 x 10mV = 320mV. ADC 0804 is used to convert the analogue output voltage of the LM35  to a proportional 8 bit digital value suitable for the microcontroller. The microcontroller accepts…

Read More

Most Popular Electronic Circuits

In this article we are attempting to list the most popular electronic circuits we have published over the last couple of years.  We know, its a little difficult task! First hurdle to cross is selecting the criteria to decide – “what makes a circuit popular ?“. Next hurdle is listing all of them in an ordered and categorized manner. Some circuits may seem so silly and simple for an experienced hobbyist/electronics geek, while some other circuits may seem so hard and complex for the amateur. We know its impossible to satisfy every one equally! However we have tried our best…

Read More

Voltmeter using 8051

Voltmeter using 8051. A simple 0-5V voltmeter using 8051 is shown in this article. This digital voltmeter has a sensitivity of  200mV which is a bit low but this project is meant for demonstrating how an ADC and seven segment display can be interfaced to 8051 to obtain a digital readout of the input voltage. A 31/2 digit high end voltmeter will be added soon. ADC0804 is the ADC and AT89S51 is the controller used in this project. Before attempting this project, go through these projects Interfacing ADC to 8051 and Interfacing seven segment display to 8051 which will give you a…

Read More

AVR Microcontroller Tutorial – The complete guide to learn AVR

We have developed a complete guide to learn AVR microcontroller – a tutorial which teaches the architecture,pin diagram,how to program an avr micro controller, how to work with ADC of avr, how to work with SPI of avr,interfacing LCD with avr, the avr gcc library, how to work with external interrupts, how to establish a USART communication etc. We have also developed a simple project to try your hands on – a frequency counter circuit built using Avr Atmega8. The whole series of articles for this tutorial were developed by our young author Rakesh Bute. We owe him a million…

Read More

Control structures and statements in C and C++

Control structures form the basic entities of a “structured programming language“. We all know languages like C/C++ or Java are all structured programming languages. Control structures are used to alter the flow of execution of the program.  Why do we need to alter the program flow ? The reason is “decision making“! In life, we may be given with a set of option like doing “Electronics” or “Computer science”. We do make a decision by analyzing certain conditions (like our personal interest, scope of job opportunities etc). With the decision we make, we alter the flow of our life’s direction….

Read More

Quick Sorting algorithm with example code in C/C++/Java languages

We have seen 3 simple sorting algorithms already 1) Bubble Sorting 2) Selection Sorting and finally Insertion sorting. All these algorithms were so simple to understand and were easy to implement as a program in C/C++ or even Java. But at the same time all 3 of them were too inefficient.  Their execution time was of the order of n*n, where n is the number of elements to be sorted. In practice, these simple sorting algorithms are seldom used.  Quick sort is an improved sorting algorithm developed by Tony Hoare (C.A.R Hoare) in 1960, at the  age of 26, while…

Read More

Insertion sorting algorithm with example in C/C++/Java languages

So far we have seen 2 sorting algorithms:- 1) Bubble sorting and 2) Selection sorting. Now in this article, we are analyzing insertion sort algorithm with its example code suitable for C/C++/Java programming languages. I recommend you go through above articles of Bubble sorting and Selection sorting before reading further.  Insertion sorting algorithm sorts one element at a time. It begins by sorting the first 2 elements in order. In the next step, it takes the third element and compares it against the first two sorted elements. Exchanges are made if necessary and the 3 elements will be sorted with respect to…

Read More

Bit rate Vs Baud rate – the common misconception

The two most common/confused words in digital communication – Bit rate and Baud rate. Generally, communication is concerned with transmission of data. In digital communication, there are two entities that are needed to carry out communication – the data to be transmitted and the signal over which the data is transmitted. Now, we have two entities to be worried about – the data and the signal. The most common misconception is that most people think both travel at the same speed! – NO! The difference: Digital data is very different from digital signal. The process of converting digital data to…

Read More

Selection Sort in C/C++/Java programming languages

In the previous article, we have analysed Bubble sort algorithm and it’s implementation in C programs. In this article we are going to see another sorting algorithm, named, Selection sorting. Just like “Bubble sort”, selection sort is also considered as an inefficient sorting algorithm. If you are curious to know the reason for this, please read the article about Bubble sort carefully. The number of comparisons involved in an average bubble sort is 0.5*(n*n-n). Same is the index for Selection sort too. Note:- Since the algorithm is implemented with the help of 2 FOR loops only, it can be used…

Read More