<?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>electrofriends.com &#187; Electronics</title>
	<atom:link href="http://electrofriends.com/category/articles/electronics/feed/" rel="self" type="application/rss+xml" />
	<link>http://electrofriends.com</link>
	<description>...bringing innovative minds together</description>
	<lastBuildDate>Fri, 11 May 2012 08:44:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>What is EMBEDDED SYSTEMS</title>
		<link>http://electrofriends.com/articles/electronics/microcontroller-electronics-articles/what-is-embedded-systems/</link>
		<comments>http://electrofriends.com/articles/electronics/microcontroller-electronics-articles/what-is-embedded-systems/#comments</comments>
		<pubDate>Thu, 17 Feb 2011 04:06:41 +0000</pubDate>
		<dc:creator>naveen</dc:creator>
				<category><![CDATA[Microcontroller]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[embedded]]></category>

		<guid isPermaLink="false">http://electrofriends.com/?p=1399</guid>
		<description><![CDATA[Embed means hidden , Similar word :Small Glass planes are embeded over the compound walls. But coming to electronics, this is a electronic system which is hidden inside a device ,whose identity is not shown to the outside world,and involve in a perticular single application. May be from remote controller to spaceship. Everywhere we see [...]]]></description>
			<content:encoded><![CDATA[<p>Embed means hidden , Similar word :Small Glass planes  are embeded over the compound walls.<br />
But coming to electronics, this is a electronic system which is hidden inside a device ,whose identity is not shown to the outside world,and involve in a perticular single application. May be from remote controller to spaceship.</p>
<p>Everywhere we see embedded, your scroll mouse is a embedded device.<br />
Very good example of embedded system is our own body organs,Heart is a emmbedded system.Kidney is one more. Which al has an hardware as muscles and sotware to do the job intelligently. Lungs. etc involved in a particular job.Which has both software and hardware(muscles),built by God.</p>
<p>Both electronics and software &#8212;&#8211;builds embeded system,say microcontroller and  embedded C .</p>
<p>Know more, next week..</p>
]]></content:encoded>
			<wfw:commentRss>http://electrofriends.com/articles/electronics/microcontroller-electronics-articles/what-is-embedded-systems/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Stepper Motor Chopping Driver</title>
		<link>http://electrofriends.com/articles/electronics/microcontroller-electronics-articles/8051-8951/stepper-motor-chopping-driver/</link>
		<comments>http://electrofriends.com/articles/electronics/microcontroller-electronics-articles/8051-8951/stepper-motor-chopping-driver/#comments</comments>
		<pubDate>Thu, 01 Oct 2009 16:33:35 +0000</pubDate>
		<dc:creator>Ranjith</dc:creator>
				<category><![CDATA[8051/8951]]></category>
		<category><![CDATA[chopping driver]]></category>
		<category><![CDATA[circuits]]></category>
		<category><![CDATA[Stepper motor]]></category>

		<guid isPermaLink="false">http://electrofriends.com/?p=799</guid>
		<description><![CDATA[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 [...]]]></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 class="size-full wp-image-800" title="Stepper Motor Chopping Driver" src="http://electrofriends.com/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 class="aligncenter size-full wp-image-801" title="Step response equation" src="http://electrofriends.com/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>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">#include &amp;lt;16f628.h&amp;gt;</span>
