<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6875261495822215624</id><updated>2024-12-19T09:00:49.288+05:30</updated><category term="Embedded System"/><category term="Analog Electronics"/><title type='text'>Surajkumar Sharma</title><subtitle type='html'>A lot of Engineering projects and tutorials on Embedded Systems, IoT, Home Automation, Arduino, Raspberry Pi, 8051 Microcontroller, ARM Cortex.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='https://surajkumartech.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/6875261495822215624/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='https://surajkumartech.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Surajkumar Sharma</name><uri>http://www.blogger.com/profile/01015148309961923598</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjT6-2WRSG9PYXDYi3KHvBxtZjIdjVviH3Omj_IfkGKELbvUkNn152moPlmho-cX1iaQQfyNHNDlhdU9sjVcDd_4-NmFs3n86oumBLjXoNUS2aH0MbsaYKfumtvRWwmGw/s220/Untitled-1.png'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>8</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6875261495822215624.post-5111303011984536448</id><published>2023-01-08T22:18:00.007+05:30</published><updated>2023-01-09T07:59:52.555+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Analog Electronics"/><title type='text'>Simple Wireless Power Transmission Circuit to Glow an LED </title><content type='html'>&lt;h2 style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-family: Noticia Text; font-size: x-large;&quot;&gt;&lt;b&gt;Simple Wireless Power Transmission Circuit to Glow an LED&lt;/b&gt;&amp;nbsp;&lt;/span&gt;&lt;/h2&gt;&lt;div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcJJdwWvmypH-K4LQAtni-MT6mFp0tO6xjESctd2ox_PP-SQqFzjgo6j9F5m_nJGzDBBlzOawurWwVNMVNgjREt2MTDr6J34YmJLADIWq53T3RpxbNMaJLsEr0WyUS5460kwRo7crPfn5klxaCt-D_nGReU44nCg0NaRt8EUSzdi5y01KSGu45xkNl/s1280/maxresdefault.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;720&quot; data-original-width=&quot;1280&quot; height=&quot;254&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcJJdwWvmypH-K4LQAtni-MT6mFp0tO6xjESctd2ox_PP-SQqFzjgo6j9F5m_nJGzDBBlzOawurWwVNMVNgjREt2MTDr6J34YmJLADIWq53T3RpxbNMaJLsEr0WyUS5460kwRo7crPfn5klxaCt-D_nGReU44nCg0NaRt8EUSzdi5y01KSGu45xkNl/w452-h254/maxresdefault.jpg&quot; width=&quot;452&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Noticia Text; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;h3 class=&quot;rtejustify&quot; style=&quot;background-color: white; box-sizing: border-box; color: #0e3d79; font-family: Lato; font-size: 24px; font-weight: 500; line-height: 1.1; margin-bottom: 10px; margin-top: 20px; text-align: justify;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;In this project, we will build a basic&amp;nbsp;&lt;span style=&quot;box-sizing: border-box; color: #121212; font-size: 17px;&quot;&gt;low powered wireless transmitter circuit to glow an LED.&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 class=&quot;rtejustify&quot; style=&quot;background-color: white; box-sizing: border-box; color: #0e3d79; font-family: Lato; font-size: 24px; font-weight: 500; line-height: 1.1; margin-bottom: 10px; margin-top: 20px; text-align: justify;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;Components Required&lt;/span&gt;&lt;/h3&gt;&lt;ol style=&quot;background-color: white; box-sizing: border-box; color: #121212; font-family: Lato; font-size: 17px; margin-bottom: 10px; margin-top: 0px; padding-left: 1.5em;&quot;&gt;&lt;li class=&quot;rtejustify&quot; style=&quot;box-sizing: border-box; text-align: justify;&quot;&gt;Transistor BD 139&lt;/li&gt;&lt;li class=&quot;rtejustify&quot; style=&quot;box-sizing: border-box; text-align: justify;&quot;&gt;LED&lt;/li&gt;&lt;li class=&quot;rtejustify&quot; style=&quot;box-sizing: border-box; text-align: justify;&quot;&gt;Hook up wires&lt;/li&gt;&lt;li class=&quot;rtejustify&quot; style=&quot;box-sizing: border-box; text-align: justify;&quot;&gt;1.2k resistors&lt;/li&gt;&lt;li class=&quot;rtejustify&quot; style=&quot;box-sizing: border-box; text-align: justify;&quot;&gt;Copper wires&lt;/li&gt;&lt;li class=&quot;rtejustify&quot; style=&quot;box-sizing: border-box; text-align: justify;&quot;&gt;1.5V battery&lt;/li&gt;&lt;/ol&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;color: #121212; font-family: Lato;&quot;&gt;&lt;span&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 17px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;h3 class=&quot;rtejustify&quot; style=&quot;background-color: white; box-sizing: border-box; color: #0e3d79; font-family: Lato; font-size: 24px; font-weight: 500; line-height: 1.1; margin-bottom: 10px; margin-top: 20px; text-align: justify;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;Circuit Diagram&lt;/span&gt;&lt;/h3&gt;&lt;p class=&quot;rtejustify&quot; style=&quot;background-color: white; box-sizing: border-box; color: #121212; font-family: Lato; font-size: 17px; margin: 0px 0px 20px; text-align: justify;&quot;&gt;The schematics, for&amp;nbsp;&lt;span style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;transferring electricity wirelessly&lt;/span&gt;&amp;nbsp;to glow an LED, is simple and can be seen in the below image, It has two parts,&amp;nbsp;&lt;span style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;Transmitter, and the receiver&lt;/span&gt;.&lt;/p&gt;&lt;p class=&quot;rtejustify&quot; style=&quot;background-color: white; box-sizing: border-box; color: #121212; font-family: Lato; font-size: 17px; margin: 0px 0px 20px; text-align: justify;&quot;&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXLcrSEHZKpH3_jYSBbHq-PuI7QnakW0vFIL67CKAkyWtNB8cTMVOI-iOpGRkJUZJd94wk9FDKsyaAI4gv0h2T-EhEMnuN7jtoKGxz0Im4xs8V2rbpAUtSHcNkskUaLCltrGkp7SKM-J7tJHfdIgDOjP--ojI1-5MCrNB8osDjGGz2c2PN5GjyzBCP/s956/circuit_PowerTransfer.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;956&quot; data-original-width=&quot;950&quot; height=&quot;457&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXLcrSEHZKpH3_jYSBbHq-PuI7QnakW0vFIL67CKAkyWtNB8cTMVOI-iOpGRkJUZJd94wk9FDKsyaAI4gv0h2T-EhEMnuN7jtoKGxz0Im4xs8V2rbpAUtSHcNkskUaLCltrGkp7SKM-J7tJHfdIgDOjP--ojI1-5MCrNB8osDjGGz2c2PN5GjyzBCP/w454-h457/circuit_PowerTransfer.png&quot; width=&quot;454&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;span style=&quot;text-align: justify;&quot;&gt;At Transmitter side, the coils are connected across the collector of the transistor, 17 turn on both sides. And the receiver is constructed using three components- transistor, resistor, and a center tapped air core inductor or a copper coil. Receiver side has an LED connected across the 34 turns copper coil.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;span&gt;&lt;!--more--&gt;&lt;/span&gt;&lt;span style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;h3 class=&quot;rtejustify&quot; style=&quot;background-color: white; box-sizing: border-box; color: #0e3d79; font-family: Lato; font-size: 24px; font-weight: 500; line-height: 1.1; margin-bottom: 10px; margin-top: 20px; text-align: justify;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;Construction of the Wireless Power Transmission Circuit&lt;/span&gt;&lt;/h3&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;p class=&quot;rtejustify&quot; style=&quot;background-color: white; box-sizing: border-box; color: #121212; font-family: Lato; font-size: 17px; margin: 0px 0px 20px; text-align: justify;&quot;&gt;Here the transistor used is NPN Transistor, any basic NPN transistor can be used here like BD139.&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAeZZjqJ2pA29eJBUoVTCFE_OzxRnCnII6Cnh1_em8TZfffCeYn4LiTf4UX7ZDod5OJRqE3FHTDBdVg13WU2voKAWeQxbMuQO_PNnq4tzly2zivXldxHhj4H8KqrAWvaJuN26Vn2Aq1OYH_lERLdydL3_40gvR5aafQ5s4avqrXYc-MZ4R7UM0xs1c/s960/bd139-transistor-pinout-equivalent-applications.gif&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;816&quot; data-original-width=&quot;960&quot; height=&quot;272&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAeZZjqJ2pA29eJBUoVTCFE_OzxRnCnII6Cnh1_em8TZfffCeYn4LiTf4UX7ZDod5OJRqE3FHTDBdVg13WU2voKAWeQxbMuQO_PNnq4tzly2zivXldxHhj4H8KqrAWvaJuN26Vn2Aq1OYH_lERLdydL3_40gvR5aafQ5s4avqrXYc-MZ4R7UM0xs1c/s320/bd139-transistor-pinout-equivalent-applications.gif&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;p class=&quot;rtejustify&quot; style=&quot;background-color: white; box-sizing: border-box; color: #121212; font-family: Lato; font-size: 17px; margin: 0px 0px 20px; text-align: justify;&quot;&gt;Coil is the crucial part in wireless energy transfer and should be built carefully. In this project, the coils are made using copper wire of&lt;span style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;&amp;nbsp;29AWG&lt;/span&gt;. Center tapped coil formation is done on the transmitter side. is used and a cylindrical coil wrapper like PVC pipe is required to wind the coil.&lt;/p&gt;&lt;p class=&quot;rtejustify&quot; style=&quot;background-color: white; box-sizing: border-box; color: #121212; font-family: Lato; font-size: 17px; margin: 0px 0px 20px; text-align: justify;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;For the transmitter&lt;/span&gt;, wind the wire till 17-turns, then the loop for center tap connection and again make 17 turns of coil. And&amp;nbsp;&lt;span style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;for the receiver&lt;/span&gt;, make a 34 turns of coil winding without the center tap.&lt;/p&gt;&lt;span&gt;&lt;!--more--&gt;&lt;/span&gt;&lt;p class=&quot;rtejustify&quot; style=&quot;background-color: white; box-sizing: border-box; color: #121212; font-family: Lato; font-size: 17px; margin: 0px 0px 20px; text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;h3 class=&quot;rtejustify&quot; style=&quot;background-color: white; box-sizing: border-box; color: #0e3d79; font-family: Lato; font-size: 24px; font-weight: 500; line-height: 1.1; margin-bottom: 10px; margin-top: 20px; text-align: justify;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;Working of the Wireless Electricity Transfer Circuit&lt;/span&gt;&lt;/h3&gt;&lt;p class=&quot;rtejustify&quot; style=&quot;background-color: white; box-sizing: border-box; color: #121212; font-family: Lato; font-size: 17px; margin: 0px 0px 20px; text-align: justify;&quot;&gt;This circuits is powered using a 1.5V battery. The circuit can’t be used for more than 1.5 volt power supply as transistor may heat up for excessive power dissipation. However, for more rating, additional driving circuits are needed.&lt;/p&gt;&lt;p class=&quot;rtejustify&quot; style=&quot;background-color: white; box-sizing: border-box; color: #121212; font-family: Lato; font-size: 17px; margin: 0px 0px 20px; text-align: justify;&quot;&gt;This wireless electricity transmission is based on the Inductive coupling technique. The circuit consists of two parts-&amp;nbsp;&lt;span style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;Transmitter and Receiver&lt;/span&gt;.&lt;/p&gt;&lt;p class=&quot;rtejustify&quot; style=&quot;background-color: white; box-sizing: border-box; color: #121212; font-family: Lato; font-size: 17px; margin: 0px 0px 20px; text-align: justify;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;In transmitter section&lt;/span&gt;, the Transistor is generating high-frequency AC current across the coil and the coil is generating a magnetic field around it. As the coil is center tapped, the two sides of the coil start to charge up. One side of the coil is connected to the resistor and another side is connected to the collector terminal of NPN transistor. During the charging condition, the base resistor starts to conduct which eventually turns on the transistor. The transistor then discharges the inductor as the emitter is connected with the ground. This charging and discharging of the inductor produces a very high frequency oscillation signal which is further transmitted as a magnetic field.&lt;/p&gt;&lt;p class=&quot;rtejustify&quot; style=&quot;background-color: white; box-sizing: border-box; color: #121212; font-family: Lato; font-size: 17px; margin: 0px 0px 20px; text-align: justify;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;On the receiver side&lt;/span&gt;, that magnetic field is transferred into the other coil, and by the Faraday’s law of induction, the receiver coil start producing EMF voltage which is further used to light up the LED.&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4qMS1QmuPrWTB468JgMYtIWWOxUdag-5l8K1qN-HgdLdpHFMse-pleX42gQUAmh_KJERd5Z5O1ZjdnA_CXjWqFnVkoJInWUvHVQkT-Cqqvjot98WtiW1ujDR5x_zdzZ8hrpr97Y9IVHmeQvJQv4y7g0eeadQr7NuNMOFuv4XdcAl0nTrGb6dxYa4q/s770/Wireless-Power-Transfer-1.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;350&quot; data-original-width=&quot;770&quot; height=&quot;245&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4qMS1QmuPrWTB468JgMYtIWWOxUdag-5l8K1qN-HgdLdpHFMse-pleX42gQUAmh_KJERd5Z5O1ZjdnA_CXjWqFnVkoJInWUvHVQkT-Cqqvjot98WtiW1ujDR5x_zdzZ8hrpr97Y9IVHmeQvJQv4y7g0eeadQr7NuNMOFuv4XdcAl0nTrGb6dxYa4q/w543-h245/Wireless-Power-Transfer-1.jpg&quot; width=&quot;543&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;span&gt;&lt;!--more--&gt;&lt;/span&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style=&quot;background-color: white; color: #121212; font-family: Lato; font-size: 17px; text-align: justify;&quot;&gt;&lt;div&gt;&lt;h3 class=&quot;rtejustify&quot; style=&quot;box-sizing: border-box; color: #0e3d79; font-size: 24px; font-weight: 500; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;Applications of Wireless Power Transmission&lt;/span&gt;&lt;/h3&gt;&lt;p class=&quot;rtejustify&quot; style=&quot;box-sizing: border-box; margin: 0px 0px 20px;&quot;&gt;Wireless power transfer (WPT) is a widely discussed topic in the electronics industry. This technology is growing rapidly in the consumer electronics market for smartphones and chargers.&lt;/p&gt;&lt;/div&gt;Wireless Energy Transfer can have huge applications and many big companies like Bosch, IKEA, Qi are working on some futuristic solutions using Wireless power transmission.&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://surajkumartech.blogspot.com/feeds/5111303011984536448/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://surajkumartech.blogspot.com/2023/01/simple-wireless-power-transmission.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/6875261495822215624/posts/default/5111303011984536448'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/6875261495822215624/posts/default/5111303011984536448'/><link rel='alternate' type='text/html' href='https://surajkumartech.blogspot.com/2023/01/simple-wireless-power-transmission.html' title='Simple Wireless Power Transmission Circuit to Glow an LED '/><author><name>Surajkumar Sharma</name><uri>http://www.blogger.com/profile/01015148309961923598</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjT6-2WRSG9PYXDYi3KHvBxtZjIdjVviH3Omj_IfkGKELbvUkNn152moPlmho-cX1iaQQfyNHNDlhdU9sjVcDd_4-NmFs3n86oumBLjXoNUS2aH0MbsaYKfumtvRWwmGw/s220/Untitled-1.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcJJdwWvmypH-K4LQAtni-MT6mFp0tO6xjESctd2ox_PP-SQqFzjgo6j9F5m_nJGzDBBlzOawurWwVNMVNgjREt2MTDr6J34YmJLADIWq53T3RpxbNMaJLsEr0WyUS5460kwRo7crPfn5klxaCt-D_nGReU44nCg0NaRt8EUSzdi5y01KSGu45xkNl/s72-w452-h254-c/maxresdefault.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6875261495822215624.post-416313172347193677</id><published>2021-05-23T19:02:00.019+05:30</published><updated>2021-05-31T15:56:01.740+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Embedded System"/><title type='text'>Pulse Oximeter Sensor with Arduino</title><content type='html'>&lt;p&gt;&lt;span style=&quot;background-color: white; color: #2c2f34; font-family: Poppins; font-size: 41px;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;h2 style=&quot;clear: both; text-align: center;&quot;&gt;&lt;span style=&quot;background-color: white; color: #2c2f34; text-align: left;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Arvo; font-size: x-large;&quot;&gt;Pulse Oximeter Sensor with Arduino&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;&lt;div&gt;&lt;span style=&quot;background-color: white; color: #2c2f34; text-align: left;&quot;&gt;&lt;b&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgasbqmkcaEjJjaGQW73tNhAe8HiV58uCp_c0l0GBdfneolqDdBN5cq9j19ctGRWeD6NSI4DZ8tzXqsBahO-jEiN6_ISc8_0z98FiPKoTzcbeASp0h79ulKxkLpzTvtoGItdIUj1bN2b8g/s2048/PXL_20210523_172154847.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1536&quot; data-original-width=&quot;2048&quot; height=&quot;451&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgasbqmkcaEjJjaGQW73tNhAe8HiV58uCp_c0l0GBdfneolqDdBN5cq9j19ctGRWeD6NSI4DZ8tzXqsBahO-jEiN6_ISc8_0z98FiPKoTzcbeASp0h79ulKxkLpzTvtoGItdIUj1bN2b8g/w601-h451/PXL_20210523_172154847.jpg&quot; width=&quot;601&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Arvo; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;h3 style=&quot;border: 0px; box-sizing: border-box; color: blue; font-size: 23px; line-height: 1.4; list-style: none; margin: 0px 0px 0.5em; outline: none; padding: 0px;&quot;&gt;&lt;span id=&quot;Interfacing_MAX30100_Pulse_Oximeter_Sensor_with_Arduino_038_LCD_Display&quot; style=&quot;border: 0px; box-sizing: border-box; list-style: none; margin: 0px; outline: none; padding: 0px;&quot;&gt;&lt;span style=&quot;border: 0px; box-sizing: border-box; list-style: none; margin: 0px; outline: none; padding: 0px;&quot;&gt;&lt;span style=&quot;font-family: Arvo;&quot;&gt;Interfacing MAX30100 Pulse Oximeter Sensor with Arduino &amp;amp; LCD Display&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;&lt;div&gt;&lt;span style=&quot;border: 0px; box-sizing: border-box; list-style: none; margin: 0px; outline: none; padding: 0px;&quot;&gt;&lt;span style=&quot;border: 0px; box-sizing: border-box; list-style: none; margin: 0px; outline: none; padding: 0px;&quot;&gt;&lt;span style=&quot;font-family: Arvo;&quot;&gt;A pulse oximeter is a device used to monitor both your heart rate and blood oxygen concentration. This device is especially important for people who need to monitor these parameters due to certain health conditions, such as asthma or congestive heart failure.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;border: 0px; box-sizing: border-box; list-style: none; margin: 0px; outline: none; padding: 0px;&quot;&gt;&lt;span style=&quot;border: 0px; box-sizing: border-box; list-style: none; margin: 0px; outline: none; padding: 0px;&quot;&gt;&lt;span style=&quot;font-family: Arvo;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: #2c2f34;&quot;&gt;&lt;span style=&quot;border: 0px; box-sizing: border-box; list-style: none; margin: 0px; outline: none; padding: 0px;&quot;&gt;&lt;span style=&quot;border: 0px; box-sizing: border-box; list-style: none; margin: 0px; outline: none; padding: 0px;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;&lt;div&gt;In this project, 16X2 LCD Display is used to see the value of BPM &amp;amp; SpO2 instead of Serial Monitor. Assemble the circuit as shown in the circuit diagram below.&lt;/div&gt;&lt;div&gt;Connect the Vin pin of MAX30100 to Arduino 5V or 3.3V pin, GND to GND. Connect the I2C Pin, SCL &amp;amp; SDA of MAX30100 to A5 &amp;amp; A4 of Arduino. Similarly connect the LCD pin 1, 5, 16 to GND of Arduino and 2, 15 to 5V VCC. Similarly connect LCD pin 4, 6, 11, 12, 13, 14 to Arduino pin 13, 12, 11, 10, 9, 8. Use 2-10K Potentiometer at pin 3 of LCD to adjust the contrast of LCD.&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border: 0px; box-sizing: border-box; color: black; font-size: 17px; line-height: 2; list-style: none; margin: 0px 0px 25px; outline: none; padding: 0px; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;&lt;b style=&quot;color: #2c2f34; font-family: Arvo; font-size: x-large;&quot;&gt;CONNECTIONS:-&lt;/b&gt;&lt;/span&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzt2_0wFWKjiS-tRaHStBFAg41kyaa-MOaEh5vHJv4wcqPd7neIxv9CotdAHkVm-0U09mJ79BbUJdNHygKf4KH88Di7CVrtMAYrh372PQ0qwUtQXuhz7DAmv4dac9_DzYSl-2zixbH7Xs/s1677/OXIMETER_bb1.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1115&quot; data-original-width=&quot;1677&quot; height=&quot;429&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzt2_0wFWKjiS-tRaHStBFAg41kyaa-MOaEh5vHJv4wcqPd7neIxv9CotdAHkVm-0U09mJ79BbUJdNHygKf4KH88Di7CVrtMAYrh372PQ0qwUtQXuhz7DAmv4dac9_DzYSl-2zixbH7Xs/w645-h429/OXIMETER_bb1.jpg&quot; width=&quot;645&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;clear: both; color: #2c2f34; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab; font-size: large;&quot;&gt;&lt;b&gt;MAX30100-&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;clear: both; color: #2c2f34; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab; font-size: medium;&quot;&gt;If you purchased the MAX30100 Module shown below, then it might not work. The MAX30100 IC uses 1.8V for VDD and this particular module uses two regulators to achieve this voltage. Nothing wrong with that.As you can see the SCL and SDA pins are pulled-up via the 4.7k ohm resistors to 1.8V! This means it won’t work well with microcontrollers with higher logic levels.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;clear: both; color: #2c2f34; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab; font-size: medium;&quot;&gt;&lt;span style=&quot;color: #2c2f34;&quot;&gt;So to operate it with the higher logic level (&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;b&gt;3.3V&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #2c2f34;&quot;&gt;), cut the path in the place of the red cross and make a jumper connection as shown by the yellow line.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab; font-size: medium;&quot;&gt;&lt;span style=&quot;color: #2c2f34;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3wZfXsncJaQ4Isnu2jEYsAni5RkVMVT6RTALw9J3RrtWxxTWJ615RcqwslAA6zUAdvRK4jYNmoFjMeUtIbziTdAF9Wyc1ptfsUIqE7_CQ3HCWc77Ie8kI6leMQkXYk60Y0K4W6kl8X3A/s785/Untitled-2+%25282%2529.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;664&quot; data-original-width=&quot;785&quot; height=&quot;260&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3wZfXsncJaQ4Isnu2jEYsAni5RkVMVT6RTALw9J3RrtWxxTWJ615RcqwslAA6zUAdvRK4jYNmoFjMeUtIbziTdAF9Wyc1ptfsUIqE7_CQ3HCWc77Ie8kI6leMQkXYk60Y0K4W6kl8X3A/w308-h260/Untitled-2+%25282%2529.jpg&quot; width=&quot;308&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8A6T8Q-hCeP0Q0_ZkIc8wxizWXn0ONt4YGzEShUuuheBj1pFK1TXJ_7tXjus0sN7usGLfPPcltDJpNf46gGNh1pMhvoYSpeqoSMKbL7mHQCB33XePAGCfaVNWLmnR6Cm9YOOxw5nmfmQ/s971/IMG_20210531_101900+%25282%2529.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;858&quot; data-original-width=&quot;971&quot; height=&quot;245&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8A6T8Q-hCeP0Q0_ZkIc8wxizWXn0ONt4YGzEShUuuheBj1pFK1TXJ_7tXjus0sN7usGLfPPcltDJpNf46gGNh1pMhvoYSpeqoSMKbL7mHQCB33XePAGCfaVNWLmnR6Cm9YOOxw5nmfmQ/w277-h245/IMG_20210531_101900+%25282%2529.jpg&quot; width=&quot;277&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; color: #2c2f34; font-size: 41px; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: white; color: #2c2f34; font-family: Arvo; font-size: large;&quot;&gt;&lt;b&gt;CODE:-&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWYlIpnZ4PRSoxYSsEfWNZ66WObEHu4nH1jjr2ZFBs1cJIDYj3tEaDYT0CObfo0Kz54LQG1-zthhPnGetB06I3GO5yjg7dRrlrc1dJBizT3zqBhXoS6UQUw-BJ53buw-_LHKVZJ_bC9-U/s2048/carbon+%25282%2529.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;2048&quot; data-original-width=&quot;1339&quot; height=&quot;956&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWYlIpnZ4PRSoxYSsEfWNZ66WObEHu4nH1jjr2ZFBs1cJIDYj3tEaDYT0CObfo0Kz54LQG1-zthhPnGetB06I3GO5yjg7dRrlrc1dJBizT3zqBhXoS6UQUw-BJ53buw-_LHKVZJ_bC9-U/w625-h956/carbon+%25282%2529.png&quot; width=&quot;625&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span style=&quot;background-color: white; color: #2c2f34; font-family: Roboto Slab; font-size: large;&quot;&gt;&lt;b&gt;&lt;div&gt;&lt;span style=&quot;background-color: white; color: #2c2f34;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;div&gt;&lt;span style=&quot;background-color: white; color: #2c2f34; font-family: Arvo; font-size: medium;&quot;&gt;&lt;pre class=&quot;lang:default decode:true&quot; style=&quot;background-color: whitesmoke; border-radius: 4px; border: 1px solid rgb(204, 204, 204); box-sizing: inherit; color: #333333; letter-spacing: 1px; line-height: 1.6; margin-bottom: 1.6em; margin-top: 0px; max-width: 100%; overflow-wrap: break-word; overflow: auto; padding: 1.6em; word-break: break-all;&quot;&gt;&lt;div style=&quot;color: black; letter-spacing: normal; white-space: normal;&quot;&gt;&lt;b&gt;&lt;div&gt;&lt;div&gt;#include &amp;lt;LiquidCrystal.h&amp;gt;&lt;/div&gt;&lt;div&gt;#include &amp;lt;Wire.h&amp;gt;&lt;/div&gt;&lt;div&gt;#include &quot;MAX30100_PulseOximeter.h&quot;&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;LiquidCrystal lcd(13, 12, 11, 10, 9, 8);&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: Arvo;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;#define REPORTING_PERIOD_MS&amp;nbsp; &amp;nbsp; &amp;nbsp;1000&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: Arvo;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;PulseOximeter pox;&lt;/div&gt;&lt;div&gt;uint32_t tsLastReport = 0;&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;void onBeatDetected()&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; Serial.println(&quot;Beat!&quot;);&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;void setup()&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; Serial.begin(115200);&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; Serial.print(&quot;Initializing pulse oximeter..&quot;);&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: Arvo;&quot;&gt;&amp;nbsp; &amp;nbsp; lcd.begin(16,2);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; lcd.print(&quot;Initializing...&quot;);&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; delay(3000);&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; lcd.clear();&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp;power supply&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; if (!pox.begin()) {&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Serial.println(&quot;FAILED&quot;);&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for(;;);&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; } else {&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Serial.println(&quot;SUCCESS&quot;);&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; }&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;pox.setIRLedCurrent(MAX30100_LED_CURR_7_6MA);&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; pox.setOnBeatDetectedCallback(onBeatDetected);&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;void loop()&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; pox.update();&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; if (millis() - tsLastReport &amp;gt; REPORTING_PERIOD_MS) {&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Serial.print(&quot;Heart rate:&quot;);&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Serial.print(pox.getHeartRate());&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Serial.print(&quot;bpm / SpO2:&quot;);&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Serial.print(pox.getSpO2());&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Serial.println(&quot;%&quot;);&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; lcd.clear();&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; lcd.setCursor(0,0);&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; lcd.print(&quot;BPM : &quot;);&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; lcd.print(pox.getHeartRate());&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; lcd.setCursor(0,1);&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; lcd.print(&quot;SpO2: &quot;);&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; lcd.print(pox.getSpO2());&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; lcd.print(&quot;%&quot;);&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; tsLastReport = millis();&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; }&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;/div&gt;&lt;/b&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;background-color: white; color: #2c2f34;&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style=&quot;font-family: Arvo; font-size: large;&quot;&gt;OUTPUT:-&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_XvefJSNwX5jGOblY7P1JmgkjvgTHkqbJU8k_nLWcT5NWUebKSRbcIHyWFnCRlBJeJAwe7c_tzV2pVk1eJzXG5vhdNq1NcOvt66ZcCew-uht7UhcnEXOmi85x63n3MFTAkl3lJRvN3uU/s2048/PXL_20210523_172410130.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1536&quot; data-original-width=&quot;2048&quot; height=&quot;441&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_XvefJSNwX5jGOblY7P1JmgkjvgTHkqbJU8k_nLWcT5NWUebKSRbcIHyWFnCRlBJeJAwe7c_tzV2pVk1eJzXG5vhdNq1NcOvt66ZcCew-uht7UhcnEXOmi85x63n3MFTAkl3lJRvN3uU/w587-h441/PXL_20210523_172410130.jpg&quot; width=&quot;587&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style=&quot;background-color: white; color: #2c2f34; font-family: Poppins; font-size: 41px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;background-color: white; color: #2c2f34; font-family: Poppins; font-size: 41px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://surajkumartech.blogspot.com/feeds/416313172347193677/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://surajkumartech.blogspot.com/2021/05/pulse-oximeter-sensor-with-arduino.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/6875261495822215624/posts/default/416313172347193677'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/6875261495822215624/posts/default/416313172347193677'/><link rel='alternate' type='text/html' href='https://surajkumartech.blogspot.com/2021/05/pulse-oximeter-sensor-with-arduino.html' title='Pulse Oximeter Sensor with Arduino'/><author><name>Surajkumar Sharma</name><uri>http://www.blogger.com/profile/01015148309961923598</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjT6-2WRSG9PYXDYi3KHvBxtZjIdjVviH3Omj_IfkGKELbvUkNn152moPlmho-cX1iaQQfyNHNDlhdU9sjVcDd_4-NmFs3n86oumBLjXoNUS2aH0MbsaYKfumtvRWwmGw/s220/Untitled-1.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgasbqmkcaEjJjaGQW73tNhAe8HiV58uCp_c0l0GBdfneolqDdBN5cq9j19ctGRWeD6NSI4DZ8tzXqsBahO-jEiN6_ISc8_0z98FiPKoTzcbeASp0h79ulKxkLpzTvtoGItdIUj1bN2b8g/s72-w601-h451-c/PXL_20210523_172154847.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6875261495822215624.post-3216316049921422037</id><published>2021-03-26T12:56:00.009+05:30</published><updated>2021-04-14T01:10:29.398+05:30</updated><title type='text'>Interfacing Stepper Motor with 8051Microcontroller</title><content type='html'>&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: red; font-family: Arvo; font-size: large;&quot;&gt;&amp;nbsp;Interfacing Stepper Motor with 8051Microcontroller&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOQhKV7r_FLy4AcFK11pEFgOwiYCb67Wy_Zy8K9L6GspOFkmlifz5UxfLEJC21YdElIVYt2nMTZLdcvDzWKFsE1ClNsjQTsMqoFrBHNX5K-zpf6DcE9F4vjuswS2rY8izVjm_hiu9p8GQ/s1431/stepper-1.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;720&quot; data-original-width=&quot;1431&quot; height=&quot;321&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOQhKV7r_FLy4AcFK11pEFgOwiYCb67Wy_Zy8K9L6GspOFkmlifz5UxfLEJC21YdElIVYt2nMTZLdcvDzWKFsE1ClNsjQTsMqoFrBHNX5K-zpf6DcE9F4vjuswS2rY8izVjm_hiu9p8GQ/w617-h321/stepper-1.jpg&quot; width=&quot;617&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span face=&quot;sans-serif&quot; style=&quot;color: #202122;&quot;&gt;&lt;span style=&quot;background-color: white; font-family: Roboto Slab;&quot;&gt;A stepper motor, also known as a step motor or stepping motor, is a brushless DC electric motor that divides a full rotation into a number of equal steps. The motor&#39;s position can then be commanded to move and hold at one of these steps without any position sensor for feedback (an open-loop controller), as long as the motor is carefully sized to the application in respect to torque and speed.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;h2 style=&quot;color: rgba(0, 0, 0, 0.87); font-size: 20px; line-height: 2rem; margin: 0px; padding: 0px;&quot;&gt;&lt;span style=&quot;font-family: Arvo;&quot;&gt;Interfacing Stepper Motor with 8051 Microcontroller&lt;/span&gt;&lt;/h2&gt;&lt;div style=&quot;font-size: 16px; margin: 0.5em 0em 0.7em; padding: 0px; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;We are using Port P0 of 8051 for connecting the stepper motor. HereULN2003 is used. This is basically a high voltage, high current Darlington transistor array. Each ULN2003 has seven NPN Darlington pairs. It can provide high voltage output with common-cathode clamp diodes for switching inductive loads.&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: &amp;quot;Roboto Slab&amp;quot;; font-size: 16px; font-weight: 700; text-align: justify;&quot;&gt;Wave Drive Mode&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Roboto Slab&amp;quot;; font-size: 16px; text-align: justify;&quot;&gt;&amp;nbsp;− In this mode, one coil is energized at a time. So all four coils are energized one after another. This mode produces less torque than the full-step drive mode.&lt;/span&gt;&lt;br /&gt;&lt;div style=&quot;font-size: 16px; margin: 0.5em 0em 0.7em; padding: 0px; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;The following table is showing the sequence of input states in different windings.&lt;/span&gt;&lt;/div&gt;&lt;p style=&quot;font-size: 16px; margin: 0.5em 0em 0.7em; padding: 0px; text-align: justify;&quot;&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhArDiU2f5xGjac_clSWHXDpgcbELDXRnTF2Q0_Z64pX45eWgFeM_L6lrW4g3_twLMQTH0TsQ8hvVn-ng2o530FddRIHvnEresD4c6m-YV2r6HBkSpbuNzjfMeXW6FjEEFw3UJpytgWk84/s1267/1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;371&quot; data-original-width=&quot;1267&quot; height=&quot;189&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhArDiU2f5xGjac_clSWHXDpgcbELDXRnTF2Q0_Z64pX45eWgFeM_L6lrW4g3_twLMQTH0TsQ8hvVn-ng2o530FddRIHvnEresD4c6m-YV2r6HBkSpbuNzjfMeXW6FjEEFw3UJpytgWk84/w642-h189/1.jpg&quot; width=&quot;642&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style=&quot;font-family: &amp;quot;Roboto Slab&amp;quot;; font-weight: 700;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;div style=&quot;font-size: 16px; margin: 0.5em 0em 0.7em; padding: 0px; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Roboto Slab&amp;quot;; font-weight: 700;&quot;&gt;Full Drive Mode&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Roboto Slab&amp;quot;;&quot;&gt;&amp;nbsp;− In this mode, two coils are energized at the same time. This mode produces more torque. Here the power consumption is also high.&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;The following table is showing the sequence of input states in different windings.&lt;/span&gt;&lt;/div&gt;&lt;p style=&quot;font-size: 16px; margin: 0.5em 0em 0.7em; padding: 0px; text-align: justify;&quot;&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkXCjc2vQaJi6wvlaMvF9wmCD9ehme6deOjqCXRfySP8X82vprZCu1Crhwi7tImphEwbOd6JRodm2iQCF7XKv6q0rigUip-_FdyXfQgfbTXw_B6zlGx8Ge1XlQ-Lxxs3PjcruJxfoKPOM/s1264/2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;375&quot; data-original-width=&quot;1264&quot; height=&quot;190&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkXCjc2vQaJi6wvlaMvF9wmCD9ehme6deOjqCXRfySP8X82vprZCu1Crhwi7tImphEwbOd6JRodm2iQCF7XKv6q0rigUip-_FdyXfQgfbTXw_B6zlGx8Ge1XlQ-Lxxs3PjcruJxfoKPOM/w640-h190/2.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;/div&gt;&lt;div style=&quot;text-align: start;&quot;&gt;&lt;span style=&quot;font-size: 16px; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;&lt;b&gt;The circuit diagram is like below:&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmoVUZPvhwHhuSJ6duAjANNO1qUTAFjcEjqPAfi-Q-VTwWVksXCjpmbPQpfSlZzwjaiydaSwyTllEbjF4LrWcF7wbDCnI7Bani22pduveFOftevyfp-GCsOL07LpyuppFd2aqkeDkYfQo/s2511/stepper.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1252&quot; data-original-width=&quot;2511&quot; height=&quot;315&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmoVUZPvhwHhuSJ6duAjANNO1qUTAFjcEjqPAfi-Q-VTwWVksXCjpmbPQpfSlZzwjaiydaSwyTllEbjF4LrWcF7wbDCnI7Bani22pduveFOftevyfp-GCsOL07LpyuppFd2aqkeDkYfQo/w622-h315/stepper.jpg&quot; width=&quot;622&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span style=&quot;font-family: Arvo; font-size: medium;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Source code:&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;&lt;span style=&quot;font-size: 16px; text-align: justify;&quot;&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; For&lt;/span&gt;&amp;nbsp;the wave drive mode-&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUdnSCYQfgAWvLSPdfZp8rsLXT8McmACZr1owlhgt4YFqQZKsPwJbJ2fN86R8qvSJGpa8dkbqUs9o2BPsEKT-CiN8eP_5GfV0DHTjTJHtOePXs62N9SJtw0eWenvjZLLXif2XQk-AJPx4/s1220/blog_step_1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1220&quot; data-original-width=&quot;858&quot; height=&quot;908&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUdnSCYQfgAWvLSPdfZp8rsLXT8McmACZr1owlhgt4YFqQZKsPwJbJ2fN86R8qvSJGpa8dkbqUs9o2BPsEKT-CiN8eP_5GfV0DHTjTJHtOePXs62N9SJtw0eWenvjZLLXif2XQk-AJPx4/w638-h908/blog_step_1.png&quot; width=&quot;638&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;pre class=&quot;lang:default decode:true&quot; style=&quot;background-color: whitesmoke; border-radius: 4px; border: 1px solid rgb(204, 204, 204); box-sizing: inherit; color: #333333; letter-spacing: 1px; line-height: 1.6; margin-bottom: 1.6em; margin-top: 0px; max-width: 100%; overflow-wrap: break-word; overflow: auto; padding: 1.6em; word-break: break-all;&quot;&gt;&lt;div style=&quot;color: black; letter-spacing: normal; white-space: normal;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;&lt;b&gt;#include&amp;lt;reg51.h&amp;gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: black; letter-spacing: normal; white-space: normal;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;&lt;b&gt;#define stepper_motor P0&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: black; letter-spacing: normal; white-space: normal;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: black; letter-spacing: normal; white-space: normal;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;&lt;b&gt;void msdelay(unsigned int time)&amp;nbsp; // Function for creating delay in milliseconds.&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: black; letter-spacing: normal; white-space: normal;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;&lt;b&gt;{&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: black; letter-spacing: normal; white-space: normal;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; unsigned i,j ;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: black; letter-spacing: normal; white-space: normal;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; for(i=0;i&amp;lt;time;i++)&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: black; letter-spacing: normal; white-space: normal;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; for(j=0;j&amp;lt;1275;j++);&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: black; letter-spacing: normal; white-space: normal;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;&lt;b&gt;}&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: black; letter-spacing: normal; white-space: normal;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: black; letter-spacing: normal; white-space: normal;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;&lt;b&gt;void main()&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: black; letter-spacing: normal; white-space: normal;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;&lt;b&gt;{&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: black; letter-spacing: normal; white-space: normal;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;&lt;b&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;while (1) {&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: black; letter-spacing: normal; white-space: normal;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;&lt;b&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;stepper_motor = 0x08;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: black; letter-spacing: normal; white-space: normal;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;&lt;b&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;msdelay(20);&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: black; letter-spacing: normal; white-space: normal;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;&lt;b&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;stepper_motor = 0x04;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: black; letter-spacing: normal; white-space: normal;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;&lt;b&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;msdelay(20);&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: black; letter-spacing: normal; white-space: normal;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;&lt;b&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;stepper_motor = 0x02;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: black; letter-spacing: normal; white-space: normal;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;&lt;b&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;msdelay(20);&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: black; letter-spacing: normal; white-space: normal;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;&lt;b&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;stepper_motor = 0x01;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: black; letter-spacing: normal; white-space: normal;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;&lt;b&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;msdelay(20);&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: black; letter-spacing: normal; white-space: normal;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;&lt;b&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;}&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: black; letter-spacing: normal; white-space: normal;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;&lt;b&gt;}&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Source code:&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;&lt;span style=&quot;font-size: 16px; text-align: justify;&quot;&gt;&amp;nbsp; &amp;nbsp; For&amp;nbsp;the Full drive mode-&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUjzUXA8TRmLK0q0NnAp44OiwPD_teOP19e8EZPxQZ6CliDTPINqSMa3da2J0CFgJhGvx7iQzSbiWtvoe7LAbT9yWnpsnyAGssutHO266WkUGp4-h4pgTaNln_kVcGKMfB-wtn50HBvFI/s1220/blog_step_2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1220&quot; data-original-width=&quot;858&quot; height=&quot;912&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUjzUXA8TRmLK0q0NnAp44OiwPD_teOP19e8EZPxQZ6CliDTPINqSMa3da2J0CFgJhGvx7iQzSbiWtvoe7LAbT9yWnpsnyAGssutHO266WkUGp4-h4pgTaNln_kVcGKMfB-wtn50HBvFI/w641-h912/blog_step_2.png&quot; width=&quot;641&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;pre class=&quot;lang:default decode:true&quot; style=&quot;background-color: whitesmoke; border-radius: 4px; border: 1px solid rgb(204, 204, 204); box-sizing: inherit; color: #333333; letter-spacing: 1px; line-height: 1.6; margin-bottom: 1.6em; margin-top: 0px; max-width: 100%; overflow-wrap: break-word; overflow: auto; padding: 1.6em; word-break: break-all;&quot;&gt;&lt;div style=&quot;color: black; letter-spacing: normal; white-space: normal;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;&lt;b&gt;#include&amp;lt;reg51.h&amp;gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: black; letter-spacing: normal; white-space: normal;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;&lt;b&gt;#define stepper_motor P0&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: black; letter-spacing: normal; white-space: normal;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: black; letter-spacing: normal; white-space: normal;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;&lt;b&gt;void msdelay(unsigned int time)&amp;nbsp; // Function for creating delay in milliseconds.&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: black; letter-spacing: normal; white-space: normal;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;&lt;b&gt;{&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: black; letter-spacing: normal; white-space: normal;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; unsigned i,j ;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: black; letter-spacing: normal; white-space: normal;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; for(i=0;i&amp;lt;time;i++)&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: black; letter-spacing: normal; white-space: normal;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; for(j=0;j&amp;lt;1275;j++);&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: black; letter-spacing: normal; white-space: normal;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;&lt;b&gt;}&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: black; letter-spacing: normal; white-space: normal;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: black; letter-spacing: normal; white-space: normal;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;&lt;b&gt;void main()&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: black; letter-spacing: normal; white-space: normal;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;&lt;b&gt;{&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: black; letter-spacing: normal; white-space: normal;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;&lt;b&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;while (1) {&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: black; letter-spacing: normal; white-space: normal;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;&lt;b&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;stepper_motor = 0x0C;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: black; letter-spacing: normal; white-space: normal;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;&lt;b&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;msdelay(20);&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: black; letter-spacing: normal; white-space: normal;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;&lt;b&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;stepper_motor = 0x06;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: black; letter-spacing: normal; white-space: normal;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;&lt;b&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;msdelay(20);&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: black; letter-spacing: normal; white-space: normal;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;&lt;b&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;stepper_motor = 0x03;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: black; letter-spacing: normal; white-space: normal;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;&lt;b&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;msdelay(20);&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: black; letter-spacing: normal; white-space: normal;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;&lt;b&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;stepper_motor = 0x09;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: black; letter-spacing: normal; white-space: normal;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;&lt;b&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;msdelay(20);&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: black; letter-spacing: normal; white-space: normal;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;&lt;b&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;}&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: black; letter-spacing: normal; white-space: normal;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;&lt;b&gt;}&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://surajkumartech.blogspot.com/feeds/3216316049921422037/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://surajkumartech.blogspot.com/2021/03/interfacing-stepper-motor-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/6875261495822215624/posts/default/3216316049921422037'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/6875261495822215624/posts/default/3216316049921422037'/><link rel='alternate' type='text/html' href='https://surajkumartech.blogspot.com/2021/03/interfacing-stepper-motor-with.html' title='Interfacing Stepper Motor with 8051Microcontroller'/><author><name>Surajkumar Sharma</name><uri>http://www.blogger.com/profile/01015148309961923598</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjT6-2WRSG9PYXDYi3KHvBxtZjIdjVviH3Omj_IfkGKELbvUkNn152moPlmho-cX1iaQQfyNHNDlhdU9sjVcDd_4-NmFs3n86oumBLjXoNUS2aH0MbsaYKfumtvRWwmGw/s220/Untitled-1.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOQhKV7r_FLy4AcFK11pEFgOwiYCb67Wy_Zy8K9L6GspOFkmlifz5UxfLEJC21YdElIVYt2nMTZLdcvDzWKFsE1ClNsjQTsMqoFrBHNX5K-zpf6DcE9F4vjuswS2rY8izVjm_hiu9p8GQ/s72-w617-h321-c/stepper-1.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6875261495822215624.post-5796639749621251916</id><published>2021-03-19T09:45:00.012+05:30</published><updated>2021-04-14T01:14:38.262+05:30</updated><title type='text'>Serial Interrupt Programming in 8051 Microcontroller</title><content type='html'>&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: red; font-family: Arvo; font-size: x-large;&quot;&gt;&lt;b&gt;Serial Interrupt Programming in 8051 Microcontroller&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;p style=&quot;background-color: white; box-sizing: border-box; line-height: 24px; margin: 0px 0px 10px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;span style=&quot;font-family: Arvo; font-size: medium;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;span style=&quot;font-family: Arvo; font-size: medium;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTlfdKQjZvQ9ZOqUr5ILIz_AwaPW2Md6p6XF3opjnARZl9-DaaEbDuKO76XH_dgnI3MB9typsROW906f9yF6WlfuJROs2fjSWZUcVhLA9rkXRgSTJHTYX0WfYVI1v9YHdZhOfmA_2uChY/s1386/Screenshot-%2528111%2529.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;696&quot; data-original-width=&quot;1386&quot; height=&quot;283&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTlfdKQjZvQ9ZOqUr5ILIz_AwaPW2Md6p6XF3opjnARZl9-DaaEbDuKO76XH_dgnI3MB9typsROW906f9yF6WlfuJROs2fjSWZUcVhLA9rkXRgSTJHTYX0WfYVI1v9YHdZhOfmA_2uChY/w543-h283/Screenshot-%2528111%2529.jpg&quot; width=&quot;543&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: Arvo; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;p style=&quot;background-color: white; box-sizing: border-box; line-height: 24px; margin: 0px 0px 10px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;span style=&quot;font-family: Arvo; font-size: medium;&quot;&gt;&lt;b&gt;Baud Rate calculation:&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;background-color: white; box-sizing: border-box; line-height: 24px; margin: 0px 0px 10px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;span style=&quot;font-family: Arvo; font-size: medium;&quot;&gt;To meet the standard baud rates generally crystal with 11.0592 MHz is used.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: Arvo; font-size: medium;&quot;&gt;As we know, 8051 divides crystal frequency by 12 to get a machine cycle frequency of 921.6 kHz.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: Arvo; font-size: medium;&quot;&gt;The internal UART block of 8051 divides this machine cycle frequency by 32, which gives the frequency of 28800 Hz which is used by UART.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: Arvo; font-size: medium;&quot;&gt;To achieve a baud rate of 9600, again 28800 Hz frequency should be divided by 3.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: Arvo; font-size: medium;&quot;&gt;This is achieved by using Timer1 in mode-2 (auto-reload mode) by putting 253 in TH1 (8-bit reg.)&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: Arvo; font-size: medium;&quot;&gt;So 28800 Hz will get divided by 3 as the timer will overflow after every 3 cycles.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: Arvo; font-size: medium;&quot;&gt;we can achieve different baud rates by putting the division factor in the TH1 register.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;p style=&quot;background-color: white; box-sizing: border-box; line-height: 24px; margin: 0px 0px 10px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 700; line-height: 24px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab; font-size: medium;&quot;&gt;Division factor to achieve different baud rates&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;table align=&quot;center&quot; border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;background-color: white; border-collapse: collapse; border-spacing: 0px; border: 0px solid rgb(153, 153, 153); color: black; display: block; line-height: 24px; max-width: 100%; overflow-wrap: break-word; overflow-x: auto; word-break: break-word;&quot;&gt;&lt;thead style=&quot;box-sizing: border-box;&quot;&gt;&lt;tr style=&quot;box-sizing: border-box; line-height: 24px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;th scope=&quot;col&quot; style=&quot;border: 1px solid rgb(153, 153, 153); box-sizing: border-box; padding: 0px; text-align: center; vertical-align: middle; width: 204px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; line-height: 24px; margin: 0px 0px 10px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; line-height: 24px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab; font-size: medium;&quot;&gt;Baud Rate&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/th&gt;&lt;th scope=&quot;col&quot; style=&quot;border: 1px solid rgb(153, 153, 153); box-sizing: border-box; padding: 0px; text-align: center; vertical-align: middle; width: 228px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; line-height: 24px; margin: 0px 0px 10px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; line-height: 24px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab; font-size: medium;&quot;&gt;TH1 (Hex)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody style=&quot;box-sizing: border-box; line-height: 24px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;tr style=&quot;box-sizing: border-box; line-height: 24px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;td style=&quot;border: 1px solid rgb(153, 153, 153); box-sizing: border-box; line-height: 24px; overflow-wrap: break-word; padding: 0px; text-align: center; vertical-align: middle; width: 204px; word-break: break-word;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; line-height: 24px; margin: 0px 0px 10px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab; font-size: medium;&quot;&gt;9600&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid rgb(153, 153, 153); box-sizing: border-box; line-height: 24px; overflow-wrap: break-word; padding: 0px; text-align: center; vertical-align: middle; width: 228px; word-break: break-word;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; line-height: 24px; margin: 0px 0px 10px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab; font-size: medium;&quot;&gt;FD&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;box-sizing: border-box; line-height: 24px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;td style=&quot;border: 1px solid rgb(153, 153, 153); box-sizing: border-box; line-height: 24px; overflow-wrap: break-word; padding: 0px; text-align: center; vertical-align: middle; width: 204px; word-break: break-word;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; line-height: 24px; margin: 0px 0px 10px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab; font-size: medium;&quot;&gt;4800&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid rgb(153, 153, 153); box-sizing: border-box; line-height: 24px; overflow-wrap: break-word; padding: 0px; text-align: center; vertical-align: middle; width: 228px; word-break: break-word;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; line-height: 24px; margin: 0px 0px 10px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab; font-size: medium;&quot;&gt;FA&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;box-sizing: border-box; line-height: 24px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;td style=&quot;border: 1px solid rgb(153, 153, 153); box-sizing: border-box; line-height: 24px; overflow-wrap: break-word; padding: 0px; text-align: center; vertical-align: middle; width: 204px; word-break: break-word;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; line-height: 24px; margin: 0px 0px 10px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab; font-size: medium;&quot;&gt;2400&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid rgb(153, 153, 153); box-sizing: border-box; line-height: 24px; overflow-wrap: break-word; padding: 0px; text-align: center; vertical-align: middle; width: 228px; word-break: break-word;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; line-height: 24px; margin: 0px 0px 10px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab; font-size: medium;&quot;&gt;F4&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;box-sizing: border-box; line-height: 24px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;td style=&quot;border: 1px solid rgb(153, 153, 153); box-sizing: border-box; line-height: 24px; overflow-wrap: break-word; padding: 0px; text-align: center; vertical-align: middle; width: 204px; word-break: break-word;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; line-height: 24px; margin: 0px 0px 10px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab; font-size: medium;&quot;&gt;1200&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid rgb(153, 153, 153); box-sizing: border-box; line-height: 24px; overflow-wrap: break-word; padding: 0px; text-align: center; vertical-align: middle; width: 228px; word-break: break-word;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; line-height: 24px; margin: 0px 0px 10px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab; font-size: medium;&quot;&gt;E8&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style=&quot;background-color: white; box-sizing: border-box; clear: both;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background-color: white; box-sizing: border-box; clear: both;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab; font-size: medium;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; line-height: 24px; margin: 0px 0px 10px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 700; line-height: 24px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;box-sizing: border-box; line-height: 24px; margin: 0px 0px 10px; overflow-wrap: break-word; text-align: left; word-break: break-word;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; line-height: 24px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;b&gt;SCON: Serial Control Register&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;p style=&quot;box-sizing: border-box; line-height: 24px; margin: 0px 0px 10px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;Serial control register SCON is used to set serial communication operation modes. Also, it is used to control transmit and receive operations.&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; line-height: 24px; margin: 0px 0px 10px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;img alt=&quot;8051 SCON Register&quot; src=&quot;https://www.electronicwings.com/images/user_images/images/8051_20160803/8051_UART/6_8051_SCON_Register.PNG&quot; style=&quot;border: 0px; box-sizing: border-box; height: auto; max-height: 100%; max-width: 100%; vertical-align: middle;&quot; /&gt;&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; line-height: 24px; margin: 0px 0px 10px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&amp;nbsp;&lt;/p&gt;&lt;div style=&quot;box-sizing: border-box; line-height: 24px; margin: 0px 0px 10px; overflow-wrap: break-word; text-align: left; word-break: break-word;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 700; line-height: 24px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;Bit 7:6 - SM0:SM1&lt;/span&gt;&lt;/span&gt;: Serial Mode Specifier&lt;/div&gt;&lt;table align=&quot;center&quot; border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; border-spacing: 0px; border: 0px solid rgb(153, 153, 153); color: black; display: block; line-height: 24px; max-width: 100%; overflow-wrap: break-word; overflow-x: auto; width: 613.612px; word-break: break-word;&quot;&gt;&lt;thead style=&quot;box-sizing: border-box;&quot;&gt;&lt;tr style=&quot;box-sizing: border-box; line-height: 24px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;th scope=&quot;col&quot; style=&quot;border: 1px solid rgb(153, 153, 153); box-sizing: border-box; padding: 0px; text-align: center; vertical-align: middle; width: 54.4px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; line-height: 24px; margin: 0px 0px 10px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; line-height: 24px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;Mode&lt;/span&gt;&lt;/p&gt;&lt;/th&gt;&lt;th scope=&quot;col&quot; style=&quot;border: 1px solid rgb(153, 153, 153); box-sizing: border-box; padding: 0px; text-align: center; vertical-align: middle; width: 54.4px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; line-height: 24px; margin: 0px 0px 10px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; line-height: 24px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;SM0&lt;/span&gt;&lt;/p&gt;&lt;/th&gt;&lt;th scope=&quot;col&quot; style=&quot;border: 1px solid rgb(153, 153, 153); box-sizing: border-box; padding: 0px; text-align: center; vertical-align: middle; width: 54.4px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; line-height: 24px; margin: 0px 0px 10px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; line-height: 24px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;SM1&lt;/span&gt;&lt;/p&gt;&lt;/th&gt;&lt;th scope=&quot;col&quot; style=&quot;border: 1px solid rgb(153, 153, 153); box-sizing: border-box; padding: 0px; text-align: center; vertical-align: middle; width: 406.4px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; line-height: 24px; margin: 0px 0px 10px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; line-height: 24px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;Mode&lt;/span&gt;&lt;/p&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody style=&quot;box-sizing: border-box; line-height: 24px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;tr style=&quot;box-sizing: border-box; line-height: 24px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;td style=&quot;border: 1px solid rgb(153, 153, 153); box-sizing: border-box; line-height: 24px; overflow-wrap: break-word; padding: 0px; text-align: center; vertical-align: middle; width: 54.4px; word-break: break-word;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; line-height: 24px; margin: 0px 0px 10px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;0&lt;/p&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid rgb(153, 153, 153); box-sizing: border-box; line-height: 24px; overflow-wrap: break-word; padding: 0px; text-align: center; vertical-align: middle; width: 54.4px; word-break: break-word;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; line-height: 24px; margin: 0px 0px 10px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;0&lt;/p&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid rgb(153, 153, 153); box-sizing: border-box; line-height: 24px; overflow-wrap: break-word; padding: 0px; text-align: center; vertical-align: middle; width: 54.4px; word-break: break-word;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; line-height: 24px; margin: 0px 0px 10px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;0&lt;/p&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid rgb(153, 153, 153); box-sizing: border-box; line-height: 24px; overflow-wrap: break-word; padding: 0px; text-align: center; vertical-align: middle; width: 406.4px; word-break: break-word;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; line-height: 24px; margin: 0px 0px 10px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;1/12 of Osc frequency shift register mode fixed baud rate&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;box-sizing: border-box; line-height: 24px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;td style=&quot;border: 1px solid rgb(153, 153, 153); box-sizing: border-box; line-height: 24px; overflow-wrap: break-word; padding: 0px; text-align: center; vertical-align: middle; width: 54.4px; word-break: break-word;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; line-height: 24px; margin: 0px 0px 10px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;1&lt;/p&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid rgb(153, 153, 153); box-sizing: border-box; line-height: 24px; overflow-wrap: break-word; padding: 0px; text-align: center; vertical-align: middle; width: 54.4px; word-break: break-word;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; line-height: 24px; margin: 0px 0px 10px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;0&lt;/p&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid rgb(153, 153, 153); box-sizing: border-box; line-height: 24px; overflow-wrap: break-word; padding: 0px; text-align: center; vertical-align: middle; width: 54.4px; word-break: break-word;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; line-height: 24px; margin: 0px 0px 10px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;1&lt;/p&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid rgb(153, 153, 153); box-sizing: border-box; line-height: 24px; overflow-wrap: break-word; padding: 0px; text-align: center; vertical-align: middle; width: 406.4px; word-break: break-word;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; line-height: 24px; margin: 0px 0px 10px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;8-bit UART with timer 1 determined baud rate&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;box-sizing: border-box; line-height: 24px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;td style=&quot;border: 1px solid rgb(153, 153, 153); box-sizing: border-box; line-height: 24px; overflow-wrap: break-word; padding: 0px; text-align: center; vertical-align: middle; width: 54.4px; word-break: break-word;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; line-height: 24px; margin: 0px 0px 10px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;2&lt;/p&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid rgb(153, 153, 153); box-sizing: border-box; line-height: 24px; overflow-wrap: break-word; padding: 0px; text-align: center; vertical-align: middle; width: 54.4px; word-break: break-word;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; line-height: 24px; margin: 0px 0px 10px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;1&lt;/p&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid rgb(153, 153, 153); box-sizing: border-box; line-height: 24px; overflow-wrap: break-word; padding: 0px; text-align: center; vertical-align: middle; width: 54.4px; word-break: break-word;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; line-height: 24px; margin: 0px 0px 10px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;0&lt;/p&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid rgb(153, 153, 153); box-sizing: border-box; line-height: 24px; overflow-wrap: break-word; padding: 0px; text-align: center; vertical-align: middle; width: 406.4px; word-break: break-word;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; line-height: 24px; margin: 0px 0px 10px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;9-bit UART with 1/32 of Osc fixed baud rate&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;box-sizing: border-box; line-height: 24px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;td style=&quot;border: 1px solid rgb(153, 153, 153); box-sizing: border-box; line-height: 24px; overflow-wrap: break-word; padding: 0px; text-align: center; vertical-align: middle; width: 54.4px; word-break: break-word;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; line-height: 24px; margin: 0px 0px 10px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;3&lt;/p&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid rgb(153, 153, 153); box-sizing: border-box; line-height: 24px; overflow-wrap: break-word; padding: 0px; text-align: center; vertical-align: middle; width: 54.4px; word-break: break-word;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; line-height: 24px; margin: 0px 0px 10px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;1&lt;/p&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid rgb(153, 153, 153); box-sizing: border-box; line-height: 24px; overflow-wrap: break-word; padding: 0px; text-align: center; vertical-align: middle; width: 54.4px; word-break: break-word;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; line-height: 24px; margin: 0px 0px 10px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;1&lt;/p&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid rgb(153, 153, 153); box-sizing: border-box; line-height: 24px; overflow-wrap: break-word; padding: 0px; text-align: center; vertical-align: middle; width: 406.4px; word-break: break-word;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; line-height: 24px; margin: 0px 0px 10px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;9-bit UART with timer 1 determined baud rate&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p style=&quot;box-sizing: border-box; line-height: 24px; margin: 0px 0px 10px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&amp;nbsp;&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; line-height: 24px; margin: 0px 0px 10px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;Normally mode-1 (SM0 =0, SM1=1) is used with 8 data bits, 1 start bit, and 1 &lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;stop bit.&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; line-height: 24px; margin: 0px 0px 10px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; line-height: 24px; margin: 0px 0px 10px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 700; line-height: 24px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;Bit 5 - SM2:&lt;/span&gt;&lt;/span&gt;&amp;nbsp;for Multiprocessor Communication&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; line-height: 24px; margin: 0px 0px 10px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;This bit enables a multiprocessor communication feature in mode 2 &amp;amp; 3.&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; line-height: 24px; margin: 0px 0px 10px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; line-height: 24px; margin: 0px 0px 10px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 700; line-height: 24px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;Bit 4 - REN:&lt;/span&gt;&lt;/span&gt;&amp;nbsp;Receive Enable&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; line-height: 24px; margin: 0px 0px 10px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1 = Receive enable&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; line-height: 24px; margin: 0px 0px 10px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0 = Receive disable&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; line-height: 24px; margin: 0px 0px 10px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; line-height: 24px; margin: 0px 0px 10px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 700; line-height: 24px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;Bit 3 - TB8:&lt;/span&gt;&amp;nbsp;&lt;/span&gt;9th Transmit Bit&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; line-height: 24px; margin: 0px 0px 10px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&amp;nbsp; &amp;nbsp; This is the 9th bit which is to be transmitted in mode 2 &amp;amp; 3 (9-bit mode)&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; line-height: 24px; margin: 0px 0px 10px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 700; line-height: 24px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;Bit 2 - RB8:&lt;/span&gt;&amp;nbsp;&lt;/span&gt;9th Receive Bit&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; line-height: 24px; margin: 0px 0px 10px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;This is the 9th received bit in mode 2 &amp;amp; 3 (9-bit mode), whereas in mode 1 &lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;if SM2 = 0 then RB8 hold the stop bit that received&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; line-height: 24px; margin: 0px 0px 10px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; line-height: 24px; margin: 0px 0px 10px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 700; line-height: 24px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;Bit 1 - TI:&amp;nbsp;&lt;/span&gt;&lt;/span&gt;Transmit Interrupt Flag&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; line-height: 24px; margin: 0px 0px 10px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;This bit indicates the transmission is complete and gets set after transmitting the byte from the buffer. Normally TI (Transmit Interrupt&lt;span&gt;&amp;nbsp;&lt;/span&gt;Flag) is set by hardware at the end of the 8th bit in mode 0 and at the beginning of the stop bit in other modes.&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; line-height: 24px; margin: 0px 0px 10px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style=&quot;box-sizing: border-box; line-height: 24px; margin: 0px 0px 10px; overflow-wrap: break-word; text-align: left; word-break: break-word;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 700; line-height: 24px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;Bit 0 – RI:&lt;/span&gt;&amp;nbsp;&lt;/span&gt;Receive Interrupt Flag&lt;/div&gt;&lt;p style=&quot;box-sizing: border-box; line-height: 24px; margin: 0px 0px 10px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;This bit indicates reception is complete and gets set after receiving the complete byte in the buffer. Normally RI (Receiver Interrupt Flag) is set by hardware in receiving mode at the end of the 8th bit in mode 0 and at the stop bit receive time in other modes.&lt;/p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background-color: white; box-sizing: border-box; line-height: 28px; margin: 20px 0px 10px; overflow-wrap: break-word; text-align: left; word-break: break-word;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; color: #333333; line-height: 25px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;span style=&quot;font-family: Arvo; font-size: medium;&quot;&gt;&lt;b&gt;Programming steps:&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;ol style=&quot;background-color: white; box-sizing: border-box; line-height: 24px; margin-bottom: 10px; margin-top: 0px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;li style=&quot;box-sizing: border-box; line-height: 24px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab; font-size: medium;&quot;&gt;Configure Timer 1 in auto-reload mode.&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; line-height: 24px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab; font-size: medium;&quot;&gt;Load TH1 with value as per required baud rate e.g. for 9600 baud rate load 0xFD. (-3 in decimal)&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; line-height: 24px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab; font-size: medium;&quot;&gt;Load SCON with serial mode and control bits. e.g. for mode 1 and enable reception, load 0x50.&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; line-height: 24px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab; font-size: medium;&quot;&gt;Start timer1 by setting TR1 bit to 1.&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; line-height: 24px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab; font-size: medium;&quot;&gt;Load transmitting data in the SBUF register.&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; line-height: 24px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab; font-size: medium;&quot;&gt;Wait until loaded data is completely transmitted by polling the TI flag.&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; line-height: 24px; overflow-wrap: break-word; word-break: break-word;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab; font-size: medium;&quot;&gt;When the TI flag is set, clear it, and repeat from step 5 to transmit more data.&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div style=&quot;background-color: white; box-sizing: border-box; clear: both;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab; font-size: medium;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab; font-size: medium;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;Write an 8051 C program to transfer &quot;YES&quot; serially at 9600 baud rate, 8-bit data,1 stop bit, Do it continuously.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab; font-size: medium;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Roboto Slab; font-size: medium;&quot;&gt;CODE:-&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;b&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxu-WITego-5SRwcs6NOWYfpEW0Qo24Kdjub4CJYaLJlILoTVh0OyVlQ8SN4jPGZ_VKzJmWDKEA7yYVQVFgd9JmL6BwFuT_4YE0TDWnCEqGWMjvaHXHJu7bGK7c1fy2JE6Jov3S5QQVkM/s1404/sertx.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1404&quot; data-original-width=&quot;1244&quot; height=&quot;721&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxu-WITego-5SRwcs6NOWYfpEW0Qo24Kdjub4CJYaLJlILoTVh0OyVlQ8SN4jPGZ_VKzJmWDKEA7yYVQVFgd9JmL6BwFuT_4YE0TDWnCEqGWMjvaHXHJu7bGK7c1fy2JE6Jov3S5QQVkM/w640-h721/sertx.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Roboto Slab; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;pre class=&quot;lang:default decode:true&quot; style=&quot;background-color: whitesmoke; border-radius: 4px; border: 1px solid rgb(204, 204, 204); box-sizing: inherit; line-height: 1.6; margin-bottom: 1.6em; margin-top: 0px; max-width: 100%; overflow-wrap: break-word; overflow: auto; padding: 1.6em; word-break: break-all;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Roboto Slab;&quot;&gt;&lt;span style=&quot;font-size: 15px; letter-spacing: 1px;&quot;&gt;&lt;b&gt;/*Write an 8051 C program to transfer &quot;YES&quot; serially at 9600 baud rate,
 8-bit data,1 stop bit, Do it for 5 times.
