tag:blogger.com,1999:blog-16605496999429642322024-03-19T22:22:56.602+05:30Embedded SystemsAnonymoushttp://www.blogger.com/profile/14732997283394377764noreply@blogger.comBlogger22125tag:blogger.com,1999:blog-1660549699942964232.post-14110963935435561872014-04-08T15:26:00.001+05:302014-04-08T15:27:39.279+05:30Bit rate VS Baude rate<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="background-color: white; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 22.5px; padding: 10px 0px; text-align: justify;">
The two most common/confused words in digital communication – Bit rate and Baud rate. Generally, communication is concerned with transmission of data. In digital communication, there are two entities that are needed to carry out communication – the data to be transmitted and the signal over which the data is transmitted. Now, we have two entities to be worried about – the data and the signal. The most common misconception is that most people think both travel at the same speed! – NO!</div>
<h3 style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 20px; line-height: 22.5px; margin: 0px; padding: 10px 0px; text-align: justify;">
The difference:</h3>
<div style="background-color: white; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 22.5px; padding: 10px 0px; text-align: justify;">
Digital data is very different from digital signal. The process of converting digital data to digital signal is called as <strong style="margin: 0px; padding: 0px;">line coding</strong>.Now, to discriminate between data and signal, data is what we need to send. But signal is what we can send. So, signal is the carrier which carries data.Also, keep in mind that the smallest entity of the data, that can represent a piece of information is called data element and shortest meaningful unit of a signal is called signal element. Consider this as in the following scenario – Consider a train. Each carriage is a signal element. Each passenger inside the train is a data element. The train as a whole is a signal and all passengers together represent a data.</div>
<h3 style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 20px; line-height: 22.5px; margin: 0px; padding: 10px 0px; text-align: justify;">
Data rate and Signal rate:</h3>
<ul style="background-color: white; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 22.5px; list-style: square; margin: 0px 0px 0px 23px; padding: 0px;">
<li style="margin: 0px; padding: 0px;">Data rate – Number of data elements transmitted per second.</li>
<li style="margin: 0px; padding: 0px;">Signal rate – Number of signal elements transmitted per second.</li>
</ul>
<div style="background-color: white; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 22.5px; padding: 10px 0px; text-align: justify;">
Now, the unit of data rate is bit rate. And the unit of signal rate is pulse rate/ modulation rate/ baud rate or simply baud. From the previous example, we can see that, a carriage in a train can carry more than one person. So, if you consider the number of person is more than one per carriage, you can say that bit rate is greater than baud rate for the signal.</div>
<h3 style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 20px; line-height: 22.5px; margin: 0px; padding: 10px 0px; text-align: justify;">
Calculating the baud rate:</h3>
<div style="background-color: white; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 22.5px; padding: 10px 0px; text-align: justify;">
Baud rate is calculated using the below formula.<br />
<a href="http://www.circuitstoday.com/wp-content/uploads/2012/09/form.jpg" style="margin: 0px; padding: 0px; text-decoration: none;"><img alt="" class="aligncenter size-full wp-image-8616" src="http://www.circuitstoday.com/wp-content/uploads/2012/09/form.jpg" height="51" style="background-color: #ececec; background-position: initial initial; background-repeat: initial initial; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 0px; display: block; margin: 10px auto; max-width: 630px; padding: 5px;" width="117" /></a></div>
<div style="background-color: white; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 22.5px; padding: 10px 0px; text-align: justify;">
here, N is the bit rate and r is the number of data elements carried by each signal element. Here r must be as great as possible for better efficiency. </div>
<div style="background-color: white; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 22.5px; padding: 10px 0px; text-align: justify;">
From the above text, it is clearly inferred that the bit rate must be greater than the baud rate for higher efficiency. The aim is to transmit as many data element as possible in a signal element. There are different methods to do this which are collectively called as line coding schemes.Some of the popular line coding schemes are: Non-return to zero (NRZ), Manchester, Alternate mark inversion (AMI) and also multi level schemes are available.</div>
<h3 style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 20px; line-height: 22.5px; margin: 0px; padding: 10px 0px; text-align: justify;">
Few Examples:</h3>
<div style="background-color: white; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 22.5px; padding: 10px 0px; text-align: justify;">
Consider the below figures.<br />
<a href="http://www.circuitstoday.com/wp-content/uploads/2012/09/rtwo.jpg" style="margin: 0px; padding: 0px; text-decoration: none;"><img alt="" class="aligncenter size-full wp-image-8610" src="http://www.circuitstoday.com/wp-content/uploads/2012/09/rtwo.jpg" height="179" style="background-color: #ececec; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 0px; display: block; margin: 10px auto; max-width: 630px; padding: 5px;" width="400" /></a><br />
Here, the data rate(bitrate) and signal rate(baud) are same and r is one. One data element rides on one signal element (analogous to one person per carriage in a train).</div>
<div style="background-color: white; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 22.5px; padding: 10px 0px; text-align: justify;">
<a href="http://www.circuitstoday.com/wp-content/uploads/2012/09/rone.jpg" style="margin: 0px; padding: 0px; text-decoration: none;"><span style="color: black;"><img alt="" class="aligncenter size-full wp-image-8611" src="http://www.circuitstoday.com/wp-content/uploads/2012/09/rone.jpg" height="200" style="background-color: #ececec; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 0px; display: block; margin: 10px auto; max-width: 630px; padding: 5px;" width="320" /></span></a></div>
<div style="background-color: white; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 22.5px; padding: 10px 0px; text-align: justify;">
And in this image, you can see that there are two data elements transmitter per signal element. In other words, the bit rate is higher than the baud rate. (Analogous to two passengers per carriage in a train) and here r is two. Hence baud rate is one half of bit rate.<br />
And the next time, when you define the baud rate – its number of signal elements per second and not number of bits per second!</div>
</div>
Anonymoushttp://www.blogger.com/profile/14732997283394377764noreply@blogger.com0tag:blogger.com,1999:blog-1660549699942964232.post-48521559749202430282014-04-04T12:05:00.000+05:302014-04-04T12:05:48.356+05:30Dark/Light sensor using transistor<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="background-color: white; font-family: 'PT Sans', sans-serif; font-size: 13px; line-height: 19px; margin-bottom: 10.5px; text-align: justify;">
Automatic dark detector senses darkness. As the light level decreases and LDR meets the maximum threshold resistance, the circuit automatically<em><strong> switches on the LED D1. </strong></em></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://www.flickr.com/photos/buildcircuit/8012529131/" rel="nofollow" style="color: #0e0a7d; margin-left: 1em; margin-right: 1em; text-decoration: none !important;" title="Dark light sensor by BUILDCIRCUIT, on Flickr"><img alt="Dark light sensor" class="lazy " data-original="http://farm9.staticflickr.com/8299/8012529131_122007df3f_n.jpg" height="312" src="http://farm9.staticflickr.com/8299/8012529131_122007df3f_n.jpg" style="border: 0px; display: inline; height: auto; max-width: 100%; vertical-align: middle;" width="320" /></a></div>
<div style="background-color: white; font-family: 'PT Sans', sans-serif; font-size: 13px; line-height: 19px; margin-bottom: 10.5px; text-align: justify;">
<span id="more-53"></span></div>
<div style="background-color: white; font-family: 'PT Sans', sans-serif; font-size: 13px; line-height: 19px; margin-bottom: 10.5px;">
</div>
<div style="text-align: justify;">
<strong><br /></strong></div>
<div style="text-align: center;">
<strong>Dark sensor with variable resistor:</strong></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://www.flickr.com/photos/buildcircuit/8012534324/" rel="nofollow" style="color: #0e0a7d; margin-left: 1em; margin-right: 1em; text-decoration: none !important;" title="Dark light sensor by BUILDCIRCUIT, on Flickr"><img alt="Dark light sensor" class="lazy " data-original="http://farm9.staticflickr.com/8317/8012534324_c64fb60f08.jpg" height="235" src="http://farm9.staticflickr.com/8317/8012534324_c64fb60f08.jpg" style="border: 0px; display: inline; height: auto; max-width: 100%; vertical-align: middle;" width="255" /></a></div>
<div style="color: #0e0a7d; text-align: justify; text-decoration: none !important;">
</div>
<em><strong></strong></em><br />
<div style="background-color: white; font-family: 'PT Sans', sans-serif; font-size: 13px; line-height: 19px; margin-bottom: 10.5px; text-align: justify;">
A dark detector can be made using a variable resistor. The sensitivity of the circuit can be adjusted with a variable resistor.</div>
<div style="background-color: white; font-family: 'PT Sans', sans-serif; font-size: 13px; line-height: 19px; margin-bottom: 10.5px; text-align: justify;">
High resistance-> more darkness to switch on the LED.</div>
<div style="background-color: white; font-family: 'PT Sans', sans-serif; font-size: 13px; line-height: 19px; margin-bottom: 10.5px; text-align: justify;">
Low resistance-> less darkness to switch on the LED.</div>
<div style="background-color: white; font-family: 'PT Sans', sans-serif; font-size: 13px; line-height: 19px; margin-bottom: 10.5px; text-align: justify;">
<strong>Automatic Light detector using variable resistor</strong></div>
<div style="background-color: white; font-family: 'PT Sans', sans-serif; font-size: 13px; line-height: 19px; margin-bottom: 10.5px; text-align: justify;">
A light detector senses light. As the light level increases and LDR meets the lowest threshold resistance, the circuit automatically turns on the LED D1. We can adjust the sensitivity using the preset VR1-10K.</div>
<div style="background-color: white; font-family: 'PT Sans', sans-serif; font-size: 13px; line-height: 19px; margin-bottom: 10.5px; text-align: justify;">
LESS RESISTANCE(VR1)-> LESS DARKNESS TO SWITCH OFF THE LED</div>
<div style="background-color: white; font-family: 'PT Sans', sans-serif; font-size: 13px; line-height: 19px; margin-bottom: 10.5px;">
</div>
<div style="text-align: justify;">
HIGH RESISTANCE(VR1)-> MORE DARKNESS TO SWITCH OFF THE LED</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://www.flickr.com/photos/buildcircuit/8012534618/" rel="nofollow" style="color: #0e0a7d; margin-left: 1em; margin-right: 1em; text-decoration: none !important;" title="Dark light sensor by BUILDCIRCUIT, on Flickr"><img alt="Dark light sensor" class="lazy " data-original="http://farm9.staticflickr.com/8307/8012534618_869988d4d3.jpg" height="282" src="http://farm9.staticflickr.com/8307/8012534618_869988d4d3.jpg" style="border: 0px; display: inline; height: auto; max-width: 100%; vertical-align: middle;" width="235" /></a></div>
<div style="color: #0e0a7d; text-align: justify; text-decoration: none !important;">
</div>
<br />
<div style="background-color: white; font-family: 'PT Sans', sans-serif; font-size: 13px; line-height: 19px; margin-bottom: 10.5px; text-align: justify;">
<strong>Just swap the resistor and LDR to convert a dark sensor to a light sensor</strong></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://www.flickr.com/photos/buildcircuit/8012528853/" rel="nofollow" style="color: #0e0a7d; margin-left: 1em; margin-right: 1em; text-decoration: none !important;" title="Dark light sensor by BUILDCIRCUIT, on Flickr"><img alt="Dark light sensor" class="lazy " data-original="http://farm9.staticflickr.com/8174/8012528853_c957595835.jpg" height="228" src="http://farm9.staticflickr.com/8174/8012528853_c957595835.jpg" style="border: 0px; display: inline; height: auto; max-width: 100%; vertical-align: middle;" width="500" /></a></div>
<div style="background-color: white; font-family: 'PT Sans', sans-serif; font-size: 13px; line-height: 19px; margin-bottom: 10.5px; text-align: justify;">
</div>
<div style="text-align: justify;">
<br /></div>
</div>
Anonymoushttp://www.blogger.com/profile/14732997283394377764noreply@blogger.com0tag:blogger.com,1999:blog-1660549699942964232.post-46839748412267380332014-04-04T11:45:00.001+05:302014-04-04T11:46:56.323+05:30Intel Galileo<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="background-color: white; box-sizing: border-box; color: #4f4e4e; font-family: 'TyponineSans Regular 18', 'Lucida Grande', Lucida, Verdana, sans-serif; line-height: 31.5px; margin-left: auto; margin-right: auto; padding: 0px; text-align: justify;">
Galileo is a microcontroller board based on the Intel® Quark <span class="wikiword" style="box-sizing: border-box;">SoC</span> X1000 Application Processor, a 32-bit Intel Pentium-class system on a chip. It’s the first board based on Intel® architecture designed to be hardware and software pin-compatible with Arduino shields designed for the Uno R3. Digital pins 0 to 13 (and the adjacent AREF and GND pins), Analog inputs 0 to 5, the power header, ICSP header, and the UART port pins (0 and 1), are all in the same locations as on the Arduino Uno R3. This is also known as the Arduino 1.0 pinout.</div>
<div style="background-color: white; box-sizing: border-box; color: #4f4e4e; font-family: 'TyponineSans Regular 18', 'Lucida Grande', Lucida, Verdana, sans-serif; line-height: 31.5px; margin-left: auto; margin-right: auto; padding: 0px; text-align: justify;">
Galileo is designed to support shields that operate at either 3.3V or 5V. The core operating voltage of Galileo is 3.3V. However, a jumper on the board enables voltage translation to 5V at the I/O pins. This provides support for 5V Uno shields and is the default behavior. By switching the jumper position, the voltage translation can be disabled to provide 3.3V operation at the I/O pins.</div>
<div style="background-color: white; box-sizing: border-box; color: #4f4e4e; font-family: 'TyponineSans Regular 18', 'Lucida Grande', Lucida, Verdana, sans-serif; line-height: 31.5px; margin-left: auto; margin-right: auto; padding: 0px; text-align: justify;">
Of course, the Galileo board is also software compatible with the Arduino Software Development Environment (IDE), which makes usability and introduction a snap. In addition to Arduino hardware and software compatibility, the Galileo board has several PC industry standard I/O ports and features to expand native usage and capabilities beyond the Arduino shield ecosystem. A full sized mini-PCI Express slot, 100Mb Ethernet port, Micro-SD slot, RS-232 serial port, USB Host port, USB Client port, and 8MByte NOR flash come standard on the board.</div>
<div style="background-color: white; box-sizing: border-box; color: #4f4e4e; font-family: 'TyponineSans Regular 18', 'Lucida Grande', Lucida, Verdana, sans-serif; line-height: 31.5px; margin-left: auto; margin-right: auto; padding: 0px; text-align: justify;">
<br /></div>
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><img src="http://arduino.cc/en/uploads/ArduinoCertified/IntelGalileo_fabD_Front.jpg" height="300" style="margin-left: auto; margin-right: auto;" width="400" /></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Intel Galileo</td></tr>
</tbody></table>
<div style="text-align: justify;">
<br /></div>
<h3 style="text-align: justify;">
Click the below link to buy</h3>
<div style="text-align: justify;">
http://www.adafruit.com/products/1637#Description</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
https://www.sparkfun.com/products/12720</div>
</div>
Anonymoushttp://www.blogger.com/profile/14732997283394377764noreply@blogger.com0tag:blogger.com,1999:blog-1660549699942964232.post-55392791156360416352013-09-04T17:42:00.001+05:302013-09-04T17:45:18.630+05:30Arduino BLUETOOTH Communication with PC<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Arial, Helvetica, sans-serif;">In this post ill show you how to connect arduino to your laptop via bluetooth connectivity. </span><br />
<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Arial, Helvetica, sans-serif;">Bluetooth is a wireless device which helps in sending and receiving data wirelessly. It is good for short range communication, range within 10mts. There are many bluetooth module out there in the market, but i am goin to use AUBTM-20 its a cheap bluetooth module. </span></div>
<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div dir="ltr" style="text-align: left;" trbidi="on">
<b><span style="font-family: Arial, Helvetica, sans-serif;">Parts you will need</span></b></div>
<div dir="ltr" style="text-align: left;" trbidi="on">
<b><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></b></div>
<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Arial, Helvetica, sans-serif;">A bluetooth module </span></div>
<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Arial, Helvetica, sans-serif;">An arduino</span></div>
<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Arial, Helvetica, sans-serif;">A laptop with bluetooth</span></div>
<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Arial, Helvetica, sans-serif;">Jumper wires</span></div>
<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Arial, Helvetica, sans-serif;">A led</span></div>
<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div dir="ltr" style="text-align: left;" trbidi="on">
<b><i><span style="font-family: Arial, Helvetica, sans-serif;">Connection</span></i></b></div>
<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Arial, Helvetica, sans-serif;">The fig. shows the connection between the bluetooth module and arduino. </span></div>
<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Arial, Helvetica, sans-serif;">RX pin from bluetooth module goes to the TX pin on arduino and vice versa. Since the data that is being transmitted from bluetooth module is being received by arduino, and vice versa. Therefore we always connect RX pin to TX pin. connect a led to pin 13 on arduino.</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br />
<img height="193" src="http://t3.gstatic.com/images?q=tbn:ANd9GcTmoXArC62MPqEKykATSyF715Xp2ugKrOuazh_efnsb7wUFrODASQ" width="400" /></span></div>
<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div dir="ltr" style="text-align: left;" trbidi="on">
<b><i><span style="font-family: Arial, Helvetica, sans-serif;">Level shifting</span></i></b></div>
<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Arial, Helvetica, sans-serif;">In some bluetooth module the data voltage is 3.3v and the data voltage on arduino is 5v, the 3.3v form TX pin of bluetooth to RX pin on arduino will not create any problem, but the 5v from TX pin of arduino to RX pin on bluetooth will burn the bluetooth chip. In order to protect this we need to shift the level of TX arduino pin to 3.3v. make this connection for TX arduino pin to make it work with the bluetooth.</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><img height="110" src="http://www.instructables.com/files/deriv/FMS/V245/H0OJ17O9/FMSV245H0OJ17O9.LARGE.jpg" width="200" /></span></div>
<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<b><i><span style="font-family: Arial, Helvetica, sans-serif;">Putty</span></i></b></div>
<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="background-color: white; font-weight: bold; line-height: 16px;">PuTTY</span><span style="background-color: white; line-height: 16px;"> is a free and open-source terminal emulator, we will use it to connect to the serial port.Download putty on your laptop. AFTER making all the connections and uploading the code to arduino, turn on the arduino and your laptop, from your laptop search for the bluetooth module and make the connection and note down the serial port for connetion.</span></span><br />
<span style="font-family: Arial, Helvetica, sans-serif; line-height: 16px;">open the putty software </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 16px;"><br /></span>
</span><br />
<ul style="text-align: left;">
<li><span style="font-family: Arial, Helvetica, sans-serif; line-height: 16px;">click on the serial button</span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif; line-height: 16px;">change the port to the bluetooth connection port</span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif; line-height: 16px;">click on open</span></li>
</ul>
<div>
<span style="font-family: Arial, Helvetica, sans-serif; line-height: 16px;">now when to press "1" you can see the led glow and when you press "0" the led will turn off.</span></div>
<div>
<span style="font-family: Arial, Helvetica, sans-serif; line-height: 16px;"><br /></span></div>
<div>
<span style="font-family: Arial, Helvetica, sans-serif; line-height: 16px;">Make use of this tutorial to make a HOME AUTOMATION system.</span></div>
<div>
<span style="font-size: x-small;"><span style="font-family: Arial, Helvetica, sans-serif; line-height: 16px;"><br /></span></span></div>
<div>
<span style="font-size: x-small;"><span style="font-family: Arial, Helvetica, sans-serif; line-height: 16px;"><br /></span></span></div>
<h3 style="text-align: left;">
<span style="font-size: x-small;"><span style="font-family: Arial, Helvetica, sans-serif; line-height: 16px;"><i>CODE</i></span></span></h3>
<div>
<span style="font-family: arial, sans-serif; font-size: x-small;"><span style="line-height: 16px;"><i><br /></i></span></span></div>
</div>
<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<br /></div>
</div>
<script src="https://gist.github.com/intexmo/6436017.js"></script></div>
Anonymoushttp://www.blogger.com/profile/14732997283394377764noreply@blogger.com0tag:blogger.com,1999:blog-1660549699942964232.post-981350917278195792013-09-01T15:22:00.002+05:302013-09-04T13:07:09.315+05:30Arduino Ping Sensor<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="background-color: white; color: #333333; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19.5px; margin-bottom: 0.8em; margin-top: 0.4em; padding: 0px;">
The PING)))™ Ultrasonic Distance Sensor is an all-in-one module for accurately measuring distances between itself and objects nearby. The effective range is from about 1 inch to 10 feet (2 centimeters to 3 meters). The PING))) sensor consumes only modest power, and is ideal for use in mobile robots, security systems, and any other application for detecting nearby objects, or measuring their distance from the sensor.</div>
<div style="background-color: white; color: #333333; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19.5px; margin-bottom: 0.8em; margin-top: 0.4em; padding: 0px;">
In operation, object detection or distance measurement is initiated by sending a short high frequency (40 kHz) tone from the PING))) module. The time it takes to detect the return echo represents the distance between the PING))) module and any objects in front of it. Using basic arithmetic, you can convert the amount of delay of the echo to inches or centimeters. The sound frequencies used in the sensor are in the ultrasonic range, and are beyond human hearing.</div>
<div style="background-color: white; color: #333333; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19.5px; margin-bottom: 0.8em; margin-top: 0.4em; padding: 0px;">
<img alt="PING))) Sensor diagram, emitting and listening for ultrasonic echo" height="164" src="http://learn.parallax.com/sites/default/files/content/kickstart/images/Ping-2.png" style="border: 0px; height: auto; max-width: 100%;" title="PING))) Sensor diagram, emitting and listening for ultrasonic echo" width="400" /></div>
<div style="background-color: white; color: #333333; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19.5px; margin-bottom: 0.8em; margin-top: 0.4em; padding: 0px;">
<br /></div>
<h3 style="text-align: left;">
Code & Schematic </h3>
<div>
<img height="248" src="http://www.instructables.com/files/deriv/FCG/RWVV/H7UR7RGD/FCGRWVVH7UR7RGD.LARGE.jpg" width="400" /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
Upload this code to arduino and open the serial monitor.</div>
<div>
kindly change the "pingpin" to pin no. 7 </div>
<div>
<br /></div>
</div>
<script src="https://gist.github.com/intexmo/6403392.js"></script></div>
Anonymoushttp://www.blogger.com/profile/14732997283394377764noreply@blogger.com0tag:blogger.com,1999:blog-1660549699942964232.post-34015716474250479182013-08-30T20:03:00.001+05:302013-08-30T20:03:39.578+05:30Arduino PIR sensor<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: left;">
<span style="line-height: 25px;"><span style="font-family: Arial, Helvetica, sans-serif;">In this simple project, we’ll build a motion-sensing alarm using a PIR (passive infrared) sensor and an Arduino microcontroller. This is a great way to learn the basics of using digital input (from the sensor) and output (in this case, to a noisy buzzer) on your Arduino.</span></span></div>
<div style="text-align: left;">
<span style="line-height: 22px;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></span></div>
<div style="text-align: left;">
<span style="line-height: 22px;"><span style="font-family: Arial, Helvetica, sans-serif;">This project requires just a few parts, and because you're using a solderless breadboard and pre-cut jumper wires, you won't need any tools at all — except your computer and USB cable to connect the Arduino.</span></span></div>
<div style="text-align: left;">
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 22px;">Connect digital input/output (I/O) pin 2 on the Arduino to row 1 on the breadboard.</span><span style="line-height: 22px;">Connect the 5V pin on the Arduino to row 2 on the breadboard, and connect a nearby ground (Gnd) pin to row 3.</span><span style="line-height: 22px;">Find the Gnd (–), Vcc (+), and Out pins on the PIR sensor.</span><span style="line-height: 22px;">Plug the PIR sensor into the breadboard so that its (–) pin connects to the Gnd row, its (+) pin connects to 5V, and its Out pin connects to digital pin 2. connect a 10k resistor between PIR output pin and vcc.</span></span></div>
<div style="text-align: left;">
<span style="color: #333333; font-family: proxima-nova, sans-serif; font-size: 16px; line-height: 22px;"><br /></span></div>
<div style="text-align: left;">
<img src="http://bildr.org/blog/wp-content/uploads/2011/06/PIR-Arduino_hookup-400x258.png?width=500" /></div>
<div style="text-align: left;">
<span style="color: #333333; font-family: proxima-nova, sans-serif; font-size: 16px; line-height: 22px;"><br /></span></div>
<div style="text-align: left;">
<span style="color: #333333; font-family: proxima-nova, sans-serif; font-size: 16px; line-height: 22px;"><br /></span></div>
<div style="text-align: left;">
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 22px;">Plug the LED's anode (the longer leg) into digital pin 13 on the Arduino.</span><span style="line-height: 22px;">Plug the LED's cathode (the shorter leg, and/or the leg on the flattened side of the LED base) into the adjacent ground (Gnd) pin on the Arduino.</span><span style="line-height: 22px;">Connect the buzzer's red wire to the Arduino's digital pin 10.</span><span style="line-height: 22px;">Connect the buzzer's black wire to the Arduino's Gnd pin (there's a spare one on the Power block of pins).</span><span style="line-height: 22px;">NOTE: These two wires can be reversed, as the polarity of the buzzer doesn't matter.</span></span></div>
<div style="text-align: left;">
<span style="color: #333333; font-family: proxima-nova, sans-serif; font-size: 16px; line-height: 22px;"><br /></span></div>
<h3 style="text-align: left;">
<span style="color: #333333; font-family: proxima-nova, sans-serif; font-size: 16px; line-height: 22px;">Code</span></h3>
<div>
<pre style="white-space: pre-wrap; word-wrap: break-word;">int ledPin = 13; // choose the pin for the LED
int inputPin = 2; // choose the input pin (for PIR sensor)
int pirState = LOW; // we start, assuming no motion detected
int val = 0; // variable for reading the pin status
int pinSpeaker = 10; //Set up a speaker on a PWM pin (digital 9, 10, or 11)
void setup() {
pinMode(ledPin, OUTPUT); // declare LED as output
pinMode(inputPin, INPUT); // declare sensor as input
pinMode(pinSpeaker, OUTPUT);
Serial.begin(9600);
}
void loop(){
val = digitalRead(inputPin); // read input value
if (val == HIGH) { // check if the input is HIGH
digitalWrite(ledPin, HIGH); // turn LED ON
playTone(300, 160);
delay(150);
if (pirState == LOW) {
// we have just turned on
Serial.println("Motion detected!");
// We only want to print on the output change, not state
pirState = HIGH;
}
} else {
digitalWrite(ledPin, LOW); // turn LED OFF
playTone(0, 0);
delay(300);
if (pirState == HIGH){
// we have just turned of
Serial.println("Motion ended!");
// We only want to print on the output change, not state
pirState = LOW;
}
}
}
// duration in mSecs, frequency in hertz
void playTone(long duration, int freq) {
duration *= 1000;
int period = (1.0 / freq) * 1000000;
long elapsed_time = 0;
while (elapsed_time < duration) {
digitalWrite(pinSpeaker,HIGH);
delayMicroseconds(period / 2);
digitalWrite(pinSpeaker, LOW);
delayMicroseconds(period / 2);
elapsed_time += (period);
}
}</pre>
<pre style="white-space: pre-wrap; word-wrap: break-word;">
</pre>
<pre style="white-space: pre-wrap; word-wrap: break-word;"><span style="font-family: Arial, Helvetica, sans-serif;">Upload the code to the arduino and test it.</span></pre>
<pre style="white-space: pre-wrap; word-wrap: break-word;"><span style="font-family: Arial, Helvetica, sans-serif;">Enjoy!!!!!!</span></pre>
</div>
</div>
Anonymoushttp://www.blogger.com/profile/14732997283394377764noreply@blogger.com0tag:blogger.com,1999:blog-1660549699942964232.post-36038587023892709392013-08-30T16:49:00.001+05:302013-08-30T16:49:03.091+05:30iPhone Arduino Push Notification<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="color: #333333; font-family: proxima-nova, sans-serif; font-size: 18px; line-height: 25px;">This project will help you to hack your doorbell to send Push notification and an email with an attached picture when somebody’s at the door. It use the free PushingBox service to delegate all the programming part and make things easy.</span><br />
<span style="color: #333333; font-family: proxima-nova, sans-serif; font-size: 18px; line-height: 25px;"><br /></span>
<h3 style="text-align: left;">
<span style="color: #333333; font-family: proxima-nova, sans-serif; font-size: medium;"><span style="font-weight: normal; line-height: 25px;"><i>How does it work</i></span></span></h3>
<div style="text-align: left;">
</div>
<ul style="line-height: 20px; margin: 20px 0px 20px 20px; padding: 0px;">
<li style="line-height: 22px; margin: 0px; padding: 0px;"><span style="font-family: Arial, Helvetica, sans-serif;">1. When the doorbell is pushed, the Arduino sends an HTTP request to the PushingBox API.</span></li>
</ul>
<ul style="line-height: 20px; margin: 20px 0px 20px 20px; padding: 0px;">
<li style="line-height: 22px; margin: 0px; padding: 0px;"><span style="font-family: Arial, Helvetica, sans-serif;">2. PushingBox launches the user's scenario and gets a picture from the web camera.</span></li>
</ul>
<ul style="line-height: 20px; margin: 20px 0px 20px 20px; padding: 0px;">
<li style="line-height: 22px; margin: 0px; padding: 0px;"><span style="font-family: Arial, Helvetica, sans-serif;">3. PushingBox sends a Push notification to the user's phone and a mail message with the picture attached.</span></li>
</ul>
<br />
<div>
<img alt="Notifying Doorbell with PushingBox" height="300" src="http://i2.wp.com/make-images.s3.amazonaws.com/uySNcpV3BRLi1dkB.jpg?resize=620%2C465" width="400" /></div>
<div>
<br /></div>
<h3 style="text-align: left;">
<br /></h3>
<div>
<div>
<div class="jstep hide" id="js-step-3" style="font-size: 16px; line-height: 20px; margin: 0px 0px 40px; padding: 0px;">
<span class="row" style="display: block; margin: 0px 0px 0px -20px; padding: 0px;"><br /><span class="span1" style="display: block; float: left; margin: 0px 0px 0px 20px; min-height: 1px; padding: 0px; width: 60px;"></span></span><span style="font-family: Arial, Helvetica, sans-serif;"><img alt="Notifying Doorbell with PushingBox" class="main 269399 0" data-src="http://make-images.s3.amazonaws.com/xdOUaHdwxHrSltQQ.jpg" height="300" src="http://i1.wp.com/make-images.s3.amazonaws.com/xdOUaHdwxHrSltQQ.jpg?resize=620%2C465" style="border: 0px; height: auto; margin: 0px; max-width: 100%; padding: 0px; vertical-align: middle;" width="400" /></span></div>
<div class="jstep hide" id="js-step-3" style="font-size: 16px; line-height: 20px; margin: 0px 0px 40px; padding: 0px;">
<ul style="margin: 20px 0px 20px 20px; padding: 0px;">
<li style="line-height: 22px; margin: 0px; padding: 0px;"><span style="font-family: Arial, Helvetica, sans-serif;">Open your doorbell.</span></li>
<li style="line-height: 22px; margin: 0px; padding: 0px;"><span style="font-family: Arial, Helvetica, sans-serif;">Solder wires to the button's terminals.</span></li>
<li style="line-height: 22px; margin: 0px; padding: 0px;"><span style="font-family: Arial, Helvetica, sans-serif;">Close the doorbell.</span></li>
</ul>
</div>
<div class="jstep hide" id="js-step-4" style="font-size: 16px; line-height: 20px; margin: 0px 0px 40px; padding: 0px;">
<span class="row" style="display: block; margin: 0px 0px 0px -20px; padding: 0px;"><br /><span class="span1" style="display: block; float: left; margin: 0px 0px 0px 20px; min-height: 1px; padding: 0px; width: 60px;"></span></span><span style="font-family: Arial, Helvetica, sans-serif;"><img alt="Notifying Doorbell with PushingBox" class="main 269399 0" data-src="http://make-images.s3.amazonaws.com/rvRMhPEgIsBdxSYZ.jpg" height="300" src="http://i1.wp.com/make-images.s3.amazonaws.com/rvRMhPEgIsBdxSYZ.jpg?resize=620%2C465" style="border: 0px; height: auto; margin: 0px; max-width: 100%; padding: 0px; vertical-align: middle;" width="400" /></span><ul style="margin: 20px 0px 20px 20px; padding: 0px;">
<li style="line-height: 22px; margin: 0px; padding: 0px;"><span style="font-family: Arial, Helvetica, sans-serif;">Plug the wires into the Arduino.</span></li>
<li style="line-height: 22px; margin: 0px; padding: 0px;"><span style="font-family: Arial, Helvetica, sans-serif;">One wire on the 5v pin;</span></li>
<li style="line-height: 22px; margin: 0px; padding: 0px;"><span style="font-family: Arial, Helvetica, sans-serif;">One wire on the 3rd input pin;</span></li>
<li style="line-height: 22px; margin: 0px; padding: 0px;"><span style="font-family: Arial, Helvetica, sans-serif;">The 10K resistor between GND and the 3rd pin.</span></li>
</ul>
</div>
<div class="jstep hide" id="js-step-5" style="font-size: 16px; line-height: 20px; margin: 0px 0px 40px; padding: 0px;">
<span class="row" style="display: block; margin: 0px 0px 0px -20px; padding: 0px;"><br /><span class="span1" style="display: block; float: left; margin: 0px 0px 0px 20px; min-height: 1px; padding: 0px; width: 60px;"></span></span><span style="font-family: Arial, Helvetica, sans-serif;"><img alt="Notifying Doorbell with PushingBox" class="main 269399 0" data-src="http://make-images.s3.amazonaws.com/pasWpYSVcofQhN5f.jpg" height="300" src="http://i2.wp.com/make-images.s3.amazonaws.com/pasWpYSVcofQhN5f.jpg?resize=620%2C465" style="border: 0px; height: auto; margin: 0px; max-width: 100%; padding: 0px; vertical-align: middle;" width="400" /></span><ul style="margin: 20px 0px 20px 20px; padding: 0px;">
<li style="line-height: 22px; margin: 0px; padding: 0px;"><span style="font-family: Arial, Helvetica, sans-serif;">Test the connectivity with a simple Arduino program.</span></li>
</ul>
</div>
<div class="jstep hide" id="js-step-6" style="font-size: 16px; line-height: 20px; margin: 0px 0px 40px; padding: 0px;">
<span class="row" style="display: block; margin: 0px 0px 0px -20px; padding: 0px;"><br /><span class="span1" style="display: block; float: left; margin: 0px 0px 0px 20px; min-height: 1px; padding: 0px; width: 60px;"></span></span><span style="font-family: Arial, Helvetica, sans-serif;"><img alt="Notifying Doorbell with PushingBox" class="main 269399 0" data-src="http://make-images.s3.amazonaws.com/g6kKlLMpSgKv5gyJ.jpg" height="300" src="http://i2.wp.com/make-images.s3.amazonaws.com/g6kKlLMpSgKv5gyJ.jpg?resize=620%2C465" style="border: 0px; height: auto; margin: 0px; max-width: 100%; padding: 0px; vertical-align: middle;" width="400" /></span><ul style="margin: 20px 0px 20px 20px; padding: 0px;">
<li style="line-height: 22px; margin: 0px; padding: 0px;"><span style="font-family: Arial, Helvetica, sans-serif;">The hardware part is finished. Let's define the way you will be notified.</span></li>
<li style="line-height: 22px; margin: 0px; padding: 0px;"><span style="font-family: Arial, Helvetica, sans-serif;">Go to <a href="http://www.pushingbox.com/" rel="nofollow" style="margin: 0px; padding: 0px; text-decoration: none;">http://www.pushingbox.com</a>.</span></li>
<li style="line-height: 22px; margin: 0px; padding: 0px;"><span style="font-family: Arial, Helvetica, sans-serif;">Login with your Google account.</span></li>
<li style="line-height: 22px; margin: 0px; padding: 0px;"><span style="font-family: Arial, Helvetica, sans-serif;">Go to the <span style="margin: 0px; padding: 0px;">My Services</span> page.</span></li>
<li style="line-height: 22px; margin: 0px; padding: 0px;"><span style="font-family: Arial, Helvetica, sans-serif;">Click on <span style="margin: 0px; padding: 0px;">Add a service</span>.</span></li>
</ul>
</div>
<div class="jstep hide" id="js-step-7" style="font-size: 16px; line-height: 20px; margin: 0px 0px 40px; padding: 0px;">
<span class="row" style="display: block; margin: 0px 0px 0px -20px; padding: 0px;"><br /><span class="span1" style="display: block; float: left; margin: 0px 0px 0px 20px; min-height: 1px; padding: 0px; width: 60px;"></span></span><span style="font-family: Arial, Helvetica, sans-serif;"><img alt="Notifying Doorbell with PushingBox" class="main 269399 0" data-src="http://make-images.s3.amazonaws.com/HfNV3AHBus3KWyt5.jpg" height="300" src="http://i2.wp.com/make-images.s3.amazonaws.com/HfNV3AHBus3KWyt5.jpg?resize=620%2C465" style="border: 0px; height: auto; margin: 0px; max-width: 100%; padding: 0px; vertical-align: middle;" width="400" /></span><ul style="margin: 20px 0px 20px 20px; padding: 0px;">
<li style="line-height: 22px; margin: 0px; padding: 0px;"><span style="font-family: Arial, Helvetica, sans-serif;">Click on the service by which you want be notified.</span></li>
<li style="line-height: 22px; margin: 0px; padding: 0px;"><span style="font-family: Arial, Helvetica, sans-serif;">Use <span style="margin: 0px; padding: 0px;">Prowl</span> or <span style="margin: 0px; padding: 0px;">Pushme.to</span> for iPhone Push notification;</span></li>
<li style="line-height: 22px; margin: 0px; padding: 0px;"><span style="font-family: Arial, Helvetica, sans-serif;"><span style="margin: 0px; padding: 0px;">Notifry</span> for Android Push notification;</span></li>
<li style="line-height: 22px; margin: 0px; padding: 0px;"><span style="font-family: Arial, Helvetica, sans-serif;"><span style="margin: 0px; padding: 0px;">Toasty</span> for Windows Phone Push notification.</span></li>
<li style="line-height: 22px; margin: 0px; padding: 0px;"><span style="font-family: Arial, Helvetica, sans-serif;">Enter the name of your new service and fill in the API that this application gave you when you installed it.</span></li>
<li style="line-height: 22px; margin: 0px; padding: 0px;"><span style="font-family: Arial, Helvetica, sans-serif;">Click <span style="margin: 0px; padding: 0px;">Submit</span>.</span></li>
</ul>
</div>
<div class="jstep hide" id="js-step-8" style="font-size: 16px; line-height: 20px; margin: 0px 0px 40px; padding: 0px;">
<span class="row" style="display: block; margin: 0px 0px 0px -20px; padding: 0px;"><br /><span class="span1" style="display: block; float: left; margin: 0px 0px 0px 20px; min-height: 1px; padding: 0px; width: 60px;"></span></span><span style="font-family: Arial, Helvetica, sans-serif;"><img alt="Notifying Doorbell with PushingBox" class="main 269399 0" data-src="http://make-images.s3.amazonaws.com/EPDJLCdSLCXHNUNK.jpg" height="300" src="http://i0.wp.com/make-images.s3.amazonaws.com/EPDJLCdSLCXHNUNK.jpg?resize=620%2C465" style="border: 0px; height: auto; margin: 0px; max-width: 100%; padding: 0px; vertical-align: middle;" width="400" /></span><span class="row smalls" style="display: block; margin: 10px 0px 0px -20px; padding: 0px;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></span><ul style="margin: 20px 0px 20px 20px; padding: 0px;">
<li style="line-height: 22px; margin: 0px; padding: 0px;"><span style="font-family: Arial, Helvetica, sans-serif;">Now, go to the <span style="margin: 0px; padding: 0px;">My Scenarios</span> page.</span></li>
<li style="line-height: 22px; margin: 0px; padding: 0px;"><span style="font-family: Arial, Helvetica, sans-serif;">Create a scenario called "Somebody's at the door".</span></li>
<li style="line-height: 22px; margin: 0px; padding: 0px;"><span style="font-family: Arial, Helvetica, sans-serif;">Click on <span style="margin: 0px; padding: 0px;">Create scenario</span>.</span></li>
<li style="line-height: 22px; margin: 0px; padding: 0px;"><span style="font-family: Arial, Helvetica, sans-serif;">Click on <span style="margin: 0px; padding: 0px;">Add an Action</span>.</span></li>
</ul>
</div>
<div class="jstep hide" id="js-step-9" style="font-size: 16px; margin: 0px 0px 40px; padding: 0px;">
<span class="row" style="display: block; line-height: 20px; margin: 0px 0px 0px -20px; padding: 0px;"><br /><span class="span1" style="display: block; float: left; margin: 0px 0px 0px 20px; min-height: 1px; padding: 0px; width: 60px;"></span></span><span style="height: auto; line-height: 20px;"><span style="font-family: Arial, Helvetica, sans-serif;"><img alt="Notifying Doorbell with PushingBox" class="main 269399 0" data-src="http://make-images.s3.amazonaws.com/DcdKIHvCZbUsUvbj.jpg" height="300" src="http://i1.wp.com/make-images.s3.amazonaws.com/Bfhn1vlAIwo1ZIpw.jpg?resize=620%2C465" style="border: 0px; height: auto; margin: 0px; max-width: 100%; padding: 0px; vertical-align: middle;" width="400" /></span></span><span class="row smalls" style="display: block; margin: 10px 0px 0px -20px; padding: 0px;"><span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 22px;"> </span><span style="line-height: 20px;">First, add an action using the Email Service.</span></span></span><ul style="line-height: 20px; margin: 20px 0px 20px 20px; padding: 0px;">
<li style="line-height: 22px; margin: 0px; padding: 0px;"><span style="font-family: Arial, Helvetica, sans-serif;">Fill in the mail Subject and the Body.</span></li>
<li style="line-height: 22px; margin: 0px; padding: 0px;"><span style="font-family: Arial, Helvetica, sans-serif;">The third field is optional and is for attaching a shot from your IP camera to the email. Fill in the URL (publicly reachable) of your web camera. The camera's output must be a picture less than 100KB in size.</span></li>
<li style="line-height: 22px; margin: 0px; padding: 0px;"><span style="font-family: Arial, Helvetica, sans-serif;">Do the same with your Push notification service and click the <span style="margin: 0px; padding: 0px;">Back</span> button.</span></li>
</ul>
</div>
<div class="jstep hide" id="js-step-10" style="font-size: 16px; line-height: 20px; margin: 0px 0px 40px; padding: 0px;">
<span class="row" style="display: block; margin: 0px 0px 0px -20px; padding: 0px;"><br /><span class="span1" style="display: block; float: left; margin: 0px 0px 0px 20px; min-height: 1px; padding: 0px; width: 60px;"></span></span><span style="font-family: Arial, Helvetica, sans-serif;"><img alt="Notifying Doorbell with PushingBox" class="main 269399 0" data-src="http://make-images.s3.amazonaws.com/aIwMibbeFusmXDSy.jpg" height="300" src="http://i1.wp.com/make-images.s3.amazonaws.com/aIwMibbeFusmXDSy.jpg?resize=620%2C465" style="border: 0px; height: auto; margin: 0px; max-width: 100%; padding: 0px; vertical-align: middle;" width="400" /></span><ul style="margin: 20px 0px 20px 20px; padding: 0px;">
<li style="line-height: 22px; margin: 0px; padding: 0px;"><span style="font-family: Arial, Helvetica, sans-serif;">Your scenario is now created.</span></li>
<li style="line-height: 22px; margin: 0px; padding: 0px;"><span style="font-family: Arial, Helvetica, sans-serif;">Click on "Test" to test the scenario.</span></li>
<li style="line-height: 22px; margin: 0px; padding: 0px;"><span style="font-family: Arial, Helvetica, sans-serif;">You should receive a Push notification on your phone and an email.</span></li>
<li style="line-height: 22px; margin: 0px; padding: 0px;"><span style="font-family: Arial, Helvetica, sans-serif;">Make a note of the "DeviceID" value of this scenario. You will paste it into the Arduino code.</span></li>
</ul>
</div>
<div class="jstep active" id="js-step-11" style="font-size: 16px; line-height: 20px; margin: 0px 0px 40px; padding: 0px;">
<span class="row" style="display: block; margin: 0px 0px 0px -20px; padding: 0px;"><br /></span><span style="height: auto;"><span style="font-family: Arial, Helvetica, sans-serif;"><img alt="Notifying Doorbell with PushingBox" class="main 269399 0" data-src="http://make-images.s3.amazonaws.com/XZPvtoYFX5je4WhM.jpg" height="300" src="http://i0.wp.com/make-images.s3.amazonaws.com/XZPvtoYFX5je4WhM.jpg?resize=620%2C465" style="border: 0px; height: auto; margin: 0px; max-width: 100%; padding: 0px; vertical-align: middle;" width="400" /></span></span><ul style="margin: 20px 0px 20px 20px; padding: 0px;">
<li style="line-height: 22px; margin: 0px; padding: 0px;"><span style="font-family: Arial, Helvetica, sans-serif;">Download the Arduino source code from the PushingBox API page and open it.</span></li>
<li style="line-height: 22px; margin: 0px; padding: 0px;"><span style="font-family: Arial, Helvetica, sans-serif;">In the <tt style="margin: 0px; padding: 0px;">#define DEVID1</tt> line, paste the DeviceID of your scenario. Make sure you enclose it in quotes as shown.</span></li>
<li style="line-height: 22px; margin: 0px; padding: 0px;"><span style="font-family: Arial, Helvetica, sans-serif;">Compile the code and program your Arduino.</span></li>
<li style="line-height: 22px; margin: 0px; padding: 0px;"><span style="font-family: Arial, Helvetica, sans-serif;">You're done! Test it</span></li>
</ul>
</div>
</div>
</div>
</div>
Anonymoushttp://www.blogger.com/profile/14732997283394377764noreply@blogger.com0tag:blogger.com,1999:blog-1660549699942964232.post-2837134361786786022013-08-30T13:46:00.001+05:302013-08-30T13:46:18.105+05:30Arduino Stepper motor Control<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="background-color: white; color: #525252; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 16.796875px;">Stepper motors fall somewhere in between a regular DC motor and a servo motor. They have the advantage that they can be positioned accurately, moved forward or backwards one 'step' at a time, but they can also rotate continuously.</span><br />
<div style="background-color: white; color: #525252; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 16.796875px; padding: 0px 0px 10px;">
The stepper motor has five leads, and we will be using both halves of the L293D this time. This means that there are a lot of connections to make on the breadboard.</div>
<div style="background-color: white; color: #525252; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 16.796875px; padding: 10px 0px 0px;">
The motor has a 5-way socket on the end. Push jumper wires into the sockets to allow the motor to be connected to the breadboard.</div>
<div style="background-color: white; color: #525252; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 16.796875px; padding: 10px 0px 0px;">
Note that the red lead of the Stepper motor is not connected to anything.</div>
<div style="background-color: white; color: #525252; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 16.796875px; padding: 10px 0px 0px;">
<img alt="fritzing.jpg" height="374" src="http://learn.adafruit.com/system/assets/assets/000/002/495/medium800/fritzing.jpg?1351683920" width="400" /></div>
<div style="background-color: white; color: #525252; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 16.796875px; padding: 10px 0px 0px;">
The following sketch uses the Serial Monitor, so once the sketch is installed and running, open the Serial Monitor and enter a number of 'steps'. Try a value of about 500, this should cause the motor to turn through about 360 degrees. Enter -500 and it will turn back in the reverse direction.</div>
<h3 style="text-align: left;">
Code</h3>
<div>
<div>
#include <Stepper.h></div>
<div>
<br /></div>
<div>
int in1Pin = 12;</div>
<div>
int in2Pin = 11;</div>
<div>
int in3Pin = 10;</div>
<div>
int in4Pin = 9;</div>
<div>
<br /></div>
<div>
Stepper motor(768, in1Pin, in2Pin, in3Pin, in4Pin); </div>
<div>
<br /></div>
<div>
void setup()</div>
<div>
{</div>
<div>
pinMode(in1Pin, OUTPUT);</div>
<div>
pinMode(in2Pin, OUTPUT);</div>
<div>
pinMode(in3Pin, OUTPUT);</div>
<div>
pinMode(in4Pin, OUTPUT);</div>
<div>
<br /></div>
<div>
// this line is for Leonardo's, it delays the serial interface</div>
<div>
// until the terminal window is opened</div>
<div>
while (!Serial);</div>
<div>
</div>
<div>
Serial.begin(9600);</div>
<div>
motor.setSpeed(20);</div>
<div>
}</div>
<div>
<br /></div>
<div>
void loop()</div>
<div>
{</div>
<div>
if (Serial.available())</div>
<div>
{</div>
<div>
int steps = Serial.parseInt();</div>
<div>
motor.step(steps);</div>
<div>
}</div>
<div>
}</div>
</div>
<div>
<br /></div>
<div>
<div style="background-color: white; color: #525252; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 16.796875px; padding: 10px 0px;">
In this tutorial, we do not use the common Red connection. This connection is only provided if you are using a different type of drive circuit that does not allow the current in each coil to be reversed. Having a center connection to each coil means that you can either energise the left or right side of the coil, and get the effect of reversing the current flow without having to use a circuit that can reverse the current.</div>
<div style="background-color: white; color: #525252; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 16.796875px; padding: 10px 0px 0px;">
Since we are using a L293D that is very good at reversing the current, we do not need this common connection, we can supply current in either direction to the whole of each of the coils.</div>
</div>
</div>
Anonymoushttp://www.blogger.com/profile/14732997283394377764noreply@blogger.com0tag:blogger.com,1999:blog-1660549699942964232.post-49713183367725424752013-08-30T13:38:00.001+05:302013-08-30T13:38:47.188+05:30Arduino servo Control<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="background-color: white; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 16.796875px; padding: 0px 0px 10px;">
The servo motor has three leads. The color of the leads varies between servo motors, but the red lead is always 5V and GND will either be black or brown. The other lead is the control lead and this is usually orange or yellow. This control lead is connected to digital pin 9.</div>
<div style="background-color: white; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 16.796875px; padding: 10px 0px 0px;">
The servo is conveniently terminated in a socket into which we can push jumper wires, to link it to the breadboard and then to the Arduino.</div>
<div style="background-color: white; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 16.796875px; padding: 10px 0px 0px;">
<img alt="fritzing_sweep.jpg" height="217" src="http://learn.adafruit.com/system/assets/assets/000/002/310/medium800/fritzing_sweep.jpg?1350557132" width="400" /></div>
<h3 style="text-align: left;">
If servo Misbehaves</h3>
<div>
<div style="background-color: white; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 16.796875px; padding: 0px 0px 10px;">
Your servo may behave erratically, and you may find that this only happens when the Arduino is plugged into certain USB ports. This is because the servo draws quite a lot of power, especially as the motor is starting up, and this sudden high demand can be enough to drop the voltage on the Arduino board, so that it resets itself.</div>
<div style="background-color: white; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 16.796875px; padding: 10px 0px 0px;">
If this happens, then you can usually cure it by adding a high value capacitor (470uF or greater) between GND and 5V on the breadboard.</div>
<div style="background-color: white; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 16.796875px; padding: 0px 0px 10px;">
The capacitor acts as a reservoir of electricity for the motor to use, so that when it starts, it takes charge from the capacitor as well as the Arduino supply.</div>
<div style="background-color: white; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 16.796875px; padding: 10px 0px 0px;">
The longer lead of the capacitor is the positive lead and this should be connected to 5V. The negative lead is also often marked with a '-' symbol.</div>
<div style="background-color: white; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 16.796875px; padding: 0px 0px 10px;">
Load up the following sketch onto your Arduino. You should find that the servo immediately begins to turn first in one direction and then back in the other.</div>
<div style="background-color: white; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 16.796875px; padding: 10px 0px 0px;">
The sketch is based on the standard 'sweep' sketch that you can find in the Arduino Examples under the folder 'servo'.</div>
<div style="background-color: white; padding: 10px 0px 0px;">
<br /></div>
<div style="background-color: white; padding: 10px 0px 0px;">
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="font-size: 14px; line-height: 16.796875px;"><br /></span></span></div>
<div style="background-color: white; padding: 10px 0px 0px;">
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="font-size: 14px; line-height: 16.796875px;">#include <Servo.h> </span></span></div>
<div style="background-color: white; padding: 10px 0px 0px;">
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="font-size: 14px; line-height: 16.796875px;"><br /></span></span></div>
<div style="background-color: white; padding: 10px 0px 0px;">
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="font-size: 14px; line-height: 16.796875px;">int servoPin = 9;</span></span></div>
<div style="background-color: white; padding: 10px 0px 0px;">
<span style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 16.796875px;">Servo servo; </span></div>
<div style="background-color: white; padding: 10px 0px 0px;">
<span style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 16.796875px;">int angle = 0; // servo position in degrees </span></div>
<div style="background-color: white; padding: 10px 0px 0px;">
<span style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 16.796875px;">void setup() </span></div>
<div style="background-color: white; padding: 10px 0px 0px;">
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="font-size: 14px; line-height: 16.796875px;">{ </span></span></div>
<div style="background-color: white; padding: 10px 0px 0px;">
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="font-size: 14px; line-height: 16.796875px;"> servo.attach(servoPin); </span></span></div>
<div style="background-color: white; padding: 10px 0px 0px;">
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="font-size: 14px; line-height: 16.796875px;">} </span></span></div>
<div style="background-color: white; padding: 10px 0px 0px;">
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="font-size: 14px; line-height: 16.796875px;"> </span></span><span style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 16.796875px;">void loop() </span></div>
<div style="background-color: white; padding: 10px 0px 0px;">
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="font-size: 14px; line-height: 16.796875px;">{ </span></span></div>
<div style="background-color: white; padding: 10px 0px 0px;">
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="font-size: 14px; line-height: 16.796875px;"> // scan from 0 to 180 degrees</span></span></div>
<div style="background-color: white; padding: 10px 0px 0px;">
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="font-size: 14px; line-height: 16.796875px;"> for(angle = 0; angle < 180; angle++) </span></span></div>
<div style="background-color: white; padding: 10px 0px 0px;">
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="font-size: 14px; line-height: 16.796875px;"> { </span></span></div>
<div style="background-color: white; padding: 10px 0px 0px;">
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="font-size: 14px; line-height: 16.796875px;"> servo.write(angle); </span></span></div>
<div style="background-color: white; padding: 10px 0px 0px;">
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="font-size: 14px; line-height: 16.796875px;"> delay(15); </span></span></div>
<div style="background-color: white; padding: 10px 0px 0px;">
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="font-size: 14px; line-height: 16.796875px;"> } </span></span></div>
<div style="background-color: white; padding: 10px 0px 0px;">
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="font-size: 14px; line-height: 16.796875px;"> // now scan back from 180 to 0 degrees</span></span></div>
<div style="background-color: white; padding: 10px 0px 0px;">
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="font-size: 14px; line-height: 16.796875px;"> for(angle = 180; angle > 0; angle--) </span></span></div>
<div style="background-color: white; padding: 10px 0px 0px;">
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="font-size: 14px; line-height: 16.796875px;"> { </span></span></div>
<div style="background-color: white; padding: 10px 0px 0px;">
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="font-size: 14px; line-height: 16.796875px;"> servo.write(angle); </span></span></div>
<div style="background-color: white; padding: 10px 0px 0px;">
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="font-size: 14px; line-height: 16.796875px;"> delay(15); </span></span></div>
<div style="background-color: white; padding: 10px 0px 0px;">
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="font-size: 14px; line-height: 16.796875px;"> } </span></span></div>
<div style="background-color: white; padding: 10px 0px 0px;">
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="font-size: 14px; line-height: 16.796875px;">} </span></span></div>
<div style="background-color: white; padding: 10px 0px 0px;">
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="font-size: 14px; line-height: 16.796875px;"><br /></span></span></div>
<div style="background-color: white; padding: 10px 0px 0px;">
<span style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 16.796875px;">Servo motors are controlled by a series of pulses and to make it easy to use them, an Arduino library has been created so that you can just instruct the servo to turn to a particular angle.</span></div>
<div style="background-color: white; padding: 10px 0px 0px;">
<span style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 16.796875px;"><br /></span></div>
<h3 style="text-align: left;">
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="font-size: 14px; line-height: 16.796875px;">Arduino SERVO knob</span></span></h3>
</div>
<div>
<span style="background-color: white; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 16.796875px;">You just need to add the pot and a lead from its slider to A0 on the Arduino</span></div>
<div>
<span style="background-color: white; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 16.796875px;"><br /></span></div>
<div>
<img alt="fritzing_knob.jpg" height="217" src="http://learn.adafruit.com/system/assets/assets/000/002/312/medium800/fritzing_knob.jpg?1350557495" width="400" /></div>
<div>
<br /></div>
<div>
<div>
<br /></div>
<div>
#include <Servo.h> </div>
<div>
<br /></div>
<div>
int potPin = 0; </div>
<div>
int servoPin = 9;</div>
<div>
Servo servo; </div>
<div>
</div>
<div>
void setup() </div>
<div>
{ </div>
<div>
servo.attach(servoPin); </div>
<div>
} </div>
<div>
</div>
<div>
void loop() </div>
<div>
{ </div>
<div>
int reading = analogRead(potPin); // 0 to 1023</div>
<div>
int angle = reading / 6; // 0 to 180-ish</div>
<div>
servo.write(angle); </div>
<div>
} </div>
</div>
<div>
<br /></div>
<div>
<div style="background-color: white; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 16.796875px; padding: 0px 0px 10px;">
There is now a second variable called 'potPin'.</div>
<div style="background-color: white; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 16.796875px; padding: 10px 0px 0px;">
To set the position of the servo, we take an analog reading from A0. This gives us a value of between 0 and 1023. Since the servo can only rotate through 180 degrees, we need to scale this down. Dividing it by six will give us an angle between 0 and 170, which will do just fine.</div>
<div style="background-color: white; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 16.796875px; padding: 10px 0px 0px;">
<br /></div>
<div style="background-color: white; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 16.796875px; padding: 10px 0px 0px;">
The position of the servo motor is set by the length of a pulse. The servo expects to receive a pulse roughly every 20 milliseconds. If that pulse is high for 1 millisecond, then the servo angle will be zero, if it is 1.5 milliseconds, then it will be at its centre position and if it is 2 milliseconds it will be at 180 degrees.The end points of the servo can vary and many servos only turn through about 170 degrees. You can also buy 'continuous' servos that can rotate through the full 360 degrees.</div>
</div>
</div>
Anonymoushttp://www.blogger.com/profile/14732997283394377764noreply@blogger.com0tag:blogger.com,1999:blog-1660549699942964232.post-14788064124642693072013-08-29T13:14:00.002+05:302013-08-29T13:14:56.194+05:30Raspberry Pi<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: left;">
<span style="background-color: white;"><span style="font-family: Arial, Helvetica, sans-serif;">The Raspberry Pi is a single-board computer developed in the UK by the Raspberry Pi Foundation with the intention of stimulating the teaching of basic computer science in schools. The Raspberry Pi is a credit-card sized computer that plugs into your TV and a keyboard. It’s a capable little PC which can be used for many of the things that your desktop PC does, like spreadsheets, word-processing and games. It also plays high-definition video. The design is based around a Broadcom BCM2835 SoC, which includes an ARM1176JZF-S 700 MHz processor, VideoCore IV GPU, and 128 or 256 Megabytes of RAM. The design does not include a built-in hard disk or solid-state drive, instead relying on an SD card for booting and long-term storage. This board is intended to run Linux kernel based operating systems.</span></span></div>
<span style="background-color: white; font-family: verdana, arial, helvetica, sans-serif; font-size: 11px;"><br /></span>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><img alt="Raspberry Pi Model B 512MB RAM" height="246" src="http://www.adafruit.com/images/medium/998_MED.jpg" style="margin-left: auto; margin-right: auto;" width="320" /></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Raspberry Pi</td></tr>
</tbody></table>
</div>
Anonymoushttp://www.blogger.com/profile/14732997283394377764noreply@blogger.com0tag:blogger.com,1999:blog-1660549699942964232.post-18055101590090019752013-08-20T17:01:00.002+05:302013-08-20T17:02:48.074+05:30Power Supply for Breadboard<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: justify;">
<span style="background-color: white;"><span style="font-family: Arial, Helvetica, sans-serif;">Embedded systems require electric power to operate. Most of the components in them including the processors can operate at a wide range of voltages. For example, the operating voltage range for PIC16F688 is from 2 to 5.5 V. It means you can supply power from three AA size batteries (4.5 V) and it will work just fine as long as the battery voltage doesn’t fall below 2 V. But there are certain applications where you need a regulated constant voltage for safer operation of the embedded system. For instance, any application that uses analog-to-digital converters (ADCs). ADCs require a fixed reference voltage to provide accurate digital count for input analog signal. If the reference voltage is not stable, the ADC output is meaningless. So, today we are going to make a regulated +5V power source for our lab.</span></span></div>
<div style="text-align: justify;">
<span style="background-color: white;"><span style="font-family: Arial, Helvetica, sans-serif;">An LM7805 linear regulator IC is used for this purpose. It converts a DC input voltage of range 7-25 V to a stable +5 V. It requires just two external capacitors and is very easy to use, as shown below.</span></span></div>
<div style="text-align: justify;">
<a href="http://embedded-lab.com/blog/wp-content/uploads/2010/10/PowerS.jpg" style="background-color: white; border: 0px; text-decoration: none;"><span style="color: black; font-family: Arial, Helvetica, sans-serif;"><img alt="" class="aligncenter size-medium wp-image-288" src="http://embedded-lab.com/blog/wp-content/uploads/2010/10/PowerS-500x213.jpg" height="213" style="border: none; margin: 0px; padding: 0px;" title="PowerS" width="500" /></span></a></div>
<div style="text-align: justify;">
<span style="background-color: white;"><span style="font-family: Arial, Helvetica, sans-serif;">The input DC voltage for LM7805 could be obtained from a 9V DC wall adapter that can supply 1 Amp of load current. Actually, 12 to 24 V adapter will work too, but the LM7805 regulator dissipates an extreme amount of heat energy at higher input voltages and, therefore, requires a bulky heat sink. The wall adapter is chosen because it is cheap, easily available (you might already have got a spare one at home), and safe (the high voltage mains AC is isolated). You can solder this circuit on a general purpose prototyping board.</span></span></div>
<br /></div>
Anonymoushttp://www.blogger.com/profile/14732997283394377764noreply@blogger.com0tag:blogger.com,1999:blog-1660549699942964232.post-77664518252886851192013-08-20T15:51:00.001+05:302013-08-20T15:51:33.601+05:30Radio Frequency(RF) Module <div dir="ltr" style="text-align: left;" trbidi="on">
<div style="color: #474747; font-family: Arial, Verdana; font-size: 14px; line-height: 20px; text-align: justify;">
<span style="background-color: white;">This example uses HT12E/D encoder-decoder pair for converting the parallel data to serial and back.</span></div>
<span style="background-color: white;"><br style="color: #474747; font-family: Arial, Verdana; font-size: 14px; line-height: 20px; text-align: justify;" /></span>
<div class="separator" style="clear: both; color: #474747; font-family: Arial, Verdana; font-size: 14px; line-height: 20px; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguG5mJNy0P_9Po_vbmpopWOVw9U80qTzBrEmplsVwMH-6q7yB7gO0QSkjCbAKnERm-PKwZWdnKoaJiPS1pDlrsH0jsP7YLuAb8trWeBwfarcSBQGWD1J78bE6kCVgBEPgpPPB0b2fR_Vnb/s1600/RF+MODULE.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguG5mJNy0P_9Po_vbmpopWOVw9U80qTzBrEmplsVwMH-6q7yB7gO0QSkjCbAKnERm-PKwZWdnKoaJiPS1pDlrsH0jsP7YLuAb8trWeBwfarcSBQGWD1J78bE6kCVgBEPgpPPB0b2fR_Vnb/s1600/RF+MODULE.JPG" height="240" width="320" /></a></div>
<span style="background-color: white;"><br style="color: #474747; font-family: Arial, Verdana; font-size: 14px; line-height: 20px; text-align: justify;" /></span><br />
<div style="color: #474747; font-family: Arial, Verdana; font-size: 14px; line-height: 20px; text-align: justify;">
<span style="background-color: white;">This encoder-decoder pair supports 4 bit parallel data.The circuit has two parts transmitter and receiver. In the transmitter part we are using HT12E for encoding data from parallel to serial. The serial output from the from the encoder is fed to the data IN of the RF transmitter. Four switches namely SW0,SW1,SW2,SW3 are used to input data to the decoder. These switches are pushbutton switches with active low states.(i.e.when you press it, the data input will be '0' and in the released state data input will be '1'. The default state is '1').</span></div>
<div style="color: #474747; font-family: Arial, Verdana; font-size: 14px; line-height: 20px; text-align: justify;">
<span style="background-color: white;"><br /></span></div>
<div style="color: #474747; font-family: Arial, Verdana; font-size: 14px; line-height: 20px; text-align: justify;">
<span style="background-color: white;">At the receiver section we are having RF receiver and HT12D decoder IC. The serial data from the receiver is fed into to serial input of the decoder. The parallel data is displayed with the help of LED's .</span></div>
<div style="color: #474747; font-family: Arial, Verdana; font-size: 14px; line-height: 20px; text-align: justify;">
<span style="background-color: white;"><br /></span></div>
<div style="color: #474747; font-family: Arial, Verdana; font-size: 14px; line-height: 20px; text-align: justify;">
<span style="background-color: white;">Another LED at the pin VT of the decoder shows whether your link is established or not. If it is ON then everything is OK. Instead if it is permanently OFF, then there is a link failure. You may refer the data sheet of the IC to know the exact function of pin VT. After each successful transmission of a 4-bit data, VT pin goes to a low state for a while and will come back to high state. Thus during the transmission you may see the LED at pin VT blinking.</span></div>
<div style="color: #474747; font-family: Arial, Verdana; font-size: 14px; line-height: 20px; text-align: justify;">
<span style="background-color: white;"><br /></span></div>
<div style="color: #474747; font-family: Arial, Verdana; font-size: 14px; line-height: 20px; text-align: justify;">
<b><span class="Apple-style-span" style="background-color: white; color: #990000;">Troubleshooting:</span></b></div>
<div style="color: #474747; font-family: Arial, Verdana; font-size: 14px; line-height: 20px; text-align: justify;">
<span style="background-color: white;"><br /></span></div>
<div style="color: #474747; font-family: Arial, Verdana; font-size: 14px; line-height: 20px; text-align: justify;">
<span style="background-color: white;">If your circuit is not working, just remove the RF transmitter and receiver and make a wired connection from the serial data OUT of the HT12E encoder to the serial data IN of the HT12D decoder. Now check whether you could receive the data send from the encoder to decoder. If it is not working, you can conclude that problem is with the encoder/decoder pair. Either there will be some bugs in the circuit or your IC's might be damaged ones.</span></div>
</div>
Anonymoushttp://www.blogger.com/profile/14732997283394377764noreply@blogger.com0tag:blogger.com,1999:blog-1660549699942964232.post-53394717455857090402013-08-19T15:07:00.003+05:302013-08-19T15:07:46.318+05:30L293D Motor Driver<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="background-color: white; color: #333333; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 1.5em; padding: 2px 0px 0px 39.890625px; text-align: justify;">
Generally, even the simplest robot requires a motor to rotate a wheel or performs particular action. <img align="right" alt="Motor Control using NPN Transistor" height="144" src="http://www.robotplatform.com/howto/L293/img_s/transistor_motor_control.jpg" style="border: 0px; padding: 0px 3px 3px;" width="188" />Since motors require more current then the microcontroller pin can typically generate, you need some type of a switch (Transistors, MOSFET, Relay etc.,) which can accept a small current, amplify it and generate a larger current, which further drives a motor. This entire process is done by what is known as a <strong>motor driver</strong>.</div>
<div style="background-color: white; color: #333333; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 1.5em; padding: 2px 0px 0px 39.890625px; text-align: justify;">
Motor driver is basically a current amplifier which takes a low-current signal from the microcontroller and gives out a proportionally higher current signal which can control and drive a motor. In most cases, a transistor can act as a switch and perform this task which drives the motor in a single direction.</div>
<div style="background-color: white; color: #333333; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 1.5em; padding: 2px 0px 0px 39.890625px; text-align: justify;">
Turning a motor ON and OFF requires only one switch to control a single motor in a single direction. What if you want your motor to reverse its direction? The simple answer is to reverse its polarity. This can be achieved by using four switches that are arranged in an intelligent manner such that the circuit not only drives the motor, but also controls its direction. Out of many, one of the most common and clever design is a H-bridge circuit where transistors are arranged in a shape that resembles the English alphabet "H".<img align="right" alt="H-bridge" height="228" src="http://www.robotplatform.com/howto/L293/img_s/h-bridge.jpg" style="border: 0px; padding: 0px 3px 3px;" width="121" /></div>
<div style="background-color: white; color: #333333; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 1.5em; padding: 2px 0px 0px 39.890625px; text-align: justify;">
As you can see in the image, the circuit has four switches A, B, C and D. Turning these switches ON and OFF can drive a motor in different ways.</div>
<ol style="background-color: white; color: #333333; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; padding-left: 79.78125px; text-align: justify;">
<li>Turning on Switches <strong>A</strong> and <strong>D</strong> makes the motor rotate clockwise</li>
<li>Turning on Switches <strong>B</strong> and <strong>C</strong> makes the motor rotate anti-clockwise</li>
<li>Turning on Switches <strong>A</strong> and <strong>B</strong> will stop the motor (Brakes)</li>
<li>Turning off all the switches gives the motor a free wheel drive</li>
<li>Lastly turning on <strong>A</strong> &<strong> C</strong> at the same time or<strong> B</strong> & <strong>D</strong> at the same time shorts your entire circuit. So, do not attempt this.</li>
</ol>
<div style="background-color: white; color: #333333; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 1.5em; padding: 2px 0px 0px 39.890625px; text-align: justify;">
H-bridges can be built from scratch using relays, mosfets, field effect transistors (FET), bi-polar junction transistors (BJT), etc. But if your current requirement is not too high and all you need is a single package which does the job of driving a small DC motor in two directions, then all you need is a L293D IC. This single inexpensive package can interface not one, but two DC motors. L293, L293B and few other versions also does the same job, but pick the L293D version as this one has an inbuilt flyback diode which protects the driving transistors from voltage spikes that occur when the motor coil is turned off.</div>
<div style="background-color: white; color: #333333; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 1.5em; padding: 2px 0px 0px 39.890625px; text-align: justify;">
<br /></div>
<div style="background-color: white; clear: both; color: #333333; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; margin-left: 0px; padding: 0px; text-align: justify;">
<h5 style="font-size: 1.1em; padding: 2px 0px 2px 31.90625px;">
<strong>Introduction</strong> to L293D IC<a href="http://www.robotplatform.com/howto/L293/img_l/L293D_Skeleton.jpg" target="_blank"><img align="right" alt="L293D Skeleton" height="181" src="http://www.robotplatform.com/howto/L293/img_s/l293d_Skeleton.gif" style="border: 0px; padding: 0px 3px 3px;" width="177" /></a></h5>
<div style="line-height: 1.5em; padding: 2px 0px 0px 39.890625px;">
L293D IC generally comes as a standard 16-pin DIP (dual-in line package). This motor driver IC can simultaneously control two small motors in either direction; forward and reverse with just 4 microcontroller pins (if you do not use enable pins). Some of the features (and drawbacks) of this IC are:</div>
<ol style="padding-left: 79.78125px;">
<li>Output current capability is limited to 600mA per channel with peak output current limited to 1.2A (non-repetitive). This means you cannot drive bigger motors with this IC. However, most small motors used in hobby robotics should work. If you are unsure whether the IC can handle a particular motor, connect the IC to its circuit and run the motor with your finger on the IC. If it gets really hot, then beware... Also note the words "non-repetitive"; if the current output repeatedly reaches 1.2A, it might destroy the drive transistors.</li>
<li>Supply voltage can be as large as 36 Volts. This means you do not have to worry much about voltage regulation.</li>
<li>L293D has an enable facility which helps you enable the IC output pins. If an enable pin is set to logic high, then state of the inputs match the state of the outputs. If you pull this low, then the outputs will be turned off regardless of the input states</li>
<li>The datasheet also mentions an "over temperature protection" built into the IC. This means an internal sensor senses its internal temperature and stops driving the motors if the temperature crosses a set point</li>
<li>Another major feature of <strong>L293D</strong> is its internal clamp diodes. This flyback diode helps protect the driver IC from voltage spikes that occur when the motor coil is turned on and off (mostly when turned off)</li>
<li>The logical low in the IC is set to 1.5V. This means the pin is set high only if the voltage across the pin crosses 1.5V which makes it suitable for use in high frequency applications like switching applications (upto 5KHz)</li>
<li>Lastly, this integrated circuit not only drives DC motors, but can also be used to drive relay solenoids, stepper motors etc.</li>
</ol>
</div>
<div style="background-color: white; color: #333333; float: right; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; margin: 10px; padding: 0px; text-align: justify;">
</div>
<h5 style="background-color: white; color: #333333; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 1.1em; padding: 2px 0px 2px 31.90625px; text-align: justify;">
L293D Connections</h5>
<div style="background-color: white; color: #333333; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 1.5em; padding: 2px 0px 0px 39.890625px; text-align: justify;">
The circuit shown to the right is the most basic implementation of L293D IC. There are 16 pins sticking out of this IC and we have to understand the functionality of each pin before implementing this in a circuit</div>
<ol style="background-color: white; color: #333333; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; padding-left: 79.78125px; text-align: justify;">
<li>Pin1 and Pin9 are "Enable" pins. They should be connected to +5V for the drivers to function. If they pulled low (GND), then the outputs will be turned off regardless of the input states, stopping the motors. If you have two spare pins in your microcontroller, connect these pins to the microcontroller, or just connect them to regulated positive 5 Volts.</li>
<li>Pin4, Pin5, Pin12 and Pin13 are ground pins which should ideally be connected to microcontroller's ground.</li>
<li>Pin2, Pin7, Pin10 and Pin15 are logic input pins. These are control pins which should be connected to microcontroller pins. Pin2 and Pin7 control the first motor (left); Pin10 and Pin15 control the second motor(right).</li>
<li>Pin3, Pin6, Pin11, and Pin14 are output pins. Tie Pin3 and Pin6 to the first motor, Pin11 and Pin14 to second motor</li>
<li>Pin16 powers the IC and it should be connected to <strong>regulated</strong> +5Volts</li>
<li>Pin8 powers the two motors and should be connected to positive lead of a secondary battery. As per the datasheet, supply voltage can be as high as 36 Volts.</li>
</ol>
<h5 style="background-color: white; color: #333333; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 1.1em; padding: 2px 0px 2px 31.90625px; text-align: justify;">
<img height="400" src="http://www.robotplatform.com/howto/L293/img_l/L293D_connections.jpg" width="331" /></h5>
<h5 style="background-color: white; color: #333333; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 1.1em; padding: 2px 0px 2px 31.90625px; text-align: justify;">
Truth table</h5>
<div style="background-color: white; color: #333333; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 1.5em; padding: 2px 0px 0px 39.890625px; text-align: justify;">
I have shown you where to connect the motors, battery and the <a href="http://www.robotplatform.com/electronics/microcontroller/microcontroller.html" style="color: green; font-size: 1em;">microcontroller</a>. But how do we control the direction of these motors? Let us take an example:</div>
<div style="background-color: white; color: #333333; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 1.5em; padding: 2px 0px 0px 39.890625px; text-align: justify;">
Suppose you need to control the left motor which is connected to Pin3 (O1) and Pin6 (O2). As mentioned above, we require three pins to control this motor - Pin1 (E1), Pin2 (I1) and Pin7 (I2). Here is the truth table representing the functionality of this motor driver.</div>
<table id="headertable" style="background-color: white; color: #333333; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; font-weight: bold; margin: 5px 5px 5px 39.890625px; text-align: center; width: 84%px;"><tbody>
<tr><td id="row-header" style="background-color: #999999; border: thin solid rgb(102, 102, 102); color: black; font-weight: normal;" width="12%">Pin 1</td><td id="row-header" style="background-color: #999999; border: thin solid rgb(102, 102, 102); color: black; font-weight: normal;" width="12%">Pin 2</td><td id="row-header" style="background-color: #999999; border: thin solid rgb(102, 102, 102); color: black; font-weight: normal;" width="12%">Pin 7</td><td id="row-header" style="background-color: #999999; border: thin solid rgb(102, 102, 102); color: black; font-weight: normal;" width="48%">Function</td></tr>
<tr><td align="center" style="border: thin solid rgb(102, 102, 102);" valign="middle">High</td><td align="center" style="border: thin solid rgb(102, 102, 102);" valign="middle">High</td><td align="center" style="border: thin solid rgb(102, 102, 102);" valign="middle">Low</td><td style="border: thin solid rgb(102, 102, 102);">Turn Anti-clockwise (Reverse)</td></tr>
<tr><td align="center" style="border: thin solid rgb(102, 102, 102);" valign="middle">High</td><td align="center" style="border: thin solid rgb(102, 102, 102);" valign="middle">Low</td><td align="center" style="border: thin solid rgb(102, 102, 102);" valign="middle">High</td><td style="border: thin solid rgb(102, 102, 102);">Turn clockwise (Forward)</td></tr>
<tr><td align="center" style="border: thin solid rgb(102, 102, 102);" valign="middle">High</td><td align="center" style="border: thin solid rgb(102, 102, 102);" valign="middle">High</td><td align="center" style="border: thin solid rgb(102, 102, 102);" valign="middle">High</td><td style="border: thin solid rgb(102, 102, 102);">Stop</td></tr>
<tr><td align="center" style="border: thin solid rgb(102, 102, 102);" valign="middle">High</td><td align="center" style="border: thin solid rgb(102, 102, 102);" valign="middle">Low</td><td align="center" style="border: thin solid rgb(102, 102, 102);" valign="middle">Low</td><td style="border: thin solid rgb(102, 102, 102);">Stop</td></tr>
<tr><td align="center" style="border: thin solid rgb(102, 102, 102);" valign="middle">Low</td><td align="center" style="border: thin solid rgb(102, 102, 102);" valign="middle">X</td><td align="center" style="border: thin solid rgb(102, 102, 102);" valign="middle">X</td><td align="center" style="border: thin solid rgb(102, 102, 102);" valign="middle">Stop</td></tr>
</tbody></table>
<div style="background-color: white; color: #333333; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 1.5em; padding: 2px 0px 0px 39.890625px; text-align: justify;">
High ~+5V, Low ~0V, X=Either high or low (don't care)</div>
<div style="background-color: white; color: #333333; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 1.5em; padding: 2px 0px 0px 39.890625px; text-align: justify;">
In the above truth table you can observe that if Pin1 (E1) is low then the motor stops, irrespective of the states on Pin2 and Pin7. Hence it is essential to hold E1 high for the driver to function, or simply connect enable pins to positive 5 volts.</div>
<div style="background-color: white; color: #333333; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 1.5em; padding: 2px 0px 0px 39.890625px; text-align: justify;">
With Pin1 high, if Pin2 is set high and Pin7 is pulled low, then current flows from Pin2 to Pin7 driving the motor in anti-clockwise direction. If the states of Pin2 and Pin7 are flipped, then current flows from Pin7 to Pin2 driving the motor in clockwise direction.</div>
<div style="background-color: white; color: #333333; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 1.5em; padding: 2px 0px 0px 39.890625px; text-align: justify;">
The above concept holds true for other side of the IC too. Connect your motor to Pin11 and Pin14; Pin10 and Pin15 are input pins, and Pin9 (E2) enables the driver.</div>
<div style="background-color: white; color: #333333; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 1.5em; padding: 2px 0px 0px 39.890625px; text-align: justify;">
I guess we have already had too much of theory. In the next section, we will start building the board.</div>
</div>
Anonymoushttp://www.blogger.com/profile/14732997283394377764noreply@blogger.com0tag:blogger.com,1999:blog-1660549699942964232.post-68369929330642381362013-08-19T14:24:00.000+05:302013-08-19T14:24:01.994+05:30Operational Amplifier (Op-amps)<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;">An op-amp operates on analog input. It can be used to amplify or attenuate this input, and to carry out mathematical operations such as addition, subtraction, integration, and differentiation. Because of their wide range of uses, op-amps are encountered in most electric circuits.</span><br />
<span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;"><br /></span>
<img alt="Figure 1: Op-amp Circuit" src="http://www.renesas.com/media/edge_ol/engineer/03/img_01.gif" /><br />
<span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;"><br /></span>
<span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;"><br /></span>
<span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;">A typical op-amp, is equipped with a non-inverting input (Vin (+)), an inverting input (Vin (−)), and an output (Vout). Although not shown in the diagram, an op-amp also has two power inputs (positive and negative), and may also include an offset input and other terminals.</span><br />
<span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;">The fundamental function of an op-amp is to greatly amplify the differential between the two inputs, and output the result. If input at V(+) is greater than at V(−), the op-amp will amplify and output a positive signal; if V(−) is greater, the op-amp will output an amplified negative signal. Two other features of a typical op-amp are: (a) the input impedance is extremely high, and (b) the output impedance is extremely low.</span><br style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;" /><span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;">Because the op-amp's gain is so high, even small differences in the inputs will rapidly drive the output voltage to its maximum or minimum value. For this reason, op-amps are usually connected to a negative feedback. Let's look at an example.</span><br />
<span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;"><br /></span>
<h3 style="text-align: left;">
<span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;">Op-Amp :- Inverting amplifier</span></h3>
<img alt="Figure. 2: Inverting Amplifier Circuit" height="140" src="http://www.renesas.com/media/edge_ol/engineer/03/img_02.gif" width="400" /><br />
<span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;">The circuit amplifies and inverts (reverses the phase of) the input signal, and outputs the result. The circuit uses negative feedback: some of the output signal is inverted and returned to the input. In this example, feedback occurs because output Vout is connected through resistor R</span><sub style="background-color: white; font-family: Arial, Helvetica, sans-serif; padding: 0px 0.2em;">2</sub><span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;"> to the inverting input (−).</span><br style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;" /><span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;">Let's look at how this circuit works. If the output is not connected to a power voltage, then the voltages applied to the inverting (−) and non-inverting (+) inputs are equal; the two inputs act as if shorted together; we can envision an imaginary short. Since the voltage difference between this imaginary short and the non-inverting input is 0 V, point A will also be at 0 V. By Ohm's Law, then, we have I</span><sub style="background-color: white; font-family: Arial, Helvetica, sans-serif; padding: 0px 0.2em;">1</sub><span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;"> = Vin/R</span><sub style="background-color: white; font-family: Arial, Helvetica, sans-serif; padding: 0px 0.2em;">1</sub><span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;">.</span><br style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;" /><span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;">Because op-amps have extremely high input impedance, there is virtually no current flow into the inverting input (−). Accordingly, I</span><sub style="background-color: white; font-family: Arial, Helvetica, sans-serif; padding: 0px 0.2em;">1</sub><span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;"> flows through point A and R</span><sub style="background-color: white; font-family: Arial, Helvetica, sans-serif; padding: 0px 0.2em;">2</sub><span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;">; this means that I</span><sub style="background-color: white; font-family: Arial, Helvetica, sans-serif; padding: 0px 0.2em;">1</sub><span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;"> and I</span><sub style="background-color: white; font-family: Arial, Helvetica, sans-serif; padding: 0px 0.2em;">2</sub><span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;"> are virtually equal. Then, by Ohm's Law, we have Vout = −I</span><sub style="background-color: white; font-family: Arial, Helvetica, sans-serif; padding: 0px 0.2em;">1</sub><span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;"> × R</span><sub style="background-color: white; font-family: Arial, Helvetica, sans-serif; padding: 0px 0.2em;">2</sub><span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;">, where I</span><sub style="background-color: white; font-family: Arial, Helvetica, sans-serif; padding: 0px 0.2em;">1</sub><span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;"> is negative because I</span><sub style="background-color: white; font-family: Arial, Helvetica, sans-serif; padding: 0px 0.2em;">2</sub><span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;"> flows from point A, where the voltage is 0. Looking at this in another way: any attempt to raise the input voltage at the inverting input (−) produces inverted and highly amplified output voltage that flows backward, passing through R</span><sub style="background-color: white; font-family: Arial, Helvetica, sans-serif; padding: 0px 0.2em;">2</sub><span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;"> and connecting to the inverted input terminal (−), thereby suppressing the voltage rise at this terminal. The system stabilizes at the output voltage that brings the voltage at the inverting input (−) to 0 V, equivalent to the voltage at the non-inverting input.</span><br style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;" /><span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;">Next, let's see how we can use the relationship between input and output to find the op-amp's gain. Specifically, Vout/Vin = (−I</span><sub style="background-color: white; font-family: Arial, Helvetica, sans-serif; padding: 0px 0.2em;">1</sub><span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;"> × R</span><sub style="background-color: white; font-family: Arial, Helvetica, sans-serif; padding: 0px 0.2em;">2</sub><span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;">) / (I</span><sub style="background-color: white; font-family: Arial, Helvetica, sans-serif; padding: 0px 0.2em;">1</sub><span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;"> × R</span><sub style="background-color: white; font-family: Arial, Helvetica, sans-serif; padding: 0px 0.2em;">1</sub><span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;">) = −R</span><sub style="background-color: white; font-family: Arial, Helvetica, sans-serif; padding: 0px 0.2em;">2</sub><span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;">/R</span><sub style="background-color: white; font-family: Arial, Helvetica, sans-serif; padding: 0px 0.2em;">1</sub><span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;">. The gain is negative because the output waveform phase is opposite that of the input waveform. </span><br style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;" /><span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;">An important thing to note about the above equation is that the gain is entirely determined by the ratio of resistances R</span><sub style="background-color: white; font-family: Arial, Helvetica, sans-serif; padding: 0px 0.2em;">2</sub><span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;"> and R</span><sub style="background-color: white; font-family: Arial, Helvetica, sans-serif; padding: 0px 0.2em;">1</sub><span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;">. Accordingly, you can change the gain simply by changing the resistances. So while the op-amp itself has a high gain, appropriate use of negative feedback can reduce the actual amplification to the desired level.</span><br />
<span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;"><br /></span>
<h3 style="text-align: left;">
<span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;">Op-Amp:- Non-Inverting Amplifier</span></h3>
<img alt="Figure. 3: Non-inverting Amplifier Circuit" height="173" src="http://www.renesas.com/media/edge_ol/engineer/03/img_03.gif" width="400" /><br />
<span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;">In the previous section we saw how an op-amp can be used to implement an inverting amplifier. Figure shows how we can use it to make a non-inverting amplifier. The non-inverting amp differs from the inverting one in two major ways: (1) the output waveform is in phase with the input waveform, and (2) the input goes into the non-inverting input terminal (+). But note that non-inverting and inverting circuits both make use of negative feedback.</span><br style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;" /><span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;">So how does this circuit work? We still have the imaginary short, which means that the non-inverting (+) and inverting (−) inputs are both at voltage Vin. So point A is also at Vin. Ohm's Law tells us that the voltage at R</span><sub style="background-color: white; font-family: Arial, Helvetica, sans-serif; padding: 0px 0.2em;">1</sub><span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;"> is Vin = R</span><sub style="background-color: white; font-family: Arial, Helvetica, sans-serif; padding: 0px 0.2em;">1</sub><span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;"> × I</span><sub style="background-color: white; font-family: Arial, Helvetica, sans-serif; padding: 0px 0.2em;">1</sub><span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;">. And since there is essentially no current into either of the op-amp inputs, it follows that I</span><sub style="background-color: white; font-family: Arial, Helvetica, sans-serif; padding: 0px 0.2em;">1</sub><span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;"> = I</span><sub style="background-color: white; font-family: Arial, Helvetica, sans-serif; padding: 0px 0.2em;">2</sub><span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;">. And as Vout is the sum of voltages at R</span><sub style="background-color: white; font-family: Arial, Helvetica, sans-serif; padding: 0px 0.2em;">1</sub><span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;"> and R</span><sub style="background-color: white; font-family: Arial, Helvetica, sans-serif; padding: 0px 0.2em;">2</sub><span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;">, we know that Vout= R</span><sub style="background-color: white; font-family: Arial, Helvetica, sans-serif; padding: 0px 0.2em;">2</sub><span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;"> × I</span><sub style="background-color: white; font-family: Arial, Helvetica, sans-serif; padding: 0px 0.2em;">2</sub><span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;"> + R</span><sub style="background-color: white; font-family: Arial, Helvetica, sans-serif; padding: 0px 0.2em;">1</sub><span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;"> × I</span><sub style="background-color: white; font-family: Arial, Helvetica, sans-serif; padding: 0px 0.2em;">1</sub><span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;">. We can rearrange these expressions to find the gain G, like this: G = Vout/Vin = (1 + R</span><sub style="background-color: white; font-family: Arial, Helvetica, sans-serif; padding: 0px 0.2em;">2</sub><span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;">/R</span><sub style="background-color: white; font-family: Arial, Helvetica, sans-serif; padding: 0px 0.2em;">1</sub><span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;">)</span><br style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;" /><span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;">Because this amplifier preserves the phase, it is often found in applications where phase considerations are an issue.</span><br style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;" /><span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;">Note also that if R</span><sub style="background-color: white; font-family: Arial, Helvetica, sans-serif; padding: 0px 0.2em;">1</sub><span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;"> is removed from the circuit and R</span><sub style="background-color: white; font-family: Arial, Helvetica, sans-serif; padding: 0px 0.2em;">2</sub><span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;"> is set to 0 ohm (or shorted), the circuit becomes a voltage follower with a gain of 1. This type of circuit is often used in buffering circuitry and impedance conversion circuits.</span><br />
<span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;"><br /></span>
<h3 style="text-align: left;">
<span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;">Comparator Circuit</span></h3>
<div class="mb15" style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px; padding: 0px;">
<img alt="Figure 4: Comparator Circuit" src="http://www.renesas.com/media/edge_ol/engineer/03/img_04.gif" /></div>
<div class="mb15" style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px; padding: 0px;">
A comparator circuit compares two voltages and outputs either a 1 (the voltage at the plus side; VDD in the illustration) or a 0 (the voltage at the negative side) to indicate which is larger. Comparators are often used, for example, to check whether an input has reached some predetermined value. In most cases a comparator is implemented using a dedicated comparator IC, but op-amps may be used as an alternative. Comparator diagrams and op-amp diagrams use the same symbols.</div>
<div style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px; padding: 0px;">
Figure 4 shows a comparator circuit. Note first that the circuit does not use feedback. The circuit amplifies the voltage difference between Vin and VREF, and outputs the result at Vout. If Vin is greater than VREF, then voltage at Vout will rise to its positive saturation level; that is, to the voltage at the positive side. If Vin is lower than VREF, then Vout, will fall to its negative saturation level, equal to the voltage at the negative side.</div>
<div style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px; padding: 0px;">
<br /></div>
<div style="background-color: white; color: #666666; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px; padding: 0px;">
<br /></div>
<div style="background-color: white; color: #666666; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px; padding: 0px;">
<br /></div>
<div style="background-color: white; color: #666666; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px; padding: 0px;">
<br /></div>
</div>
Anonymoushttp://www.blogger.com/profile/14732997283394377764noreply@blogger.com0tag:blogger.com,1999:blog-1660549699942964232.post-79262856638836955992013-08-19T04:15:00.002+05:302013-08-19T04:15:39.496+05:30Digital Thermometer<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="background-color: white; border: 0px; color: #454545; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 16px; line-height: 20px; margin-bottom: 1em; min-height: 1em; outline: 0px; padding: 0px; vertical-align: baseline;">
This tutorial shows an interesting way to read the temperature from the environment with the Arduino, and shows it on a LCD 16x2 display (in Fahrenheit), by using some elements from its programming and the temperature LM35DZ sensor.</div>
<div style="background-color: white; border: 0px; color: #454545; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 16px; line-height: 20px; margin-bottom: 1em; min-height: 1em; outline: 0px; padding: 0px; vertical-align: baseline;">
For that, it will be necessary the following components:</div>
<div style="background-color: white; border: 0px; color: #454545; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 16px; line-height: 20px; margin-bottom: 1em; min-height: 1em; outline: 0px; padding: 0px; vertical-align: baseline;">
- 1 Arduino board</div>
<div style="background-color: white; border: 0px; color: #454545; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 16px; line-height: 20px; margin-bottom: 1em; min-height: 1em; outline: 0px; padding: 0px; vertical-align: baseline;">
- 1 LCD 16x2 display</div>
<div style="background-color: white; border: 0px; color: #454545; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 16px; line-height: 20px; margin-bottom: 1em; min-height: 1em; outline: 0px; padding: 0px; vertical-align: baseline;">
- 1 10K potentiometer</div>
<div style="background-color: white; border: 0px; color: #454545; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 16px; line-height: 20px; margin-bottom: 1em; min-height: 1em; outline: 0px; padding: 0px; vertical-align: baseline;">
- 1 Temperature LM35 sensor</div>
<div style="background-color: white; border: 0px; color: #454545; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 16px; line-height: 20px; margin-bottom: 1em; min-height: 1em; outline: 0px; padding: 0px; vertical-align: baseline;">
- Jumpers for connection</div>
<div style="background-color: white; border: 0px; color: #454545; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 16px; line-height: 20px; margin-bottom: 1em; min-height: 1em; outline: 0px; padding: 0px; vertical-align: baseline;">
This sensor captures the external temperature and converts it into a corresponding voltage value. In this circuit, we connect the output Vo of the sensor to the Arduino’s A0 pin, which converts it to a <i style="background-color: transparent; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">float</i> value of temperature, and then, exhibits it on the LCD. The 10K potentiometer adjusts the contrast of the display.</div>
<div style="background-color: white; border: 0px; color: #454545; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 16px; line-height: 20px; margin-bottom: 1em; min-height: 1em; outline: 0px; padding: 0px; vertical-align: baseline;">
<br /></div>
<div style="background-color: white; border: 0px; color: #454545; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 16px; line-height: 20px; margin-bottom: 1em; min-height: 1em; outline: 0px; padding: 0px; vertical-align: baseline;">
Now, set up the circuit below with the Arduino and the other components: </div>
<div style="background-color: white; border: 0px; color: #454545; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 16px; line-height: 20px; margin-bottom: 1em; min-height: 1em; outline: 0px; padding: 0px; vertical-align: baseline;">
<a href="http://api.ning.com/files/xvZFwQ6bwXA5Kv2iUadEvmoZR8BRpy-09CKJ3IV6vlvSoEoCEQtfNqLsVc8HlzM3I*e-TbfEFi*yaXhb57TCqCMgXQluUrET/esquema.bmp" style="background-color: transparent; border-bottom-style: none; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; color: #383838; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;" target="_self"><img class="align-full" height="256" src="http://api.ning.com/files/xvZFwQ6bwXA5Kv2iUadEvmoZR8BRpy-09CKJ3IV6vlvSoEoCEQtfNqLsVc8HlzM3I*e-TbfEFi*yaXhb57TCqCMgXQluUrET/esquema.bmp?width=500" style="background-color: transparent; border: 0px; clear: both !important; display: block !important; height: auto; margin: 4px 0px; max-width: 737px; outline: 0px; padding: 0px; vertical-align: baseline;" width="320" /></a></div>
<div style="background-color: white; border: 0px; color: #454545; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 16px; line-height: 20px; margin-bottom: 1em; min-height: 1em; outline: 0px; padding: 0px; vertical-align: baseline;">
</div>
<div style="background-color: white; border: 0px; color: #454545; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 16px; line-height: 20px; margin-bottom: 1em; min-height: 1em; outline: 0px; padding: 0px; vertical-align: baseline;">
And then, open the Arduino’s IDE and enter the following code:</div>
<div style="background-color: white; border: 0px; color: #454545; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 16px; line-height: 20px; margin-bottom: 1em; min-height: 1em; outline: 0px; padding: 0px; vertical-align: baseline;">
<br /></div>
<div style="background-color: white; border: 0px; color: #454545; line-height: 20px; margin-bottom: 1em; min-height: 1em; outline: 0px; padding: 0px; text-align: left; vertical-align: baseline;">
<span style="font-family: Verdana, sans-serif;">#include <LiquidCrystal.h> // Include the library to use a LCD display</span></div>
<div style="background-color: white; border: 0px; color: #454545; line-height: 20px; margin-bottom: 1em; min-height: 1em; outline: 0px; padding: 0px; text-align: left; vertical-align: baseline;">
<span style="font-family: Verdana, sans-serif;">#define sensor 0 // Define the A0 pin as “sensor”</span></div>
<div style="background-color: white; border: 0px; color: #454545; line-height: 20px; margin-bottom: 1em; min-height: 1em; outline: 0px; padding: 0px; text-align: left; vertical-align: baseline;">
<br /></div>
<div style="background-color: white; border: 0px; color: #454545; line-height: 20px; margin-bottom: 1em; min-height: 1em; outline: 0px; padding: 0px; text-align: left; vertical-align: baseline;">
<span style="font-family: Verdana, sans-serif;">int Vin; // Variable to read the value from the Arduino’s pin</span></div>
<div style="background-color: white; border: 0px; color: #454545; line-height: 20px; margin-bottom: 1em; min-height: 1em; outline: 0px; padding: 0px; text-align: left; vertical-align: baseline;">
<span style="font-family: Verdana, sans-serif;">float Temperature; // Variable that receives the converted voltage value to temperature</span></div>
<div style="background-color: white; border: 0px; color: #454545; line-height: 20px; margin-bottom: 1em; min-height: 1em; outline: 0px; padding: 0px; text-align: left; vertical-align: baseline;">
<span style="font-family: Verdana, sans-serif;">float TF; // Variable to receive the converted value from ºC to ºF</span></div>
<div style="background-color: white; border: 0px; color: #454545; line-height: 20px; margin-bottom: 1em; min-height: 1em; outline: 0px; padding: 0px; text-align: left; vertical-align: baseline;">
<br /></div>
<div style="background-color: white; border: 0px; color: #454545; line-height: 20px; margin-bottom: 1em; min-height: 1em; outline: 0px; padding: 0px; text-align: left; vertical-align: baseline;">
<span style="font-family: Verdana, sans-serif;">LiquidCrystal lcd (12, 11, 5, 4, 3, 2); </span></div>
<div style="background-color: white; border: 0px; color: #454545; line-height: 20px; margin-bottom: 1em; min-height: 1em; outline: 0px; padding: 0px; text-align: left; vertical-align: baseline;">
<span style="font-family: Verdana, sans-serif;">/* The function above declares which Arduino’s pins will be used for controlling the LCD */</span></div>
<div style="background-color: white; border: 0px; color: #454545; line-height: 20px; margin-bottom: 1em; min-height: 1em; outline: 0px; padding: 0px; text-align: left; vertical-align: baseline;">
<span style="font-family: Verdana, sans-serif;">void setup()</span></div>
<div style="background-color: white; border: 0px; color: #454545; line-height: 20px; margin-bottom: 1em; min-height: 1em; outline: 0px; padding: 0px; text-align: left; vertical-align: baseline;">
<span style="font-family: Verdana, sans-serif;">{</span></div>
<div style="background-color: white; border: 0px; color: #454545; line-height: 20px; margin-bottom: 1em; min-height: 1em; outline: 0px; padding: 0px; text-align: left; vertical-align: baseline;">
<span style="font-family: Verdana, sans-serif;"> lcd.begin(16, 2); // It tells the Arduino that the display is a 16x2 type</span></div>
<div style="background-color: white; border: 0px; color: #454545; line-height: 20px; margin-bottom: 1em; min-height: 1em; outline: 0px; padding: 0px; text-align: left; vertical-align: baseline;">
<span style="font-family: Verdana, sans-serif;"> lcd.print("Temperature: "); // Send the text to the screen of the display.</span></div>
<div style="background-color: white; border: 0px; color: #454545; line-height: 20px; margin-bottom: 1em; min-height: 1em; outline: 0px; padding: 0px; text-align: left; vertical-align: baseline;">
<span style="font-family: Verdana, sans-serif;">}</span></div>
<div style="background-color: white; border: 0px; color: #454545; line-height: 20px; margin-bottom: 1em; min-height: 1em; outline: 0px; padding: 0px; text-align: left; vertical-align: baseline;">
<span style="font-family: Verdana, sans-serif;">void loop()</span></div>
<div style="background-color: white; border: 0px; color: #454545; line-height: 20px; margin-bottom: 1em; min-height: 1em; outline: 0px; padding: 0px; text-align: left; vertical-align: baseline;">
<span style="font-family: Verdana, sans-serif;">{</span></div>
<div style="background-color: white; border: 0px; color: #454545; line-height: 20px; margin-bottom: 1em; min-height: 1em; outline: 0px; padding: 0px; text-align: left; vertical-align: baseline;">
<span style="font-family: Verdana, sans-serif;"> Vin = analogRead (sensor); /* Tells the Arduino to read the pin and stores the value in “Vin” */</span></div>
<div style="background-color: white; border: 0px; color: #454545; line-height: 20px; margin-bottom: 1em; min-height: 1em; outline: 0px; padding: 0px; text-align: left; vertical-align: baseline;">
<span style="font-family: Verdana, sans-serif;"> Temperature=(500*Vin)/1023; /* Converts the voltage value into temperature and stores it into the “Temperature” variable (in ºC)*/</span></div>
<div style="background-color: white; border: 0px; color: #454545; line-height: 20px; margin-bottom: 1em; min-height: 1em; outline: 0px; padding: 0px; text-align: left; vertical-align: baseline;">
<span style="font-family: Verdana, sans-serif;">TF = ((9*Temperature)/5)+32; // Converts ºC to ºF</span></div>
<div style="background-color: white; border: 0px; color: #454545; line-height: 20px; margin-bottom: 1em; min-height: 1em; outline: 0px; padding: 0px; text-align: left; vertical-align: baseline;">
<span style="font-family: Verdana, sans-serif;"> lcd.setCursor(0, 1); // Moves the cursor of the display to the next line</span></div>
<div style="background-color: white; border: 0px; color: #454545; line-height: 20px; margin-bottom: 1em; min-height: 1em; outline: 0px; padding: 0px; text-align: left; vertical-align: baseline;">
<span style="font-family: Verdana, sans-serif;"> lcd.print(TF); // Exhibits the value of the temperature on the display</span></div>
<div style="background-color: white; border: 0px; color: #454545; line-height: 20px; margin-bottom: 1em; min-height: 1em; outline: 0px; padding: 0px; text-align: left; vertical-align: baseline;">
<span style="font-family: Verdana, sans-serif;"> lcd.print(" F"); // Writes “F” to indicate that it is in Fahrenheit scale.</span></div>
<div style="background-color: white; border: 0px; color: #454545; line-height: 20px; margin-bottom: 1em; min-height: 1em; outline: 0px; padding: 0px; text-align: left; vertical-align: baseline;">
<br /></div>
<div style="background-color: white; border: 0px; color: #454545; line-height: 20px; margin-bottom: 1em; min-height: 1em; outline: 0px; padding: 0px; text-align: left; vertical-align: baseline;">
<span style="font-family: Verdana, sans-serif;"> delay(1000); // Waits for a second to read the pin again</span></div>
<div style="background-color: white; border: 0px; color: #454545; line-height: 20px; margin-bottom: 1em; min-height: 1em; outline: 0px; padding: 0px; text-align: left; vertical-align: baseline;">
<span style="font-family: Verdana, sans-serif;">}</span></div>
<div style="background-color: white; border: 0px; color: #454545; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 16px; line-height: 20px; margin-bottom: 1em; min-height: 1em; outline: 0px; padding: 0px; vertical-align: baseline;">
In the end, upload the code to your Aduino.</div>
<div style="background-color: white; border: 0px; color: #454545; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 16px; line-height: 20px; margin-bottom: 1em; min-height: 1em; outline: 0px; padding: 0px; vertical-align: baseline;">
Your project to show the temperature is ready!!! We hope you have enjoyed. Any doubts, post here.</div>
<div style="background-color: white; border: 0px; color: #454545; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 16px; line-height: 20px; margin-bottom: 1em; min-height: 1em; outline: 0px; padding: 0px; vertical-align: baseline;">
Note: The LM35DZ sensor converts temperature values from -55ºC to 150ºC.</div>
<div style="background-color: white; border: 0px; color: #454545; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 16px; line-height: 20px; margin-bottom: 1em; min-height: 1em; outline: 0px; padding: 0px; vertical-align: baseline;">
If somebody is interested, this is the explanation for the conversion calculation from voltage to temperature done by the software.</div>
<div style="background-color: white; border: 0px; color: #454545; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 16px; line-height: 20px; margin-bottom: 1em; min-height: 1em; outline: 0px; padding: 0px; vertical-align: baseline;">
In this sensor, for each 1ºC received, the Vo output is added in 10mV, in a range from 0 to 5V, with 10 bits of resolution for Analog/Digital conversion (1024 different values to represent the temperature).</div>
<div style="background-color: white; border: 0px; color: #454545; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 16px; line-height: 20px; margin-bottom: 1em; min-height: 1em; outline: 0px; padding: 0px; vertical-align: baseline;">
Thus, the maximum value (1023, therefore it is from 0 to 1023) will be 5V. The half will match 511 or 2.5V, and so forth. For calculation purposes, there would be 5V in the output of the sensor for a temaprature value of 500ºC (which is different in a real situation). However, this regard lets us generalize it to the following relation:</div>
<div style="background-color: white; border: 0px; color: #454545; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 16px; line-height: 20px; margin-bottom: 1em; min-height: 1em; outline: 0px; padding: 0px; vertical-align: baseline;">
Temperature ----- Vin</div>
<div style="background-color: white; border: 0px; color: #454545; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 16px; line-height: 20px; margin-bottom: 1em; min-height: 1em; outline: 0px; padding: 0px; vertical-align: baseline;">
500ºC ----- 1023 (maximum values)</div>
<div style="background-color: white; border: 0px; color: #454545; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 16px; line-height: 20px; margin-bottom: 1em; min-height: 1em; outline: 0px; padding: 0px; vertical-align: baseline;">
<br /></div>
<div style="background-color: white; border: 0px; color: #454545; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 16px; line-height: 20px; margin-bottom: 1em; min-height: 1em; outline: 0px; padding: 0px; vertical-align: baseline;">
So, there will be:</div>
<div style="background-color: white; border: 0px; color: #454545; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 16px; line-height: 20px; margin-bottom: 1em; min-height: 1em; outline: 0px; padding: 0px; vertical-align: baseline;">
Temperature = (500*Vin)/1023, but as it is in ºC and we want in ºF, we convert it:</div>
<div style="background-color: white; border: 0px; color: #454545; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 16px; line-height: 20px; margin-bottom: 1em; min-height: 1em; outline: 0px; padding: 0px; vertical-align: baseline;">
TF = ((9*Temperature)/5)+32, and this is the printed value on the LCD display.</div>
</div>
Anonymoushttp://www.blogger.com/profile/14732997283394377764noreply@blogger.com0tag:blogger.com,1999:blog-1660549699942964232.post-21104505128811540462013-08-19T04:06:00.002+05:302013-08-19T04:06:27.627+05:30Hall Effect Sensor<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: left;">
<span style="font-family: Verdana, sans-serif; font-size: x-small;"><span style="background-color: white; line-height: 16.890625px;">A Hall Effect sensor is a device that detects the presence of magnetic field. It is based on the Hall Effect. The Hall Effect was discovered by Edwin hall in 1869. When current is passed through the conductor and the same conductor is placed in magnetic field perpendicular to the current flow then a voltage called the hall voltage is generated perpendicular to both the current and magnetic field. This is known as Hall Effect.</span><span style="background-color: white; line-height: 16.890625px;">When no magnetic field is applied to the current carrying thin semiconductor material(hall element) the hall voltage(Vh) is zero. When an external magnetic field is applied to the current carrying hall element perpendicular to the current flow a Lorentz force acts on the current due to which a voltage called hall voltage(Vh) is generated perpendicular to both the current and the magnetic field. This voltage is very small (in uV) and needs amplification.</span></span></div>
<div style="text-align: left;">
<span style="font-family: Verdana, sans-serif; font-size: x-small;"><span style="background-color: white; line-height: 16.890625px;"><br /></span></span></div>
<div style="text-align: left;">
<img alt="Hall Effect Sensor" height="270" src="http://www.electronics-tutorials.ws/electromagnetism/mag26.gif" width="320" /></div>
<div style="text-align: left;">
<span style="font-family: Verdana, sans-serif; font-size: x-small;"><span style="background-color: white; line-height: 16.890625px;"><br /></span></span></div>
<div style="text-align: left;">
</div>
<h3 style="text-align: left;">
<span style="font-family: Verdana, sans-serif; font-size: x-small;"><span style="background-color: white; line-height: 16.890625px;">Application</span></span></h3>
<span style="font-family: Verdana, sans-serif; font-size: x-small;">Hall effect sensors are activated by a magnetic field and in many applications the device can be operated by a single permanent magnet attached to a moving shaft or device. There are many different types of magnet movements, such as "Head-on", "Sideways", "Push-pull" or "Push-push" etc sensing movements. Which every type of configuration is used, to ensure maximum sensitivity the magnetic lines of flux must always be perpendicular to the sensing area of the device and must be of the correct polarity.<br />Also to ensure linearity, high field strength magnets are required that produce a large change in field strength for the required movement. There are several possible paths of motion for detecting a magnetic field, and below are two of the more common sensing configurations using a single magnet.Head-on Detection and Sideways Detection<br /></span><br />
<div style="text-align: left;">
<span style="background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.890625px;"><br /></span></div>
<span style="background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.890625px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.890625px;"><br /></span></div>
Anonymoushttp://www.blogger.com/profile/14732997283394377764noreply@blogger.com0tag:blogger.com,1999:blog-1660549699942964232.post-69158141765748299372013-08-10T20:28:00.001+05:302013-08-10T20:30:30.202+05:30Interfacing relay with Arduino<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: left;">
<span style="background-color: white; font-family: Verdana, 'Trebuchet MS'; font-size: 13px; line-height: 18px;">In this quick Arduino tutorial I will explain how you can control a relay using the Arduino Board, one 1K and one 10K resistors, 1 BC547 transistor, one 6V or 12V relay, one 1N4007 diode and a 12V fan. When the button is pressed the fan will turn ON and will remain in this state until the button is pressed again.</span></div>
<div style="text-align: left;">
<span style="background-color: white; font-family: Verdana, 'Trebuchet MS'; font-size: 13px; line-height: 18px;"><br /></span></div>
<h3 style="text-align: left;">
<span style="font-family: Verdana, Trebuchet MS; font-size: x-small;"><span style="line-height: 18px;">Schematic </span></span></h3>
<div>
<img alt="arduino control relay schematic" height="227" src="http://www.electroschematics.com/wp-content/uploads/2013/07/arduino-control-relay-schematic-550x391.png" width="320" /></div>
<div>
<br /></div>
<h3 style="text-align: left;">
<span style="font-size: small;">Working</span></h3>
<h3 style="text-align: left;">
<div style="background-color: white; font-family: Verdana, 'Trebuchet MS'; font-size: 13px; font-weight: normal; line-height: 18px;">
When the button is pressed the Arduino board will put pin 2 in HIGH state, meaning 5V on pin 2. This voltage is used to drive the transistor that will switch ON the relay and the load (in our case the fan) will be powered from the main power supply.</div>
<div style="background-color: white; font-family: Verdana, 'Trebuchet MS'; font-size: 13px; font-weight: normal; line-height: 18px;">
You cannot use the 5V from the USB to power up the transistor and the LOAD because the USB port usually delivers only 100mA, and this is not enough to switch the relay and the LOAD. That is why you must use an external power supply (Vcc) that is between 7 to 12 volts to power up the Arduino board and the transistor + relay. The load uses its own power supply, for instance if you use a light bulb then you might connect it to the 110/220V mains or any other power source.</div>
</h3>
<h3 style="text-align: left;">
</h3>
<h3 style="text-align: left;">
Code</h3>
<div style="text-align: left;">
<pre class="wp-code-highlight prettyprint prettyprinted" style="font-size: 12px; line-height: 16px; margin-bottom: 6px; margin-top: 6px; overflow: auto; padding: 2px 7px; width: 578.1875px;"><span style="background-color: white;"><span class="kwd" style="font-weight: bold;">int</span><span class="pln"> pinButton </span><span class="pun">=</span><span class="pln"> </span><span class="lit">8</span><span class="pun">;</span><span class="pln">
</span><span class="kwd" style="font-weight: bold;">int</span><span class="pln"> </span><span class="typ">Relay</span><span class="pln"> </span><span class="pun">=</span><span class="pln"> </span><span class="lit">2</span><span class="pun">;</span><span class="pln">
</span><span class="kwd" style="font-weight: bold;">int</span><span class="pln"> stateRelay </span><span class="pun">=</span><span class="pln"> LOW</span><span class="pun">;</span><span class="pln">
</span><span class="kwd" style="font-weight: bold;">int</span><span class="pln"> stateButton</span><span class="pun">;</span><span class="pln">
</span><span class="kwd" style="font-weight: bold;">int</span><span class="pln"> previous </span><span class="pun">=</span><span class="pln"> LOW</span><span class="pun">;</span><span class="pln">
</span><span class="kwd" style="font-weight: bold;">long</span><span class="pln"> time </span><span class="pun">=</span><span class="pln"> </span><span class="lit">0</span><span class="pun">;</span><span class="pln">
</span><span class="kwd" style="font-weight: bold;">long</span><span class="pln"> debounce </span><span class="pun">=</span><span class="pln"> </span><span class="lit">500</span><span class="pun">;</span><span class="pln">
</span><span class="kwd" style="font-weight: bold;">void</span><span class="pln"> setup</span><span class="pun">()</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
pinMode</span><span class="pun">(</span><span class="pln">pinButton</span><span class="pun">,</span><span class="pln"> INPUT</span><span class="pun">);</span><span class="pln">
pinMode</span><span class="pun">(</span><span class="typ">Relay</span><span class="pun">,</span><span class="pln"> OUTPUT</span><span class="pun">);</span><span class="pln">
</span><span class="pun">}</span><span class="pln">
</span><span class="kwd" style="font-weight: bold;">void</span><span class="pln"> loop</span><span class="pun">()</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
stateButton </span><span class="pun">=</span><span class="pln"> digitalRead</span><span class="pun">(</span><span class="pln">pinButton</span><span class="pun">);</span><span class="pln">
</span><span class="kwd" style="font-weight: bold;">if</span><span class="pun">(</span><span class="pln">stateButton </span><span class="pun">==</span><span class="pln"> HIGH </span><span class="pun">&&</span><span class="pln"> previous </span><span class="pun">==</span><span class="pln"> LOW </span><span class="pun">&&</span><span class="pln"> millis</span><span class="pun">()</span><span class="pln"> </span><span class="pun">-</span><span class="pln"> time </span><span class="pun">></span><span class="pln"> debounce</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
</span><span class="kwd" style="font-weight: bold;">if</span><span class="pun">(</span><span class="pln">stateRelay </span><span class="pun">==</span><span class="pln"> HIGH</span><span class="pun">){</span><span class="pln">
stateRelay </span><span class="pun">=</span><span class="pln"> LOW</span><span class="pun">;</span><span class="pln">
</span><span class="pun">}</span><span class="pln"> </span><span class="kwd" style="font-weight: bold;">else</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
stateRelay </span><span class="pun">=</span><span class="pln"> HIGH</span><span class="pun">;</span><span class="pln">
</span><span class="pun">}</span><span class="pln">
time </span><span class="pun">=</span><span class="pln"> millis</span><span class="pun">();</span><span class="pln">
</span><span class="pun">}</span><span class="pln">
digitalWrite</span><span class="pun">(</span><span class="typ">Relay</span><span class="pun">,</span><span class="pln"> stateRelay</span><span class="pun">);</span><span class="pln">
previous </span><span class="pun">==</span><span class="pln"> stateButton</span><span class="pun">;</span><span class="pln">
</span><span class="pun">}</span></span></pre>
<pre class="wp-code-highlight prettyprint prettyprinted" style="font-size: 12px; line-height: 16px; margin-bottom: 6px; margin-top: 6px; overflow: auto; padding: 2px 7px; width: 578.1875px;"><span style="background-color: white;"><span class="pun">
</span></span></pre>
<pre class="wp-code-highlight prettyprint prettyprinted" style="font-size: 12px; line-height: 16px; margin-bottom: 6px; margin-top: 6px; overflow: auto; padding: 2px 7px; width: 578.1875px;"><span style="background-color: white;"><span class="pun">
</span></span></pre>
<pre class="wp-code-highlight prettyprint prettyprinted" style="font-size: 12px; line-height: 16px; margin-bottom: 6px; margin-top: 6px; overflow: auto; padding: 2px 7px; width: 578.1875px;"><span style="background-color: white; font-family: Verdana, 'Trebuchet MS'; font-size: 13px; line-height: 18px; white-space: normal;">#### DO NOT connect in any ways the main power supply that drive the LOAD to the arduino and transistor circuitry! ######</span></pre>
</div>
</div>
Anonymoushttp://www.blogger.com/profile/14732997283394377764noreply@blogger.com0tag:blogger.com,1999:blog-1660549699942964232.post-12946789223011667792013-08-09T00:06:00.000+05:302013-08-09T00:11:59.965+05:30Working with MOSFET<div dir="ltr" style="text-align: left;" trbidi="on">
<h4 style="text-align: left;">
<div style="text-align: left;">
</div>
</h4>
<h3 style="text-align: left;">
<span class="font-size-2" style="background-color: transparent; border: 0px; line-height: 1.2 !important; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><span style="background-color: transparent; border: 0px; font-weight: normal; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Introduction</span></span></h3>
<span style="font-weight: normal;"><span class="font-size-2" style="background-color: transparent; border: 0px; line-height: 1.2 !important; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">MOSFET or simply FET (MOS = metal-oxide semiconductor and FET = field effect transistor) is a type of transistor, a component used as a switch or an amplifier of electric signals.</span></span><br />
<br />
<br />
<h3 style="text-align: left;">
<span style="font-weight: normal;"><span class="font-size-2" style="background-color: transparent; border: 0px; line-height: 1.2 !important; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><span style="background-color: transparent; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">MOSFETs</span></span></span></h3>
<span style="font-weight: normal;"><span class="font-size-2" style="background-color: transparent; border: 0px; line-height: 1.2 !important; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">A MOSFET usually has three terminals: <span style="background-color: transparent; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Gate, Source and Drain. </span>There are two essential types: N-channel and P-channel, which are basically different because of the polarization. The current to be supplied to the circuit, which will circulate between <span style="background-color: transparent; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Source </span>and <span style="background-color: transparent; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Drain </span>of the FET, is controlled by the voltage applied on the <span style="background-color: transparent; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Gate </span>terminal. This last one has a dielectric separation from the other two, generating therefore an almost-null current value on the <span style="background-color: transparent; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Gate, </span>and an electric field which influences in the <span style="background-color: transparent; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Source </span>and in the <span style="background-color: transparent; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Drain</span>. Below, we have these two basic types of FETs and their corresponding usual symbols:</span></span><span style="font-weight: normal;"><span class="font-size-3" style="background-color: transparent; border: 0px; line-height: 1.2 !important; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><a href="http://api.ning.com/files/oPiLRtYZll*FDH54Msv0S6fZh5RkV1zH8XX21LsqhSyEaFH*XtiIPA6Os6UI9cOgV15vowbuzTWWwd-NxiuxAn5zGCunPA72/canalNP.gif" style="background-color: transparent; border-bottom-style: none; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; color: #383838; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;" target="_self"><img class="align-full" src="http://api.ning.com/files/oPiLRtYZll*FDH54Msv0S6fZh5RkV1zH8XX21LsqhSyEaFH*XtiIPA6Os6UI9cOgV15vowbuzTWWwd-NxiuxAn5zGCunPA72/canalNP.gif" style="background-color: transparent; border: 0px; clear: both !important; display: block !important; height: auto; margin: 4px 0px; max-width: 737px; outline: 0px; padding: 0px; vertical-align: baseline;" width="556" /></a></span></span><span style="font-weight: normal;"><span class="font-size-3" style="background-color: transparent; border: 0px; line-height: 1.2 !important; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Concerning Polarization:</span></span><span style="font-weight: normal;"><span class="font-size-3" style="background-color: transparent; border: 0px; line-height: 1.2 !important; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><a href="http://api.ning.com/files/QOkGyeZ5XayfUZJr8YCfB0JsDM2sSqayel6QVM4LIt6Zf9wqG6Xz*CenzN7brt-HWqn-u1FE6JmMaFvmXMBuGw4nSeEhmVHD/polarizao.PNG" style="background-color: transparent; border-bottom-style: none; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; color: #383838; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;" target="_self"><img class="align-full" src="http://api.ning.com/files/QOkGyeZ5XayfUZJr8YCfB0JsDM2sSqayel6QVM4LIt6Zf9wqG6Xz*CenzN7brt-HWqn-u1FE6JmMaFvmXMBuGw4nSeEhmVHD/polarizao.PNG" style="background-color: transparent; border: 0px; clear: both !important; display: block !important; height: auto; margin: 4px 0px; max-width: 737px; outline: 0px; padding: 0px; vertical-align: baseline;" width="528" /></a></span></span><span style="font-weight: normal;"><span class="font-size-3" style="background-color: transparent; border: 0px; line-height: 1.2 !important; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"> P-Channel</span></span><span style="font-weight: normal;"><span class="font-size-3" style="background-color: transparent; border: 0px; line-height: 1.2 !important; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"> </span></span><span style="font-weight: normal;"><span class="font-size-3" style="background-color: transparent; border: 0px; line-height: 1.2 !important; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><a href="http://api.ning.com/files/dz*sdwsIwTOF1GL3bZPk*RFuEMFA9yaPFE4ygpLzZUfW1qR5t7ba9WjnaYMW7I6h3kLC09zAKdli6GQXFnbUM-iPZEToPWaH/polarizaocanalN.PNG" style="background-color: transparent; border-bottom-style: none; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; color: #383838; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;" target="_self"><img class="align-full" src="http://api.ning.com/files/dz*sdwsIwTOF1GL3bZPk*RFuEMFA9yaPFE4ygpLzZUfW1qR5t7ba9WjnaYMW7I6h3kLC09zAKdli6GQXFnbUM-iPZEToPWaH/polarizaocanalN.PNG" style="background-color: transparent; border: 0px; clear: both !important; display: block !important; height: auto; margin: 4px 0px; max-width: 737px; outline: 0px; padding: 0px; vertical-align: baseline;" width="562" /></a></span></span><span style="font-weight: normal;"><span style="background-color: transparent; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="font-size-3" style="background-color: transparent; border: 0px; line-height: 1.2 !important; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">N-Channel</span></span><span style="font-weight: normal;"><span class="font-size-3" style="background-color: transparent; border: 0px; line-height: 1.2 !important; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"> </span></span><span style="font-weight: normal;"><span class="font-size-2" style="background-color: transparent; border: 0px; line-height: 1.2 !important; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Another more known type of transistor, the BJT (<span style="background-color: transparent; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">bipolar junction transistor), </span> also has three terminals: <span style="background-color: transparent; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Base, Collector </span>and <span style="background-color: transparent; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Emitter. </span>The current to be supplied to the circuit, which will circulate between <span style="background-color: transparent; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Collector </span>and <span style="background-color: transparent; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Emitter </span>of the BJT, is controlled by the <span style="background-color: transparent; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">current </span>of the <span style="background-color: transparent; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Base </span>terminal, unlike a MOSFET, which is controlled by the voltage. This is one of the main differences between them, causing a TBJ to be generally applied in circuits with a low value of current, and a FET not only for these ones but also for applications with higher values of power/current.</span></span><span style="font-weight: normal;"><span class="font-size-2" style="background-color: transparent; border: 0px; line-height: 1.2 !important; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><span style="background-color: transparent; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Application Examples of MOSFETs</span></span></span><span style="font-weight: normal;"><span class="font-size-2" style="background-color: transparent; border: 0px; line-height: 1.2 !important; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">One of the most common applications for MOSFETs is on CMOS circuits (see the reference link at the end of this tutorial for more details). However, there are also others, for example:</span></span><span style="font-weight: normal;"><span class="font-size-2" style="background-color: transparent; border: 0px; line-height: 1.2 !important; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">- Voltage Controlled Resistance</span></span><span style="font-weight: normal;"><span class="font-size-2" style="background-color: transparent; border: 0px; line-height: 1.2 !important; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">- Power Switching Circuits</span></span><span style="font-weight: normal;"><span class="font-size-2" style="background-color: transparent; border: 0px; line-height: 1.2 !important; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">- Frequency Mixers</span></span><span style="font-weight: normal;"><span class="font-size-2" style="background-color: transparent; border: 0px; line-height: 1.2 !important; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">- Etc.</span></span><span style="font-weight: normal;"><span class="font-size-2" style="background-color: transparent; border: 0px; line-height: 1.2 !important; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"> </span></span><span style="font-weight: normal;"><span class="font-size-2" style="background-color: transparent; border: 0px; line-height: 1.2 !important; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><span style="background-color: transparent; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Example: </span>Turning a DC motor on with a MOSFET (MOSFET as a switch) and the Arduino.</span></span><span style="font-weight: normal;"><span class="font-size-2" style="background-color: transparent; border: 0px; line-height: 1.2 !important; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><span style="background-color: transparent; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Components:</span></span></span><span style="font-weight: normal;"><span class="font-size-2" style="background-color: transparent; border: 0px; line-height: 1.2 !important; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><span style="background-color: transparent; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">- </span>1 <a href="http://www.labdegaragem.org/loja/index.php/29-arduino.html" style="background-color: transparent; border-bottom-style: none; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; color: #383838; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;" target="_blank">Arduino Board</a> </span></span><span style="font-weight: normal;"><span class="font-size-2" style="background-color: transparent; border: 0px; line-height: 1.2 !important; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><span style="background-color: transparent; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">- </span>1 <a href="http://www.labdegaragem.org/loja/index.php/n-channel-mosfet-60v-30a.html" style="background-color: transparent; border-bottom-style: none; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; color: #383838; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;" target="_blank">MOSFET Transistor (N-channel)</a> </span></span><span style="font-weight: normal;"><span class="font-size-2" style="background-color: transparent; border: 0px; line-height: 1.2 !important; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">- 1 <a href="http://www.labdegaragem.org/loja/index.php/novidades/p-channel-mosfet-60v-27a.html" style="background-color: transparent; border-bottom-style: none; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; color: #383838; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;" target="_blank">MOSFET Transistor (P-channel)</a></span></span><span style="font-weight: normal;"><span class="font-size-2" style="background-color: transparent; border: 0px; line-height: 1.2 !important; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">- 1 DC motor (5V - 1A)</span></span><span style="font-weight: normal;"><span class="font-size-2" style="background-color: transparent; border: 0px; line-height: 1.2 !important; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">- <a href="http://www.labdegaragem.org/loja/index.php/43-cabos-conexoes/jumpers-pacote-com-15-unidades.html" style="background-color: transparent; border-bottom-style: none; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; color: #383838; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;" target="_blank">Jumpers for Connection</a></span></span><span style="font-weight: normal;"><span class="font-size-2" style="background-color: transparent; border: 0px; line-height: 1.2 !important; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">- 1 Resistor of 200 Ohms</span></span><span style="font-weight: normal;"><span class="font-size-2" style="background-color: transparent; border: 0px; line-height: 1.2 !important; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">- 1 5V - 1A Source</span></span><span style="font-weight: normal;"><span class="font-size-2" style="background-color: transparent; border: 0px; line-height: 1.2 !important; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"> </span></span><span style="font-weight: normal;"><span class="font-size-2" style="background-color: transparent; border: 0px; line-height: 1.2 !important; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Hardware:</span></span><br />
<span style="font-weight: normal;"><span class="font-size-3" style="background-color: transparent; border: 0px; line-height: 1.2 !important; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><span class="font-size-2" style="background-color: transparent; border: 0px; line-height: 1.2 !important; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><span style="background-color: transparent; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><br /></span></span></span></span>
<span style="font-weight: normal;"><span class="font-size-3" style="background-color: transparent; border: 0px; line-height: 1.2 !important; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><span class="font-size-2" style="background-color: transparent; border: 0px; line-height: 1.2 !important; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><span style="background-color: transparent; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">With a N-channel MOSFET:</span></span></span></span><span style="font-weight: normal;"><span class="font-size-3" style="background-color: transparent; border: 0px; line-height: 1.2 !important; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><span style="background-color: transparent; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><a href="http://api.ning.com/files/43RjtIMQLEFn7saFmKTvpcZJxHQxlUwK51TCtthTuTs3YrBlFEH-X3zf0U2ctOtdaCzZ3bwucEC6K2HfSqZhzQ__/hardwareN.PNG" style="background-color: transparent; border-bottom-style: none; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; color: #383838; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;" target="_self"><img class="align-full" src="http://api.ning.com/files/43RjtIMQLEFn7saFmKTvpcZJxHQxlUwK51TCtthTuTs3YrBlFEH-X3zf0U2ctOtdaCzZ3bwucEC6K2HfSqZhzQ__/hardwareN.PNG?width=500" style="background-color: transparent; border: 0px; clear: both !important; display: block !important; height: auto; margin: 4px 0px; max-width: 737px; outline: 0px; padding: 0px; vertical-align: baseline;" width="500" /></a></span></span></span><span style="font-weight: normal;"><span class="font-size-3" style="background-color: transparent; border: 0px; line-height: 1.2 !important; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"> </span></span><br />
<span style="font-weight: normal;"><span class="font-size-2" style="background-color: transparent; border: 0px; line-height: 1.2 !important; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><span style="background-color: transparent; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">With a P-channel MOSFET:</span></span></span><span style="font-weight: normal;"><a href="http://api.ning.com/files/gxS3NaXMVCIcaJl55Di0ysBcuFM9MKNW6L7COFKEfZqUl-8m7P*xDJraJ4ORoOxNbz7PEHO9MOvXl58BxGMVrbRSVz3ZDwTK/HardwareP.PNG" style="background-color: transparent; border-bottom-style: none; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; color: #383838; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;" target="_self"><img class="align-full" src="http://api.ning.com/files/gxS3NaXMVCIcaJl55Di0ysBcuFM9MKNW6L7COFKEfZqUl-8m7P*xDJraJ4ORoOxNbz7PEHO9MOvXl58BxGMVrbRSVz3ZDwTK/HardwareP.PNG?width=500" style="background-color: transparent; border: 0px; clear: both !important; display: block !important; height: auto; margin: 4px 0px; max-width: 737px; outline: 0px; padding: 0px; vertical-align: baseline;" width="500" /></a></span><span style="font-weight: normal;"><br /></span><span style="font-weight: normal;"><br /></span><br />
<span style="font-weight: normal;">// Controlling a DC motor with a MOSFET transistor (basic application) for P-channel and N-channel</span><span style="font-weight: normal;">// The motor used in this Firmware is of 5V - 1A</span><span style="font-weight: normal;">// This hardware was not projected to control the sense of rotation of the motor (unless it inverts its polarity), only its speed.</span><span style="font-weight: normal;">// Nevertheless, it can be controlled by a more elaborated hardware (an H bridge of MOSFETs for example)</span><span style="font-weight: normal;"><br /></span><br />
<span style="font-weight: normal;"><br /></span>
<span style="font-weight: normal;">#define GatePin 6 // Defines the pin to receive the signal in the Gate of the MOS</span><br />
<span style="font-weight: normal;"><span style="background-color: transparent; border: 0px; color: #3366ff; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><br /></span></span>
<span style="font-weight: normal;"><span style="background-color: transparent; border: 0px; color: #3366ff; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">int GateSignal = 0</span>; // Value that will be set in the PWM pin (0 to 1023) for controlling the speed of motor.</span><span style="font-weight: normal;"><br /></span><br />
<span style="font-weight: normal;"><br /></span>
<span style="font-weight: normal;">void setup () </span><br />
<span style="font-weight: normal;"><br /></span>
<span style="font-weight: normal;">{</span><span style="font-weight: normal;">pinMode (GatePin, OUTPUT); // Defines Arduino's pin 5 as an output</span><span style="font-weight: normal;">}</span><br />
<span style="font-weight: normal;"><br /></span>
<span style="font-weight: normal;">void loop () </span><br />
<span style="font-weight: normal;">{ </span><span style="font-weight: normal;">while ((GateSignal <0) || (GateSignal >1023)) </span><br />
<span style="font-weight: normal;">{ </span><span style="font-weight: normal;">continue; </span><span style="font-weight: normal;">}</span><br />
<span style="font-weight: normal;">analogWrite (GatePin, GateSignal); // But if it is in this range, the Arduino sends the signal to the "GatePin".</span><span style="font-weight: normal;">}</span><span style="font-weight: normal;"><span style="line-height: 15px;"><br /></span></span><br />
<span style="font-weight: normal;"><span style="line-height: 15px;"><br /></span></span>
<span style="font-weight: normal;"><span style="line-height: 15px;"><br /></span></span>
<span style="font-weight: normal;"><span style="line-height: 15px;">Pay attention to the blue line of the code. In N-channel MOS polarization, the maximum rotation of the motor will be when the value of "GateSignal" is 1023 (therefore in N-channel the </span><em style="border: 0px; line-height: 15px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Gate </em><span style="line-height: 15px;">terminal conducts with logic level "1"). However in P-channel, this rotation will be the maximum if the logic level of "GateSignal" is "0" (therefore in P-channel the </span><em style="border: 0px; line-height: 15px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Gate </em><span style="line-height: 15px;">terminal conducts with logic level "0"). And the same happens with the minimum rotation.</span></span><br />
<br />
<br />
<br />
<h4 style="text-align: left;">
<div style="background-color: white; border: 0px; color: #454545; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; line-height: 20px; margin-bottom: 1em; min-height: 1em; outline: 0px; padding: 0px; vertical-align: baseline;">
</div>
<div style="background-color: white; border: 0px; color: #454545; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; line-height: 20px; margin-bottom: 1em; min-height: 1em; outline: 0px; padding: 0px; vertical-align: baseline;">
</div>
<div style="background-color: white; border: 0px; color: #454545; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; line-height: 20px; margin-bottom: 1em; min-height: 1em; outline: 0px; padding: 0px; vertical-align: baseline;">
</div>
<div style="background-color: white; border: 0px; color: #454545; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; line-height: 20px; margin-bottom: 1em; min-height: 1em; outline: 0px; padding: 0px; vertical-align: baseline;">
</div>
</h4>
<div style="background-color: white; border: 0px; color: #454545; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; line-height: 20px; margin-bottom: 1em; min-height: 1em; outline: 0px; padding: 0px; vertical-align: baseline;">
</div>
</div>
Anonymoushttp://www.blogger.com/profile/14732997283394377764noreply@blogger.com0tag:blogger.com,1999:blog-1660549699942964232.post-41541102607867103352013-08-08T19:02:00.001+05:302013-08-08T19:02:48.100+05:30Glow LED not Blow<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="background-color: white; font-family: arial, helvetica, clean, sans-serif; font-size: 13px; line-height: 16px; margin-bottom: 1em; padding: 0px;">
I've noticed that some people are uncertain how to calculate series resistance for a LED or when using a group of LEDs are uncertain about wiring them in series or parallel. This walkthrough will try and explain how and why.</div>
<div style="background-color: white; font-family: arial, helvetica, clean, sans-serif; font-size: 13px; line-height: 16px; margin-bottom: 1em; padding: 0px;">
LEDs come in a wide range of colour, brightness and power ratings. Some of the latest highpower LEDs even require heatsinking. No matter what LED you want to use, they all have some basic properties in common that you need to know before using them in a circuit.</div>
<div style="background-color: white; font-family: arial, helvetica, clean, sans-serif; font-size: 13px; line-height: 16px; margin-bottom: 1em; padding: 0px;">
First of all, LEDs are a polarised electronic component. This means that power must be connected the right way or else damage will occur. For this reason there is always some indication on the caseing as to which lead is positive and which is negative.</div>
<div style="background-color: white; font-family: arial, helvetica, clean, sans-serif; font-size: 13px; line-height: 16px; margin-bottom: 1em; padding: 0px;">
<img height="320" src="http://letsmakerobots.com/files/userpics/u1533/LED_label.jpg" width="224" /></div>
<h3 style="text-align: left;">
Calculate the resistor value</h3>
<div style="background-color: white; font-family: arial, helvetica, clean, sans-serif; font-size: 13px; line-height: 16px; margin-bottom: 1em; padding: 0px;">
To calculate the correct resistor value you need to know a few things about your LED.</div>
<div style="background-color: white; font-family: arial, helvetica, clean, sans-serif; font-size: 13px; line-height: 16px; margin-bottom: 1em; padding: 0px;">
1. what is it's forward voltage drop?</div>
<div style="background-color: white; font-family: arial, helvetica, clean, sans-serif; font-size: 13px; line-height: 16px; margin-bottom: 1em; padding: 0px;">
2. what is it's maximum continuous forward voltage.</div>
<div style="background-color: white; font-family: arial, helvetica, clean, sans-serif; font-size: 13px; line-height: 16px; margin-bottom: 1em; padding: 0px;">
This information should be supplied with you LEDs or can be found in the data sheet. I've attached the data sheet for a high intensity IR LED as an example of what to expect. It is worth becoming familiar with data sheets. You don't need to understand everything in them but you should be able to find basic information such as absolute maximum ratings and electrical characteristics. The second attachment covers a wide range of components but in the section on LEDs it gives you details on various LEDs such as forward voltage and max continuous current. It demonstrates that both values can vary widely depending on the LED.</div>
<div style="background-color: white; font-family: arial, helvetica, clean, sans-serif; font-size: 13px; line-height: 16px; margin-bottom: 1em; padding: 0px;">
Once you know the forward voltage drop and maximum current you can work out your circuit design and resistor values.</div>
<div style="background-color: white; font-family: arial, helvetica, clean, sans-serif; font-size: 13px; line-height: 16px; margin-bottom: 1em; padding: 0px;">
This is a basic power indication LED circuit. The formula for calculating the series resistor is:</div>
<div style="background-color: white; font-family: arial, helvetica, clean, sans-serif; font-size: 13px; line-height: 16px; margin-bottom: 1em; padding: 0px;">
R ohms = (Vsupply - VLED) / I where "I" is current in amps. For the circuit on the right, assume the supply voltage is 7.2V, the forward voltage of the diode is 2.1V and it's maximum forward current is 15mA.</div>
<div style="background-color: white; font-family: arial, helvetica, clean, sans-serif; font-size: 13px; line-height: 16px; margin-bottom: 1em; padding: 0px;">
R ohms = (7.2V - 2.1V) / 0.015A</div>
<div style="background-color: white; font-family: arial, helvetica, clean, sans-serif; font-size: 13px; line-height: 16px; margin-bottom: 1em; padding: 0px;">
R ohms = 5.1V / 0.015A</div>
<div style="background-color: white; font-family: arial, helvetica, clean, sans-serif; font-size: 13px; line-height: 16px; margin-bottom: 1em; padding: 0px;">
R ohms = 340 ohms</div>
<div style="background-color: white; font-family: arial, helvetica, clean, sans-serif; font-size: 13px; line-height: 16px; margin-bottom: 1em; padding: 0px;">
Since you can't get a 340 ohm resistor I would use a 390 ohm. The current would be less giving you a safety margin.</div>
<div style="background-color: white; font-family: arial, helvetica, clean, sans-serif; font-size: 13px; line-height: 16px; margin-bottom: 1em; padding: 0px;">
If you are driving a LED from a processor output as an indicator light then the same formula works except that your supply voltage is that of the processor (usually 5V) and your processor is limited on it maximum current output. Pic processors have a maximum limit of 25mA which is enough for most LEDs. Note that the forward voltage of the LED must be less than the supply voltage or else it wont light up.</div>
<div style="background-color: white; font-family: arial, helvetica, clean, sans-serif; font-size: 13px; line-height: 16px; margin-bottom: 1em; padding: 0px;">
<br /></div>
</div>
Anonymoushttp://www.blogger.com/profile/14732997283394377764noreply@blogger.com0tag:blogger.com,1999:blog-1660549699942964232.post-21955561475185422013-07-23T15:36:00.002+05:302013-08-08T23:48:07.816+05:30Serial LCD<div dir="ltr" style="text-align: left;" trbidi="on">
This example shows how to send serial input from a host computer to the LCD connected to microcontroller. I am using 4 bit mode to drive my LCD.<br />
<div>
<br /></div>
<div>
<br /></div>
<div>
<h4 style="text-align: left;">
Video</h4>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<object class="BLOGGER-youtube-video" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" data-thumbnail-src="http://i1.ytimg.com/vi/r_QeIuHMT_8/0.jpg" height="266" width="320"><param name="movie" value="http://www.youtube.com/v/r_QeIuHMT_8?version=3&f=user_uploads&c=google-webdrive-0&app=youtube_gdata" /><param name="bgcolor" value="#FFFFFF" /><param name="allowFullScreen" value="true" /><embed width="320" height="266" src="http://www.youtube.com/v/r_QeIuHMT_8?version=3&f=user_uploads&c=google-webdrive-0&app=youtube_gdata" type="application/x-shockwave-flash" allowfullscreen="true"></embed></object></div>
<div>
<br /></div>
<div>
<br /></div>
<h4 style="text-align: left;">
Original Photo</h4>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyw6RliuphlBN8YHZ5kELWB79L1QbrdYrs46SYuSLQ_d2PR7ix8c26nNGonm5nnKUEJ_Qk0QR2xbkc6x7NHkapl-Z862KIH5Coh8B7psVt_Y0IpjUn9a16v7FJQ5y5sFtPy9ikgxtdvBLF/s1600/IMG_0034.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyw6RliuphlBN8YHZ5kELWB79L1QbrdYrs46SYuSLQ_d2PR7ix8c26nNGonm5nnKUEJ_Qk0QR2xbkc6x7NHkapl-Z862KIH5Coh8B7psVt_Y0IpjUn9a16v7FJQ5y5sFtPy9ikgxtdvBLF/s320/IMG_0034.JPG" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAtWcrBsoT1NVry3gUnx1XKtvH77MA-Z39PHAJOcv8ukCn_fBUQBUvjkJZfDCjNAFHOeemUQZZDKqgsByxl9Mrgmot1j637D1n49sKaBmPkSzO6WckP0Y9HIAzFw5bwZjkDdG8D6ydoKk0/s1600/IMG_0053.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAtWcrBsoT1NVry3gUnx1XKtvH77MA-Z39PHAJOcv8ukCn_fBUQBUvjkJZfDCjNAFHOeemUQZZDKqgsByxl9Mrgmot1j637D1n49sKaBmPkSzO6WckP0Y9HIAzFw5bwZjkDdG8D6ydoKk0/s320/IMG_0053.JPG" width="320" /></a></div>
<div>
<br /></div>
<div>
<br /></div>
<h4 style="text-align: left;">
Pin Connection</h4>
<div style="text-align: left;">
<ul style="text-align: left;">
<li>LCD RS pin to digital pin 12</li>
<li>LCD Enable pin to digital pin 11</li>
<li>LCD D4 pin to digital pin 5</li>
<li>LCD D5 pin to digital pin 4</li>
<li>LCD D6 pin to digital pin 3</li>
<li>LCD D7 pin to digital pin 2</li>
</ul>
<h4 style="text-align: left;">
Schematic</h4>
<div>
<img height="245" src="http://arduino.cc/en/uploads/Tutorial/LCD_bb.png" width="400" /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<h4 style="text-align: left;">
Code</h4>
<div>
<pre style="white-space: pre-wrap; word-wrap: break-word;">#include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup(){
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
// initialize the serial communications:
Serial.begin(9600);
}
void loop()
{
// when characters arrive over the serial port...
if (Serial.available()) {
// wait a bit for the entire message to arrive
delay(100);
// clear the screen
lcd.clear();
// read all the available characters
while (Serial.available() > 0) {
// display each character to the LCD
lcd.write(Serial.read());
}
}
}</pre>
<pre style="white-space: pre-wrap; word-wrap: break-word;"></pre>
<pre style="white-space: pre-wrap; word-wrap: break-word;"></pre>
<pre style="white-space: pre-wrap; word-wrap: break-word;"></pre>
<pre style="white-space: pre-wrap; word-wrap: break-word;">Open the serial monitor, type anything and press send.</pre>
<pre style="white-space: pre-wrap; word-wrap: break-word;">The data from your PC will be displayed on your LCD.</pre>
</div>
</div>
</div>
</div>
Anonymoushttp://www.blogger.com/profile/14732997283394377764noreply@blogger.com0tag:blogger.com,1999:blog-1660549699942964232.post-84227770816911106862013-07-11T13:44:00.000+05:302013-08-08T23:49:17.329+05:30Mood Lamp<div dir="ltr" style="text-align: left;" trbidi="on">
Mood Lamp basically is a RGB led lamp made with 10 RGB led connected in parallel. This lamp is controlled by microcontroller which changes its colour through PWM pins.<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/8xW6LukfTW0?feature=player_embedded' frameborder='0'></iframe></div>
<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhG5GqWtmhLy7RQir84MJ0Imta2pXObi6anqihiPXtaQ7zQ2bDMG_GdpRotpqixMTMPKfYFcssqwG4K7XhYHto2P1V01UzT3qvZrq5Uir6bu3kk6P8VB5dtS6o_PwezYzkTEn33_GeTBK0b/s1600/a+(1).JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhG5GqWtmhLy7RQir84MJ0Imta2pXObi6anqihiPXtaQ7zQ2bDMG_GdpRotpqixMTMPKfYFcssqwG4K7XhYHto2P1V01UzT3qvZrq5Uir6bu3kk6P8VB5dtS6o_PwezYzkTEn33_GeTBK0b/s320/a+(1).JPG" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">RGB led </td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyAGvA6XLF0vMaYKW1eBTwkCpJQZHpRduP9yUcTlhWknouUJgfFOF_wgE20MI2dYho0Jb0xRcHiuVwmsY_L5SbkRogyg_0aBDxocjYtMPJAvIzfJrQO_WKByFm1c_KFnu7FC35EpcFRtlz/s1600/a+(6).JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyAGvA6XLF0vMaYKW1eBTwkCpJQZHpRduP9yUcTlhWknouUJgfFOF_wgE20MI2dYho0Jb0xRcHiuVwmsY_L5SbkRogyg_0aBDxocjYtMPJAvIzfJrQO_WKByFm1c_KFnu7FC35EpcFRtlz/s320/a+(6).JPG" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div style="text-align: left;">
<br /></div>
<h3 style="text-align: left;">
PARTS USED</h3>
<div style="text-align: left;">
<ul style="text-align: left;">
<li>RGB LEDs</li>
<li>PCB</li>
<li>Power supply (9v)</li>
<li>Arduino microcontroller</li>
<li>Transistor TIP122</li>
<li>Solder iron</li>
</ul>
</div>
<br />
<h3 style="text-align: left;">
Schematic </h3>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilQwRlWi50svHV_JNB9WNXIm67x2uBARVBIiCjm4ud2xmj0yVq2uAM5sbKN-2sCL3jAXoSbNay4ghq5V4lQ-KmTKeBR8QdJZ2c6IbzcgccjjKxvMLGZ9089t6NZhj25N3F51lPVHWzozUF/s1600/arduino+rgb.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="272" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilQwRlWi50svHV_JNB9WNXIm67x2uBARVBIiCjm4ud2xmj0yVq2uAM5sbKN-2sCL3jAXoSbNay4ghq5V4lQ-KmTKeBR8QdJZ2c6IbzcgccjjKxvMLGZ9089t6NZhj25N3F51lPVHWzozUF/s400/arduino+rgb.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">RGB led lamp Circuit</td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<h3 style="text-align: left;">
Code</h3>
<div>
<div>
int redPin = 6;</div>
<div>
int greenPin = 15;</div>
<div>
int bluePin = 3;</div>
<div>
</div>
<div>
void setup()</div>
<div>
{</div>
<div>
pinMode(redPin, OUTPUT);</div>
<div>
pinMode(greenPin, OUTPUT);</div>
<div>
pinMode(bluePin, OUTPUT); </div>
<div>
}</div>
<div>
</div>
<div>
void loop()</div>
<div>
{</div>
<div>
setColor(255, 0, 0); // red</div>
<div>
delay(1000);</div>
<div>
setColor(0, 255, 0); // green</div>
<div>
delay(1000);</div>
<div>
setColor(0, 0, 255); // blue</div>
<div>
delay(1000);</div>
<div>
setColor(255, 255, 0); // yellow</div>
<div>
delay(1000); </div>
<div>
setColor(80, 0, 80); // purple</div>
<div>
delay(1000);</div>
<div>
setColor(0, 255, 255); // aqua</div>
<div>
delay(1000);</div>
<div>
}</div>
<div>
</div>
<div>
void setColor(int red, int green, int blue)</div>
<div>
{</div>
<div>
analogWrite(redPin, red);</div>
<div>
analogWrite(greenPin, green);</div>
<div>
analogWrite(bluePin, blue); </div>
<div>
}</div>
</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
Change the code as per your project.</div>
<div>
<br /></div>
</div>
Anonymoushttp://www.blogger.com/profile/14732997283394377764noreply@blogger.com0tag:blogger.com,1999:blog-1660549699942964232.post-44775833740646370472013-07-03T17:19:00.001+05:302013-07-03T17:28:28.815+05:30Embedded system<p style="text-align: -webkit-auto; "><span style="-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);">An Embedded System is a computer system designed for specific control functions within a larger system. It is embedded as part of a complete device often including hardware and mechanical parts.</span></p><p style="text-align: -webkit-auto; "><span style="-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);">Embedded systems control many devices in common use today, namely Mobile Phones, Automobiles, Aircrafts, Computers, etc.</span></p><p style="text-align: -webkit-auto; "><span style="-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);">In simple words: An Embedded System is a combination of hardware and software whose purpose is to control a device, a process or a larger system.</span></p><p style="text-align: -webkit-auto; "><span style="-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);"></span></p><div class="separator" style="clear: both;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJRXXgpKyXm_lNLa_7pYpGeRePbAOS3HDCPneDT7yhIt7xsux9OrmIfQFvM2FjSChvAY2EJA4jXk44euXxtvHeRmr7ofkMKk9bzEjaWCr-qXVcZN7YzkE9UflTCrRt29SOnWEg2IZdpZfv/s640/blogger-image--732760428.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJRXXgpKyXm_lNLa_7pYpGeRePbAOS3HDCPneDT7yhIt7xsux9OrmIfQFvM2FjSChvAY2EJA4jXk44euXxtvHeRmr7ofkMKk9bzEjaWCr-qXVcZN7YzkE9UflTCrRt29SOnWEg2IZdpZfv/s640/blogger-image--732760428.jpg"></a></div><br><p></p><p style="text-align: -webkit-auto; "><span style="-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);"><br></span></p>Anonymoushttp://www.blogger.com/profile/14732997283394377764noreply@blogger.com0