<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>8051/8951 | Student Projects</title>
	<atom:link href="https://studentprojects.in/category/electronics/microcontroller/8051-8951/feed/" rel="self" type="application/rss+xml" />
	<link>https://studentprojects.in</link>
	<description>Microcontroller projects, Circuit Diagrams, Project Ideas</description>
	<lastBuildDate>Sun, 13 Mar 2022 02:30:15 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.1.7</generator>
	<item>
		<title>Stepper Motor Chopping Driver</title>
		<link>https://studentprojects.in/electronics/microcontroller/8051-8951/stepper-motor-chopping-driver/</link>
					<comments>https://studentprojects.in/electronics/microcontroller/8051-8951/stepper-motor-chopping-driver/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Thu, 01 Oct 2009 16:33:35 +0000</pubDate>
				<category><![CDATA[8051/8951]]></category>
		<category><![CDATA[Stepper motor]]></category>
		<category><![CDATA[chopping driver]]></category>
		<category><![CDATA[circuits]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=799</guid>

					<description><![CDATA[<p>Chopper drive circuits Chopper drive circuits are also referred to as constant current drives because they generate a somewhat constant current in each winding rather than applying a constant voltage. On each new step, a very high voltage is applied to the winding initially. This causes the current in the winding to rise quickly since</p>
<p>The post <a href="https://studentprojects.in/electronics/microcontroller/8051-8951/stepper-motor-chopping-driver/">Stepper Motor Chopping Driver</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p><strong>Chopper drive circuits<br />
</strong></p>
<p>Chopper drive circuits are also referred to as constant current drives because they generate a somewhat constant current in each winding rather than applying a constant voltage. On each new step, a very high voltage is applied to the winding initially. This causes the current in the winding to rise quickly since dI/dt = V/L where V is very large.</p>
<p>When the current exceeds a specified current limit, the voltage is turned off or &#8220;chopped&#8221; and when the winding current drops below the specified limit, the voltage is turned on again. In this way, the current is held relatively constant for a particular step position.<br />
This allows driving stepper motors with higher torque and higher speed.</p>
<p><strong>Steps:</strong></p>
<ol>
<li> Measure Inductance and resistance of motor coil.</li>
<li> Get time constant.</li>
<li> Choose voltage value and desired calculation for program variables.</li>
<li> Write chopping program.</li>
</ol>
<p><img decoding="async" loading="lazy" class="size-full wp-image-800" title="Stepper Motor Chopping Driver" src="https://studentprojects.in/wp-content/uploads/2009/10/Stepper_Motor_Chopping_Driver.jpg" alt=" " width="500" height="259" /></p>
<p>Can be done using oscilloscope and step response equation on LR circuit or from stepper motor datasheet:<br />
<img decoding="async" loading="lazy" class="aligncenter size-full wp-image-801" title="Step response equation" src="https://studentprojects.in/wp-content/uploads/2009/10/Step_response_equation.jpg" alt="Step response equation" width="268" height="71" />Put I= maximum coil current from stepper datasheet (different from Imax)<br />
R=Rc = internal resistance of the stepper coil from stepper datasheet<br />
L =Lc = inductance of stepper coil from stepper datasheet<br />
Time constant ( T ) = L/R.<br />
Put t which is the desired time to reach the step level (start of chopping)</p>
<p>From above we can get   Imax  then by multiplying  it with Rc we can get the desired Applied voltage Vs to reach the maximum current in time t.<br />
<strong><br />
Case Study:<br />
</strong><br />
Stepper motor has the following specifications<br />
Max current per phase = 1A, voltage = 5.7V, Resistance per phase = 5.7<br />
Inductance = 6.5 mH/phase</p>
<p>So its time constant = 1.14 msec<br />
We put desired t=.5 msec to reach its max current instead of taking 1.14 msec It will give us Imax = 2.8164 and Vs=16 V so we will need to apply a 16 V to reach our max current per Phase in .5 msec.</p>
<p><strong>Program for Chopping driver </strong></p>
<pre lang="c">#include &lt;16f628.h&gt;
#use delay ( clock=4M )

// GLOBAL VARIABLES /////////////
int steps[] = {1,2,4,8}; // motor steps
int step_ptr = 0;
int step = 0;
int desiredt = 500; // desired time to reach max current at start of every step 0.5 msec
int choppingt = 50; // chopping time = 0.1 desired time = 50 usec

// FUNCTIONS ////////////////////

// INTERRUPTS ///////////////////

#INT_TIMER0
void change_step ()
{
if ((++step_ptr) &gt; 3)  step_ptr=0;
step = steps[step_ptr];
output_b(step);
delay_us(desiredt);
output_b(0);
delay_us(choppingt);
}

// MAIN /////////////////////////
void main()
{
// Motor terminals are connected to Port B (Unipolar Stepper Motor)
// setup interrupt timer0 to desired stepping speed let motor change step every 2msec
// if step angle = 1.8 degree, steps per revolution = 360/1.8 = 200 steps
// time per revolution = 200 * 2 msec = 0.4 sec
// rpm = 60/0.4 = 150 rpm

setup_timer_0(RTCC_INTERNAL | RTCC_DIV_16);

// put first step//
step = steps[step_ptr];
output_b(step);
delay_us(desiredt);
output_b(0);
delay_us(choppingt);

// enable interrupt/////
enable_interrupts(GLOBAL);
enable_interrupts(INT_TIMER0);

// chopping loop//

while (1)
{
// put step (apply voltage) //
output_b(step);
// wait chopping time //
delay_us(choppingt);
// clear step ////
output_b(0);
// wait chopping time//
delay_us(choppingt);
}
}</pre>
<p>References:</p>
<p>&#8211;    Wikipedia.org<br />
&#8211;    Microchip Co. application notes.</p>
<p>Article by &#8211; Amr Ayoub</p><p>The post <a href="https://studentprojects.in/electronics/microcontroller/8051-8951/stepper-motor-chopping-driver/">Stepper Motor Chopping Driver</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/electronics/microcontroller/8051-8951/stepper-motor-chopping-driver/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Interfacing 7-segment display using 8051 Microcontroller</title>
		<link>https://studentprojects.in/electronics/microcontroller/8051-8951/interfacing-7-segment-display-using-8051-microcontroller/</link>
					<comments>https://studentprojects.in/electronics/microcontroller/8051-8951/interfacing-7-segment-display-using-8051-microcontroller/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Mon, 17 Aug 2009 13:32:44 +0000</pubDate>
				<category><![CDATA[8051/8951]]></category>
		<category><![CDATA[7-segment]]></category>
		<category><![CDATA[8051 Microcontroller]]></category>
		<category><![CDATA[8951 Microcontroller]]></category>
		<category><![CDATA[lookup table]]></category>
		<category><![CDATA[Seven Segment]]></category>
		<category><![CDATA[7447 decoder]]></category>
		<category><![CDATA[Interfacing using microcontroller]]></category>
		<category><![CDATA[pin configuration]]></category>
		<category><![CDATA[program to interface]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=673</guid>

					<description><![CDATA[<p>The Light Emitting Diode (LED), finds its place in many applications in this modern electronic fields. One of them is the Seven Segment Display. Seven-segment displays contains the arrangement of the LEDs in “Eight” (8) passion, and a Dot (.) with a common electrode, lead (Anode or Cathode). The purpose of arranging it in that</p>
<p>The post <a href="https://studentprojects.in/electronics/microcontroller/8051-8951/interfacing-7-segment-display-using-8051-microcontroller/">Interfacing 7-segment display using 8051 Microcontroller</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>The Light Emitting Diode (LED), finds its place in many applications in this modern electronic fields. One of them is the Seven Segment Display. Seven-segment displays contains the arrangement of the LEDs in “Eight” (8) passion, and a Dot (.) with a common electrode, lead (Anode or Cathode). The purpose of arranging it in that passion is that we can make any number out of that by switching ON and OFF the particular LED&#8217;s. Here is the block diagram of the Seven Segment LED arrangement.<span id="more-673"></span></p>
<p style="text-align: center;"><strong>Pin configuration of a seven segment display:</strong><br /><img decoding="async" loading="lazy" class="size-medium wp-image-475 aligncenter" title="7 segment pin configuration" src="https://studentprojects.in/wp-content/uploads/2009/04/7_seg_pin_config-300x266.gif" alt="7 segment pin configuration" width="300" height="266" /></p>
<p><strong>LED’s are basically of two types:</strong></p>
<ol>
<li>Common Cathode (CC)<br />All the 8 anode legs uses only one cathode, which is common.</li>
<li>Common Anode (CA)<br />The common leg for all the cathode is of Anode type.</li>
</ol>
<p>For the discussion purpose, we use CC LED, where by just reversing the logical voltages we can implement the same for CA LED also.</p>
<p>In a CC LED, all the 8 legs (&#8216;a&#8217; through &#8216;h&#8217;) are of anode type and the common cathode will be connected to the GND of the supply. By energizing any of the legs with +5 Volts will lead to switch the correspondent segment ON. In the microprocessor binary system, 0Volts will be considered as Binary 0, and 5Volts will be considered as Binary1. Considering these two condition, we can make an arrangement as the microcontroller gives OUT the 0s and 1s through its ports, which is connected to the 8 legs of the LED. Of course, we can control the Port Output; implicitly we can Switch-ON required legs of the display.</p>
<p>There 2 methods of interfacing LED with the Microcontroller Intel 8051/8951.</p>
<ol>
<li><a href="https://studentprojects.in/articles/electronics/microcontroller-electronics-articles/8051-8951/interfacing-7-segment-display-with-microcontroller-using-lookup-table/">Using lookup table. This uses 7 output pins of microcontroller</a></li>
<li>Using 7447 decoder. This method uses 4 output pins of microcontroller</li>
</ol>
<p>The difference between the two main methods is simple and clear. In both the cases, microcontroller communicates with external world through its ports. But, in the 1st case, we connect all the 8 pins of the port directly to the LED and control the voltage through the ports manually to display the desired number. But, in the second case, we send the BCD of the number that we wanted to display to a middleware IC 7447, the BCD to LED code converter, which by itself gives out the correspondent 7 segment codes to the LED.</p>
<p>Here we explain using lookup table. Click here for the method &#8220;using 7447 decoder&#8221;</p>
<p><strong>Using 7447 decoder:</strong></p>
<p>The IC7447 is a BCD to 7-segment pattern converter. This setup is the advanced form of the &lt;previous&gt; setup where we entered the patterns manually to display the desired character. Here in this case, the IC7447 takes the Binary Coded Decimal (BCD) as the input and outputs the relevant 7 segment code. We connect first four pins of the microcontroller Port 2  to the 7447 and the Output 8 pins of 7447 to the 8 legs of the LED as shown in the figure. Te circuit diagrams are shown below, the first figure is interfacing the CA LED where as the second is of CC LED. The number required to display is sent as the lower nibble of the Port 2 of the Microcontroller. The 7447 converts the four input bits (BCD) to their corresponding 7-segment codes. The outputs of the 7447 are connected to the 7-segment display.</p>
<figure id="attachment_674" aria-describedby="caption-attachment-674" style="width: 507px" class="wp-caption aligncenter"><img decoding="async" loading="lazy" class="size-full wp-image-674" title="Circuit diagram for interfacing Common Anode 7-Segment Display " src="https://studentprojects.in/wp-content/uploads/2009/08/7_seg_circuit_ca_7447.gif" alt="Circuit diagram for interfacing Common Anode 7-Segment Display" width="507" height="326" /><figcaption id="caption-attachment-674" class="wp-caption-text">Circuit diagram for interfacing Common Anode 7-Segment Display</figcaption></figure>
<figure id="attachment_675" aria-describedby="caption-attachment-675" style="width: 507px" class="wp-caption aligncenter"><img decoding="async" loading="lazy" class="size-full wp-image-675" title="Circuit diagram for Common Cathode 7-Segment Display" src="https://studentprojects.in/wp-content/uploads/2009/08/7_seg_circuit_cc_7447.gif" alt="Circuit diagram for Common Cathode 7-Segment Display" width="507" height="326" /><figcaption id="caption-attachment-675" class="wp-caption-text">Circuit diagram for Common Cathode 7-Segment Display</figcaption></figure>
<p><strong>Program:</strong></p>
<p lang="asm">This program displays characters 0 through 9 on seven-segment display using IC 7447 as the middle wear.</p>


<pre class="wp-block-code"><code lang="wasm" class="language-wasm">again: mov a,#00h ; Start form zero
       up: mov p2, a ; Move to Port 2 
       mov r3,#255 ; Delay 
D1:    mov r1,#255 
D:     djnz r1,D 
       djnz r3,D1 
       inc a 
       cjne a,#0ah,up 
       sjmp again</code></pre><p>The post <a href="https://studentprojects.in/electronics/microcontroller/8051-8951/interfacing-7-segment-display-using-8051-microcontroller/">Interfacing 7-segment display using 8051 Microcontroller</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/electronics/microcontroller/8051-8951/interfacing-7-segment-display-using-8051-microcontroller/feed/</wfw:commentRss>
			<slash:comments>51</slash:comments>
		
		
			</item>
		<item>
		<title>Heavy electrical device protector</title>
		<link>https://studentprojects.in/electronics/microcontroller/8051-8951/heavy-electrical-device-protector/</link>
					<comments>https://studentprojects.in/electronics/microcontroller/8051-8951/heavy-electrical-device-protector/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Sun, 16 Aug 2009 15:41:26 +0000</pubDate>
				<category><![CDATA[8051/8951]]></category>
		<category><![CDATA[Microcontroller]]></category>
		<category><![CDATA[Device protector]]></category>
		<category><![CDATA[ADC]]></category>
		<category><![CDATA[Electronic project]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=658</guid>

					<description><![CDATA[<p>Applications: In monitoring &#38; controlling of power systems such as Transformers, Generators, Motors etc. To analyze the performance of electrical machines. Can be used as a safety device to protect machines from over loading, excessive voltage etc. To make the power distribution system efficient. Recording device/Line parameters. Introduction This unit is used to protect heavy</p>
<p>The post <a href="https://studentprojects.in/electronics/microcontroller/8051-8951/heavy-electrical-device-protector/">Heavy electrical device protector</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p><strong>Applications:</strong></p>
<ol>
<li> In monitoring &amp; controlling of power systems such as Transformers, Generators, Motors etc.</li>
<li>To analyze the performance of electrical machines.</li>
<li>Can be used as a safety device to protect machines from over loading, excessive voltage etc.</li>
<li> To make the power distribution system efficient.</li>
<li>Recording device/Line parameters.</li>
</ol>
<p><strong>Introduction<br />
</strong><br />
This unit is used to protect heavy electrical machinery from damage caused by over loading. Over heating excessive voltage etc.</p>
<p>The unit works as a fuse so disconnect the device or m/c from circuit when detects abnormal condition &amp; after a fixed time (for over loading )/ or when conditions gets normal it automatically reconnects the unit or m/c to circuit.</p>
<p>Now if it detects the abnormal condition again it repeats the process again for a number of time &amp; if condition does not get normal, it disconnect &amp; locks the m/c.</p>
<p>We are also providing the facility of password protection so m/c will not run after locking without entering password.</p>
<p><strong>Auto Recloser</strong></p>
<p>In our project we designed a circuit which contains a micro controller which collects the data from sensors placed at different locations of device &amp; display them into LCD.</p>
<p>Now after collecting the data micro controller compares them with standard values (pre defined for each sensor on normal working conditions) &amp; if it detects deviation from normal values it gives a buzzer sound &amp; if it crosses the maximum limit it trip off the unit for a fixed duration &amp; records the collected data into EEPROM.<br />
Now if the number of tripping exceeds the 10 no. it  permanently trip the unit &amp; starts them only after detecting the password.</p>
<p><strong>The utility of this circuit are:</strong></p>
<ol>
<li> To warn the manufacturer at the initial stage of fault so that manufacturer can take proper corrective action before serious damage to device occurs which saves a lot of money required to reconstruct the device and other associated losses.</li>
<li> Performance observation of the device.</li>
<li> Monitoring of the device.</li>
</ol>
<p><strong>Block Diagram Explanation<br />
</strong></p>
<p><figure id="attachment_660" aria-describedby="caption-attachment-660" style="width: 264px" class="wp-caption alignleft"><img decoding="async" loading="lazy" class="size-full wp-image-660" title="Block Diagram" src="https://studentprojects.in/wp-content/uploads/2009/08/block_Diagram.jpg" alt="Block Diagram" width="264" height="492" /><figcaption id="caption-attachment-660" class="wp-caption-text">Block Diagram</figcaption></figure></p>
<p><strong>A) Sensors:</strong></p>
<p>This is the part of circuit which senses the different parameters of the unit.<br />
To make the circuit unit independent it is necessary to use a conditioning unit between sensor &amp; multiplexer. The conditioning unit will automatically maintain the output level of signals between desired limits.</p>
<p><strong>B) Multiplexer:<br />
</strong><br />
This is required to select sensors one by one for analog to digital conversion of their values (output). When we are using single ADC the multiplexer must be analog in nature because we have to connect the analog signals.</p>
<p><strong>C) A/D Converter:<br />
</strong><br />
This unit converts the analog signals coming from multiplexer in to 8bit parallel digital data which is a must for Micro controller operation because Micro controller can not work with analog signals directly.</p>
<p><strong>D) Micro controller:<br />
</strong><br />
As the name indicates this unit has the over all command of all blocks or this unit decides  when to use &amp; which unit has to be used. Since it is a programmable device it provides the facility to update the device without changes in hardware &amp; it also reduces the hardware required to implement the circuit.</p>
<p><strong>E) LCD Display:<br />
</strong><br />
Display plays an important role whenever we want a user friendly system because user can see &amp; read the information from display &amp; can get better understanding about the system. Since we want to display alphabets for massages &amp; digits for readings we required a alphanumeric LCD display so we use a 16 character , 2 line display best suitable for our requirement because our massage length to not greater then 16 character, so they can be displayed on single line only.</p>
<p><strong>F)  EEPROM R/W<br />
</strong><br />
As we consider a SIM it’s a memory card or ROM   which can be erased electrically because many EEPROM requires different voltage levels to program, we need a voltage level shifter or Converter to interface it with microcontroller which have only two level outputs 5VDC &amp; 0V DC.</p>
<p><strong>G)  EEPROM<br />
</strong><br />
It’s a two terminal memory device which stores the Information about the energy in a predefined format it contains 10, 8bit number interrelated by some mathematical function so that it can  not be charged by unauthorized persons although we have used here a chip which can be used for 256 bytes of memory so that in future we can incorporate some additional features also in same card.</p>
<p><strong>H) Key Pad<br />
</strong><br />
This section consist the keys one to reset the controller &amp; other one to provide the password.</p>
<p><strong>I) Indications &amp; Beeper<br />
</strong><br />
Although we are using here a LCD display to display the information but it is still requirement of a system that it should create the special attention of user to read same specific information on LCD this is done by this block. It generates a beeping sound on over loading mode. So that user need not to read the LCD frequently (when not required).</p>
<p><strong>J)  Relay &amp; tripping unit</strong></p>
<p>To disconnect the supply when tripped. </p><p>The post <a href="https://studentprojects.in/electronics/microcontroller/8051-8951/heavy-electrical-device-protector/">Heavy electrical device protector</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/electronics/microcontroller/8051-8951/heavy-electrical-device-protector/feed/</wfw:commentRss>
			<slash:comments>18</slash:comments>
		
		
			</item>
		<item>
		<title>Interfacing 7-Segment Display using lookup table</title>
		<link>https://studentprojects.in/electronics/microcontroller/8051-8951/interfacing-7-segment-display-with-microcontroller-using-lookup-table/</link>
					<comments>https://studentprojects.in/electronics/microcontroller/8051-8951/interfacing-7-segment-display-with-microcontroller-using-lookup-table/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Tue, 28 Apr 2009 07:21:46 +0000</pubDate>
				<category><![CDATA[8051/8951]]></category>
		<category><![CDATA[Microcontroller]]></category>
		<category><![CDATA[7-Segment Display]]></category>
		<category><![CDATA[7447]]></category>
		<category><![CDATA[LED]]></category>
		<category><![CDATA[lookup table]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=474</guid>

					<description><![CDATA[<p>The Light Emitting Diode (LED), finds its place in many applications in this modern electronic fields. One of them is the Seven Segment Display. Seven-segment displays contains the arrangement of the LEDs in “Eight” (8) passion, and a Dot (.) with a common electrode, lead (Anode or Cathode).</p>
<p>The post <a href="https://studentprojects.in/electronics/microcontroller/8051-8951/interfacing-7-segment-display-with-microcontroller-using-lookup-table/">Interfacing 7-Segment Display using lookup table</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>The Light Emitting Diode (LED), finds its place in many applications in this modern electronic fields. One of them is the Seven Segment Display. Seven-segment displays contains the arrangement of the LEDs in “Eight” (8) passion, and a Dot (.) with a common electrode, lead (Anode or Cathode). The purpose of arranging it in that passion is that we can make any number out of that by switching ON and OFF the particular LED&#8217;s. Here is the block diagram of the Seven Segment LED arrangement.<span id="more-474"></span></p>
<p style="text-align: center;"><strong>Pin configuration of a seven segment display:</strong><br />
<img decoding="async" loading="lazy" class="size-medium wp-image-475 aligncenter" title="7 segment pin configuration" src="https://studentprojects.in/wp-content/uploads/2009/04/7_seg_pin_config-300x266.gif" alt="7 segment pin configuration" width="300" height="266" /></p>
<p><strong>LED’s are basically of two types:</strong></p>
<ol>
<li>Common Cathode (CC)<br />
All the 8 anode legs uses only one cathode,  which is common.</li>
<li>Common Anode (CA)<br />
The common leg for all the cathode is of Anode type.</li>
</ol>
<p>For the discussion purpose, we use CC LED, where by just reversing the logical voltages we can implement the same for CA LED also.</p>
<p>In a CC LED, all the 8 legs (&#8216;a&#8217; through &#8216;h&#8217;) are of anode type and the common cathode will be connected to the GND of the supply. By energizing any of the legs with +5 Volts will lead to switch the correspondent segment ON. In the microprocessor binary system, 0Volts will be considered as Binary 0, and 5Volts will be considered as Binary1. Considering these two condition, we can make an arrangement as the microcontroller gives OUT the 0s and 1s through its ports, which is connected to the 8 legs of the LED. Of course, we can control the Port Output; implicitly we can Switch-ON required legs of the display.</p>
<p>There 2 methods of interfacing LED with the Microcontroller Intel 8051/8951.</p>
<ol>
<li>Using lookup table. This uses 7 output pins of microcontroller</li>
<li><a href="https://studentprojects.in/articles/electronics/microcontroller-electronics-articles/8051-8951/interfacing-7-segment-display-using-7447-decoder/">Using 7447 decoder. This method uses 4 output pins of microcontroller</a></li>
</ol>
<p>The difference between the two main methods is simple and clear. In both the cases, microcontroller communicates with external world through its ports. But, in the 1st case, we connect all the 8 pins of the port directly to the LED and control the voltage through the ports manually to display the desired number.  But, in the second case, we send the BCD of the number that we wanted to display to a middleware IC 7447, the BCD to LED code converter, which by itself gives out the correspondent 7 segment codes to the LED.</p>
<p>Here we explain using lookup table. Click here for the method &#8220;using 7447 decoder&#8221;</p>
<p><strong>Using Lookup Table:</strong></p>
<p>As we discussed, this method uses the port of the microcontroller to display the desired number. The common cathode pin is connected to GND by external wire, if it is the CC LED and in the case of the common Anode LED, the Anode pin is connected to +Vcc. Here, other pins of the LED are connected to Port 2 of 8951. A table will be prepared which relates the BCD code to the LED display code (pattern). We call it as Lookup table. The table below explains how we construct the Lookup table. Circuit diagram is given below.</p>
<p><strong>Circuit diagram for Common Anode 7-Segment Display:</strong></p>
<p style="text-align: center;"><a href="https://studentprojects.in/wp-content/uploads/2009/04/7_seg_circuit_ca.gif"><img decoding="async" loading="lazy" class="size-medium wp-image-476 aligncenter" title="7 segment circuit comon anode" src="https://studentprojects.in/wp-content/uploads/2009/04/7_seg_circuit_ca-300x256.gif" alt="7 segment circuit comon anode" width="300" height="256" /></a></p>
<p style="text-align: center;"><strong>Circuit diagram for Common Cathode 7-Segment Display:</strong></p>
<p style="text-align: center;"><a href="https://studentprojects.in/wp-content/uploads/2009/04/7_seg_circuit_cc.gif"><img decoding="async" loading="lazy" class="size-medium wp-image-477 aligncenter" title="7 segment circuit comon cathode" src="https://studentprojects.in/wp-content/uploads/2009/04/7_seg_circuit_cc-300x256.gif" alt="7 segment circuit comon cathode" width="300" height="256" /></a></p><p>The post <a href="https://studentprojects.in/electronics/microcontroller/8051-8951/interfacing-7-segment-display-with-microcontroller-using-lookup-table/">Interfacing 7-Segment Display using lookup table</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/electronics/microcontroller/8051-8951/interfacing-7-segment-display-with-microcontroller-using-lookup-table/feed/</wfw:commentRss>
			<slash:comments>9</slash:comments>
		
		
			</item>
		<item>
		<title>8051 Microcontroller port programming</title>
		<link>https://studentprojects.in/electronics/microcontroller/8051-8951/8051-microcontroller-port-programming/</link>
					<comments>https://studentprojects.in/electronics/microcontroller/8051-8951/8051-microcontroller-port-programming/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Wed, 19 Nov 2008 09:24:58 +0000</pubDate>
				<category><![CDATA[8051/8951]]></category>
		<category><![CDATA[port programming]]></category>
		<category><![CDATA[8051 I/O Ports]]></category>
		<category><![CDATA[8051 Microcontroller]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=160</guid>

					<description><![CDATA[<p>There are four ports P0, P1, P2  and  P3 each  use  8 pins,  making  them 8-bit  ports. All the ports upon  RESET are configured as output, ready to be used as output ports. To use any of these ports as an input port, it must be programmed. Pin configuration of 8051/8031 microcontroller. Port 0: Port</p>
<p>The post <a href="https://studentprojects.in/electronics/microcontroller/8051-8951/8051-microcontroller-port-programming/">8051 Microcontroller port programming</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>There are four ports P0, P1, P2  and  P3 each  use  8 pins,  making  them 8-bit  ports. All the ports upon  RESET are configured as output, ready to be used as output ports. To use any of these ports as an input port, it must be programmed.</p>
<p>Pin configuration of 8051/8031 microcontroller.</p>
<p><figure id="attachment_161" aria-describedby="caption-attachment-161" style="width: 260px" class="wp-caption aligncenter"><img decoding="async" loading="lazy" class="size-full wp-image-161" title="Pin configuration of 8951" src="https://studentprojects.in/wp-content/uploads/2008/11/pin-8051.gif" alt="Pin configuration of 8951" width="260" height="550" /><figcaption id="caption-attachment-161" class="wp-caption-text">Pin configuration of 8951</figcaption></figure></p>
<p><strong>Port 0:</strong> Port 0 occupies a total of 8 pins (pins 32-39) .It can be used for input or output. To use the pins of port 0 as both input and output ports, each pin must be connected externally to a 10K ohm pull-up resistor. This is due to the fact that P0 is an open drain, unlike P1, P2, and P3.Open drain  is a term used for MOS chips in the same way that open collector is used for TTL chips. With external pull-up resistors connected upon reset, port 0 is configured as an output port. For example, the following code will continuously send out to port 0 the alternating values 55H and AAH</p>
<p>MOV A,#55H<br />
BACK:  MOV P0,A<br />
ACALL DELAY<br />
CPL A<br />
SJMP BACK</p>
<p><strong>Port 0 as Input :</strong> With resistors connected to port 0, in order to make it an input, the port must be programmed by writing 1 to all the bits. In the following code, port 0 is configured first as an input port by writing 1&#8217;s to it, and then data is received from the port and sent to P1.</p>
<p><figure id="attachment_162" aria-describedby="caption-attachment-162" style="width: 400px" class="wp-caption aligncenter"><img decoding="async" loading="lazy" class="size-full wp-image-162" title="8051 I/O Ports" src="https://studentprojects.in/wp-content/uploads/2008/11/8051.gif" alt="8051 I/O Ports" width="400" height="266" /><figcaption id="caption-attachment-162" class="wp-caption-text">8051 I/O Ports</figcaption></figure></p>
<p>MOV A,#0FFH         ; A = FF hex<br />
MOV P0,A                ; make P0 an input port<br />
BACK: MOV A,P0               ;get data from P0<br />
MOV P1,A                ;send it to port 1<br />
SJMP BACK</p>
<p><strong>Dual role of port 0:</strong> Port 0 is also designated as AD0-AD7, allowing it to be used for both address and data. When connecting an 8051/31 to an external memory, port 0 provides both address and data. The 8051 multiplexes address and data through port 0 to save pins. ALE indicates if P0 has address or data. When ALE = 0, it provides data D0-D7, but when ALE =1 it has address and data with the help of a 74LS373 latch.</p>
<p><strong>Port 1: </strong>Port 1 occupies a total of 8 pins (pins 1 through 8). It can be used as input or output. In contrast to port 0, this port does not need any pull-up resistors since it already has pull-up resistors internally. Upon reset, Port 1 is configured as an output port. For example, the following code will continuously send out to port1 the alternating values 55h  &amp; AAh</p>
<p>MOV A,#55H                    ; A = 55 hex<br />
BACK: MOV P1,A                        ;send it to Port 1<br />
ACALL DELAY                  ;call delay routine<br />
CPL A                               ;make A=0<br />
SJMP BACK</p>
<p><strong> Port 1 as input: </strong>To make port1 an input port, it must programmed as such by writing 1 to all its bits. In the following code port1 is configured first as an input port by writing 1’s to it, then data is received from the port and saved in R7 ,R6 &amp; R5.</p>
<p>MOV A,#0FFH   ;A=FF HEX<br />
MOV P1,A         ;make P1 an input port by writing all 1’s to it<br />
MOV A,P1         ;get data from P1<br />
MOV R7,A         ;save it in register R7<br />
ACALL DELAY   ;wait<br />
MOV  A,P1        ;get another data from P1<br />
MOV R6,A         ;save it in register R6<br />
ACALL DELAY   ;wait<br />
MOV  A,P1        ;get another data from P1<br />
MOV R5,A         ;save it in register R5</p>
<p><strong>Port 2 : </strong>Port 2 occupies a total of 8 pins (pins 21- 28). It can be used as input or output. Just like P1, P2 does not need any pull-up resistors since it already has pull-up resistors internally. Upon reset,Port 2 is configured as an output port. For example, the following code will send out continuously to port 2 the alternating values 55h and AAH. That is all the bits of port 2 toggle continuously.</p>
<p>MOV A,#55H                    ; A = 55 hex<br />
BACK:  MOV P2,A                        ;send it to Port 2<br />
ACALL DELAY                  ;call delay routine<br />
CPL A                               ;make A=0<br />
SJMP BACK</p>
<p><strong>Port 2 as input :</strong> To make port 2 an input, it must programmed as such by writing 1 to all its bits. In the following code, port 2 is configured first as an input port by writing 1’s to it. Then data is received from that port and is sent to P1 continuously.</p>
<p>MOV A,#0FFH         ;A=FF hex<br />
MOV P2,A                ;make P2 an input port by writing all 1’s to it<br />
BACK: MOV A,P2     ;get data from P2<br />
MOV P1,A                ;send it to Port1<br />
SJMP BACK             ;keep doing that</p>
<p><strong> Dual role of port 2 :</strong> In systems based on the 8751, 8951, and DS5000, P2 is used as simple I/O. However, in 8031-based systems, port 2 must be used along with P0 to provide the 16-bit address for the external memory. As shown in pin configuration 8051, port 2 is also designed as A8-A15, indicating the dual function. Since an 8031 is capable of accessing 64K bytes of external memory, it needs a path for the 16 bits of the address. While P0 provides the lower 8 bits via A0-A7, it is the job of P2 to provide bits A8-A15 of the address. In other words, when 8031 is connected to external memory, P2 is used for the upper 8 bits of the 16 bit address, and it cannot be used for I/O.</p>
<p><strong>Port 3 :</strong> Port 3 occupies a total of 8 pins, pins 10 through 17. It can be used as input or output. P3 does not need any pull-up resistors, the same as P1 and P2 did not. Although port 3 is configured as an output port upon reset. Port 3 has the additional function of providing some extremely important signals such as interrupts. This information applies both 8051 and 8031 chips.</p>
<p><figure id="attachment_163" aria-describedby="caption-attachment-163" style="width: 448px" class="wp-caption aligncenter"><img decoding="async" loading="lazy" class="size-full wp-image-163" title="Functions of port 3" src="https://studentprojects.in/wp-content/uploads/2008/11/table.gif" alt="Functions of port 3" width="448" height="299" /><figcaption id="caption-attachment-163" class="wp-caption-text">Functions of port 3</figcaption></figure></p>
<p>P3.0 and P3.1 are used for the RxD and TxD serial communications signals. Bits P3.2 and P3.3 are set aside for external interrupts. Bits P3.4 and P3.5 are used for timers 0 and 1. Finally P3.6 and P3.7 are used to provide the WR and RD signals of external memories connected in 8031 based systems.</p>
<p><strong> Read-modify-write feature :</strong> The ports in the 8051 can be accessed by the read-modify-write technique. This feature saves many lines of code by combining in a single instruction all three action of (1) reading the port, (2) modifying it, and (3) writing to the port. The following code first places 01010101 (binary) into port 1. Next, the instruction “XLR P1,#0FFH” performs an XOR logic operation on P1 with 1111 1111 (binary), and then writes the result back into P1.</p>
<p>MOV P1,#55H      ;P1=01010101<br />
AGAIN: XLR P1,#0FFH     ;EX-OR P1 with 1111 1111<br />
ACALL DELAY<br />
SJMP AGAIN</p>
<p>Notice that XOR of 55H and FFH gives AAH. Likewise, the XOR of AAH and FFH gives 55H.</p>
<p>Single bit  addressability of ports:  There are times that we need to access only 1 or 2 bits of the port instead of the entire 8 bits. A powerful feature of 8051 I/O ports is their capability to access individual bits of the port without altering the rest of the bits in that port.</p>
<p>For example, the following code toggles the bit p1.2 continuously.</p>
<p>BACK:  CPL P1.2                   ;complement p1.2 only<br />
ACALL DELAY<br />
SJMP BACK</p>
<p>Notice that P1.2 is the third bit of P1, since the first bit is P1.0, the second bit is P1.1, and so on. Notices in example of those unused portions of port1 are undisturbed. Table bellow shows the bits of 8051 I/O ports. This single bit addressability of I/O ports is one of the features of the 8051 microcontroller.</p>
<p><figure id="attachment_164" aria-describedby="caption-attachment-164" style="width: 500px" class="wp-caption aligncenter"><img decoding="async" loading="lazy" class="size-full wp-image-164" title="Addressing bits" src="https://studentprojects.in/wp-content/uploads/2008/11/address.gif" alt="Addressing bits" width="500" height="272" /><figcaption id="caption-attachment-164" class="wp-caption-text"> </figcaption></figure></p><p>The post <a href="https://studentprojects.in/electronics/microcontroller/8051-8951/8051-microcontroller-port-programming/">8051 Microcontroller port programming</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/electronics/microcontroller/8051-8951/8051-microcontroller-port-programming/feed/</wfw:commentRss>
			<slash:comments>54</slash:comments>
		
		
			</item>
		<item>
		<title>8051/8951 microcontroller Instruction Set</title>
		<link>https://studentprojects.in/electronics/microcontroller/8051-8951/80518951-microcontroller-instruction-set/</link>
					<comments>https://studentprojects.in/electronics/microcontroller/8051-8951/80518951-microcontroller-instruction-set/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Wed, 19 Nov 2008 08:52:02 +0000</pubDate>
				<category><![CDATA[8051/8951]]></category>
		<category><![CDATA[machine control instruction]]></category>
		<category><![CDATA[Microcontroller]]></category>
		<category><![CDATA[8051 insrtructions]]></category>
		<category><![CDATA[8951 instructions]]></category>
		<category><![CDATA[microcontroller Instruction Set]]></category>
		<category><![CDATA[Arithmetic instructions]]></category>
		<category><![CDATA[Logic instructions.]]></category>
		<category><![CDATA[Data transfer instructions.]]></category>
		<category><![CDATA[Boolean variable manipulation instruction.]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=157</guid>

					<description><![CDATA[<p>The instruction set is divided in to 5 categories. They are as follows: Arithmetic instructions Logic instructions. Data transfer instructions. Boolean variable manipulation instruction. Program and machine control instruction. We have listed all the instructions of  microcontroller with description, Bytes, Cycle. Each instructions are explained in the next pages one by one. All instructions are</p>
<p>The post <a href="https://studentprojects.in/electronics/microcontroller/8051-8951/80518951-microcontroller-instruction-set/">8051/8951 microcontroller Instruction Set</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>The instruction set is divided in to 5 categories. They are as follows:</p>
<ol>
<li>Arithmetic instructions</li>
<li>Logic instructions.</li>
<li>Data transfer instructions.</li>
<li>Boolean variable manipulation instruction.</li>
<li>Program and machine control instruction.</li>
</ol>
<p>We have listed all the instructions of  microcontroller with description, Bytes, Cycle. Each instructions are explained in the next pages one by one.</p>
<p><figure id="attachment_1098" aria-describedby="caption-attachment-1098" style="width: 606px" class="wp-caption aligncenter"><img decoding="async" loading="lazy" class="size-full wp-image-1098" title="8051 Microcontroller Arithmetic instructions" src="https://studentprojects.in/wp-content/uploads/2008/11/8051_Arithmetic_Instructions.gif" alt="8051 Microcontroller Arithmetic instructions" width="606" height="685" /><figcaption id="caption-attachment-1098" class="wp-caption-text">8051 Microcontroller Arithmetic instructions</figcaption></figure></p>
<p><figure id="attachment_1101" aria-describedby="caption-attachment-1101" style="width: 606px" class="wp-caption aligncenter"><img decoding="async" loading="lazy" class="size-full wp-image-1101" title="8051 Microcontroller logic operation instructions" src="https://studentprojects.in/wp-content/uploads/2008/11/8051_logic_operations.gif" alt="8051 Microcontroller logic operation instructions" width="606" height="629" /><figcaption id="caption-attachment-1101" class="wp-caption-text">8051 Microcontroller logic operation instructions</figcaption></figure></p>
<p><figure id="attachment_1100" aria-describedby="caption-attachment-1100" style="width: 606px" class="wp-caption aligncenter"><img decoding="async" loading="lazy" class="size-full wp-image-1100" title="8051 Microcontroller data transfer instructions" src="https://studentprojects.in/wp-content/uploads/2008/11/8051_data_transfer_instructions.gif" alt="8051 Microcontroller data transfer instructions" width="606" height="702" /><figcaption id="caption-attachment-1100" class="wp-caption-text">8051 Microcontroller data transfer instructions</figcaption></figure></p>
<p><figure id="attachment_1099" aria-describedby="caption-attachment-1099" style="width: 606px" class="wp-caption aligncenter"><img decoding="async" loading="lazy" class="size-full wp-image-1099" title="8051 Microcontroller Boolean variable manipulation instructions" src="https://studentprojects.in/wp-content/uploads/2008/11/8051_boolean_variable_manipulation_instructions.gif" alt="8051 Microcontroller Boolean variable manipulation instructions" width="606" height="753" /><figcaption id="caption-attachment-1099" class="wp-caption-text">8051 Microcontroller Boolean variable manipulation instructions</figcaption></figure></p>
<p><figure id="attachment_1102" aria-describedby="caption-attachment-1102" style="width: 606px" class="wp-caption aligncenter"><img decoding="async" loading="lazy" class="size-full wp-image-1102" title="8051 microcontroller program and machine control instructions" src="https://studentprojects.in/wp-content/uploads/2008/11/8051_program_and_machine_control_instructions.gif" alt="8051 microcontroller program and machine control instructions" width="606" height="175" /><figcaption id="caption-attachment-1102" class="wp-caption-text">8051 microcontroller program and machine control instructions</figcaption></figure></p>
<p>All instructions are explained in the next pages.</p><p>The post <a href="https://studentprojects.in/electronics/microcontroller/8051-8951/80518951-microcontroller-instruction-set/">8051/8951 microcontroller Instruction Set</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/electronics/microcontroller/8051-8951/80518951-microcontroller-instruction-set/feed/</wfw:commentRss>
			<slash:comments>21</slash:comments>
		
		
			</item>
		<item>
		<title>Interfacing an LCD to the 8951 Microcontroller</title>
		<link>https://studentprojects.in/electronics/microcontroller/8051-8951/interfacing-an-lcd-to-the-8951-microcontroller/</link>
					<comments>https://studentprojects.in/electronics/microcontroller/8051-8951/interfacing-an-lcd-to-the-8951-microcontroller/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Wed, 19 Nov 2008 08:21:36 +0000</pubDate>
				<category><![CDATA[8051/8951]]></category>
		<category><![CDATA[Interfacing LCD]]></category>
		<category><![CDATA[8951 Microcontroller]]></category>
		<category><![CDATA[source code]]></category>
		<category><![CDATA[LCD commands]]></category>
		<category><![CDATA[LCD pin configuration]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=151</guid>

					<description><![CDATA[<p>LCD pin descriptions: The LCD discussed in this section has 14 pins. The function of each pin is given in table. Vcc, Vss, and VEE: While Vcc and Vss  provide  +5V and ground, respectively, VEE  is used for controlling LCD contrast. RS &#8211; register select: There are two very important registers inside the LCD. The</p>
<p>The post <a href="https://studentprojects.in/electronics/microcontroller/8051-8951/interfacing-an-lcd-to-the-8951-microcontroller/">Interfacing an LCD to the 8951 Microcontroller</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p><strong>LCD pin descriptions:</strong><br />
The LCD discussed in this section has 14 pins. The function of each pin is given in table.</p>
<p><figure id="attachment_152" aria-describedby="caption-attachment-152" style="width: 355px" class="wp-caption aligncenter"><img decoding="async" loading="lazy" class="size-full wp-image-152" title="LCD pin desciptions" src="https://studentprojects.in/wp-content/uploads/2008/11/lcd_pin.jpg" alt="LCD pin desciptions" width="355" height="225" /><figcaption id="caption-attachment-152" class="wp-caption-text">LCD pin descriptions</figcaption></figure></p>
<p><figure id="attachment_153" aria-describedby="caption-attachment-153" style="width: 500px" class="wp-caption aligncenter"><img decoding="async" loading="lazy" class="size-full wp-image-153" title="LCD pin desciptions" src="https://studentprojects.in/wp-content/uploads/2008/11/licdpinconf.jpg" alt="LCD pin desciptions" width="500" height="317" /><figcaption id="caption-attachment-153" class="wp-caption-text">LCD pin desciptions</figcaption></figure></p>
<p><strong> Vcc, Vss, and VEE</strong>:</p>
<p>While Vcc and Vss  provide  +5V and ground, respectively, VEE  is used for controlling LCD contrast.</p>
<p><strong>RS &#8211; register select:</strong></p>
<p>There are two very important registers inside the LCD. The RS pin is used for their selection as follows. If RS = 0, the instruction command code register is selected, allowing the user to send a command such as clear display, cursor at home, etc. If  RS = 1 the data register is selected, allowing the user to send data to be displayed on the LCD.</p>
<p><strong>R/W &#8211; read/write:</strong></p>
<p>R/W input allows the user to write information to the LCD or read information from it. R/W = 1 when reading; R/W =0 when writing.</p>
<p><strong>E &#8211; enable:</strong></p>
<p>The enable pin is used by the LCD to latch information presented to its data pins. When data is supplied to data pins, a high to low pulse must be applied to this pin in order for the LCD to latch in the data present at the data pins. This pulse must be a minimum of 450 ns wide.</p>
<p><strong>D0 – D7:</strong></p>
<p>The 8 bit data pins, D0 – D7, are used to send information to the LCD or read the contents of the LCD’s internal registers.</p>
<p>To display letters and numbers, we send ASCII codes for the letters A – Z, a – z, and numbers 0 – 9 to these pins while making RS = 1.</p>
<p>There are also instructions command codes that can be sent to the LCD to clear the display or force the cursor to the home position or blink the cursor. Table below lists the instruction command codes.</p>
<p><figure id="attachment_154" aria-describedby="caption-attachment-154" style="width: 447px" class="wp-caption aligncenter"><img decoding="async" loading="lazy" class="size-full wp-image-154" title="LCD Commands table" src="https://studentprojects.in/wp-content/uploads/2008/11/lcdcommands.jpg" alt="LCD Commands table" width="447" height="443" /><figcaption id="caption-attachment-154" class="wp-caption-text">LCD Commands table</figcaption></figure></p>
<p>We also use RS = 0 to check the busy flag bit to see if the LCD is ready to receive information. The busy flag is D7 and can be read when R/W =1 and RS = 0, as follows: if R/W =1, RS =0. When D7 = 1(busy flag = 1), the LCD busy taking care of  internal operations and will not accept any new information. When D7 = 0, the LCD is ready to receive new information. Note: It is recommended to check the busy flag before writing any data to the LCD.</p>
<p>Example programs are given in the next page.</p><p>The post <a href="https://studentprojects.in/electronics/microcontroller/8051-8951/interfacing-an-lcd-to-the-8951-microcontroller/">Interfacing an LCD to the 8951 Microcontroller</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/electronics/microcontroller/8051-8951/interfacing-an-lcd-to-the-8951-microcontroller/feed/</wfw:commentRss>
			<slash:comments>18</slash:comments>
		
		
			</item>
		<item>
		<title>Stepper motor control board</title>
		<link>https://studentprojects.in/electronics/microcontroller/8051-8951/stepper-motor-control-board/</link>
					<comments>https://studentprojects.in/electronics/microcontroller/8051-8951/stepper-motor-control-board/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Mon, 17 Nov 2008 12:57:54 +0000</pubDate>
				<category><![CDATA[8051/8951]]></category>
		<category><![CDATA[8951]]></category>
		<category><![CDATA[Stepper motor]]></category>
		<category><![CDATA[microcontroller programming]]></category>
		<category><![CDATA[Unipolar stepper motor]]></category>
		<category><![CDATA[RPM calculation]]></category>
		<category><![CDATA[control board circuit]]></category>
		<category><![CDATA[8951 programs]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=127</guid>

					<description><![CDATA[<p>This project is actually an educational kit. One can study the full operation of unipolar type stepper motor using this board. As it is micro controller based it can be programmable also and one can learn micro controller interfacing with LEDs, key board and stepper motor. Thus single board serves the purpose of learning stepper</p>
<p>The post <a href="https://studentprojects.in/electronics/microcontroller/8051-8951/stepper-motor-control-board/">Stepper motor control board</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>This project is actually an educational kit. One can study the full operation of unipolar type stepper motor using this board. As it is micro controller based it can be programmable also and one can learn micro controller interfacing with LEDs, key board and stepper motor. Thus single board serves the purpose of learning stepper motor control as well as learning micro controller programming.</p>
<p><strong>General description and system block diagram:-</strong></p>
<p>The complete board consists of transformer, control circuit, keypad and stepper motor as shown in snap. The given figure shows the block diagram of project.</p>
<p><figure id="attachment_128" aria-describedby="caption-attachment-128" style="width: 368px" class="wp-caption aligncenter"><img decoding="async" loading="lazy" class="size-full wp-image-128" title="System block diagram" src="https://studentprojects.in/wp-content/uploads/2008/11/block3.gif" alt="System block diagram" width="368" height="180" /><figcaption id="caption-attachment-128" class="wp-caption-text">System block diagram</figcaption></figure></p>
<p>The circuit has inbuilt 5 V power supply so when it is connected with transformer it will give the supply to circuit and motor both. The 8 Key keypad is connected with circuit through which user can give the command to control stepper motor. The control circuit includes micro controller 89C51, indicating LEDs, and current driver chip ULN2003A. One can program the controller to control the operation of stepper motor. He can give different commands through keypad like, run clockwise, run anticlockwise, increase/decrease RPM, increase/decrease revolutions, stop motor, change the mode, etc. before we start with project it is must that we first understood the operation of unipolar stepper motor.</p>
<p><strong>Unipolar stepper motor:-</strong></p>
<p>In the construction of unipolar stepper motor there are four coils. One end of each coil is tide together and it gives common terminal which is always connected with positive terminal of supply. The other ends of each coil are given for interface.  Specific color code may also be given. Like in my motor orange is first coil (L1), brown is second (L2), yellow is third (L3), black is fourth (L4) and red for common terminal.</p>
<p>By means of controlling a stepper motor operation we can</p>
<ol>
<li>Increase or decrease the RPM (speed) of it</li>
<li>Increase or decrease number of revolutions of it</li>
<li>Change its direction means rotate it clockwise or anticlockwise</li>
</ol>
<p>To vary the RPM of motor we have to vary the PRF (Pulse Repetition Frequency). Number of applied pulses will vary number of rotations and last to change direction we have to change pulse sequence.</p>
<p>So all these three things just depends on applied pulses. Now there are three different modes to rotate this motor</p>
<ol>
<li>Single coil excitation</li>
<li>Double coil excitation</li>
<li>Half step excitation</li>
</ol>
<p>The table given below will give you the complete idea that how to give pulses in each mode</p>
<p><figure id="attachment_129" aria-describedby="caption-attachment-129" style="width: 600px" class="wp-caption aligncenter"><img decoding="async" loading="lazy" class="size-full wp-image-129" title="Pulses for stepper motor module" src="https://studentprojects.in/wp-content/uploads/2008/11/steppertable.jpg" alt="Pulses for stepper motor module" width="600" height="256" /><figcaption id="caption-attachment-129" class="wp-caption-text">Pulses for stepper motor module</figcaption></figure></p>
<p>Note:- In half step excitation mode motor will rotate at half the specified given step resolution. Means if step resolution is 1.8 degree then in this mode it will be 0.9 degree. Step resolution means on receiving on 1 pulse motor will rotate that much degree. If step resolution is 1.8 degree then it will take 200 pulses for motor to compete 1 revolution (360 degree).</p>
<p>Now let me give you the specification of the stepper motor that I have used.</p>
<p>Max rated voltage: &#8211;    5 V<br />
Max rated current per coil: &#8211; 0.5 Amp<br />
Step resolution: &#8211;    1.8 degree / pulse<br />
Max RPM: &#8211;    20 in single/double coil excitation mode and 60 in half step mode<br />
Torque: &#8211; 1.5 Kg/cm2</p>
<p><strong>RPM calculation:-</strong></p>
<p>One can calculate the exact RPM at which motor will run. We know that motor needs 200 pulses to complete 1 revolution. Means if 200 pulses applied in 1 second motor will complete 1 revolution in 1 second. Now 1 rev. in 1 sec means 60 rev. in 1 minute. That will give us 60 RPM. Now 200 pulses in 1 sec means the PRF is 200 Hz. And delay will be 5 millisecond (ms). Now lets see it reverse.</p>
<p>*  If delay is 10 ms then PRF will be 100 Hz.<br />
*  So 100 pulses will be given in 1 sec<br />
*  Motor will complete 1 revolution in 2 second<br />
*  So the RPM will be 30.</p>
<p>In same manner as you change delay the PRF will be changed and it will change RPM</p>
<p><strong>Stepper motor control board circuit:-</strong></p>
<p><figure id="attachment_130" aria-describedby="caption-attachment-130" style="width: 591px" class="wp-caption aligncenter"><img decoding="async" loading="lazy" class="size-full wp-image-130" title="Stepper motor control board circuit" src="https://studentprojects.in/wp-content/uploads/2008/11/circuit.gif" alt="Stepper motor control board circuit" width="591" height="555" /><figcaption id="caption-attachment-130" class="wp-caption-text">Stepper motor control board circuit</figcaption></figure></p>
<p>The circuit consists of very few components. The major components are 7805, 89C51 and ULN2003A.</p>
<p><strong>Connections:-</strong></p>
<ol>
<li>The transformer terminals are given to bridge rectifier to generate rectified DC.</li>
<li>It is filtered and given to regulator IC 7805 to generate 5 V pure DC. LED indicates supply is ON.</li>
<li>All the push button micro switches J1 to J8 are connected with port P1 as shown to form serial keyboard.</li>
<li>12 MHz crystal is connected to oscillator terminals of 89C51 with two biasing capacitors.</li>
<li>All the LEDs are connected to port P0 as shown</li>
<li>Port P2 drives stepper motor through current driver chip ULN2003A.</li>
<li>The common terminal of motor is connected to Vcc and rest all four terminals are connected to port P2 pins in sequence through ULN chip.</li>
</ol>
<p>Now by downloading different programs in to 89C51 we can control the operation of stepper motor. Let us see all different kind of program.</p><p>The post <a href="https://studentprojects.in/electronics/microcontroller/8051-8951/stepper-motor-control-board/">Stepper motor control board</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/electronics/microcontroller/8051-8951/stepper-motor-control-board/feed/</wfw:commentRss>
			<slash:comments>34</slash:comments>
		
		
			</item>
	</channel>
</rss>