<span style="color: #339933;">#use delay ( clock=4M )</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// GLOBAL VARIABLES /////////////</span>
<span style="color: #993333;">int</span> steps<span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><span style="color: #0000dd;">1</span><span style="color: #339933;">,</span><span style="color: #0000dd;">2</span><span style="color: #339933;">,</span><span style="color: #0000dd;">4</span><span style="color: #339933;">,</span><span style="color: #0000dd;">8</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// motor steps</span>
<span style="color: #993333;">int</span> step_ptr <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
<span style="color: #993333;">int</span> step <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
<span style="color: #993333;">int</span> desiredt <span style="color: #339933;">=</span> <span style="color: #0000dd;">500</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// desired time to reach max current at start of every step 0.5 msec</span>
<span style="color: #993333;">int</span> choppingt <span style="color: #339933;">=</span> <span style="color: #0000dd;">50</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// chopping time = 0.1 desired time = 50 usec</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// FUNCTIONS ////////////////////</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// INTERRUPTS ///////////////////</span>
&nbsp;
<span style="color: #339933;">#INT_TIMER0</span>
<span style="color: #993333;">void</span> change_step <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">++</span>step_ptr<span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000dd;">3</span><span style="color: #009900;">&#41;</span>  step_ptr<span style="color: #339933;">=</span><span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
step <span style="color: #339933;">=</span> steps<span style="color: #009900;">&#91;</span>step_ptr<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
output_b<span style="color: #009900;">&#40;</span>step<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
delay_us<span style="color: #009900;">&#40;</span>desiredt<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
output_b<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
delay_us<span style="color: #009900;">&#40;</span>choppingt<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// MAIN /////////////////////////</span>
<span style="color: #993333;">void</span> main<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #666666; font-style: italic;">// Motor terminals are connected to Port B (Unipolar Stepper Motor)</span>
<span style="color: #666666; font-style: italic;">// setup interrupt timer0 to desired stepping speed let motor change step every 2msec</span>
<span style="color: #666666; font-style: italic;">// if step angle = 1.8 degree, steps per revolution = 360/1.8 = 200 steps</span>
<span style="color: #666666; font-style: italic;">// time per revolution = 200 * 2 msec = 0.4 sec</span>
<span style="color: #666666; font-style: italic;">// rpm = 60/0.4 = 150 rpm</span>
&nbsp;
setup_timer_0<span style="color: #009900;">&#40;</span>RTCC_INTERNAL <span style="color: #339933;">|</span> RTCC_DIV_16<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// put first step//</span>
step <span style="color: #339933;">=</span> steps<span style="color: #009900;">&#91;</span>step_ptr<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
output_b<span style="color: #009900;">&#40;</span>step<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
delay_us<span style="color: #009900;">&#40;</span>desiredt<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
output_b<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
delay_us<span style="color: #009900;">&#40;</span>choppingt<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// enable interrupt/////</span>
enable_interrupts<span style="color: #009900;">&#40;</span>GLOBAL<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
enable_interrupts<span style="color: #009900;">&#40;</span>INT_TIMER0<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// chopping loop//</span>
&nbsp;
<span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #666666; font-style: italic;">// put step (apply voltage) //</span>
output_b<span style="color: #009900;">&#40;</span>step<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// wait chopping time //</span>
delay_us<span style="color: #009900;">&#40;</span>choppingt<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// clear step ////</span>
output_b<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// wait chopping time//</span>
delay_us<span style="color: #009900;">&#40;</span>choppingt<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>References:</p>
<p>-    Wikipedia.org<br />
-    Microchip Co. application notes.</p>
<p>Article by &#8211; Amr Ayoub</p>
]]></content:encoded>
			<wfw:commentRss>http://electrofriends.com/articles/electronics/microcontroller-electronics-articles/8051-8951/stepper-motor-chopping-driver/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Circuit Troubleshooting</title>
		<link>http://electrofriends.com/articles/electronics/circuit-troubleshooting/</link>
		<comments>http://electrofriends.com/articles/electronics/circuit-troubleshooting/#comments</comments>
		<pubDate>Mon, 24 Aug 2009 03:12:50 +0000</pubDate>
		<dc:creator>Amr Ayoub</dc:creator>
				<category><![CDATA[Analog]]></category>
		<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Circuit testing]]></category>
		<category><![CDATA[Circuit Troubleshooting]]></category>
		<category><![CDATA[componente testing]]></category>

		<guid isPermaLink="false">http://electrofriends.com/?p=713</guid>
		<description><![CDATA[Short notes about Circuit troubleshooting. - Check the circuit for mechanical failures, like disconnected wire, broken vias on the board, and connections between two adjacent vias which are not to be connected. - You should compare values of components and their connections with values and connections between components on the schematic. - Measuring DC voltages [...]]]></description>
			<content:encoded><![CDATA[<p>Short notes about Circuit troubleshooting.</p>
<p>- Check the circuit for mechanical failures, like disconnected wire, broken vias on the board, and connections between two adjacent vias which are not to be connected.</p>
<p>- You should compare values of components and their connections with values and connections between components on the schematic.</p>
<p>- Measuring DC voltages at certain points of the board, and comparing these values to the ones on the schematic. So, by knowing the operation of the circuit you start the process of elimination to find the “suspect” component.</p>
<p>- If there are several “suspects”, and this is not a rare occurrence in complex devices, the testing is divided into groups of components, you start checking in reverse soldering order, this means that you start with components last soldered, because those are the most sensitive components on the circuit like integrated circuits, transistors, diodes, etc.</p>
<p>- Check electrolytic capacitors, since they have a somewhat limited lifespan and leave resistors and block capacitors as last in line since they are sturdy little thingies and can take a lot of beating.</p>
<p>- Grid transformers are tested by measuring the resistance of the copper wire on the primary and secondary coil. Since the primary coil has more curls than the secondary one, and is wound using a thinner wire, it&#8217;s resistance is higher, and it&#8217;s value lays in range between several tens of ohms (in high power transformers) to several hundreds of ohms, even to kilo ohms (in low power transformers). Coils can be tested in the same way as transformers – through their resistance. Infinite resistance still means disconnected coil.</p>
<p>- DC capacitors should produce an infinite value on the instrument. Exceptions are electrolytic and very high value block capacitors. When the positive end of an electrolytic capacitor is connected to a positive probe of an analog instrument, and a negative end to a negative probe, needle jumps to the lowest value and then gradually comes back towards infinity. This is a proof that the capacitor is ok, and the needle&#8217;s movement is the charge stored in the component being discharged. (Even small capacitance components get charged while testing, but their discharge time is very short, so the needle doesn&#8217;t have the time to move.)</p>
<p>amr.a.ayoub@gmail.com</p>
<p>Reference:-<br />
M i k r o E l e k t r o n i k a.</p>
]]></content:encoded>
			<wfw:commentRss>http://electrofriends.com/articles/electronics/circuit-troubleshooting/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Interfacing 7-segment display using 7447 decoder</title>
		<link>http://electrofriends.com/articles/electronics/microcontroller-electronics-articles/8051-8951/interfacing-7-segment-display-using-7447-decoder/</link>
		<comments>http://electrofriends.com/articles/electronics/microcontroller-electronics-articles/8051-8951/interfacing-7-segment-display-using-7447-decoder/#comments</comments>
		<pubDate>Mon, 17 Aug 2009 13:32:44 +0000</pubDate>
		<dc:creator>Ranjith</dc:creator>
				<category><![CDATA[8051/8951]]></category>
		<category><![CDATA[7-segment]]></category>
		<category><![CDATA[7447 decoder]]></category>
		<category><![CDATA[8951 Microcontroller]]></category>
		<category><![CDATA[Interfacing using microcontroller]]></category>
		<category><![CDATA[lookup table]]></category>
		<category><![CDATA[pin configuration]]></category>
		<category><![CDATA[program to interface]]></category>
		<category><![CDATA[Seven Segment]]></category>

		<guid isPermaLink="false">http://electrofriends.com/?p=673</guid>
		<description><![CDATA[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 [...]]]></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 class="size-medium wp-image-475 aligncenter" title="7 segment pin configuration" src="http://electrofriends.com/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="http://electrofriends.com/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>
<div id="attachment_674" class="wp-caption aligncenter" style="width: 517px"><img class="size-full wp-image-674" title="Circuit diagram for interfacing Common Anode 7-Segment Display " src="http://electrofriends.com/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" /><p class="wp-caption-text">Circuit diagram for interfacing Common Anode 7-Segment Display</p></div>
<div id="attachment_675" class="wp-caption aligncenter" style="width: 517px"><img class="size-full wp-image-675" title="Circuit diagram for Common Cathode 7-Segment Display" src="http://electrofriends.com/wp-content/uploads/2009/08/7_seg_circuit_cc_7447.gif" alt="Circuit diagram for Common Cathode 7-Segment Display" width="507" height="326" /><p class="wp-caption-text">Circuit diagram for Common Cathode 7-Segment Display</p></div>
<p><strong>Program:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="asm" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">This</span> program displays characters <span style="color: #0000ff;">0</span> through <span style="color: #0000ff;">9</span> on seven<span style="color: #339933;">-</span><span style="color: #000000; font-weight: bold;">segment</span> display 
using IC <span style="color: #0000ff;">7447</span> as the middle wear<span style="color: #339933;">.</span>
&nbsp;
  again<span style="color: #339933;">:</span> <span style="color: #00007f; font-weight: bold;">mov</span> a<span style="color: #339933;">,</span>#<span style="color: #0000ff;">00h</span>                  <span style="color: #666666; font-style: italic;">; Start form zero</span>
     up<span style="color: #339933;">:</span>  <span style="color: #00007f; font-weight: bold;">mov</span> p2<span style="color: #339933;">,</span> a                  <span style="color: #666666; font-style: italic;">; Move to Port 2</span>
          <span style="color: #00007f; font-weight: bold;">mov</span> r3<span style="color: #339933;">,</span>#<span style="color: #0000ff;">255</span>                <span style="color: #666666; font-style: italic;">; Delay</span>
     D1<span style="color: #339933;">:</span>  <span style="color: #00007f; font-weight: bold;">mov</span> r1<span style="color: #339933;">,</span>#<span style="color: #0000ff;">255</span>
      D<span style="color: #339933;">:</span>  djnz r1<span style="color: #339933;">,</span>D
          djnz r3<span style="color: #339933;">,</span>D1
          <span style="color: #00007f; font-weight: bold;">inc</span> a
          cjne a<span style="color: #339933;">,</span>#<span style="color: #0000ff;">0ah</span><span style="color: #339933;">,</span>up
          sjmp again</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://electrofriends.com/articles/electronics/microcontroller-electronics-articles/8051-8951/interfacing-7-segment-display-using-7447-decoder/feed/</wfw:commentRss>
		<slash:comments>38</slash:comments>
		</item>
		<item>
		<title>Heavy electrical device protector</title>
		<link>http://electrofriends.com/articles/electronics/microcontroller-electronics-articles/8051-8951/heavy-electrical-device-protector/</link>
		<comments>http://electrofriends.com/articles/electronics/microcontroller-electronics-articles/8051-8951/heavy-electrical-device-protector/#comments</comments>
		<pubDate>Sun, 16 Aug 2009 15:41:26 +0000</pubDate>
		<dc:creator>Ranjith</dc:creator>
				<category><![CDATA[8051/8951]]></category>
		<category><![CDATA[ADC]]></category>
		<category><![CDATA[Device protector]]></category>
		<category><![CDATA[Electronic project]]></category>
		<category><![CDATA[Microcontroller]]></category>

		<guid isPermaLink="false">http://electrofriends.com/?p=658</guid>
		<description><![CDATA[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 [...]]]></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>