*/
#include &amp;lt;reg51.h&amp;gt;
void SerTx(unsigned char);
unsigned int i = 0;

void SerTx(unsigned char ch)
 {
    SBUF = ch;              //loading value in buffer
    while(TI==0);         //wait untill transmition is over
    TI=0; 
 }

void main(void)
{
TMOD = 0x20;           //use Timer 1, 8-bit auto-reload
TH1 = 0xFD;              //9600 baud rate
SCON = 0x50;
TR1 = 1;	               //start timer
for(i;i&amp;lt;5;i++)
	{
	   SerTx(&#39;Y&#39;);
	   SerTx(&#39;E&#39;);
	   SerTx(&#39;S&#39;);
	}
	while(1);
}&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;div&gt;&lt;span style=&quot;font-family: Roboto Slab; font-size: medium;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;Write an 8051 C program&lt;/span&gt;&amp;nbsp;to receive bytes of data serially and put them in P2.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: Roboto Slab; font-size: medium;&quot;&gt;Set baud rate at 9600, 8-bit data, and 1 stop bit.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: Roboto Slab; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: Roboto Slab; font-size: medium;&quot;&gt;&lt;b&gt;CODE:-&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;pre class=&quot;lang:default decode:true&quot; style=&quot;background-color: whitesmoke; border-radius: 4px; border: 1px solid rgb(204, 204, 204); box-sizing: inherit; line-height: 1.6; margin-bottom: 1.6em; margin-top: 0px; max-width: 100%; overflow-wrap: break-word; overflow: auto; padding: 1.6em; word-break: break-all;&quot;&gt;&lt;span style=&quot;color: #333333;&quot;&gt;&lt;span style=&quot;font-size: 15px; letter-spacing: 1px;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;// Program in 8051  in C to receive bytes of data serially and put them in P2.
// Set baud rate at 4800, 8-bit data, and 1 stop bit.

#include &amp;lt;reg51.h&amp;gt;

&lt;/span&gt;&lt;span style=&quot;font-family: Arvo;&quot;&gt;void&lt;/span&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt; main (void)
 {
   unsigned char myData;
   TMOD = 0x20;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Roboto Slab&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Roboto Slab&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt; //use Timer-1,8-bit auto-reload
   TH1 = 0xFD;  &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Roboto Slab&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Roboto Slab&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Roboto Slab&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;//9600 baud rate
   SCON = 0x50;
   TR1 = 1;                   //start timer
   while(1)
&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Roboto Slab&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Roboto Slab&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;{
	   &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Roboto Slab&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;while(RI==0);
	  &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Roboto Slab&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;myData = SBUF;
	 &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Roboto Slab&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;  P2=myData;
	&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Roboto Slab&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;   RI=0;
	  }
 }&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: Roboto Slab; font-size: medium;&quot;&gt;&lt;b&gt;Alternet way using Serial interrupt:-&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #333333;&quot;&gt;&lt;pre class=&quot;lang:default decode:true&quot; style=&quot;background-color: whitesmoke; border-radius: 4px; border: 1px solid rgb(204, 204, 204); box-sizing: inherit; letter-spacing: 1px; line-height: 1.6; margin-bottom: 1.6em; margin-top: 0px; max-width: 100%; overflow-wrap: break-word; overflow: auto; padding: 1.6em; white-space: pre; word-break: break-all;&quot;&gt;&lt;b style=&quot;font-size: large;&quot;&gt;
&lt;/b&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;&lt;b&gt;#include &amp;lt;reg51.h&amp;gt;	/* Include x51 header file */

void Ext_int_Init()				
{
  EA = 1;	/* Enable global interrupt */
  ES = 1;  	/* Enable serial interrupt */			
}

void UART_Init()
{
  TMOD = 0x20;	/* Timer 1, 8-bit auto reload mode */
  TH1 = 0xFD;	      /* Load value for 9600 baud rate */
  SCON = 0x50;	      /* Mode 1, reception enable */
  TR1 = 1;	            /* Start timer 1 */
}

void Serial_ISR() interrupt 4    
{
  P2 = SBUF;	   /* Give received data on port 1 */
  RI = 0;	         /* Clear RI flag */
} 

void main()
{
  P2 = 0x00;	   /* Make P2 output */
  Ext_int_Init();  /* Call Ext. interrupt initialize */
  UART_Init();
  while(1);
}&lt;/b&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://surajkumartech.blogspot.com/feeds/5796639749621251916/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://surajkumartech.blogspot.com/2021/03/serial-interrupt-programming-in-8051.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/6875261495822215624/posts/default/5796639749621251916'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/6875261495822215624/posts/default/5796639749621251916'/><link rel='alternate' type='text/html' href='https://surajkumartech.blogspot.com/2021/03/serial-interrupt-programming-in-8051.html' title='Serial Interrupt Programming in 8051 Microcontroller'/><author><name>Surajkumar Sharma</name><uri>http://www.blogger.com/profile/01015148309961923598</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjT6-2WRSG9PYXDYi3KHvBxtZjIdjVviH3Omj_IfkGKELbvUkNn152moPlmho-cX1iaQQfyNHNDlhdU9sjVcDd_4-NmFs3n86oumBLjXoNUS2aH0MbsaYKfumtvRWwmGw/s220/Untitled-1.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTlfdKQjZvQ9ZOqUr5ILIz_AwaPW2Md6p6XF3opjnARZl9-DaaEbDuKO76XH_dgnI3MB9typsROW906f9yF6WlfuJROs2fjSWZUcVhLA9rkXRgSTJHTYX0WfYVI1v9YHdZhOfmA_2uChY/s72-w543-h283-c/Screenshot-%2528111%2529.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6875261495822215624.post-6354351680073651504</id><published>2021-03-09T11:16:00.018+05:30</published><updated>2021-04-14T01:20:02.767+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Embedded System"/><title type='text'>LCD Interfacing with 8051 Microcontroller</title><content type='html'>&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;color: red; font-family: Arvo; font-size: x-large;&quot;&gt;&lt;b&gt;LCD Interfacing with 8051 Microcontroller&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;color: red; font-family: Arvo; font-size: large;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUP-xYkzPXJEtNzEZXd_VQKCPyLsbZUYOMBJOhwX_0cWNvfA6Ypxz7Raoy9oYoFUm-fGlYZuzyYNoGYnJGcA10gCdzUlaBkt_ooaAeYs7xyjgJ80zWAuTdJtVGZbzH4snT0VfjrqarZx4/s1058/LCD+%25282%2529.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;507&quot; data-original-width=&quot;1058&quot; height=&quot;279&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUP-xYkzPXJEtNzEZXd_VQKCPyLsbZUYOMBJOhwX_0cWNvfA6Ypxz7Raoy9oYoFUm-fGlYZuzyYNoGYnJGcA10gCdzUlaBkt_ooaAeYs7xyjgJ80zWAuTdJtVGZbzH4snT0VfjrqarZx4/w573-h279/LCD+%25282%2529.jpg&quot; width=&quot;573&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;iframe allowfullscreen=&quot;&quot; class=&quot;BLOG_video_class&quot; height=&quot;356&quot; src=&quot;https://www.youtube.com/embed/uH2E3OVQz_g&quot; width=&quot;484&quot; youtube-src-id=&quot;uH2E3OVQz_g&quot;&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;table border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;background-color: white; border-collapse: collapse; border-spacing: 0px; font-family: Roboto, Arial, sans-serif; margin-bottom: 20px;&quot;&gt;&lt;tbody style=&quot;border-top: 1px solid rgb(204, 204, 204); box-sizing: border-box;&quot;&gt;&lt;tr style=&quot;box-sizing: border-box;&quot;&gt;&lt;td style=&quot;box-sizing: border-box; padding: 10px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;&lt;span style=&quot;font-family: Arvo; font-size: medium;&quot;&gt;Hex Code&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;box-sizing: border-box; padding: 10px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;&lt;span style=&quot;font-family: Arvo; font-size: medium;&quot;&gt;Command to LCD Instruction Register&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;box-sizing: border-box;&quot;&gt;&lt;td style=&quot;box-sizing: border-box; padding: 10px;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;0F&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;box-sizing: border-box; padding: 10px;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;LCD ON, cursor ON&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;box-sizing: border-box;&quot;&gt;&lt;td style=&quot;box-sizing: border-box; padding: 10px;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;01&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;box-sizing: border-box; padding: 10px;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;Clear display screen&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;box-sizing: border-box;&quot;&gt;&lt;td style=&quot;box-sizing: border-box; padding: 10px;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;02&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;box-sizing: border-box; padding: 10px;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;Return home&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;box-sizing: border-box;&quot;&gt;&lt;td style=&quot;box-sizing: border-box; padding: 10px;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;04&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;box-sizing: border-box; padding: 10px;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;Decrement cursor (shift cursor to left)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;box-sizing: border-box;&quot;&gt;&lt;td style=&quot;box-sizing: border-box; padding: 10px;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;06&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;box-sizing: border-box; padding: 10px;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;Increment cursor (shift cursor to right)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;box-sizing: border-box;&quot;&gt;&lt;td style=&quot;box-sizing: border-box; padding: 10px;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;05&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;box-sizing: border-box; padding: 10px;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;Shift display right&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;box-sizing: border-box;&quot;&gt;&lt;td style=&quot;box-sizing: border-box; padding: 10px;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;07&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;box-sizing: border-box; padding: 10px;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;Shift display left&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;box-sizing: border-box;&quot;&gt;&lt;td style=&quot;box-sizing: border-box; padding: 10px;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;0E&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;box-sizing: border-box; padding: 10px;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;Display ON, cursor&amp;nbsp;blinking&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;box-sizing: border-box;&quot;&gt;&lt;td style=&quot;box-sizing: border-box; padding: 10px;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;80&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;box-sizing: border-box; padding: 10px;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;Force cursor to the beginning of the first line&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;box-sizing: border-box;&quot;&gt;&lt;td style=&quot;box-sizing: border-box; padding: 10px;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;C0&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;box-sizing: border-box; padding: 10px;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;Force cursor to the beginning of the second line&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;box-sizing: border-box;&quot;&gt;&lt;td style=&quot;box-sizing: border-box; padding: 10px;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;38&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;box-sizing: border-box; padding: 10px;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;2 lines and 5×7 matrix&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;box-sizing: border-box;&quot;&gt;&lt;td style=&quot;box-sizing: border-box; padding: 10px;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;83&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;box-sizing: border-box; padding: 10px;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;Cursor line 1 position 3&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;box-sizing: border-box;&quot;&gt;&lt;td style=&quot;box-sizing: border-box; padding: 10px;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;3C&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;box-sizing: border-box; padding: 10px;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;Activate the second line&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;box-sizing: border-box;&quot;&gt;&lt;td style=&quot;box-sizing: border-box; padding: 10px;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;08&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;box-sizing: border-box; padding: 10px;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;Display OFF, cursor OFF&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;box-sizing: border-box;&quot;&gt;&lt;td style=&quot;box-sizing: border-box; padding: 10px;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;C1&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;box-sizing: border-box; padding: 10px;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;Jump to the second line, position 1&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;box-sizing: border-box;&quot;&gt;&lt;td style=&quot;box-sizing: border-box; padding: 10px;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;OC&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;box-sizing: border-box; padding: 10px;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;Display ON, cursor OFF&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;box-sizing: border-box;&quot;&gt;&lt;td style=&quot;box-sizing: border-box; padding: 10px;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;C1&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;box-sizing: border-box; padding: 10px;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;Jump to the second line, position 1&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;box-sizing: border-box;&quot;&gt;&lt;td style=&quot;box-sizing: border-box; padding: 10px;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;C2&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;box-sizing: border-box; padding: 10px;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;Jump to a second line, position 2&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style=&quot;background-color: white; box-sizing: border-box; color: #222222; line-height: 1.2; margin: 20px 0px; text-align: justify;&quot;&gt;&lt;span style=&quot;box-sizing: border-box;&quot;&gt;&lt;span style=&quot;font-family: Arvo; font-size: medium;&quot;&gt;&lt;b&gt;Circuit Diagram :&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4p-nBxCI-0uvC_n2erCYcPHI2mAfXxREdM6w-7EnZqtH7RE2Ulcitx49AAF9A_nsOEpBCD34riCqdjZdzXI7IQnmeZY_AWeflBdTlNZJJ8FnRKzDkZLTM492j4o6D4XID5ecwYJ6uq3U/s2048/LCD-Design.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1081&quot; data-original-width=&quot;2048&quot; height=&quot;392&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4p-nBxCI-0uvC_n2erCYcPHI2mAfXxREdM6w-7EnZqtH7RE2Ulcitx49AAF9A_nsOEpBCD34riCqdjZdzXI7IQnmeZY_AWeflBdTlNZJJ8FnRKzDkZLTM492j4o6D4XID5ecwYJ6uq3U/w630-h392/LCD-Design.jpg&quot; width=&quot;630&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style=&quot;box-sizing: border-box; font-size: 22px; font-weight: 500;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Arvo; font-size: medium;&quot;&gt;&lt;b&gt;Source Code:&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Arvo; font-size: medium;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh35uV73nYiyxcufxjNAquJlmA-bUu0RoCtR5g7urIfvqOi0oP9E-4KdDpjtOAshYOxrG3jqHKu3gsC_cVwgwoete60FfDTXtu2LvQ0rJH870xndGwxU-CPO6QL9J9JGyI5JKNGVAao0Bg/s2048/lcd.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;2048&quot; data-original-width=&quot;1079&quot; height=&quot;1209&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh35uV73nYiyxcufxjNAquJlmA-bUu0RoCtR5g7urIfvqOi0oP9E-4KdDpjtOAshYOxrG3jqHKu3gsC_cVwgwoete60FfDTXtu2LvQ0rJH870xndGwxU-CPO6QL9J9JGyI5JKNGVAao0Bg/w639-h1209/lcd.png&quot; width=&quot;639&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;pre class=&quot;lang:default decode:true&quot; style=&quot;background-color: whitesmoke; border-radius: 4px; border: 1px solid rgb(204, 204, 204); box-sizing: inherit; color: #333333; font-size: 15px; font-weight: 700; letter-spacing: 1px; line-height: 1.6; margin-bottom: 1.6em; margin-top: 0px; max-width: 100%; overflow-wrap: break-word; overflow: auto; padding: 1.6em; word-break: break-all;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;// Program for LCD Interfacing with 8051 Microcontroller (P89V51RD2) 

#include&amp;lt;reg51.h&amp;gt;
#include &amp;lt;string.h&amp;gt;

#define display_port P2      //Data pins connected to port 2 on microcontroller
sbit rs = P0^0;  //Register Select pin connected to pin 0 of port 0
sbit rw = P0^1;  // Read/Write pin connected to pin 0 of port 1
sbit e =  P0^2;  //Enable pin connected to pin 0 of port 2

void msdelay(unsigned int time)  // Function for creating delay in milliseconds.
{
    unsigned i,j ;
    for(i=0;i&amp;lt;time;i++)    
    for(j=0;j&amp;lt;1275;j++);
}
void lcd_cmd(unsigned char command)  //Function to send command instruction to LCD
{
    display_port = command;
    rs= 0;
    rw=0;
    e=1;
    msdelay(1);
    e=0;
}

void lcd_data(unsigned char disp_data)  //Function to send display _data to LCD
{
    display_port = disp_data;
    rs= 1;
    rw=0;
    e=1;
    msdelay(1);
    e=0;
}

 void lcd_init()    //Function to prepare the LCD  and get it ready
{
    lcd_cmd(0x38);  // for _using 2 lines and 5X7 matrix of LCD
    msdelay(10);
    lcd_cmd(0x0F);  // turn display ON, cursor blinking
    msdelay(10);
    lcd_cmd(0x01);  //clear screen
    msdelay(10);
    lcd_cmd(0x81);  // bring cursor to position 1 of line 1
    msdelay(10);
}
void main()
{
    unsigned char a[15]=&quot;Surajkumar&quot;;    //string of 14 characters with a null terminator.
    int l=0;
		int len = strlen(a);
	
    lcd_init();
	
		for(l;l&amp;lt;len;l++)
		{
			lcd_data(a[l]);
			msdelay(50);
			
		} 
		
	   // OR
	
		
    //while(a[l] != &#39;\0&#39;) // searching the null terminator in the sentence
    //{
    //    lcd_data(a[l]);
    //    l++;
    //    msdelay(50);
    //}
 
  while(1);

}&lt;/span&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='https://surajkumartech.blogspot.com/feeds/6354351680073651504/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://surajkumartech.blogspot.com/2021/03/lcd-interfacing-with-8051.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/6875261495822215624/posts/default/6354351680073651504'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/6875261495822215624/posts/default/6354351680073651504'/><link rel='alternate' type='text/html' href='https://surajkumartech.blogspot.com/2021/03/lcd-interfacing-with-8051.html' title='LCD Interfacing with 8051 Microcontroller'/><author><name>Surajkumar Sharma</name><uri>http://www.blogger.com/profile/01015148309961923598</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjT6-2WRSG9PYXDYi3KHvBxtZjIdjVviH3Omj_IfkGKELbvUkNn152moPlmho-cX1iaQQfyNHNDlhdU9sjVcDd_4-NmFs3n86oumBLjXoNUS2aH0MbsaYKfumtvRWwmGw/s220/Untitled-1.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUP-xYkzPXJEtNzEZXd_VQKCPyLsbZUYOMBJOhwX_0cWNvfA6Ypxz7Raoy9oYoFUm-fGlYZuzyYNoGYnJGcA10gCdzUlaBkt_ooaAeYs7xyjgJ80zWAuTdJtVGZbzH4snT0VfjrqarZx4/s72-w573-h279-c/LCD+%25282%2529.jpg" height="72" width="72"/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6875261495822215624.post-611520676208234164</id><published>2021-03-08T15:28:00.009+05:30</published><updated>2021-04-14T01:24:42.597+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Embedded System"/><title type='text'>Control LEDs with Voice Command</title><content type='html'>&lt;p style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;color: red; font-family: Arvo; font-size: large;&quot;&gt;&lt;b&gt;Control LEDs with Voice Command&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7yzhq56xzxWnmg_jCoG-kkjudVCG3xmxkb0uZfGtaUFqGhf9c95vbuFaWubO_DeRNq9un_IUtnXmB5G2WSJ4H-H3z5idAceR0sVQ7s-ZgO56cLXQjV_uZI1L6eTY7cK7bqp_jtx9ETPE/s2633/10y692.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1194&quot; data-original-width=&quot;2633&quot; height=&quot;312&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7yzhq56xzxWnmg_jCoG-kkjudVCG3xmxkb0uZfGtaUFqGhf9c95vbuFaWubO_DeRNq9un_IUtnXmB5G2WSJ4H-H3z5idAceR0sVQ7s-ZgO56cLXQjV_uZI1L6eTY7cK7bqp_jtx9ETPE/w637-h312/10y692.jpg&quot; width=&quot;637&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh66CAX9lkfXwUpDDZiyxTAVtVgQUkMPWL_HrjMTfLnoburD87HdFQK59Rp9ooX_cVi6y5qD52EeffsvWGfWCtgMGOIOeBxAFveVE1asSGxaWWNCPvtlCa_J_f3CQxyCEEieKsvoVyRSu8/s2000/5075540.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;2000&quot; data-original-width=&quot;2000&quot; height=&quot;273&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh66CAX9lkfXwUpDDZiyxTAVtVgQUkMPWL_HrjMTfLnoburD87HdFQK59Rp9ooX_cVi6y5qD52EeffsvWGfWCtgMGOIOeBxAFveVE1asSGxaWWNCPvtlCa_J_f3CQxyCEEieKsvoVyRSu8/w285-h273/5075540.jpg&quot; width=&quot;285&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihTupX9nKHJsXXlFmydGWlrxVDjDpQpKo5WXL8aQIE8ziMxtdsNrv7AeOK5GvnQnilkl6ogmSNMULIvSfZVtNsHlzTbZ0miK3CRAzpxuk8HoDo6GrxxTzg6vRvXQpmN6nt_vV4SG0AMUA/s2000/3487337.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em; text-align: right;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;2000&quot; data-original-width=&quot;2000&quot; height=&quot;312&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihTupX9nKHJsXXlFmydGWlrxVDjDpQpKo5WXL8aQIE8ziMxtdsNrv7AeOK5GvnQnilkl6ogmSNMULIvSfZVtNsHlzTbZ0miK3CRAzpxuk8HoDo6GrxxTzg6vRvXQpmN6nt_vV4SG0AMUA/w312-h312/3487337.jpg&quot; width=&quot;312&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;This is a very basic project for controlling LED (Red) using voice control. To accomplish this we have used the Bluetooth HC-05 module and android apps are available on the play store. LEDs will be On/Off on your voice command.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;background-color: white; box-sizing: inherit; clear: both; letter-spacing: 1px; line-height: 1.1; margin-bottom: 10px; margin-top: 20px; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Arvo; font-size: medium;&quot;&gt;&lt;b&gt;Procedure:-&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;ol style=&quot;background-color: white; box-sizing: inherit; font-family: sans-serif; letter-spacing: 1px; list-style-image: initial; list-style-position: initial; margin: 0px 0px 1.5em 3em;&quot;&gt;&lt;li style=&quot;box-sizing: inherit;&quot;&gt;Make the connections as shown in the connection image. Don’t connect the RX &amp;amp; TX pins WHILE/BEFORE&amp;nbsp; uploading the code!&lt;/li&gt;&lt;li style=&quot;box-sizing: inherit;&quot;&gt;Copy the code given below.&lt;/li&gt;&lt;li style=&quot;box-sizing: inherit;&quot;&gt;Download any app called&amp;nbsp;&lt;span style=&quot;box-sizing: inherit;&quot;&gt;BT Voice Control.&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: inherit;&quot;&gt;Open the app&lt;span style=&quot;box-sizing: inherit;&quot;&gt;&amp;nbsp;&lt;/span&gt;(It will automatically turn on the device’s Bluetooth). Go to options. Click on&amp;nbsp;&lt;span style=&quot;box-sizing: inherit;&quot;&gt;“Connect”.&amp;nbsp;&lt;/span&gt;Choose the device – HC 05.&lt;/li&gt;&lt;li style=&quot;box-sizing: inherit;&quot;&gt;When you are connecting to the Bluetooth module for the first time, it will ask you for the password. Enter&amp;nbsp;&lt;span style=&quot;box-sizing: inherit;&quot;&gt;0000&amp;nbsp;&lt;/span&gt;OR&amp;nbsp;&lt;span style=&quot;box-sizing: inherit;&quot;&gt;1234.&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: inherit;&quot;&gt;&amp;nbsp;When the device gets successfully paired with the sensor, the LED lights on the sensor will start blinking at a slower rate than usual.&lt;/li&gt;&lt;li style=&quot;box-sizing: inherit;&quot;&gt;DONE. Copy the code given below &amp;amp; test it out!&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;&lt;span face=&quot;sans-serif&quot;&gt;&lt;span style=&quot;letter-spacing: 1px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: Arvo; font-size: medium;&quot;&gt;&lt;span style=&quot;letter-spacing: 1px;&quot;&gt;&lt;b&gt;Source Code:-&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: Arvo; font-size: medium;&quot;&gt;&lt;span style=&quot;letter-spacing: 1px;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2yzZDGNjZgcLiE4fw7WZfnUp55z3M0qA0EEHmBdnsfpNZQPUGGK5GM4MT4C7EkO7i-L899evyvOIssAMGVeb9wV-J0Aep_qa_MX2s6ckY7WHWRjgJeKJNnIrQHG2lNnX1n2mdbtqO-fI/s1808/btvoice.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1808&quot; data-original-width=&quot;1582&quot; height=&quot;730&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2yzZDGNjZgcLiE4fw7WZfnUp55z3M0qA0EEHmBdnsfpNZQPUGGK5GM4MT4C7EkO7i-L899evyvOIssAMGVeb9wV-J0Aep_qa_MX2s6ckY7WHWRjgJeKJNnIrQHG2lNnX1n2mdbtqO-fI/w638-h730/btvoice.png&quot; width=&quot;638&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;pre class=&quot;lang:default decode:true&quot; style=&quot;background-color: whitesmoke; border-radius: 4px; border: 1px solid rgb(204, 204, 204); box-sizing: inherit; color: #333333; font-size: 15px; letter-spacing: 1px; line-height: 1.6; margin-bottom: 1.6em; margin-top: 0px; max-width: 100%; overflow-wrap: break-word; overflow: auto; padding: 1.6em; word-break: break-all;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;&lt;b&gt;String voice;
#define RED 8

void setup() {
  Serial.begin(9600);
  pinMode(RED,OUTPUT);
}
 

void RedOn(){
digitalWrite (RED, HIGH);
}
void RedOff(){
digitalWrite (RED, LOW);
}

 
void loop() {                    
  while (Serial.available()){  //Check if there is an available byte to read
  delay(10);                   //Delay added to make thing stable
  char c = Serial.read();      //Conduct a serial read
  if (c == &#39;#&#39;) {break;}       //Exit the loop when the # is detected after the word
  voice += c; //Shorthand for voice = voice + c
  } 
  if (voice.length() &amp;gt; 0) {
    Serial.println(voice);
//-----------------------------------------------------------------------//   
  //----------Control Multiple Pins/ LEDs----------// 
   if(voice ==&quot;red&quot; || voice ==&quot;red on&quot;){
&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;RedOn();
&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;}
&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;else if(voice ==&quot;red off&quot;){
&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;RedOff();
&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;}

voice=&quot;&quot;; //Reset the variable after initiating
}
}&lt;/b&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div&gt;&lt;span face=&quot;sans-serif&quot;&gt;&lt;span style=&quot;letter-spacing: 1px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span face=&quot;sans-serif&quot;&gt;&lt;span style=&quot;letter-spacing: 1px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: Arvo; font-size: medium;&quot;&gt;&lt;span style=&quot;letter-spacing: 1px;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;h3 style=&quot;background-color: white; box-sizing: inherit; clear: both; letter-spacing: 1px; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;span style=&quot;font-family: Arvo; font-size: medium;&quot;&gt;Connections:-&lt;/span&gt;&lt;/h3&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: Arvo; font-size: medium;&quot;&gt;Bluetooth:-&amp;nbsp; &amp;nbsp; &amp;nbsp;Arduino UNO:-&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: Arvo; font-size: medium;&quot;&gt;&amp;nbsp; RxD&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;==&amp;gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; TxD&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: Arvo; font-size: medium;&quot;&gt;&amp;nbsp; TxD&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;==&amp;gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; RxD&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: Arvo;&quot;&gt;&amp;nbsp; Vcc&lt;/span&gt;&lt;span style=&quot;font-family: Arvo;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ==&amp;gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 3.3V&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: Arvo;&quot;&gt;&amp;nbsp; Gnd&lt;/span&gt;&lt;span style=&quot;font-family: Arvo;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;==&amp;gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Gnd&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggvIM7MGoxTw6yz_Y4xprQFcLYsci1rv-Wf6lPQEkaW5nWomCFjbN5PCqLQXkIOfqls0ukAJ1n6Hmzr1qjzTeO3cBCpKr38osvFmRiJ8eNe-Cw6D0VPjjG6LlUzobxGN_w1a7GRjtcKDQ/s892/thmbnail-video.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;720&quot; data-original-width=&quot;892&quot; height=&quot;501&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggvIM7MGoxTw6yz_Y4xprQFcLYsci1rv-Wf6lPQEkaW5nWomCFjbN5PCqLQXkIOfqls0ukAJ1n6Hmzr1qjzTeO3cBCpKr38osvFmRiJ8eNe-Cw6D0VPjjG6LlUzobxGN_w1a7GRjtcKDQ/w621-h501/thmbnail-video.jpg&quot; width=&quot;621&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;embed-frame&quot; style=&quot;box-sizing: border-box; margin: 60px 0px; padding: 0px;&quot;&gt;&lt;div class=&quot;figure youtube&quot; style=&quot;box-sizing: border-box; margin: 0px; padding: 0px;&quot;&gt;&lt;div class=&quot;figcaption embed-figcaption&quot; data-contenteditable=&quot;true&quot; data-default-text=&quot;Type in a caption&quot; data-disable-toolbar=&quot;true&quot; style=&quot;background-color: white; box-sizing: border-box; color: #888888; font-family: &amp;quot;typonine sans regular&amp;quot;; font-size: 18px; letter-spacing: 0.3px; margin: 0px 0px 10px; padding: 0px;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://surajkumartech.blogspot.com/feeds/611520676208234164/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://surajkumartech.blogspot.com/2021/03/control-leds-with-voice-command-this-is.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/6875261495822215624/posts/default/611520676208234164'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/6875261495822215624/posts/default/611520676208234164'/><link rel='alternate' type='text/html' href='https://surajkumartech.blogspot.com/2021/03/control-leds-with-voice-command-this-is.html' title='Control LEDs with Voice Command'/><author><name>Surajkumar Sharma</name><uri>http://www.blogger.com/profile/01015148309961923598</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjT6-2WRSG9PYXDYi3KHvBxtZjIdjVviH3Omj_IfkGKELbvUkNn152moPlmho-cX1iaQQfyNHNDlhdU9sjVcDd_4-NmFs3n86oumBLjXoNUS2aH0MbsaYKfumtvRWwmGw/s220/Untitled-1.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7yzhq56xzxWnmg_jCoG-kkjudVCG3xmxkb0uZfGtaUFqGhf9c95vbuFaWubO_DeRNq9un_IUtnXmB5G2WSJ4H-H3z5idAceR0sVQ7s-ZgO56cLXQjV_uZI1L6eTY7cK7bqp_jtx9ETPE/s72-w637-h312-c/10y692.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6875261495822215624.post-1414231450574403662</id><published>2021-03-07T13:55:00.017+05:30</published><updated>2021-03-10T01:17:04.252+05:30</updated><title type='text'>LM386 based audio amplifier</title><content type='html'>&lt;p style=&quot;text-align: center;&quot;&gt;&lt;b style=&quot;background-color: white; color: red; font-size: 27px;&quot;&gt;&lt;span style=&quot;font-family: Arvo;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;b style=&quot;background-color: white; color: red; font-size: 27px;&quot;&gt;&lt;span style=&quot;font-family: Arvo;&quot;&gt;LM386 based audio amplifier: circuit and working.&lt;/span&gt;&lt;/b&gt;&amp;nbsp;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1152&quot; data-original-width=&quot;2048&quot; height=&quot;242&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglsi7sYy6d97WcA8vGMBGddnf-GRHn6aFGxaG4uUJJwkLBB4h0KdiXWxElX-8DbhuU_80w4l20B1rQpstxKmP9EXoVzysgsE66WqL8C6UkSDLzycIC5NYtzSGlG9KMhc7w7mTxXSP3Y7g/w429-h242/IMG_20190421_170424.jpg&quot; width=&quot;429&quot; /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #666666;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;we will show you how to build LM386 Audio Amplifier Circuit. It is a very low-cost audio amplifier and can power any speaker. For the cost and size of the circuit, the sound from the LM386 Audio Amplifier can be adequately loud.&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab;&quot;&gt;There are many Audio Amplifier Circuits designed using LM386 IC. The main problem with these circuits is noise and interference. The noise from the Amplifier Circuit designed in this project is considerably less and if designed on a proper circuit board, this will make a great Audio Amplifier.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span face=&quot;sans-serif&quot;&gt;&lt;span style=&quot;font-size: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;h3 style=&quot;background-color: white; box-sizing: border-box; line-height: 1.2; margin: 0px 0px 16px;&quot;&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;span style=&quot;box-sizing: border-box;&quot;&gt;&lt;span style=&quot;font-family: Roboto Slab; font-size: large;&quot;&gt;Introduction to LM386&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/h3&gt;&lt;p style=&quot;background-color: white; box-sizing: border-box; margin: 0px 0px 26px; padding: 0px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box;&quot;&gt;&lt;span style=&quot;color: #666666; font-family: Roboto Slab;&quot;&gt;The LM386 is an all–in–one Class-AB Audio Amplifier IC that can be used in a variety of applications. LM386 IC has been in use for decades and is still being used as an Amplifier in Computer speakers and Portable Stereos.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;background-color: white; box-sizing: border-box; margin: 0px 0px 26px; padding: 0px;&quot;&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;Roboto Slab&amp;quot;;&quot;&gt;LM386 is a low voltage power amplifier with an inactive power draw of 24mW, which makes it suitable for battery-controlled applications. The most common package for LM386 is an 8 – pin DIP.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;538&quot; data-original-width=&quot;883&quot; height=&quot;310&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGVo9per0o3OOxt-dERFE-ihlytx40bEDelb8PSgI2C0HNMnQaS5Dxq6spclRlaOO3ejMt-RbLwuuiAHjot-J4xRY6ovWeBcSZhGi3yLm0YU4mzSXcUITnzRyMP7uWIriJ4UQ_Ys-dtBI/w508-h310/272-18.jpg&quot; width=&quot;508&quot; /&gt;&lt;br /&gt;&lt;h2 style=&quot;background-color: white; box-sizing: border-box; color: #404041; font-family: &amp;quot;Martel Sans&amp;quot;, sans-serif; font-size: 20px; line-height: 20px; margin: 30px 0px 10px; padding: 0px;&quot;&gt;Schematic of LM386 Audio Amplifier Circuit&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #666666; font-family: Roboto Slab;&quot;&gt;Before using this project, test it using the 6V battery. Connect the 8-ohm, one-watt speaker to output pin 5 of IC1 through C3. Switch on S1 and keep VR1 to its mid position. Now, take a screwdriver and gently touch it on input terminal pin 3 of IC1. You should hear a humming sound from the speaker. This will confirm that your circuit is working and ready to use.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;background-color: white; color: #222222; font-family: &amp;quot;Open Sans&amp;quot;; font-size: 17px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;background-color: white; border: 0px; box-sizing: border-box; clear: both; line-height: 1.2; margin: 0px 0px 16px; outline: 0px; padding: 0px; text-align: justify; vertical-align: baseline;&quot;&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-family: Arvo; font-size: large;&quot;&gt;&lt;b&gt;Features of IC LM386&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;p style=&quot;background-color: white; border: 0px; box-sizing: border-box; line-height: 1.825; margin: 0px 0px 24px; outline: 0px; padding: 0px; text-align: justify; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;color: #666666; font-family: Roboto Slab;&quot;&gt;The main features of LM386 chip include the following.&lt;/span&gt;&lt;/p&gt;&lt;ol style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;Roboto Slab&amp;quot;; font-style: inherit;&quot;&gt;IC LM386 is obtainable in the package of 8-pin MSOP&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;Roboto Slab&amp;quot;; font-style: inherit;&quot;&gt;Exterior components are minimum&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://www.elprocus.com/paper-battery-construction-and-working/&quot; rel=&quot;noopener noreferrer&quot; style=&quot;background-color: white; border: 0px; box-sizing: border-box; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; text-decoration-line: none; vertical-align: baseline;&quot; target=&quot;_blank&quot;&gt;&lt;span style=&quot;color: #666666; font-family: Roboto Slab;&quot;&gt;Operation of Battery&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;Roboto Slab&amp;quot;; font-style: inherit;&quot;&gt;Low static power drain- 4mA&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;Roboto Slab&amp;quot;; font-style: inherit;&quot;&gt;The range of supply voltage is wide which is ranges from 4Volts to 12Volts or 5Volts to 18 Volts.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;Roboto Slab&amp;quot;; font-style: inherit;&quot;&gt;Input is referenced by ground&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;Roboto Slab&amp;quot;; font-style: inherit;&quot;&gt;Distortion is less 0.2%&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;Roboto Slab&amp;quot;; font-style: inherit;&quot;&gt;Self-centering o/p static voltage&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;Roboto Slab&amp;quot;; font-style: inherit;&quot;&gt;The voltage gain range will be from 20 to 200&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://surajkumartech.blogspot.com/feeds/1414231450574403662/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://surajkumartech.blogspot.com/2021/03/lm386-based-audio-amplifier.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/6875261495822215624/posts/default/1414231450574403662'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/6875261495822215624/posts/default/1414231450574403662'/><link rel='alternate' type='text/html' href='https://surajkumartech.blogspot.com/2021/03/lm386-based-audio-amplifier.html' title='LM386 based audio amplifier'/><author><name>Surajkumar Sharma</name><uri>http://www.blogger.com/profile/01015148309961923598</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjT6-2WRSG9PYXDYi3KHvBxtZjIdjVviH3Omj_IfkGKELbvUkNn152moPlmho-cX1iaQQfyNHNDlhdU9sjVcDd_4-NmFs3n86oumBLjXoNUS2aH0MbsaYKfumtvRWwmGw/s220/Untitled-1.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglsi7sYy6d97WcA8vGMBGddnf-GRHn6aFGxaG4uUJJwkLBB4h0KdiXWxElX-8DbhuU_80w4l20B1rQpstxKmP9EXoVzysgsE66WqL8C6UkSDLzycIC5NYtzSGlG9KMhc7w7mTxXSP3Y7g/s72-w429-h242-c/IMG_20190421_170424.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6875261495822215624.post-1326126254229212648</id><published>2021-02-18T21:59:00.024+05:30</published><updated>2021-04-14T01:29:16.880+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Embedded System"/><title type='text'>Interfacing LED with 8051 Microcontroller in Assembly </title><content type='html'>&lt;h3 style=&quot;-webkit-font-smoothing: initial; background-color: white; border: 0px; color: var(--h-color, #161616); font-family: &amp;quot;IBM Plex Sans&amp;quot;, system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, sans-serif; font-size: 20px; line-height: 1.5; margin: 1.2em 0px 1em; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;&lt;span style=&quot;color: red; font-family: Arvo; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;&lt;span style=&quot;color: red; font-family: Arvo; font-size: x-large;&quot;&gt;Blinking 1 LED using 8051&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;&lt;span style=&quot;color: red; font-family: Arvo; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;179&quot; data-original-width=&quot;538&quot; height=&quot;189&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-wsORJKTs3VdzqJZ3Irz66QEJ3p9TI9S6v3A2hcJ0Js66yaS4tjlKHybOacfmo_dNWxYfiP25TQsMuiveDjx8tDPuJ19E0iCbGyrMKgc6OPMSe05pAlsqR_lZubQZAGroPOCBms5FkKI/w617-h189/led-s-binary-counter-pattern_orig-1.png&quot; width=&quot;617&quot; /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/h3&gt;&lt;h3 style=&quot;-webkit-font-smoothing: initial; background-color: white; border: 0px; color: var(--h-color, #161616); line-height: 1.5; margin: 1.2em 0px 1em; padding: 0px; text-align: center; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;font-size: 18.72px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/h3&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;background-color: white; color: #444444; font-family: Roboto Slab; text-align: justify;&quot;&gt;This is the first project regarding 8051 and of course one of the simplest, blinking LEDs using 8051. The microcontroller used here is AT89S51 In the circuit, push-button switch S1, capacitor C3 and resistor R3 form the reset circuitry. When S1 is pressed, the voltage at the reset pin (pin9) goes high and this resets the chip. C1, C2, and X1 are related to the on-chip oscillator which produces the required clock frequency. P1.0 (pin1) is selected as the output pin. When P1.o goes high the transistor Q1 is forward biased and LED goes ON. When P1.0 goes low the transistor goes to cut off and the LED extinguishes. The transistor driver circuit for the LED can be avoided and the LED can be connected directly to the P1.0 pin with a series current limiting resistor(~1K). &amp;nbsp;The time for which P1.o goes high and low (the time period of the LED) &amp;nbsp;is determined by the program. The circuit diagram for blinking 1 LED is shown below.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span face=&quot;&amp;quot;IBM Plex Sans&amp;quot;, system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, sans-serif&quot; style=&quot;background-color: white; color: #303030; font-size: 17px; text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;background-color: white; border: 0px; line-height: 1.5; margin: 1.2em 0px 1em; padding: 0px; text-align: left; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;font-family: Arvo; font-size: medium;&quot;&gt;&lt;b&gt;Program.&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;background-color: white; border: 0px; line-height: 1.5; margin: 1.2em 0px 1em; padding: 0px; text-align: left; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;font-family: Arvo; font-size: medium;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVk73q8Ycs4RdZksx9UpXgwG79GgascdjUlsRo_2ctMVOTYWxTSa4zOijYnddV3ihsE1nNKD1Zdzg07PHbdHQlaPxSH4uLO9B2JEXIrgp1SvzRIyF2vCRLntuuqZzHvo73OSLfsPx_uuI/s778/led-1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;778&quot; data-original-width=&quot;654&quot; height=&quot;754&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVk73q8Ycs4RdZksx9UpXgwG79GgascdjUlsRo_2ctMVOTYWxTSa4zOijYnddV3ihsE1nNKD1Zdzg07PHbdHQlaPxSH4uLO9B2JEXIrgp1SvzRIyF2vCRLntuuqZzHvo73OSLfsPx_uuI/w634-h754/led-1.png&quot; width=&quot;634&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;pre style=&quot;-webkit-font-smoothing: var(--base-aa); background: rgb(248, 248, 248); border: 0px; color: #303030; font-family: Menlo, Monaco, Consolas, monospace; font-size: 17px; margin-bottom: 1.857em; margin-top: 0px; overflow-wrap: break-word; padding: 1.857em; vertical-align: baseline; word-break: break-all;&quot;&gt;START: CPL P1.0
       ACALL WAIT  
       SJMP START

WAIT:  MOV R4,#05H
WAIT1: MOV R3,#00H
WAIT2: MOV R2,#00H
WAIT3: DJNZ R2,WAIT3
        DJNZ R3,WAIT2
        DJNZ R4,WAIT1
        RET&lt;/pre&gt;&lt;pre style=&quot;-webkit-font-smoothing: var(--base-aa); background: rgb(248, 248, 248); border: 0px; margin-bottom: 1.857em; margin-top: 0px; overflow-wrap: break-word; padding: 1.857em; vertical-align: baseline; word-break: break-all;&quot;&gt;&lt;h3 style=&quot;-webkit-font-smoothing: initial; background-color: white; border: 0px; color: var(--h-color, #161616); line-height: 1.5; margin: 1.2em 0px 1em; padding: 0px; text-align: center; vertical-align: baseline; white-space: normal;&quot;&gt;&lt;span style=&quot;font-family: Arvo; font-size: large;&quot;&gt;Blinking &amp;nbsp;2 LED alternatively using 8051.&lt;/span&gt;&lt;/h3&gt;&lt;div&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: Roboto Slab; white-space: normal;&quot;&gt;This circuit can blink two LEDs alternatively. P1.0 and P1.1 are assigned as the outputs. When P1.0 goes high P1.0 goes low and vice versa and the LEDs follow the state of &amp;nbsp;the corresponding port to which it is connected. Here there is no driver stage for the LEDs and they are connected directly to the corresponding ports through &amp;nbsp;series current limiting resistors (R1 &amp;amp; R2). Circuit diagram is shown below.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: #303030; font-family: Menlo, Monaco, Consolas, monospace; font-size: 17px;&quot;&gt;&lt;span face=&quot;&amp;quot;IBM Plex Sans&amp;quot;, system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, sans-serif&quot; style=&quot;background-color: white; white-space: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;background-color: white; border: 0px; line-height: 1.5; margin: 1.2em 0px 1em; padding: 0px; text-align: left; vertical-align: baseline; white-space: normal;&quot;&gt;&lt;span style=&quot;font-family: Arvo; font-size: medium;&quot;&gt;&lt;b&gt;Program.&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;background-color: white; border: 0px; line-height: 1.5; margin: 1.2em 0px 1em; padding: 0px; text-align: left; vertical-align: baseline; white-space: normal;&quot;&gt;&lt;span style=&quot;font-family: Arvo; font-size: medium;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPs_yhbaw7WvrC0Q7aqThkrs_KLEAROkAScNfjy5VOkAJWi7wMHhDeMqFkYeqVJmQWBc9sa7n2JVggAzwT9wj8LT_-w8qHjSgSFKByT3Udj5lGq4m02qZdGHpHJd3QWE9Z67gkQMkqCns/s924/led-2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;924&quot; data-original-width=&quot;654&quot; height=&quot;865&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPs_yhbaw7WvrC0Q7aqThkrs_KLEAROkAScNfjy5VOkAJWi7wMHhDeMqFkYeqVJmQWBc9sa7n2JVggAzwT9wj8LT_-w8qHjSgSFKByT3Udj5lGq4m02qZdGHpHJd3QWE9Z67gkQMkqCns/w611-h865/led-2.png&quot; width=&quot;611&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: #303030; font-family: Menlo, Monaco, Consolas, monospace; font-size: 17px;&quot;&gt;&lt;pre style=&quot;-webkit-font-smoothing: var(--base-aa); background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; font-family: Menlo, Monaco, Consolas, monospace; margin-bottom: 1.857em; margin-top: 0px; overflow-wrap: break-word; padding: 1.857em; vertical-align: baseline; word-break: break-all;&quot;&gt;START: CPL P1.0
       ACALL WAIT  
       CPL P1.0
       CPL P1.1
       ACALL WAIT
       CPL P1.1  
       SJMP START

WAIT:  MOV R4,#05H
WAIT1: MOV R3,#00H
WAIT2: MOV R2,#00H
WAIT3: DJNZ R2,WAIT3
        DJNZ R3,WAIT2
        DJNZ R4,WAIT1
        RET&lt;/pre&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://surajkumartech.blogspot.com/feeds/1326126254229212648/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://surajkumartech.blogspot.com/2021/02/interfacing-led-with-8051.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/6875261495822215624/posts/default/1326126254229212648'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/6875261495822215624/posts/default/1326126254229212648'/><link rel='alternate' type='text/html' href='https://surajkumartech.blogspot.com/2021/02/interfacing-led-with-8051.html' title='Interfacing LED with 8051 Microcontroller in Assembly '/><author><name>Surajkumar Sharma</name><uri>http://www.blogger.com/profile/01015148309961923598</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjT6-2WRSG9PYXDYi3KHvBxtZjIdjVviH3Omj_IfkGKELbvUkNn152moPlmho-cX1iaQQfyNHNDlhdU9sjVcDd_4-NmFs3n86oumBLjXoNUS2aH0MbsaYKfumtvRWwmGw/s220/Untitled-1.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-wsORJKTs3VdzqJZ3Irz66QEJ3p9TI9S6v3A2hcJ0Js66yaS4tjlKHybOacfmo_dNWxYfiP25TQsMuiveDjx8tDPuJ19E0iCbGyrMKgc6OPMSe05pAlsqR_lZubQZAGroPOCBms5FkKI/s72-w617-h189-c/led-s-binary-counter-pattern_orig-1.png" height="72" width="72"/><thr:total>0</thr:total></entry></feed>