<div id="attachment_660" class="wp-caption alignleft" style="width: 274px"><img class="size-full wp-image-660" title="Block Diagram" src="http://electrofriends.com/wp-content/uploads/2009/08/block_Diagram.jpg" alt="Block Diagram" width="264" height="492" /><p class="wp-caption-text">Block Diagram</p></div>
<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>
]]></content:encoded>
			<wfw:commentRss>http://electrofriends.com/articles/electronics/microcontroller-electronics-articles/8051-8951/heavy-electrical-device-protector/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>System for Mobile communications (GSM)</title>
		<link>http://electrofriends.com/articles/electronics/analog/system-for-mobile-communications-gsm/</link>
		<comments>http://electrofriends.com/articles/electronics/analog/system-for-mobile-communications-gsm/#comments</comments>
		<pubDate>Sat, 06 Jun 2009 17:23:41 +0000</pubDate>
		<dc:creator>Ranjith</dc:creator>
				<category><![CDATA[Analog]]></category>

		<guid isPermaLink="false">http://electrofriends.com/?p=592</guid>
		<description><![CDATA[GSM – AN OVERVIEW GSM, Global System for Mobile communications, is today the most successful digital mobile telecommunication system. This second-generation (2G) system provides voice and limited data services and uses digital modulation with improved audio quality. The different versions of GSM are: GSM 900 band (850-915MHz up-link frequency and 935-960MHz downlink frequency) GSM 1800 [...]]]></description>
			<content:encoded><![CDATA[<p><strong>GSM – AN OVERVIEW</strong></p>
<p>GSM, Global System for Mobile communications, is today the most successful digital mobile telecommunication system. This second-generation (2G) system provides voice and limited data services and uses digital modulation with improved audio quality.</p>
<p>The different versions of GSM are:</p>
<ol>
<li>GSM 900 band (850-915MHz up-link frequency and 935-960MHz downlink frequency)</li>
<li>GSM 1800 band or digital cellular system (DCS) 1800 band (1710-1785MHz up-link frequency and 1805-1880MHz downlink frequency)</li>
<li>Personal Communication service (PCS) 1900 band (1850-1910MHz up-link frequency and 1930-1990MHz downlink frequency)</li>
</ol>
<p>GSM Mobile communication system can be intelligently used by electronic devices that can collect some data and send it to the central place using SMS or GSM data call. It’s required In-Vehicle Tracking Systems because GPS (Global Positioning System) can normally only receive location information from the satellites but cannot communicate back with them. Hence we need some other communication system like GSM to send this location information to the central control room. Other technologies can also be used but they are more costly.</p>
<p><strong>GSM Network Architecture</strong></p>
<p>GSM Network consists of three main parts:</p>
<ul>
<li>Mobile Station (MS) carried by the subscriber</li>
<li>Base Station Subsystem (BSS) controls radio link with mobile station</li>
<li>Network &amp; Switching Subsystem (NSS) mobility management and switching of calls between mobile users, and between mobile and fixed network users.</li>
</ul>
<p>Mobile Station consists of:</p>
<ul>
<li>Mobile Equipment (ME) such as hand portable and vehicle mounted unit</li>
<li>Subscriber Identity Module (SIM), which contains the entire customer related information (identification, secret key for authentication, etc).</li>
</ul>
<p>Base Station Subsystem consists of:</p>
<ul>
<li>Base Transceiver Station (BTS) defines a cell and is responsible for radio link protocols with the Mobile Station</li>
<li>Base Station Controller (BSC) controls multiple BTSs and manages radio channel setup, and handovers. The BSC is the connection between the Mobile Station and Mobile Switching Center.</li>
</ul>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-593" title="GSM Network" src="http://electrofriends.com/wp-content/uploads/2009/06/gsm_network.jpg" alt="GSM Network" width="521" height="450" /><br />
Figure 1. Layout of generic GSM network</p>
<p><strong>Network and Switching Subsystems consists of: </strong></p>
<ul>
<li>Mobile Switching Center (MSC) is the central component of the NSS. Operates all switching functions for the mobiles within its  jurisdiction. Interface between mobile and other (including fixed) network. Its functions:</li>
<li>Manages the location of mobiles</li>
<li>Switches calls</li>
<li>Manages Security features</li>
<li>Controls handover between BSCs</li>
<li>Resource management</li>
<li>Interworks with and manages network databases</li>
<li>Collects call billing data and sends to billing system</li>
<li>Collects traffic statistics for performance monitoring</li>
</ul>
<p>Network Databases – Home Location Register and Visitor Location Register together with MSC provides the call routing and roaming capabilities of GSM.</p>
<ul>
<li>Home Location Register (HLR) contains all the subscriber information for the purposes of call control, and location determination. There is logically one HLR per GSM network, although it may be implemented as a distributed database.</li>
<li>Visitors Location Register (VLR) is only a temporary storage while the particular subscriber is located in the geographical area controlled by the MSC/VLR. Contains only the necessary information provision of subscribed services.</li>
<li>Authentication Center (AuC) is a protected database that stores the security information for each subscriber (a copy of the secret key stored in each SIM).</li>
<li>Equipment Identity Register (EIR) is a list of all valid mobile equipment on the network.</li>
</ul>
<p>SMS is one of the unique features of GSM compared to older analog systems. For point-to-point SMS, a message can be sent to another subscriber to the service, and an acknowledgment of receipt is sent to the sender. SMS also can be used in Cell Broadcast mode to send messages such as traffic or news updates. Messages can be stored on the SIM card for later retrieval. SMS is effective because it can transmit short messages within 3 to 5 s via the GSM network and doesn’t occupy a telephony channel. Moreover, the cost savings makes it a worthwhile choice. With SMS transmitting, gathering position data is easy and convenient.</p>
<p><strong>THE GSM UNIT:</strong></p>
<p>The GSM unit contains a GSM module along with a GSM transmitter antenna. The module functions according to its built and the antenna transmits the information to the Base Station wherein this is exposed to further processing. GPS is not a two-way system. It can either receive or transmit but not both. Due to its inability in doing so, GSM systems are used.</p>
<p><img class="alignright size-full wp-image-596" title="GSM Module" src="http://electrofriends.com/wp-content/uploads/2009/06/gsm_module.jpg" alt="GSM Module" width="133" height="95" />The GSM module that we are using in this unit is the SIMCOM SIM300 module. Designed for global market, SIM300 is a Tri-band GSM/GPRS engine that works on frequencies EGSM 900 MHz, DCS 1800 MHz and PCS1900 MHz. SIM300 provide RF antenna interface with two alternatives: antenna connector and antenna pad. The antenna connector is MURATA MM9329-2700. And customer’s antenna can be soldered to the antenna pad.</p>
<p>SMS is one of the unique features of GSM compared to older analog systems. For point-to-point SMS, a message can be sent to another subscriber to the service, and an acknowledgment of receipt is sent to the sender. SMS also can be used in Cell Broadcast mode to send messages such as traffic or news updates. Messages can be stored on the SIM card for later retrieval. SMS is effective because it can transmit short messages within 3 to 5s via the GSM network and doesn’t occupy a telephony channel. Moreover, the cost savings makes it a worthwhile choice. With SMS transmitting, gathering position data is easy and convenient.</p>
<p>We use AT commands to control and program the SIMCOM SIM300 module. The data and control commands are exchanged between the PIC microcontroller and GSM module through the serial interface. There are many groups of AT commands, including: Call Control, Data Card Control, Phone Control, Computer Data Card Control, Reporting Operation, Network Communication Parameter, Miscellaneous, and Short Message Service. We use some of the SMS commands to communicate with the control center. The main AT commands for using SMS are listed below.</p>
<ul>
<li>A/                 -  Re-issues last AT command given</li>
<li>ATD              -  Mobile originated call to dialable number</li>
<li>ATH              &#8211; Disconnect existing connection</li>
<li>AT+CSCA    &#8211; Set the SMS center address. Mobile-originated messages are transmitted through this service center.</li>
<li>AT+CMGS   &#8211; Send SMS command</li>
<li>AT+CMGF   &#8211; Select format for incoming and outgoing messages: zero for PDU mode, one for Text  mode.</li>
<li>AT+CSMS    &#8211; Select message service</li>
<li>AT+CRES     &#8211; Restore SMS settings</li>
<li>AT+CSCB     &#8211; Select cell broadcast SMS messages</li>
<li>AT+CSDH    &#8211; Show SMS text mode parameters</li>
</ul>
<p>Let’s review an example of how to make a GSM module send and read a sample SMS in Text mode. First, initialize the GSM module with AT commands AT+CSCA and AT+CMGF. Using the former sets the SMS center number to be used with outgoing SMS messages. Remember, the number will be saved on the SIM card just like in normal mobile phones. There are two different modes—Text mode and Protocol Data Unit (PDU) mode—for handling short messages. The system default is PDU mode; however, Text mode is easier to understand. So, use the AT+CMGF=1 command to set the module to the GSM 07.05 standard SMS Text mode. The AT+CMGS command is used to send a short message. The GSM module can receive incoming short messages and save them on the SIM card automatically. You can use the AT+CMGR command to read an incoming short message from the SIM card storage, and then use the AT+CMGD command to delete it when you’re finished. If you want to read an SMS message, then send a AT+CMGR=x command to tell the GSM module which short message you want to read. Next, check the serial port to receive the message from the GSM module.</p>
]]></content:encoded>
			<wfw:commentRss>http://electrofriends.com/articles/electronics/analog/system-for-mobile-communications-gsm/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Global Positioning System (GPS)</title>
		<link>http://electrofriends.com/articles/electronics/analog/global-positioning-system-gps/</link>
		<comments>http://electrofriends.com/articles/electronics/analog/global-positioning-system-gps/#comments</comments>
		<pubDate>Sat, 06 Jun 2009 06:27:28 +0000</pubDate>
		<dc:creator>Ranjith</dc:creator>
				<category><![CDATA[Analog]]></category>

		<guid isPermaLink="false">http://electrofriends.com/?p=580</guid>
		<description><![CDATA[GPS – AN OVERVIEW The GPS (Global Positioning System) is a “constellation” of 24 well-spaced satellites that orbit the earth and make it possible for people with ground receivers to pinpoint their geographic location. The location accuracy is anywhere from 100 to 10 meters for most equipment. Accuracy can be pinpointed to within 1 meter [...]]]></description>
			<content:encoded><![CDATA[<p><strong>GPS – AN OVERVIEW</strong><br />
The GPS (Global Positioning System) is a “constellation” of 24 well-spaced satellites that orbit the earth and make it possible for people with ground receivers to pinpoint their geographic location. The location accuracy is anywhere from 100 to 10 meters for most equipment. Accuracy can be pinpointed to within 1 meter with special military-approved equipment .GPS equipment is widely used in science and has now become sufficiently low-cost so that almost anyone can own a GPS receiver.</p>
<p>The GPS has three components namely:<img class="alignright size-full wp-image-581" title="GPS" src="http://electrofriends.com/wp-content/uploads/2009/06/gps.jpg" alt="GPS" width="199" height="180" /></p>
<ol>
<li>The space segment: consisting of 24 satellites orbiting the earth at an altitude      of 11000 nautical miles.</li>
<li>The user segment: consisting of a receiver, which is mounted on the unit whose location has to be determined.</li>
<li>The control segment: consists of various ground stations controlling the satellites.</li>
</ol>
<p>The GPS is owned and operated by the U.S Department of Defense but is available for general use around the world. Briefly, here’s how it works:</p>
<ol>
<li>21 GPS satellites and 3 spare satellites are in orbit at 10,600 miles above the earth. The satellites are spaced so that from any point on earth, 4 satellites will be above the horizon.</li>
<li>Each satellite contains a computer, an atomic clock and a radio. With an understanding of its own orbit and the clock, it continually broadcasts its changing position and time. (Once a day, each satellite checks its own sense of time and position with a ground station and makes any minor correction).</li>
<li>On the ground, any GPS receiver contains a computer that “triangulates” its own position by getting bearings from 3 or 4 satellites. The result is provided in the form of a geographic position- Longitude and latitude, for most of the receivers, within 100 meters.</li>
<li>If the receiver is also equipped with a display screen that shows a map, the position can be shown on the map.</li>
<li>If the 4th satellite can be received, the receiver/computer can figure out the altitude as well as the geographic position.</li>
<li>If you are moving, your receiver may also be able to calculate your speed and direction of travel and give the estimated times of arrival to specified destinations.</li>
</ol>
<p><img class="aligncenter size-full wp-image-582" title="GPS Module" src="http://electrofriends.com/wp-content/uploads/2009/06/gps_module.jpg" alt="GPS Module" width="475" height="307" /><br />
For a GPS receiver to function, it needs to lock onto satellite signals. Each satellite broadcasts two signals at 1.57542GHz and 1.2276GHz, denoted as L1 and L2, respectively. A satellite specific code, known as the course acquisition (C/A) code, is used to discern satellites. Correlation of the transmitted codes against local codes is needed to locate satellites in frequency space. The 1023 bit C/A code modulates the L1 at 1.023MHz, repeating every millisecond. Accumulation of this 1000Hz data is required for a receiver to operate.</p>
<p>Once the GPS receiver made the calculation, it can tell the latitude, the longitude and the altitude of its’ current position. This doesn’t tell much to the average user. So in order to make use of the GPS receiver more user-friendly many receivers send this data to a program which displays a map and can show the position on it. Geographical Information System (GIS) is a computer-based software capable of handling maps and various details given on the map. Data generated by the GPS use spatial data referenced to the earth. In other words this data is the coordinates of its own position expressed in latitude and longitude. This data needs to be positioned on a map of the area for any useful analysis.</p>
<p>GPS is being used in science to provide data that has never been available before in the quantity and degree of accuracy that the GPS makes possible. GPS receivers are becoming consumer products. In addition to their outdoor use, receivers can be used in cars to relate the driver’s location with traffic and weather information.</p>
<p><strong>THE GPS UNIT:</strong></p>
<p>The GPS unit contains a GPS module along with a GPS receiver antenna. The module functions according to its built and the antenna receives the information from the GPS satellite in NMEA (National Marine Electronics Association) format. This data is then sent to the microcontroller wherein it is decoded to the required format and sent further.</p>
<p>GPS ANTENNA:</p>
<p>The AGA Series GPS antenna is a standard product for the GPS system. The circular polarization improves reception ability. The built-in low noise amplifier with very low DC power consumption enhances an already high performance patch array. The antenna has the following features:</p>
<ul>
<li>Low noise figure</li>
<li>High gain</li>
<li>Ceramic patch antenna</li>
<li>Water-tight housing</li>
<li>Temperature and vibration qualified</li>
<li>Compact size</li>
<li>Low cost</li>
</ul>
<p><strong>GPS MODULE:</strong></p>
<p>CPIT GPS module SA3618/SA3618P (patch on top) is a high sensitivity ULTRA LOW power consumption cost efficient, compact size; plug &amp; play GPS module board designed for a broad spectrum of OEM system applications.</p>
<p><img class="alignright size-full wp-image-583" title="GPS Antenna" src="http://electrofriends.com/wp-content/uploads/2009/06/gps_antenna.jpg" alt="GPS Antenna" width="200" height="161" />The GPS module receiver will track up to 16 satellites at a time while providing fast time-to-first-fix and 1Hz navigation updates. Its superior capability meets the sensitivity &amp; accuracy requirements of car navigation as well as other location-based applications, such as AVL system. Handheld navigator, PDA, pocket PC, or any battery operated navigation system.</p>
<p>The module communicates with application system via RS232 (TTL level) with NMEA0183 protocol.</p>
<p>Main Features:</p>
<ul>
<li>Built-in high performance NMEX chipset.</li>
<li>Average Cold Start in 60 seconds.</li>
<li>Ultra Low power consumption.( SA3618 27mA typ @ 3.3V )</li>
<li>16 channels All-in-View tracking.</li>
<li>On chip 4Mb flash memory.</li>
<li>TTL level serial port for GPS receiver command message Interface.</li>
<li>Compact Board Size</li>
</ul>
<p>Technical Specifications:</p>
<ol>
<li><strong>Electrical Characteristics </strong>
<ul>
<li> General<br />
Frequency L1, 1575.42 MHz<br />
C/A code 1.023 MHz chip rate<br />
Channels 16</li>
<li>Sensitivity<br />
Tracking -152dBm typ<br />
Acquisition -139dBm typ</li>
<li> Accuracy<br />
Position 5 meters CEP (90%) horizontal, SA off.<br />
Velocity 0.1 meters/second<br />
Time 1 microsecond synchronized to GPS time</li>
</ul>
</li>
<li><strong>Dynamic Conditions</strong><br />
Altitude 10,000 meters max<br />
Horizontal Velocity 300 kilometers/hour max<br />
Vertical Velocity 36 kilometers/hour max<br />
Acceleration 2g, max<br />
Jerk 4 meters/second3, max</li>
<li><strong>Power</strong><br />
Main power input 3.3 ±5% VDC input.<br />
Supply Current SA3618 26 mA @ 3.3V (Continuous mode)</li>
<li><strong>Serial Port</strong><br />
Electrical interface one full duplex serial communication, TTL interface<br />
Protocol message NMEA-0183, version 3.0 optional.<br />
Default NMEA GGA, GSA, GSV, RMC and VTC. 9600 baud rate, 8 bits data, 1 start, 1 stop, no parity.</li>
<li><strong>Recommended External Antenna Specification</strong><br />
Gain 20dB (including cable loss)<br />
Noise figure 1.5dB<br />
Current 3 ~ 30mA<br />
Operate Voltage 2.5 ~ 2.8V</li>
</ol>
<p><strong>Serial Interface</strong><br />
Communication to the SA3618 is provided via a serial interface. A 10-pin 1.27mm whole connector is used. Pin 6 (Reset) is the active-low reset input. The SA3618 always requires a reset at power-up, or it will not start properly. An optional onboard reset circuit can be provided. A reset forces the SA3618 processor to reboot, but will not influence other parameters such as hot or cold start. Pin 1 (GPIO [4]) and pin 10 (GPIO [0]) are spare pins that can be used e.g. to control power modes, to indicate SA3618 status, or to force a cold start. They can be left unconnected if desired.<br />
I/O voltage level is set to 2.7V.</p>
<p><strong>PIN DESCRIPTION OF SA3618</strong></p>
<p><strong><img class="aligncenter size-full wp-image-584" title="SA3618 Pin Description" src="http://electrofriends.com/wp-content/uploads/2009/06/sa3618_pindescription.jpg" alt="SA3618 Pin Description" width="402" height="291" />GETTING GPS DATA:</strong></p>
<p>After the GPS Module computes the positioning and other useful information, it then transmits the data in some standard format. With differential GPS signal input the accuracy ranges from 1 to 5 m; however, without differential input, the accuracy can be 25 m.</p>
<p>About 60 s after the GPS module is cold booted it begins to output a set of data (according to the NMEA format) though port C once every second at 9600 bps, 8 data bits, one stop bit, and no parity. NMEA GPS messages include six groups of data sets: GGA, GGL, GSA, GSV, RMC, and VTG. We use only the most useful RMC message- Recommended Minimum Specific GNSS Data-which contains all of the basic information required to build a navigation system.</p>
<p>We only need position and time data, so the UTC position, longitude with east west indicator, and latitude with north/south indicator are picked out from the RMC message. All of this data will be formatted into a standard fixed length packet with some other helpful information. Next, this data packet will be transmitted to the control center and stored in the micro controller.</p>
<p>Here’s a sample of how the GPS receiver antenna receives information from the GPS satellite in NMEA format:</p>
<p><strong>NMEA format sample:</strong><br />
The GPS module that we are using in this unit is SA3618 and the GPS receiving antenna used is G-501.</p>
<p><strong>SA3618 NMEA Protocol</strong><br />
The SA3618 software is capable of supporting the following NMEA message<br />
Formats:</p>
<p><img class="aligncenter size-full wp-image-585" title="SA3618 NMEA Protocol" src="http://electrofriends.com/wp-content/uploads/2009/06/sa3618_nmea_protocol.jpg" alt="SA3618 NMEA Protocol" width="476" height="281" />* (1): 1sec output 1msg, (3): 3sec output 1msg, 9600 baud rate (Standard output)</p>
<p><strong>General NMEA Format:</strong></p>
<p>The general NMEA (National Marine Electronics Association) format consists of an ASCII string commencing with a. $. Character and terminating with a &lt;CR&gt;&lt;LF&gt; sequence. NMEA standard messages commence with .GP. then a 3-letter message identifier. NemeriX specific messages commence with $PNMRX followed by a 3 digit number. The message header is followed by a comma delimited list of fields optionally terminated with a checksum consisting of an asterix .*. and a 2 digit hex value representing the checksum. There is no comma preceding the checksum field. When present, the checksum is calculated as a bitwise exclusive of the characters between the. $. and.*.. As an ASCII representation, the number of digits in each number will vary depending on the number and precision, hence the record length will vary. Certain fields may be omitted if they are not used, in which case the field position is reserved using commas to ensure correct interpretation of subsequent fields. The tables below indicate the maximum and minimum widths of the fields to allow for buffer size allocation.</p>
<p>$GPRMC: This message transfers recommended minimum specific GNSS data. The $GPRMC message format is as shown below</p>
<p><img class="aligncenter size-full wp-image-586" title="GPRMS Message formate" src="http://electrofriends.com/wp-content/uploads/2009/06/gprms_message_formate.jpg" alt="GPRMS Message formate" width="549" height="578" /><img class="aligncenter size-full wp-image-588" title="GPS Hyper Terminal" src="http://electrofriends.com/wp-content/uploads/2009/06/gps_hyper_terminal1.jpg" alt="GPS Hyper Terminal" width="523" height="443" /></p>
]]></content:encoded>
			<wfw:commentRss>http://electrofriends.com/articles/electronics/analog/global-positioning-system-gps/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>RF UNIT</title>
		<link>http://electrofriends.com/articles/electronics/analog/rf-unit/</link>
		<comments>http://electrofriends.com/articles/electronics/analog/rf-unit/#comments</comments>
		<pubDate>Fri, 05 Jun 2009 11:12:56 +0000</pubDate>
		<dc:creator>Ranjith</dc:creator>
				<category><![CDATA[Analog]]></category>

		<guid isPermaLink="false">http://electrofriends.com/?p=565</guid>
		<description><![CDATA[The RF section consists of an RF transmitter and an RF receiver.  The RF transmitter mainly consists of a remote key that contains a code hopping encoder, HCS301 along with 2 buttons and two LEDs. The RF receiver section consists of a Low Power ASK receiver IC. The key encoder will generate the company specific [...]]]></description>
			<content:encoded><![CDATA[<p>The RF section consists of an RF transmitter and an RF receiver.  The RF transmitter mainly consists of a remote key that contains a code hopping encoder, HCS301 along with 2 buttons and two LEDs. The RF receiver section consists of a Low Power ASK receiver IC. The key encoder will generate the company specific “Company ID”, which will be decoded by the low power ASK receiver IC. The LEDS are used to show the status of the remote key. The two buttons provided are used for ‘entry’ and ‘exit’. When both the buttons are pressed together, the system goes into a ‘panic’ state wherein the system will turn on the siren and immobilize the vehicle in emergency condition after a 10sec delay.</p>
<p><strong>THE TRANSMITTER UNIT:</strong></p>
<p>The transmitter consists of a code hopping encoder, HCS301 from Microchip Technology. The HCS301 utilizes the KEELOQ code hopping technology, which incorporates high security, a small package security, a small package outline and low cost, to make this device a perfect solution for unidirectional remote keyless entry systems and access control systems.</p>
<p>The HCS301 combines a 32-bit hopping code, generated by a nonlinear encryption algorithm, with a 28-bit serial number and 6 information bits to create a 66-bit code word. The code word length eliminates the threat of code scanning and the code hopping mechanism makes each transmission unique, thus rendering code capture and resend schemes useless. The crypt key, serial number and configuration data are stored in an EEPROM array, which is not accessible via any external connection. The EEPROM data is programmable but read-protected. The data can be verified only after an automatic erase and programming operation. This protects against attempts to gain access to keys or manipulate synchronization values. The HCS301 provides an easy-to-use serial interface for programming the necessary keys, system parameters and configuration data.</p>
<p><strong>Security</strong></p>
<ul>
<li>Programmable 28-bit serial number</li>
<li>Programmable 64-bit encryption key</li>
<li>Each transmission is unique</li>
<li>66-bit transmission code length</li>
<li>32-bit hopping code</li>
<li>34-bit fixed code (28-bit serial number,</li>
<li>4-bit button code, 2-bit status)</li>
<li>Encryption keys are read protected</li>
</ul>
<p><strong>Operating</strong></p>
<ul>
<li>3.5V &#8211; 13.0V operation</li>
<li>Four button inputs</li>
<li>No additional circuitry required</li>
<li>15 functions available</li>
<li>Selectable baud rate</li>
<li>Automatic code word completion</li>
<li>Battery low signal transmitted to receiver</li>
<li>Battery low indication on LED</li>
<li>Non-volatile synchronization data</li>
</ul>
<p><strong>Other</strong></p>
<ul>
<li>Functionally identical to HCS300</li>
<li>Easy-to-use programming interface</li>
<li>On-chip EEPROM</li>
<li>On-chip oscillator and timing components</li>
<li>Button inputs have internal pull-down resistors</li>
<li>Current limiting on LED output</li>
<li>Low external component cost</li>
</ul>
<p style="text-align: center;"><img class="size-full wp-image-567 aligncenter" title="RFID Transimitter IC hcs301" src="http://electrofriends.com/wp-content/uploads/2009/06/hcs301.jpg" alt="RFID Transimitter IC hcs301" width="225" height="160" /><img class="size-full wp-image-568 aligncenter" title="RFID Transmitter" src="http://electrofriends.com/wp-content/uploads/2009/06/rfid_transmitter.jpg" alt="RFID Transmitter" width="267" height="207" /></p>
<p>The HCS301 is a simple device to use. It requires only the addition of buttons and RF circuitry for use as the transmitter in your security application. The HCS301 will wake-up upon detecting a button press and delay approximately 10 ms for button debounce. The synchronization counter, discrimination value and button information will be encrypted to form the hopping code. The hopping code portion will change every transmission, even if the same button is pushed again. A code word that has been transmitted will not repeat for more than 64K transmissions. This provides more than 18 years of use before a code is repeated; based on 10 operations per day. Overflow information sent from the encoder can be used to extend the number of unique transmissions to more than 192K. If in the transmit process it is detected that a new button(s) has been pressed, a RESET will immediately occur and the current code word will not be completed. Please note that buttons removed will not have any effect on the code word unless no buttons remain pressed; in which case the code word will be completed and the power-down will occur.</p>
<p><strong>Code Word Format:</strong></p>
<p>The HCS301 code word is made up of several parts. Each code word contains a 50% duty cycle preamble, a header, 32 bits of encrypted data and 34 bits of fixed data followed by a guard period before another code word can begin.</p>
<p><img class="aligncenter size-full wp-image-569" title="Code Word Formate: Preampable/Header Portion" src="http://electrofriends.com/wp-content/uploads/2009/06/codewordformate.jpg" alt="Code Word Formate: Preampable/Header Portion" width="495" height="105" /><img class="aligncenter size-full wp-image-570" title="Code Word Formate: Data Formate" src="http://electrofriends.com/wp-content/uploads/2009/06/cwf_dataformate.jpg" alt="Code Word Formate: Data Formate" width="492" height="132" /><strong>Code Word Organization:</strong></p>
<p>The HCS301 transmits a 66-bit code word when a button is pressed. The 66-bit word is constructed from a Fixed Code portion and an Encrypted Code portion. The 32 bits of Encrypted Data are generated from 4 button bits, 12 discrimination bits and the 16-bit sync value. The encrypted portion alone provides up to four billion changing code combinations. The 34 bits of Fixed Code Data are made up of 2 status bits, 4 button bits and the 28-bit serial number. The fixed and encrypted sections combined increase the number of code combinations to 7.38 x 1019.</p>
<p><strong>Code Word Completion:</strong></p>
<p>The code word completion feature ensures that entire code words are transmitted, even if the button is released before the code word is complete. If the button is held down beyond the time for one code word, multiple code words will result. If another button is activated during a transmission, the active transmission will be aborted and a new transmission will begin using the new button information.</p>
<p><strong>THE RECEIVER UNIT:</strong></p>
<p>The receiver unit consists of the RX3400, which is a low power ASK receiver IC, and is suitable for use in a variety of low power radio applications including remote keyless entry. The RX3400 is based on a single-conversion, super-heterodyne receiver architecture and incorporates an entire phase-locked loop (PLL) for precise local oscillator generation.<br />
Features</p>
<p><img class="size-full wp-image-571 alignleft" title="RFID rx3400" src="http://electrofriends.com/wp-content/uploads/2009/06/rx3400.jpg" alt="RFID rx3400" width="146" height="225" /></p>
<ul>
<li>Extremely low power operation</li>
<li>Low external part count</li>
<li>Receiver input frequency: 290 – 460 MHz</li>
<li>On-chip VCO with integrated PLL using crystal oscillator reference</li>
<li>PLL power down feature</li>
<li>Integrated IF and data filters</li>
<li>SSOP-24 package (0.64 mm pitch)</li>
</ul>
<p><strong>Functional Description</strong></p>
<p>The RX3400 ASK receiver IC incorporates an LNA; mixer; PLL-based local oscillator including VCO, fixed divider (÷ 64), reference crystal oscillator, phase-frequency detector (PFD), and charge pump; IF filter; logarithmic amplifier; data filter; peak detector; and 1- bit comparator and is capable of demodulating ASK input signals.</p>
<p><strong>PLL Power-down Function</strong></p>
<p>The PLL portion of the IC can be powered up and down through the control of the PD input (pin 14). During PLL power down operation (pin 14 pull low), the reference crystal oscillator, fixed VCO divider, PFD, and charge pump are all shut off and the current consumption of the IC drops by approximately 600mA. The VCO circuitry remains on and may be configured to operate as a buffer amplifier for an external SAW-based oscillator.</p>
<p><strong>1-bit Comparator</strong></p>
<p>The integrated 1-bit comparator operates as a data slicer and “squares up” the data filtered RSSI output from the logarithmic amplifier. The decision threshold voltage level for the 1-bit comparator is stored on an external capacitor connected to the ASKREF pin.</p>
]]></content:encoded>
			<wfw:commentRss>http://electrofriends.com/articles/electronics/analog/rf-unit/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PIC &#8211; Introduction</title>
		<link>http://electrofriends.com/articles/electronics/microcontroller-electronics-articles/pic/pic-introduction/</link>
		<comments>http://electrofriends.com/articles/electronics/microcontroller-electronics-articles/pic/pic-introduction/#comments</comments>
		<pubDate>Fri, 05 Jun 2009 09:45:33 +0000</pubDate>
		<dc:creator>Ranjith</dc:creator>
				<category><![CDATA[PIC]]></category>
		<category><![CDATA[PIC Microcontrollers]]></category>
		<category><![CDATA[PIC Tutorial]]></category>

		<guid isPermaLink="false">http://electrofriends.com/?p=562</guid>
		<description><![CDATA[The term PIC, or Peripheral Interface Controller, has been coined by Microchip technology to identify its single chip microcontrollers. PIC microcontrollers possess an array of features that make them attractive for a wide range of applications. Furthermore these microcontrollers are available with a range of capabilities, packaged in both dual-in-line(DIP) packages and surface-mount packages. Factors [...]]]></description>
			<content:encoded><![CDATA[<p>The term PIC, or Peripheral Interface Controller, has been coined by Microchip technology to identify its single chip microcontrollers. PIC microcontrollers possess an array of features that make them attractive for a wide range of applications. Furthermore these microcontrollers are available with a range of capabilities, packaged in both dual-in-line(DIP) packages and surface-mount packages. Factors that account for the wide popularity of PIC microcontrollers include the following:</p>
<ul>
<li><strong>Speed</strong>: When operated at its maximum clock rate, a PIC executes most of its instructions in 0.2µs, or 5 instructions per microsecond.</li>
<li><strong>Instruction set simplicity</strong>: The instruction set consists of just 35 instructions.</li>
<li><strong>Integration of operational features</strong>: Power-on Reset and Brown –out protection insure that the chip operates only when the supply voltage is within specification. A watchdog timer resets the PIC if the chip ever malfunctions and deviates from its normal operations.</li>
<li><strong>Programmable timer options</strong>: The versatile timers can characterize inputs, control outputs and provide timing for program execution.</li>
<li><strong>Interrupt control</strong>: Up to 12 independent interrupt sources can control when the CPU will deal with each source.</li>
<li><strong>Powerful output pin control</strong>: A single instruction can select and drive a single output pin high or low in its 0.2µs instruction execution time. The pin can drive a load of up to 25mA.</li>
<li><strong>I/O port expansion</strong>:  The built-in serial peripheral interface can make use of standard 16-pin shift register parts to add any number of I/O pins.</li>
<li><strong>Serial programming via two pins</strong>: The simplicity of programming hardware supports the availability of PIC programmers for under $100.</li>
</ul>
<p>PICs use a RISC instruction set, which varies in length from about 35 instructions for the low-end PICs to about 70 instructions for the high-end PICs. The instruction set includes instructions to perform a variety of operations on the accumulator and a constant or the accumulator and a memory location, as well as for conditionally executing code and jumping/calling other parts of the program and returning from them, and specific hardware features like interrupts and one low-power mode called sleep. Microchip provides a freeware IDE package called MPLAB, which also includes a software simulator as well as an assembler.</p>
<p>The word size of PICs is a source of much confusion. All PICs (except dsPICs and PIC24s) handle data in 8-bit chunks, so they should be called 8-bit microcontrollers. But unlike most CPUs, PICs use Harvard architecture, so the size of an instruction can be different from the size of the data. In fact, different PIC families use different instruction sizes, which make it a challenge to compare the code size of PICs to other microcontrollers. For example, say a microcontroller has 6144 bytes of program memory. For a 12-bit PIC, this works out to 4096 words (or assembly instructions); for a 16-bit PIC, this is 3072 words.<br />
PICmicro devices are grouped by the size of their instruction word and their instruction set. The four current PICmicro families and their instruction word length are:</p>
<ol>
<li>Base-Line:    12-bit instruction Word length</li>
<li>Mid-Range:  14-bit instruction Word length</li>
<li>High-End:     16-bit instruction Word length</li>
<li>Enhanced:    16-bit instruction Word length</li>
</ol>
<p>The PIC18FXXX MCU family belongs to the Enhanced MCU family of devices. These devices have full-speed USB support, all sorts of inbuilt hardware and are very powerful and versatile.</p>
<p>Microchip offers three program memory types. The memory type is designated in the part number by the first letter(s) after the family affiliation designators.</p>
<ol>
<li>C, as in PIC18CXXX. These devices have EEPROM type memory.</li>
<li>CR, as in PIC18CRXXX. These devices have ROM type memory.</li>
<li>F, as in PIC18FXXX. These devices have FLASH type memory.</li>
</ol>
<p>The PIC18FXXX family offers the advantages of all PIC18 microcontrollers-namely, high computational performance at an economical price-with the addition of high-endurance, Enhanced flash program memory.</p>
<p>Microchip offers a wide range of development tools that allows users to efficiently develop and debug application code. Microchip’s development tools can be broken down into four categories:</p>
<ol>
<li>Code generation</li>
<li>Hardware/Software debug</li>
<li>Device programmer</li>
<li>Product evaluation boards</li>
</ol>
<p>All tools developed by Microchip operate under the MPLAB@ Integrated Development Environment (IDE).</p>
]]></content:encoded>
			<wfw:commentRss>http://electrofriends.com/articles/electronics/microcontroller-electronics-articles/pic/pic-introduction/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Interfacing 7-Segment Display using lookup table</title>
		<link>http://electrofriends.com/articles/electronics/microcontroller-electronics-articles/8051-8951/interfacing-7-segment-display-with-microcontroller-using-lookup-table/</link>
		<comments>http://electrofriends.com/articles/electronics/microcontroller-electronics-articles/8051-8951/interfacing-7-segment-display-with-microcontroller-using-lookup-table/#comments</comments>
		<pubDate>Tue, 28 Apr 2009 07:21:46 +0000</pubDate>
		<dc:creator>Ranjith</dc:creator>
				<category><![CDATA[8051/8951]]></category>
		<category><![CDATA[7-Segment Display]]></category>
		<category><![CDATA[7447]]></category>
		<category><![CDATA[LED]]></category>
		<category><![CDATA[lookup table]]></category>
		<category><![CDATA[Microcontroller]]></category>

		<guid isPermaLink="false">http://electrofriends.com/?p=474</guid>
		<description><![CDATA[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). ]]></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 class="size-medium wp-image-475 aligncenter" title="7 segment pin configuration" src="http://electrofriends.com/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="http://electrofriends.com/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="http://electrofriends.com/wp-content/uploads/2009/04/7_seg_circuit_ca.gif"><img class="size-medium wp-image-476 aligncenter" title="7 segment circuit comon anode" src="http://electrofriends.com/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="http://electrofriends.com/wp-content/uploads/2009/04/7_seg_circuit_cc.gif"><img class="size-medium wp-image-477 aligncenter" title="7 segment circuit comon cathode" src="http://electrofriends.com/wp-content/uploads/2009/04/7_seg_circuit_cc-300x256.gif" alt="7 segment circuit comon cathode" width="300" height="256" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://electrofriends.com/articles/electronics/microcontroller-electronics-articles/8051-8951/interfacing-7-segment-display-with-microcontroller-using-lookup-table/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>

