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

<channel>
	<title>Arduino Archives &#8211; Make Some Stuff</title>
	<atom:link href="https://makesomestuff.org/tutorials/arduino/feed/" rel="self" type="application/rss+xml" />
	<link>https://makesomestuff.org/tutorials/arduino/</link>
	<description>Build Cool Electronics Projects!</description>
	<lastBuildDate>Sat, 27 Sep 2025 22:11:35 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.2</generator>

<image>
	<url>https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/11/cropped-icon2.png?fit=32%2C32&#038;ssl=1</url>
	<title>Arduino Archives &#8211; Make Some Stuff</title>
	<link>https://makesomestuff.org/tutorials/arduino/</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">165766821</site>	<item>
		<title>Arduino Motorized Camera Slider</title>
		<link>https://makesomestuff.org/arduino-motorized-camera-slider/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=arduino-motorized-camera-slider</link>
					<comments>https://makesomestuff.org/arduino-motorized-camera-slider/#comments</comments>
		
		<dc:creator><![CDATA[Ahmed Ibrahim]]></dc:creator>
		<pubDate>Fri, 28 Aug 2020 16:02:03 +0000</pubDate>
				<category><![CDATA[Arduino Projects]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Bluetooth]]></category>
		<category><![CDATA[camera slider]]></category>
		<guid isPermaLink="false">https://makesomestuff.org/?p=1028</guid>

					<description><![CDATA[<p><a href="https://makesomestuff.org">Make Some Stuff</a><br />
<a href="https://makesomestuff.org/arduino-motorized-camera-slider/">Arduino Motorized Camera Slider</a></p>
<p>For someone who loves to shoot some random hobbyist videos, it&#8217;s somehow expensive to buy a motorized camera slider. So, I built my own. In this tutorial, we will go through each step to build your own Bluetooth-controlled motorized camera slider. Hardware Components Component Quantity V-Slot 20&#215;40 Linear Rail the length you want. Solid V [...]</p>
<p>The post <a href="https://makesomestuff.org/arduino-motorized-camera-slider/">Arduino Motorized Camera Slider</a> appeared first on <a href="https://makesomestuff.org">Make Some Stuff</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><a href="https://makesomestuff.org">Make Some Stuff</a><br />
<a href="https://makesomestuff.org/arduino-motorized-camera-slider/">Arduino Motorized Camera Slider</a></p>

<p class="wp-block-paragraph">For someone who loves to shoot some random hobbyist videos, it&#8217;s somehow expensive to buy a motorized camera slider. So, I built my own. In this tutorial, we will go through each step to build your own Bluetooth-controlled motorized camera slider.</p>



<figure class="wp-embed-aspect-16-9 wp-has-aspect-ratio wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube"><div class="wp-block-embed__wrapper">
<iframe title="Arduino Bluetooth Motorized Camera Slider" width="770" height="433" src="https://www.youtube.com/embed/NDiSkqDO93k?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
</div></figure>



<h2 class="wp-block-heading">Hardware Components</h2>



<hr class="wp-block-separator has-css-opacity"/>



<figure class="wp-block-table"><table><thead><tr><th class="has-text-align-center" data-align="center">Component</th><th class="has-text-align-center" data-align="center">Quantity</th></tr></thead><tbody><tr><td class="has-text-align-center" data-align="center"><a href="https://openbuildspartstore.com/v-slot-20x40-linear-rail/" target="_blank" rel="noreferrer noopener">V-Slot 20&#215;40 Linear Rail</a></td><td class="has-text-align-center" data-align="center">the length you want.</td></tr><tr><td class="has-text-align-center" data-align="center"><a href="https://openbuildspartstore.com/solid-v-wheel-kit/" target="_blank" rel="noreferrer noopener">Solid V Wheel Kit</a></td><td class="has-text-align-center" data-align="center">4</td></tr><tr><td class="has-text-align-center" data-align="center"><a href="https://openbuildspartstore.com/drop-in-tee-nuts/" target="_blank" rel="noreferrer noopener">Drop In Tee Nuts</a></td><td class="has-text-align-center" data-align="center">4</td></tr><tr><td class="has-text-align-center" data-align="center"><a href="https://openbuildspartstore.com/eccentric-spacer/" target="_blank" rel="noreferrer noopener">Eccentric Spacer</a></td><td class="has-text-align-center" data-align="center">2</td></tr><tr><td class="has-text-align-center" data-align="center"><a href="https://openbuildspartstore.com/aluminum-spacers-10-pack/" target="_blank" rel="noreferrer noopener">9mm Aluminium spacer</a></td><td class="has-text-align-center" data-align="center">2</td></tr><tr><td class="has-text-align-center" data-align="center"><a href="https://openbuildspartstore.com/aluminum-spacers-10-pack/" target="_blank" rel="noreferrer noopener">3mm Aluminium spacer</a></td><td class="has-text-align-center" data-align="center">2</td></tr><tr><td class="has-text-align-center" data-align="center"><a href="https://openbuildspartstore.com/low-profile-screws-m5-10-pack/" target="_blank" rel="noreferrer noopener">Low Profile M5 screws length 20mm with nuts</a></td><td class="has-text-align-center" data-align="center">4</td></tr><tr><td class="has-text-align-center" data-align="center"><a href="https://openbuildspartstore.com/low-profile-screws-m5-10-pack/" target="_blank" rel="noreferrer noopener">Low Profile M5 screws lenght 10mm</a></td><td class="has-text-align-center" data-align="center">4</td></tr><tr><td class="has-text-align-center" data-align="center"><a href="https://www.ebay.com/itm/340pcs-M3-A2-Stainless-Steel-Hex-Screw-Nuts-Bolt-Cap-Socket-Assortment-Kit/222963932692?hash=item33e9af9e14:g:-CwAAOSwo9Fa6suH" target="_blank" rel="noreferrer noopener">M3 Allen HEX screws length 16mm with nuts</a></td><td class="has-text-align-center" data-align="center">8</td></tr><tr><td class="has-text-align-center" data-align="center"><a href="https://www.ebay.com/itm/KFL08-8mm-Zinc-Alloy-Self-aligning-Pillow-Flange-Block-Bearing-Miniature-Rhombic/143438599109?hash=item21659b53c5:g:4A8AAOSwQ4RdySdd" target="_blank" rel="noreferrer noopener">8mm Self-aligning Pillow Flange Block Bearing</a></td><td class="has-text-align-center" data-align="center">2</td></tr><tr><td class="has-text-align-center" data-align="center"><a href="https://www.ebay.com/itm/GT2-Timing-Pulley-Gear-20T-8mm-Bore-Hole-for-NEMA-RepRap-Prusa-Mendel-3D-Printer/263425227906?hash=item3d555dfc82:g:GV8AAOxywh1TEVPG" target="_blank" rel="noreferrer noopener">GT2 Bore 8mm 20 Teeth Timing Aluminum Pulley</a></td><td class="has-text-align-center" data-align="center">1</td></tr><tr><td class="has-text-align-center" data-align="center"><a href="https://www.ebay.com/itm/8mm-3D-Printer-Axis-Chrome-Plated-Smooth-Rod-Steel-Linear-Rail-Shaft-100-600mm/153607228218?hash=item23c3b44b3a:m:mY6AOQ6oZHBubk2jHuabjPg" target="_blank" rel="noreferrer noopener">8mm linear rail shaft</a></td><td class="has-text-align-center" data-align="center"> 60mm</td></tr><tr><td class="has-text-align-center" data-align="center"><a href="https://www.ebay.com/itm/GT2-Timing-Pulley-Gear-20T-5mm-Bore-Hole-for-NEMA-RepRap-Prusa-Mendel-3D-Printer/142649231949?hash=item21368e8a4d:g:qewAAOxy0bRTCELM" target="_blank" rel="noreferrer noopener">GT2</a><a href="https://www.ebay.com/itm/GT2-Timing-Pulley-Gear-20T-5mm-Bore-Hole-for-NEMA-RepRap-Prusa-Mendel-3D-Printer/142649231949?hash=item21368e8a4d:g:qewAAOxy0bRTCELM"> Bore 5mm 20 Teeth Timing Aluminum Pulley</a></td><td class="has-text-align-center" data-align="center">1</td></tr><tr><td class="has-text-align-center" data-align="center"><a href="https://www.ebay.com/itm/Black-Parts-GT2-6mm-Open-Timing-Belt-Width-6mm-GT2-Belt-for-3D-Printer/392318165563?hash=item5b57fc223b:g:bc8AAOSwVaNdDeYP" target="_blank" rel="noreferrer noopener">GT2-6mm Open Timing Belt</a></td><td class="has-text-align-center" data-align="center">(depending on your rail length)</td></tr><tr><td class="has-text-align-center" data-align="center"><a href="https://www.ebay.com/itm/Nema-17-Stepper-Motor-1-8-4-wires-60mm-48mm-40mm-34mm-1-5A-Bipolar/352897334644?_trkparms=ispr%3D1&amp;hash=item522a51fd74:m:mHj94orsqeJqc1634mx24Wg&amp;enc=AQAEAAACUBPxNw%2BVj6nta7CKEs3N0qU7O3ukBZjnBrVQsQ2MMPXWIAi1HMVJbRNVtObrEdHCSjYn%2BGEwRDAeNniflOwcPPRfnKoGS6IJ84KUZ%2Fk%2FknWYvNDHmGo%2F2q0myFM4a2%2BbUClUd75n4PTjlONz%2Bv81mLiyR8Op2wRQxHjZabCgVOQOyGrhhWOT%2FRAuFRWnGWMRoFjgdeVrhXMM19UISegxwT9By1sksEYnFv9MxnLAydPf%2BAvtaApj8IjFsv%2B6rCDncCUF4xkkb4vhGdTkUhFa6urG8X1AM1TxRLXKPSK%2BZWC97KJQLagmGQQOnkypOwCO3Cxn7b9nZU1PLiAoYFb8RIjNqBHNau%2BVp7ZMV68x%2FqTFUcWkyx8P3T%2Ffkc38ceGRlQiOQMy3QRMLqPwXAPCtf%2BHZxk4aFnGQXaTJ1nGvcBoV7DQXh7EfgDFLGakq5wI8GdslRC54sW0DJ2v6k%2BszD1jw3BcZfuc9Zv%2BqkpQ%2BQKiokxmzeh70WNRb1GzZY3GzXKk98cSTZQOyivHGO%2B6Xo7LZdEnZ55VhuqqMA47De%2BkZQXguluLqL2mdbnYKyEcYEKkU%2Fglmo8EpnwhpV4wxgGU7rJNuPxzpRMhWgbHodfanHLOJqdTx7nsyIr9Wk8diQem97oyclJ3bVJDYNyJjBLswrFZ%2B8ev0%2B%2BSD6uiht3e9TSn%2FzkD4r0lHTGZDT%2FYuwHUhNyyeBAzDZ5yJk%2Bo1xFaEpDLgO0DoYJCMvkkxgcjzKtj5aN45Dt3rwvwdgvcBN34iEkBtjg%2BkNPEtChESQp8%3D&amp;checksum=352897334644caee8af7443e491e91fba2927abe88db&amp;enc=AQAEAAACUBPxNw%2BVj6nta7CKEs3N0qU7O3ukBZjnBrVQsQ2MMPXWIAi1HMVJbRNVtObrEdHCSjYn%2BGEwRDAeNniflOwcPPRfnKoGS6IJ84KUZ%2Fk%2FknWYvNDHmGo%2F2q0myFM4a2%2BbUClUd75n4PTjlONz%2Bv81mLiyR8Op2wRQxHjZabCgVOQOyGrhhWOT%2FRAuFRWnGWMRoFjgdeVrhXMM19UISegxwT9By1sksEYnFv9MxnLAydPf%2BAvtaApj8IjFsv%2B6rCDncCUF4xkkb4vhGdTkUhFa6urG8X1AM1TxRLXKPSK%2BZWC97KJQLagmGQQOnkypOwCO3Cxn7b9nZU1PLiAoYFb8RIjNqBHNau%2BVp7ZMV68x%2FqTFUcWkyx8P3T%2Ffkc38ceGRlQiOQMy3QRMLqPwXAPCtf%2BHZxk4aFnGQXaTJ1nGvcBoV7DQXh7EfgDFLGakq5wI8GdslRC54sW0DJ2v6k%2BszD1jw3BcZfuc9Zv%2BqkpQ%2BQKiokxmzeh70WNRb1GzZY3GzXKk98cSTZQOyivHGO%2B6Xo7LZdEnZ55VhuqqMA47De%2BkZQXguluLqL2mdbnYKyEcYEKkU%2Fglmo8EpnwhpV4wxgGU7rJNuPxzpRMhWgbHodfanHLOJqdTx7nsyIr9Wk8diQem97oyclJ3bVJDYNyJjBLswrFZ%2B8ev0%2B%2BSD6uiht3e9TSn%2FzkD4r0lHTGZDT%2FYuwHUhNyyeBAzDZ5yJk%2Bo1xFaEpDLgO0DoYJCMvkkxgcjzKtj5aN45Dt3rwvwdgvcBN34iEkBtjg%2BkNPEtChESQp8%3D&amp;checksum=352897334644caee8af7443e491e91fba2927abe88db" target="_blank" rel="noreferrer noopener">bipolar Nema17 Stepper motor</a></td><td class="has-text-align-center" data-align="center">1</td></tr><tr><td class="has-text-align-center" data-align="center"><a href="https://www.amazon.com/HiLetgo-Stepstick-Stepper-Printer-Compatible/dp/B07BND65C8/ref=sr_1_3?dchild=1&amp;keywords=a4988&amp;qid=1598635507&amp;sr=8-3" target="_blank" rel="noreferrer noopener">A4988 Stepper motor driver</a></td><td class="has-text-align-center" data-align="center">1</td></tr><tr><td class="has-text-align-center" data-align="center">12V 3A Rechargeable Battery</td><td class="has-text-align-center" data-align="center">1</td></tr><tr><td class="has-text-align-center" data-align="center"><a href="https://www.amazon.com/gp/slredirect/picassoRedirect.html/ref=pa_sp_atf_aps_sr_pg1_1?ie=UTF8&amp;adId=A0525912YQ0RC2BZUQ1V&amp;url=%2FDSD-TECH-HC-05-Pass-through-Communication%2Fdp%2FB01G9KSAF6%2Fref%3Dsr_1_2_sspa%3Fdchild%3D1%26keywords%3DHC-05%2BBluetooth%2BModule%26qid%3D1598635562%26sr%3D8-2-spons%26psc%3D1&amp;qualifier=1598635562&amp;id=4505933433153694&amp;widgetName=sp_atf" target="_blank" rel="noreferrer noopener">HC-05 Bluetooth Module</a></td><td class="has-text-align-center" data-align="center">1</td></tr><tr><td class="has-text-align-center" data-align="center"><a href="https://store.arduino.cc/usa/arduino-uno-rev3" target="_blank" rel="noreferrer noopener">Arduino UNO</a></td><td class="has-text-align-center" data-align="center">1</td></tr><tr><td class="has-text-align-center" data-align="center"><a href="https://www.pcbway.com/project/shareproject/Arduino_Motorized_Camera_Slider.html" target="_blank" rel="noreferrer noopener">Cairo Camera Slider Arduino UNO Sheild</a></td><td class="has-text-align-center" data-align="center">1</td></tr></tbody></table></figure>



<h2 class="wp-block-heading">Used Software</h2>



<hr class="wp-block-separator has-css-opacity"/>



<figure class="wp-block-table"><table><tbody><tr><td><a href="https://www.arduino.cc/en/Main/Software" target="_blank" rel="noreferrer noopener">Arduino IDE</a></td></tr><tr><td><a href="https://www.autodesk.com/products/fusion-360/students-teachers-educators" target="_blank" rel="noreferrer noopener">Autodesk Fusion360 (Free License)</a></td></tr><tr><td><a href="https://www.autodesk.com/products/eagle/free-download" target="_blank" rel="noreferrer noopener">Autodesk Eagle (Free License)</a></td></tr></tbody></table></figure>



<h2 class="wp-block-heading">Project Overview</h2>



<hr class="wp-block-separator has-css-opacity"/>



<p class="has-regular-font-size wp-block-paragraph">Today we will build a motorized camera slider that we can control it wirelessly over Bluetooth from a custom-made android mobile app. I used the &#8220;MIT App inventor&#8221; tool to make the app which gives us the ability to control a lot of stuff like the slider movement speed, traveling distance, acceleration/deceleration rate and a lot more. The mobile app is very robust, inside the app you can set your camera slider length which you are using. which means, you are free to build your actual camera slider with any length up to 10 meters without worrying about the app.</p>



<script async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-4043148098486780" crossorigin="anonymous"></script>
<ins class="adsbygoogle" style="display:block; text-align:center;" data-ad-layout="in-article" data-ad-format="fluid" data-ad-client="ca-pub-4043148098486780" data-ad-slot="2430604139"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="578" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/GOPR0074.jpg?resize=770%2C578&#038;ssl=1" alt="Cairo Camera Slider" class="wp-image-1084" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/GOPR0074-scaled.jpg?resize=1024%2C768&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/GOPR0074-scaled.jpg?resize=600%2C450&amp;ssl=1 600w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/GOPR0074-scaled.jpg?resize=800%2C600&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/GOPR0074-scaled.jpg?resize=300%2C225&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/GOPR0074-scaled.jpg?resize=768%2C576&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/GOPR0074-scaled.jpg?resize=1536%2C1152&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">Cairo Camera Slider</figcaption></figure>



<p class="has-regular-font-size wp-block-paragraph">We used a NEMA17 stepper motor as an actuator so we can control how many steps do we need the camera slider to move. To control a stepper motor using the Arduino board, we need a translator that takes commands from the Arduino board and translate it to the language that the stepper motor understands. Here comes the A4988 <a href="https://www.pololu.com/product/1182">Pololu stepper motor driver</a> role, which gives us five different microstep resolutions (down to 1/16 step) to achieve the maximum moving accuracy and movement smoothness.</p>



<figure class="is-style-default wp-block-image size-full"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="578" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6838-scaled.jpg?resize=770%2C578&#038;ssl=1" alt="Cairo Camera Slider In-Action" class="wp-image-1130" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6838-scaled.jpg?w=2048&amp;ssl=1 2048w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6838-scaled.jpg?resize=600%2C450&amp;ssl=1 600w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6838-scaled.jpg?resize=800%2C600&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6838-scaled.jpg?resize=300%2C225&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6838-scaled.jpg?resize=1024%2C768&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6838-scaled.jpg?resize=768%2C576&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6838-scaled.jpg?resize=1536%2C1152&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>



<p class="has-regular-font-size wp-block-paragraph">This project Designed with makeability in a fablab/makerspace/hackerspace in mind.</p>



<h2 class="wp-block-heading">CAD And 3d Modeling</h2>



<hr class="wp-block-separator has-css-opacity"/>



<p class="has-regular-font-size wp-block-paragraph">We used Fusion360 to design the camera slider, we chose to use very well-known, easy-to-find mechanical components that you can buy easily from almost any online or offline store no matter where you live. </p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="433" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/Camera-Slider-In-session-v38.png?resize=770%2C433&#038;ssl=1" alt="Cairo Camera Slider" class="wp-image-1041" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/Camera-Slider-In-session-v38.png?resize=1024%2C576&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/Camera-Slider-In-session-v38.png?resize=800%2C450&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/Camera-Slider-In-session-v38.png?resize=300%2C169&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/Camera-Slider-In-session-v38.png?resize=768%2C432&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/Camera-Slider-In-session-v38.png?resize=1536%2C864&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">Cairo Camera Slider</figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph">We are using <a href="https://openbuilds.com/">Openbuilds hardware</a> to build the mechanical structure, the V-slot 2040 linear rail as a guide for the camera to move on. Two pulleys, one on the stepper motor shaft. And the other one, on an 8mm linear rail shaft on the opposite side of the slider with an open timing belt between them to convert from the stepper motor rotary motion to linear motion. </p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="433" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/right-pulley.png?resize=770%2C433&#038;ssl=1" alt="Right-side Pulley" class="wp-image-1042" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/right-pulley.png?resize=1024%2C576&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/right-pulley.png?resize=800%2C450&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/right-pulley.png?resize=300%2C169&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/right-pulley.png?resize=768%2C432&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/right-pulley.png?resize=1536%2C864&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">Right-side Pulley</figcaption></figure>
</div>

<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="433" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/motor-pulley.png?resize=770%2C433&#038;ssl=1" alt="Left-side Pulley" class="wp-image-1043" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/motor-pulley.png?resize=1024%2C576&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/motor-pulley.png?resize=800%2C450&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/motor-pulley.png?resize=300%2C169&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/motor-pulley.png?resize=768%2C432&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/motor-pulley.png?resize=1536%2C864&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">Left-side Pulley</figcaption></figure>
</div>


<p class="wp-block-paragraph">The 8mm linear rail shaft is installed between two Self-aligning Pillow Flange Block Bearings that are installed on the top and bottom plate by four M5 screws.</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="433" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/Right-leg-Flange-Bearing2.png?resize=770%2C433&#038;ssl=1" alt="Flange Bearing" class="wp-image-1046" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/Right-leg-Flange-Bearing2.png?resize=1024%2C576&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/Right-leg-Flange-Bearing2.png?resize=800%2C450&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/Right-leg-Flange-Bearing2.png?resize=300%2C169&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/Right-leg-Flange-Bearing2.png?resize=768%2C432&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/Right-leg-Flange-Bearing2.png?resize=1536%2C864&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">Flange Bearing</figcaption></figure>
</div>


<p class="wp-block-paragraph">We are using four Delrin V-Slot solid wheels they ride down in the V-groove of the V-Slot rail to make the camera movement extremely smooth. The middle of the camera plate has a 1/4 inch diameter hole for a standard tripod screw so you can mount your camera easily.</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="433" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/Slider-Plate.png?resize=770%2C433&#038;ssl=1" alt="Camera Plate" class="wp-image-1047" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/Slider-Plate.png?resize=1024%2C576&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/Slider-Plate.png?resize=800%2C450&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/Slider-Plate.png?resize=300%2C169&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/Slider-Plate.png?resize=768%2C432&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/Slider-Plate.png?resize=1536%2C864&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">Camera Plate</figcaption></figure>
</div>


<p class="wp-block-paragraph">Lastly, an enclosure for the electronics, All the camera slider parts are fixed together by m3*16mm screws and nuts. </p>



<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="433" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/Electronics-enclosure-1024x576.png?resize=770%2C433&#038;ssl=1" alt="" class="wp-image-1050" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/Electronics-enclosure.png?resize=1024%2C576&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/Electronics-enclosure.png?resize=800%2C450&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/Electronics-enclosure.png?resize=300%2C169&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/Electronics-enclosure.png?resize=768%2C432&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/Electronics-enclosure.png?resize=1536%2C864&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>



<h2 class="wp-block-heading">Digital Fabrication (3d Printing)</h2>



<hr class="wp-block-separator has-css-opacity"/>



<p class="wp-block-paragraph">All of the camera slider body is 3D-printed with 0.2 layer height, 20% infill, except the Camera slider left and right leg, which are printed with 0.2 layer height, 50% infill.</p>



<p class="wp-block-paragraph"><strong>You can download the STL files from this link.</strong></p>



<div class="wp-block-buttons is-content-justification-center is-layout-flex wp-container-core-buttons-is-layout-fe48e5de wp-block-buttons-is-layout-flex">
<div class="wp-block-button"><a class="wp-block-button__link has-background has-text-align-center wp-element-button" href="https://www.thingiverse.com/thing:4581661" style="border-radius:100px;background-color:#00a99d" target="_blank" rel="noreferrer noopener">thingiverse</a></div>
</div>



<h2 class="wp-block-heading">V-Wheel Kit Assembly </h2>



<hr class="wp-block-separator has-css-opacity"/>



<p class="wp-block-paragraph">The assembly process is very easy man, come on! In the first step, we need to assemble the four Solid V-Wheels. The solid V-wheel kit comes with a rubber wheel, two bearings, two percision shims, and a lock nut.</p>


<div class="wp-block-image is-style-default">
<figure class="aligncenter size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="334" height="852" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/1wh.jpg?resize=334%2C852&#038;ssl=1" alt="" class="wp-image-1133" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/1wh.jpg?w=334&amp;ssl=1 334w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/1wh.jpg?resize=118%2C300&amp;ssl=1 118w" sizes="auto, (max-width: 334px) 100vw, 334px" /><figcaption class="wp-element-caption">Solid V-wheel Kit</figcaption></figure>
</div>


<p class="wp-block-paragraph">Insert the bearing from one side of the rubber wheel and flip the wheel around, then insert one precision shim inside the rubber wheel, lastly insert the second bearing from the second face side.</p>



<figure class="wp-block-gallery alignwide has-nested-images columns-default is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="420" data-id="1134" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/2wh.jpg?resize=770%2C420&#038;ssl=1" alt="insert the first bearing" class="wp-image-1134" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/2wh-scaled.jpg?resize=1024%2C558&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/2wh-scaled.jpg?resize=800%2C436&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/2wh-scaled.jpg?resize=300%2C163&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/2wh-scaled.jpg?resize=768%2C419&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/2wh-scaled.jpg?resize=1536%2C837&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>



<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="418" data-id="1135" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/3wh.jpg?resize=770%2C418&#038;ssl=1" alt="insert the precision shim" class="wp-image-1135" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/3wh-scaled.jpg?resize=1024%2C556&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/3wh-scaled.jpg?resize=800%2C434&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/3wh-scaled.jpg?resize=300%2C163&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/3wh-scaled.jpg?resize=768%2C417&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/3wh-scaled.jpg?resize=1536%2C834&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>
</figure>



<figure class="is-style-default wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="418" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/4wh.jpg?resize=770%2C418&#038;ssl=1" alt="" class="wp-image-1136" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/4wh-scaled.jpg?resize=1024%2C556&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/4wh-scaled.jpg?resize=800%2C434&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/4wh-scaled.jpg?resize=300%2C163&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/4wh-scaled.jpg?resize=768%2C417&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/4wh-scaled.jpg?resize=1536%2C834&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">insert the second bearing</figcaption></figure>



<figure class="wp-embed-aspect-16-9 wp-has-aspect-ratio wp-block-embed aligncenter is-type-video is-provider-youtube wp-block-embed-youtube"><div class="wp-block-embed__wrapper">
<iframe loading="lazy" title="OpenBuilds V Wheel kit Assembly Guide" width="770" height="433" src="https://www.youtube.com/embed/YtkGiLg2edk?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
</div></figure>



<h2 class="wp-block-heading">Camera Slider Mechanical Assembly</h2>



<p class="wp-block-paragraph">First, We need to assemble the camera plate and the four solid V-Wheels. using the 9mm aluminum spacer, the precision shim, and the lock nut. </p>



<figure class="wp-block-gallery alignwide has-nested-images columns-default is-cropped wp-block-gallery-2 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="362" data-id="1162" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/4-as.jpg?resize=770%2C362&#038;ssl=1" alt="" class="wp-image-1162" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/4-as-scaled.jpg?resize=1024%2C481&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/4-as-scaled.jpg?resize=800%2C376&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/4-as-scaled.jpg?resize=300%2C141&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/4-as-scaled.jpg?resize=768%2C361&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/4-as-scaled.jpg?resize=1536%2C721&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>



<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="359" data-id="1160" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/3-as.jpg?resize=770%2C359&#038;ssl=1" alt="" class="wp-image-1160" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/3-as-scaled.jpg?resize=1024%2C478&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/3-as-scaled.jpg?resize=800%2C373&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/3-as-scaled.jpg?resize=300%2C140&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/3-as-scaled.jpg?resize=768%2C358&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/3-as-scaled.jpg?resize=1536%2C717&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>
</figure>



<p class="wp-block-paragraph">We are going to repeat the previous step with the other three wheels. in the two right wheels we&#8217;re going to use the 9mm spacer. And the other two left wheels we&#8217;re going to use the eccentric spacer with a 3mm spacer instead of the 9mm spacer.</p>



<script async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-4043148098486780" crossorigin="anonymous"></script>
<ins class="adsbygoogle" style="display:block; text-align:center;" data-ad-layout="in-article" data-ad-format="fluid" data-ad-client="ca-pub-4043148098486780" data-ad-slot="2430604139"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="is-style-default wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="362" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/2-as.jpg?resize=770%2C362&#038;ssl=1" alt="" class="wp-image-1158" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/2-as-scaled.jpg?resize=1024%2C481&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/2-as-scaled.jpg?resize=800%2C376&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/2-as-scaled.jpg?resize=300%2C141&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/2-as-scaled.jpg?resize=768%2C361&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/2-as-scaled.jpg?resize=1536%2C722&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>



<p class="wp-block-paragraph">Now, insert the camera holder plate in the V-slot profile. If you found that the plate is loose and wiggling, you can tighten the Eccentric nut until you get a solid plate.</p>



<figure class="wp-block-gallery alignwide has-nested-images columns-default is-cropped wp-block-gallery-3 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="365" data-id="1156" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/1-as.jpg?resize=770%2C365&#038;ssl=1" alt="" class="wp-image-1156" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/1-as-scaled.jpg?resize=1024%2C486&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/1-as-scaled.jpg?resize=800%2C380&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/1-as-scaled.jpg?resize=300%2C142&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/1-as-scaled.jpg?resize=768%2C365&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/1-as-scaled.jpg?resize=1536%2C730&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>



<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="364" data-id="1155" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/0as.jpg?resize=770%2C364&#038;ssl=1" alt="" class="wp-image-1155" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/0as-scaled.jpg?resize=1024%2C484&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/0as-scaled.jpg?resize=800%2C378&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/0as-scaled.jpg?resize=300%2C142&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/0as-scaled.jpg?resize=768%2C363&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/0as-scaled.jpg?resize=1536%2C726&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>
</figure>



<p class="wp-block-paragraph">Let&#8217;s insert two drop-in tee nuts in each end of the V-slot profile. we need to connect the V-slot profile with the right and left legs of the camera slider.</p>



<figure class="wp-block-gallery alignwide has-nested-images columns-default is-cropped wp-block-gallery-4 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="481" data-id="1157" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/1as.jpg?resize=770%2C481&#038;ssl=1" alt="" class="wp-image-1157" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/1as-scaled.jpg?resize=1024%2C640&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/1as-scaled.jpg?resize=800%2C500&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/1as-scaled.jpg?resize=300%2C188&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/1as-scaled.jpg?resize=768%2C480&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/1as-scaled.jpg?resize=1536%2C960&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>



<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="327" data-id="1159" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/2as.jpg?resize=770%2C327&#038;ssl=1" alt="" class="wp-image-1159" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/2as-scaled.jpg?resize=1024%2C435&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/2as-scaled.jpg?resize=800%2C339&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/2as-scaled.jpg?resize=300%2C127&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/2as-scaled.jpg?resize=768%2C326&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/2as-scaled.jpg?resize=1536%2C652&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>
</figure>



<figure class="is-style-default wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="351" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/22as.jpg?resize=770%2C351&#038;ssl=1" alt="" class="wp-image-1185" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/22as-scaled.jpg?resize=1024%2C467&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/22as-scaled.jpg?resize=800%2C365&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/22as-scaled.jpg?resize=300%2C137&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/22as-scaled.jpg?resize=768%2C351&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/22as-scaled.jpg?resize=1536%2C701&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>



<p class="wp-block-paragraph">Get the two camera slider legs and push them into the V-slot profile.</p>



<figure class="wp-block-gallery alignwide has-nested-images columns-default is-cropped wp-block-gallery-5 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="364" data-id="1161" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/3as.jpg?resize=770%2C364&#038;ssl=1" alt="" class="wp-image-1161" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/3as-scaled.jpg?resize=1024%2C484&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/3as-scaled.jpg?resize=800%2C378&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/3as-scaled.jpg?resize=300%2C142&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/3as-scaled.jpg?resize=768%2C363&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/3as-scaled.jpg?resize=1536%2C725&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>



<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="351" data-id="1167" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/4as.jpg?resize=770%2C351&#038;ssl=1" alt="" class="wp-image-1167" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/4as-scaled.jpg?resize=1024%2C467&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/4as-scaled.jpg?resize=800%2C365&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/4as-scaled.jpg?resize=300%2C137&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/4as-scaled.jpg?resize=768%2C350&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/4as-scaled.jpg?resize=1536%2C701&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>
</figure>



<figure class="is-style-default wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="363" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/5as.jpg?resize=770%2C363&#038;ssl=1" alt="" class="wp-image-1168" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/5as-scaled.jpg?resize=1024%2C483&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/5as-scaled.jpg?resize=800%2C377&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/5as-scaled.jpg?resize=300%2C141&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/5as-scaled.jpg?resize=768%2C362&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/5as-scaled.jpg?resize=1536%2C724&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>



<p class="wp-block-paragraph">bring four M5X10mm screws, and fix the two legs with the V-slot profile.</p>



<figure class="wp-block-gallery alignwide has-nested-images columns-default is-cropped wp-block-gallery-6 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="355" data-id="1169" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/6as.jpg?resize=770%2C355&#038;ssl=1" alt="" class="wp-image-1169" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/6as-scaled.jpg?resize=1024%2C472&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/6as-scaled.jpg?resize=800%2C369&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/6as-scaled.jpg?resize=300%2C138&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/6as-scaled.jpg?resize=768%2C354&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/6as-scaled.jpg?resize=1536%2C709&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>



<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="353" data-id="1170" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/7as.jpg?resize=770%2C353&#038;ssl=1" alt="" class="wp-image-1170" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/7as-scaled.jpg?resize=1024%2C470&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/7as-scaled.jpg?resize=800%2C367&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/7as-scaled.jpg?resize=300%2C138&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/7as-scaled.jpg?resize=768%2C352&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/7as-scaled.jpg?resize=1536%2C705&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>
</figure>



<p class="wp-block-paragraph">We need to install the NEMA 17 stepper motor on its plate. then, using four M3X16mm screws we are gonna fix the motor in place.</p>



<figure class="wp-block-gallery alignwide has-nested-images columns-default is-cropped wp-block-gallery-7 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="364" data-id="1171" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/8as.jpg?resize=770%2C364&#038;ssl=1" alt="" class="wp-image-1171" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/8as-scaled.jpg?resize=1024%2C484&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/8as-scaled.jpg?resize=800%2C378&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/8as-scaled.jpg?resize=300%2C142&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/8as-scaled.jpg?resize=768%2C363&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/8as-scaled.jpg?resize=1536%2C726&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>



<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="352" data-id="1172" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/9as.jpg?resize=770%2C352&#038;ssl=1" alt="" class="wp-image-1172" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/9as-scaled.jpg?resize=1024%2C468&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/9as-scaled.jpg?resize=800%2C366&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/9as-scaled.jpg?resize=300%2C137&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/9as-scaled.jpg?resize=768%2C351&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/9as-scaled.jpg?resize=1536%2C702&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>
</figure>



<figure class="wp-block-gallery alignwide has-nested-images columns-default is-cropped wp-block-gallery-8 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="352" data-id="1173" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/10as.jpg?resize=770%2C352&#038;ssl=1" alt="" class="wp-image-1173" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/10as-scaled.jpg?resize=1024%2C468&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/10as-scaled.jpg?resize=800%2C366&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/10as-scaled.jpg?resize=300%2C137&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/10as-scaled.jpg?resize=768%2C351&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/10as-scaled.jpg?resize=1536%2C703&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>



<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="396" data-id="1174" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/11as.jpg?resize=770%2C396&#038;ssl=1" alt="" class="wp-image-1174" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/11as-scaled.jpg?resize=1024%2C527&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/11as-scaled.jpg?resize=800%2C412&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/11as-scaled.jpg?resize=300%2C154&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/11as-scaled.jpg?resize=768%2C395&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/11as-scaled.jpg?resize=1536%2C791&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>
</figure>



<p class="wp-block-paragraph">On the left leg, insert two nuts inside the left leg top nuts place.</p>



<figure class="wp-block-gallery alignwide has-nested-images columns-default is-cropped wp-block-gallery-9 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="364" data-id="1175" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/12as.jpg?resize=770%2C364&#038;ssl=1" alt="" class="wp-image-1175" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/12as-scaled.jpg?resize=1024%2C484&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/12as-scaled.jpg?resize=800%2C378&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/12as-scaled.jpg?resize=300%2C142&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/12as-scaled.jpg?resize=768%2C363&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/12as-scaled.jpg?resize=1536%2C726&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>



<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="351" data-id="1176" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/13as.jpg?resize=770%2C351&#038;ssl=1" alt="" class="wp-image-1176" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/13as-scaled.jpg?resize=1024%2C467&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/13as-scaled.jpg?resize=800%2C365&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/13as-scaled.jpg?resize=300%2C137&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/13as-scaled.jpg?resize=768%2C350&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/13as-scaled.jpg?resize=1536%2C701&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>
</figure>



<p class="wp-block-paragraph">Bring the NEMA 17 motor plate ad fix it on the top of the left leg. and, using two M3X16mm screws we are gonna fix the plate on the left leg.</p>



<figure class="wp-block-gallery alignwide has-nested-images columns-default is-cropped wp-block-gallery-10 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="361" data-id="1177" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/14as.jpg?resize=770%2C361&#038;ssl=1" alt="" class="wp-image-1177" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/14as-scaled.jpg?resize=1024%2C480&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/14as-scaled.jpg?resize=800%2C375&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/14as-scaled.jpg?resize=300%2C141&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/14as-scaled.jpg?resize=768%2C360&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/14as-scaled.jpg?resize=1536%2C720&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>



<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="351" data-id="1178" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/15as.jpg?resize=770%2C351&#038;ssl=1" alt="" class="wp-image-1178" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/15as-scaled.jpg?resize=1024%2C467&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/15as-scaled.jpg?resize=800%2C365&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/15as-scaled.jpg?resize=300%2C137&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/15as-scaled.jpg?resize=768%2C351&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/15as-scaled.jpg?resize=1536%2C701&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>
</figure>



<figure class="wp-block-gallery alignwide has-nested-images columns-default is-cropped wp-block-gallery-11 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="350" data-id="1179" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/16as.jpg?resize=770%2C350&#038;ssl=1" alt="" class="wp-image-1179" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/16as-scaled.jpg?resize=1024%2C466&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/16as-scaled.jpg?resize=800%2C364&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/16as-scaled.jpg?resize=300%2C137&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/16as-scaled.jpg?resize=768%2C350&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/16as-scaled.jpg?resize=1536%2C699&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>



<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="350" data-id="1180" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/17as.jpg?resize=770%2C350&#038;ssl=1" alt="" class="wp-image-1180" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/17as-scaled.jpg?resize=1024%2C465&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/17as-scaled.jpg?resize=800%2C364&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/17as-scaled.jpg?resize=300%2C136&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/17as-scaled.jpg?resize=768%2C349&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/17as-scaled.jpg?resize=1536%2C698&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>
</figure>



<p class="wp-block-paragraph">To be able to convert the stepper motor rotational movement into linear movement, we need to install a GT2 Bore 5mm pulley on the motor shaft. and using the Allen key, tighten the pulley set screw to keep it in place.</p>



<figure class="wp-block-gallery alignwide has-nested-images columns-default is-cropped wp-block-gallery-12 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="363" data-id="1181" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/18as.jpg?resize=770%2C363&#038;ssl=1" alt="" class="wp-image-1181" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/18as-scaled.jpg?resize=1024%2C483&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/18as-scaled.jpg?resize=800%2C377&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/18as-scaled.jpg?resize=300%2C142&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/18as-scaled.jpg?resize=768%2C362&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/18as-scaled.jpg?resize=1536%2C725&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>



<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="353" data-id="1182" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/19as.jpg?resize=770%2C353&#038;ssl=1" alt="" class="wp-image-1182" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/19as-scaled.jpg?resize=1024%2C470&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/19as-scaled.jpg?resize=800%2C367&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/19as-scaled.jpg?resize=300%2C138&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/19as-scaled.jpg?resize=768%2C353&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/19as-scaled.jpg?resize=1536%2C705&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>
</figure>



<p class="wp-block-paragraph">Let&#8217;s go to the camera slider right leg, insert four M3 nuts in the leg nuts place. </p>



<figure class="wp-block-gallery alignwide has-nested-images columns-default is-cropped wp-block-gallery-13 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="363" data-id="1183" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/20as.jpg?resize=770%2C363&#038;ssl=1" alt="" class="wp-image-1183" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/20as-scaled.jpg?resize=1024%2C483&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/20as-scaled.jpg?resize=800%2C377&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/20as-scaled.jpg?resize=300%2C142&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/20as-scaled.jpg?resize=768%2C362&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/20as-scaled.jpg?resize=1536%2C725&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>



<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="353" data-id="1184" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/21as.jpg?resize=770%2C353&#038;ssl=1" alt="" class="wp-image-1184" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/21as-scaled.jpg?resize=1024%2C470&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/21as-scaled.jpg?resize=800%2C367&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/21as-scaled.jpg?resize=300%2C138&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/21as-scaled.jpg?resize=768%2C353&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/21as-scaled.jpg?resize=1536%2C705&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>
</figure>



<p class="wp-block-paragraph">Then, put the right leg bearings two plates on the top of the camera slider right leg.</p>



<figure class="wp-block-gallery alignwide has-nested-images columns-default is-cropped wp-block-gallery-14 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="360" data-id="1186" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/23as.jpg?resize=770%2C360&#038;ssl=1" alt="" class="wp-image-1186" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/23as-scaled.jpg?resize=1024%2C479&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/23as-scaled.jpg?resize=800%2C375&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/23as-scaled.jpg?resize=300%2C140&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/23as-scaled.jpg?resize=768%2C360&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/23as-scaled.jpg?resize=1536%2C719&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>



<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="361" data-id="1187" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/24as.jpg?resize=770%2C361&#038;ssl=1" alt="" class="wp-image-1187" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/24as-scaled.jpg?resize=1024%2C480&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/24as-scaled.jpg?resize=800%2C375&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/24as-scaled.jpg?resize=300%2C141&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/24as-scaled.jpg?resize=768%2C360&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/24as-scaled.jpg?resize=1536%2C720&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>
</figure>



<p class="wp-block-paragraph">Using four M3X16mm screws, fix the two plates on the camera slider right leg to keep them in place.</p>



<figure class="wp-block-gallery alignwide has-nested-images columns-default is-cropped wp-block-gallery-15 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="353" data-id="1188" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/25as.jpg?resize=770%2C353&#038;ssl=1" alt="" class="wp-image-1188" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/25as-scaled.jpg?resize=1024%2C469&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/25as-scaled.jpg?resize=800%2C366&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/25as-scaled.jpg?resize=300%2C137&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/25as-scaled.jpg?resize=768%2C352&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/25as-scaled.jpg?resize=1536%2C703&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>



<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="350" data-id="1189" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/26as.jpg?resize=770%2C350&#038;ssl=1" alt="" class="wp-image-1189" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/26as-scaled.jpg?resize=1024%2C466&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/26as-scaled.jpg?resize=800%2C364&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/26as-scaled.jpg?resize=300%2C137&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/26as-scaled.jpg?resize=768%2C350&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/26as-scaled.jpg?resize=1536%2C699&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>
</figure>



<figure class="wp-block-gallery alignwide has-nested-images columns-default is-cropped wp-block-gallery-16 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="350" data-id="1190" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/27as.jpg?resize=770%2C350&#038;ssl=1" alt="" class="wp-image-1190" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/27as-scaled.jpg?resize=1024%2C465&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/27as-scaled.jpg?resize=800%2C363&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/27as-scaled.jpg?resize=300%2C136&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/27as-scaled.jpg?resize=768%2C348&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/27as-scaled.jpg?resize=1536%2C697&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>



<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="354" data-id="1191" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/28as.jpg?resize=770%2C354&#038;ssl=1" alt="" class="wp-image-1191" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/28as-scaled.jpg?resize=1024%2C471&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/28as-scaled.jpg?resize=800%2C368&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/28as-scaled.jpg?resize=300%2C138&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/28as-scaled.jpg?resize=768%2C353&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/28as-scaled.jpg?resize=1536%2C706&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>
</figure>



<p class="wp-block-paragraph">Bring one of the 8mm flange block bearings and install it on the top right leg plate. using two M5X20mm screws and two M5 nuts.</p>



<figure class="wp-block-gallery alignwide has-nested-images columns-default is-cropped wp-block-gallery-17 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="364" data-id="1192" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/29as.jpg?resize=770%2C364&#038;ssl=1" alt="" class="wp-image-1192" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/29as-scaled.jpg?resize=1024%2C484&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/29as-scaled.jpg?resize=800%2C379&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/29as-scaled.jpg?resize=300%2C142&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/29as-scaled.jpg?resize=768%2C363&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/29as-scaled.jpg?resize=1536%2C727&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>



<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="362" data-id="1193" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/30as.jpg?resize=770%2C362&#038;ssl=1" alt="" class="wp-image-1193" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/30as-scaled.jpg?resize=1024%2C482&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/30as-scaled.jpg?resize=800%2C377&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/30as-scaled.jpg?resize=300%2C141&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/30as-scaled.jpg?resize=768%2C362&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/30as-scaled.jpg?resize=1536%2C723&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>
</figure>



<figure class="is-style-default wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="360" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/31as.jpg?resize=770%2C360&#038;ssl=1" alt="" class="wp-image-1194" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/31as-scaled.jpg?resize=1024%2C479&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/31as-scaled.jpg?resize=800%2C374&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/31as-scaled.jpg?resize=300%2C140&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/31as-scaled.jpg?resize=768%2C359&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/31as-scaled.jpg?resize=1536%2C718&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>



<p class="wp-block-paragraph">We need to repeat the previous step with the second 8mm flange bearing block to fix it on the camera slider right leg bottom plate.</p>



<figure class="wp-block-gallery alignwide has-nested-images columns-default is-cropped wp-block-gallery-18 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="362" data-id="1196" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/33as.jpg?resize=770%2C362&#038;ssl=1" alt="" class="wp-image-1196" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/33as-scaled.jpg?resize=1024%2C482&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/33as-scaled.jpg?resize=800%2C377&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/33as-scaled.jpg?resize=300%2C141&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/33as-scaled.jpg?resize=768%2C362&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/33as-scaled.jpg?resize=1536%2C724&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>



<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="362" data-id="1197" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/34as.jpg?resize=770%2C362&#038;ssl=1" alt="" class="wp-image-1197" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/34as-scaled.jpg?resize=1024%2C482&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/34as-scaled.jpg?resize=800%2C377&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/34as-scaled.jpg?resize=300%2C141&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/34as-scaled.jpg?resize=768%2C361&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/34as-scaled.jpg?resize=1536%2C723&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>
</figure>



<figure class="is-style-default wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="363" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/36as.jpg?resize=770%2C363&#038;ssl=1" alt="" class="wp-image-1199" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/36as-scaled.jpg?resize=1024%2C483&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/36as-scaled.jpg?resize=800%2C377&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/36as-scaled.jpg?resize=300%2C141&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/36as-scaled.jpg?resize=768%2C362&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/36as-scaled.jpg?resize=1536%2C724&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>



<p class="wp-block-paragraph">Insert the 8mm linear rail shaft in the 8mm flange bearing block from it&#8217;s bottom side, ad push it to the top. Then, insert the 8mm bore pulley into the linear rail shaft and fix it by tightening the pulley&#8217;s set screw.</p>



<figure class="wp-block-gallery alignwide has-nested-images columns-default is-cropped wp-block-gallery-19 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="362" data-id="1200" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/37as.jpg?resize=770%2C362&#038;ssl=1" alt="" class="wp-image-1200" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/37as-scaled.jpg?resize=1024%2C482&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/37as-scaled.jpg?resize=800%2C377&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/37as-scaled.jpg?resize=300%2C141&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/37as-scaled.jpg?resize=768%2C362&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/37as-scaled.jpg?resize=1536%2C723&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>



<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="360" data-id="1201" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/38as.jpg?resize=770%2C360&#038;ssl=1" alt="" class="wp-image-1201" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/38as-scaled.jpg?resize=1024%2C479&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/38as-scaled.jpg?resize=800%2C374&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/38as-scaled.jpg?resize=300%2C140&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/38as-scaled.jpg?resize=768%2C359&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/38as-scaled.jpg?resize=1536%2C718&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>
</figure>



<figure class="is-style-default wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="362" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/39as.jpg?resize=770%2C362&#038;ssl=1" alt="" class="wp-image-1202" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/39as-scaled.jpg?resize=1024%2C481&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/39as-scaled.jpg?resize=800%2C375&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/39as-scaled.jpg?resize=300%2C141&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/39as-scaled.jpg?resize=768%2C361&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/39as-scaled.jpg?resize=1536%2C721&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>



<p class="wp-block-paragraph">Checkpoint, Now we assembled all the camera slider mechanism except one thing. the timing belt. Let&#8217;s do it.</p>



<script async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-4043148098486780" crossorigin="anonymous"></script>
<ins class="adsbygoogle" style="display:block; text-align:center;" data-ad-layout="in-article" data-ad-format="fluid" data-ad-client="ca-pub-4043148098486780" data-ad-slot="2430604139"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<figure class="is-style-default wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="361" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/40as.jpg?resize=770%2C361&#038;ssl=1" alt="" class="wp-image-1203" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/40as-scaled.jpg?resize=1024%2C480&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/40as-scaled.jpg?resize=800%2C375&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/40as-scaled.jpg?resize=300%2C141&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/40as-scaled.jpg?resize=768%2C360&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/40as-scaled.jpg?resize=1536%2C720&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>



<p class="wp-block-paragraph">rotate the 6mm timing belt on the NEMA17 motor 5mm bore pulley. Also, on the right leg 8mm bore pulley. Lastly, tighten the belt with the camera plate.</p>



<figure class="wp-block-gallery alignwide has-nested-images columns-default is-cropped wp-block-gallery-20 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="353" data-id="1217" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/53as.jpg?resize=770%2C353&#038;ssl=1" alt="" class="wp-image-1217" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/53as-scaled.jpg?resize=1024%2C469&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/53as-scaled.jpg?resize=800%2C366&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/53as-scaled.jpg?resize=300%2C137&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/53as-scaled.jpg?resize=768%2C352&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/53as-scaled.jpg?resize=1536%2C703&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>



<figure class="wp-block-image size-large"><img data-recalc-dims="1" decoding="async" data-id="1271" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/GOPR0075-copy.jpg?w=770&#038;ssl=1" alt="" class="wp-image-1271"/></figure>
</figure>



<p class="wp-block-paragraph">It&#8217;s time to assemble the control board. insert the Cairo Camera Slider Arduino shield on the top of the Arduino board.</p>



<figure class="wp-block-gallery alignwide has-nested-images columns-default is-cropped wp-block-gallery-21 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="362" data-id="1205" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/42as.jpg?resize=770%2C362&#038;ssl=1" alt="" class="wp-image-1205" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/42as-scaled.jpg?resize=1024%2C482&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/42as-scaled.jpg?resize=800%2C377&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/42as-scaled.jpg?resize=300%2C141&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/42as-scaled.jpg?resize=768%2C362&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/42as-scaled.jpg?resize=1536%2C723&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>



<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="362" data-id="1206" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/43as.jpg?resize=770%2C362&#038;ssl=1" alt="Cairo Camera Slider Arduino Shield" class="wp-image-1206" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/43as-scaled.jpg?resize=1024%2C482&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/43as-scaled.jpg?resize=800%2C377&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/43as-scaled.jpg?resize=300%2C141&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/43as-scaled.jpg?resize=768%2C362&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/43as-scaled.jpg?resize=1536%2C723&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>
</figure>



<p class="wp-block-paragraph">Insert the Arduino board and the Cairo Camera Slider shield inside the control board enclosure.</p>



<figure class="wp-block-gallery alignwide has-nested-images columns-default is-cropped wp-block-gallery-22 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="363" data-id="1207" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/44as.jpg?resize=770%2C363&#038;ssl=1" alt="" class="wp-image-1207" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/44as-scaled.jpg?resize=1024%2C483&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/44as-scaled.jpg?resize=800%2C378&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/44as-scaled.jpg?resize=300%2C142&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/44as-scaled.jpg?resize=768%2C362&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/44as-scaled.jpg?resize=1536%2C725&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>



<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="365" data-id="1208" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/45as.jpg?resize=770%2C365&#038;ssl=1" alt="" class="wp-image-1208" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/45as-scaled.jpg?resize=1024%2C485&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/45as-scaled.jpg?resize=800%2C379&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/45as-scaled.jpg?resize=300%2C142&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/45as-scaled.jpg?resize=768%2C364&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/45as-scaled.jpg?resize=1536%2C728&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>
</figure>



<p class="wp-block-paragraph">insert two M3 nuts inside the left leg nuts place.</p>



<figure class="is-style-default wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="364" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/48as.jpg?resize=770%2C364&#038;ssl=1" alt="" class="wp-image-1211" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/48as-scaled.jpg?resize=1024%2C484&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/48as-scaled.jpg?resize=800%2C378&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/48as-scaled.jpg?resize=300%2C142&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/48as-scaled.jpg?resize=768%2C363&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/48as-scaled.jpg?resize=1536%2C726&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>



<p class="wp-block-paragraph">install the control board enclosure to the Cairo Camera Slider left leg with M3X16mm screws.</p>



<figure class="wp-block-gallery alignwide has-nested-images columns-default is-cropped wp-block-gallery-23 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="363" data-id="1209" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/46as.jpg?resize=770%2C363&#038;ssl=1" alt="" class="wp-image-1209" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/46as-scaled.jpg?resize=1024%2C483&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/46as-scaled.jpg?resize=800%2C377&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/46as-scaled.jpg?resize=300%2C141&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/46as-scaled.jpg?resize=768%2C362&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/46as-scaled.jpg?resize=1536%2C724&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>



<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="365" data-id="1210" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/47as.jpg?resize=770%2C365&#038;ssl=1" alt="" class="wp-image-1210" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/47as-scaled.jpg?resize=1024%2C485&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/47as-scaled.jpg?resize=800%2C379&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/47as-scaled.jpg?resize=300%2C142&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/47as-scaled.jpg?resize=768%2C364&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/47as-scaled.jpg?resize=1536%2C728&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>
</figure>



<figure class="is-style-default wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="356" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/49as.jpg?resize=770%2C356&#038;ssl=1" alt="" class="wp-image-1212" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/49as-scaled.jpg?resize=1024%2C474&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/49as-scaled.jpg?resize=800%2C370&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/49as-scaled.jpg?resize=300%2C139&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/49as-scaled.jpg?resize=768%2C356&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/49as-scaled.jpg?resize=1536%2C711&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>



<p class="wp-block-paragraph">close the enclosure box top face with two M3 screws and nuts, and that&#8217;s it! </p>



<figure class="wp-block-gallery alignwide has-nested-images columns-default is-cropped wp-block-gallery-24 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="367" data-id="1213" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/50as.jpg?resize=770%2C367&#038;ssl=1" alt="" class="wp-image-1213" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/50as-scaled.jpg?resize=1024%2C488&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/50as-scaled.jpg?resize=800%2C382&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/50as-scaled.jpg?resize=300%2C143&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/50as-scaled.jpg?resize=768%2C366&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/50as-scaled.jpg?resize=1536%2C733&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>



<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="364" data-id="1214" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/51as.jpg?resize=770%2C364&#038;ssl=1" alt="" class="wp-image-1214" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/51as-scaled.jpg?resize=1024%2C484&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/51as-scaled.jpg?resize=800%2C379&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/51as-scaled.jpg?resize=300%2C142&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/51as-scaled.jpg?resize=768%2C363&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/51as-scaled.jpg?resize=1536%2C726&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>
</figure>



<figure class="is-style-default wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="364" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/52as.jpg?resize=770%2C364&#038;ssl=1" alt="" class="wp-image-1215" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/52as-scaled.jpg?resize=1024%2C484&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/52as-scaled.jpg?resize=800%2C379&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/52as-scaled.jpg?resize=300%2C142&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/52as-scaled.jpg?resize=768%2C363&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/52as-scaled.jpg?resize=1536%2C726&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>



<h2 class="wp-block-heading">Stepper Motor Test Control </h2>



<hr class="wp-block-separator has-css-opacity"/>



<p class="wp-block-paragraph">After assembling all the parts together, We need to test it to make sure that everything is installed in its place correctly. Now, we need to connect the stepper motor with the Arduino board through the A4988 stepper motor driver and write some code to run that thing.</p>



<h3 class="wp-block-heading">A4988 stepper motor driver</h3>



<p class="wp-block-paragraph">To control any stepper motor using the Arduino board or any microcontroller, you will need a stepper motor driver which works as a translator, takes commands from the Arduino board and translate it to the language that the motor understands. </p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="458" height="407" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/a4988Driver.png?resize=458%2C407&#038;ssl=1" alt="A4988 Motor Driver" class="wp-image-1057" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/a4988Driver.png?w=458&amp;ssl=1 458w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/a4988Driver.png?resize=300%2C267&amp;ssl=1 300w" sizes="auto, (max-width: 458px) 100vw, 458px" /><figcaption class="wp-element-caption">A4988 Motor Driver</figcaption></figure>
</div>


<p class="wp-block-paragraph">there are a lot of stepper motor drivers out there but we will use the <strong>A4988 driver</strong>. This driver allows us to control one bipolar motor at up to 2A output current per coil, it&#8217;s very simple to interface with the Arduino board you only need two digital pins to fully control your motor step and direction, which allows you to control the maximum current output easily with an onboard potentiometer, and gives you a micro-step resolution down to 1/16 micro-step.</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="500" height="312" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/A4988-Stepper-Motor-Driver-Module-Pinout.png?resize=500%2C312&#038;ssl=1" alt="A4988 Drover Pinout" class="wp-image-1058" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/A4988-Stepper-Motor-Driver-Module-Pinout.png?w=500&amp;ssl=1 500w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/A4988-Stepper-Motor-Driver-Module-Pinout.png?resize=300%2C187&amp;ssl=1 300w" sizes="auto, (max-width: 500px) 100vw, 500px" /><figcaption class="wp-element-caption">A4988 Drover Pinout</figcaption></figure>
</div>


<p class="wp-block-paragraph"><strong>VMOT, GND:</strong> It&#8217;s the power connection pins for the stepper motor itself, it can be 8V-35V. In our case, we are connecting a 12V 3A power source on those pins with a 100uf decoupling capacitor to protect the A4998 board from any power spikes.</p>


<div class="su-note"  style="border-color:#e5e54c;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><div class="su-note-inner su-u-clearfix su-u-trim" style="background-color:#FFFF66;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;">According to the datasheet, the motor supply requires an appropriate decoupling capacitor close to the board, capable of sustaining 4A.</div></div>



<p class="wp-block-paragraph"><strong>2B, 2A:</strong> the output pins for the stepper motor first coil which can deliver up to 2A.</p>



<p class="wp-block-paragraph"><strong>1A, 1B:</strong> the output pins for the stepper motor second coil which can deliver up to 2A as well.</p>


<div class="su-note"  style="border-color:#e5e54c;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><div class="su-note-inner su-u-clearfix su-u-trim" style="background-color:#FFFF66;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;">Bipolar stepper motors(which we are using in this project) typically have four leads, two for each coil. Connect the motor first coil leads to board outputs 1A and 1B. And the motor second coil leads to board outputs 2A and 2B. Note that if you happen to swap which way the wires are connected for any coil, the stepper motor will turn in the opposite direction, and if you happen to pair up wires from different coils, the motor should be noticeably erratic when you try to step it, if it even moves at all. You can use the AVO meter to test each coil leads</div></div>



<p class="wp-block-paragraph"><strong>VDD, GND: </strong>Used for driving the internal logic circuitry, it can be 3V to 5.5V. It&#8217;s totally isolated from the VMOT pin.</p>



<p class="wp-block-paragraph"><strong>EN: </strong>Stands for &#8220;Enable&#8221; it&#8217;s an active LOW(0V) input pin, which means when this pin pulled LOW(0V) the A4988 chip is enabled. And when pulled HIGH(5V) the A4988 chip is disabled. By default, this pin is pulled LOW(0V) . So, the chip is always enabled unless you pull it HIGH(5V).</p>



<p class="wp-block-paragraph"><strong>MS1, MS2, MS3: </strong>Through these pins, you can select your motor microstepping resolution(step size). The A4988 gives you five different microstep resolutions <em>(full step, half step, quarter step, Eighth step, Sixteenth step)</em>. By applying appropriate logic levels to these three pins we can set the motors to one of the five step resolutions.</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="400" height="204" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/microstep-resolution.png?resize=400%2C204&#038;ssl=1" alt="Microstep Resolution Selection" class="wp-image-1063" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/microstep-resolution.png?w=400&amp;ssl=1 400w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/microstep-resolution.png?resize=300%2C153&amp;ssl=1 300w" sizes="auto, (max-width: 400px) 100vw, 400px" /><figcaption class="wp-element-caption">Microstep Resolution Selection</figcaption></figure>
</div>


<p class="wp-block-paragraph">By default, the <strong>MS1, MS2, MS3 </strong>pins have internal pull-down resistors. So leaving these three microstep selection pins disconnected results in full-step mode.</p>



<p class="wp-block-paragraph"><strong>RST, SLP: </strong>The <em>&#8220;Reset&#8221;</em> pin is an active LOW(0V) input pin, which means when it pulled LOW(0V), all the step inputs are ignored it also resets the translator itself until you pull it HIGH(5V). The <em>&#8220;Sleep&#8221;</em> pin also an active LOW pin, pulling it LOW, puts the driver in the sleep mode minimizing the power consumption. By default, the <em>&#8220;Sleep&#8221;</em> pin is pulled HIGH(5V).</p>


<div class="su-note"  style="border-color:#e5e54c;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><div class="su-note-inner su-u-clearfix su-u-trim" style="background-color:#FFFF66;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;">The &#8220;RST&#8221; pin is floating, if you are not using it, you can connect it with the &#8220;SLP&#8221; pin  bringing it HIGH(5V) to enable the driver.</div></div>


<div class="su-note"  style="border-color:#e5e54c;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><div class="su-note-inner su-u-clearfix su-u-trim" style="background-color:#FFFF66;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;">It&#8217;s a good practice to put the A4988 motor driver module in the sleep mode when you are not using the motors to save some power.</div></div>



<p class="wp-block-paragraph"><strong>STP, DIR: </strong>The <em>&#8220;Step&#8221; </em>pin is responsible for controlling the number of steps that the motor is rotating, each pulse to the <em>&#8220;Step&#8221; </em>pin corresponds for one microstep in the direction selected by the <em>&#8220;Direction&#8221; </em>pin, the faster the pulses, the faster the motor will rotate. By applying logic value HIGH(5V) on the <em>&#8220;Direction&#8221;</em> pin it makes the motor rotate clockwise, by applying LOW(0V) it makes the motor rotate counterclockwise<em>(it may differs from one to another according to your motor wiring with the driver).</em></p>


<div class="su-note"  style="border-color:#e5e54c;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><div class="su-note-inner su-u-clearfix su-u-trim" style="background-color:#FFFF66;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;">The Step and Directions pins are not connected to anything internally. So, you should not leave either of these pins floating in your project.</div></div>



<h3 class="wp-block-heading">NEMA17 Stepper Motor</h3>



<p class="wp-block-paragraph">Stepper motors are DC motors that can rotate in precise increments, they are used in many applications like 3D printers to align the printhead and CNC machines to control the movement of the cutting tool and this is because they are very accurate and precise.</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="381" height="492" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/nema-17-stepper-motor-17hs4006-22b-13a.png?resize=381%2C492&#038;ssl=1" alt="NEMA 17 stepper motor" class="wp-image-1075" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/nema-17-stepper-motor-17hs4006-22b-13a.png?w=381&amp;ssl=1 381w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/nema-17-stepper-motor-17hs4006-22b-13a.png?resize=232%2C300&amp;ssl=1 232w" sizes="auto, (max-width: 381px) 100vw, 381px" /><figcaption class="wp-element-caption">NEMA 17 stepper motor</figcaption></figure>
</div>


<p class="wp-block-paragraph">Unlike DC motors, stepper motors are controlled by applying DC electrical pulses to their internal coils. Each pulse makes the shaft advance by one step or a fraction of step which is called &#8220;Microstepping&#8221;. So, you can control precisely how many steps or even fraction steps you want the motor shaft to move. Another great advantage of using stepper motors is that it can move very precisely and accurately at very slow speeds without even stalling.</p>


<div class="su-note"  style="border-color:#e5e54c;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><div class="su-note-inner su-u-clearfix su-u-trim" style="background-color:#FFFF66;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;">Motor stalling means that the electric motor has more load on it than it is designed for and it can no longer supply enough torque to keep it spinning</div></div>



<script async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-4043148098486780" crossorigin="anonymous"></script>
<ins class="adsbygoogle" style="display:block; text-align:center;" data-ad-layout="in-article" data-ad-format="fluid" data-ad-client="ca-pub-4043148098486780" data-ad-slot="2430604139"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="wp-block-paragraph">The type of motor we are using in this project is the <strong>NEMA 17 Bipolar stepper motor</strong>. The bipolar stepper motor has two internal coils and it usually has four wires, two wires per coil. unlike the Bipolar stepper motor which has five wires. The &#8220;Step Angle&#8221; of the motor is <strong>1.8°</strong> which indicates how much the shaft advances in each full step, the motor works on 9V but if you want to get the maximum power of it use a 12V power source.</p>


<div class="su-note"  style="border-color:#e5e54c;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><div class="su-note-inner su-u-clearfix su-u-trim" style="background-color:#FFFF66;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;">You can calculate how many steps the motor can rotate in one full revolution by applying this simple equation <b>360(Full circle degrees) / 1.8(Full step degrees) </b>Now, we know that the stepper motor moves <b>200 full step/one full rotation</b></div></div>


<div class="su-note"  style="border-color:#e5e54c;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><div class="su-note-inner su-u-clearfix su-u-trim" style="background-color:#FFFF66;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;">Stepper motors are categorized by frame size. The term <b>&#8220;NEMA&#8221;</b> stands for <b>The National Electrical Manufacturers Association</b> which sets the standars for many electrical products including stepper motors. The number <b>&#8220;17&#8221;</b> refers to the sizing of the motor plate. So, A <b>NEMA 17</b> stepper motor is a motor with <b>1.7 X 1.7 Inch</b> mounting face.</div></div>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="429" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/NEMA17-and-A4988.png?resize=770%2C429&#038;ssl=1" alt="A4988 stepper driver &amp; NEMA 17 stepper motor" class="wp-image-1076" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/NEMA17-and-A4988.png?resize=1024%2C570&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/NEMA17-and-A4988.png?resize=800%2C445&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/NEMA17-and-A4988.png?resize=300%2C167&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/NEMA17-and-A4988.png?resize=768%2C427&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/NEMA17-and-A4988.png?w=1080&amp;ssl=1 1080w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">A4988 stepper driver &amp; NEMA 17 stepper motor</figcaption></figure>
</div>


<p class="wp-block-paragraph">So, by connecting the stepper motor with the A4988 stepper motor driver, we can control how many steps we need the motor to move and in what direction. Also, we can set the &#8220;microstep&#8221; mode is it full step, half step, quarter step, &#8230;.. Let&#8217;s take a look at the wiring diagram.</p>



<h3 class="wp-block-heading">Wiring Diagram</h3>



<p class="wp-block-paragraph">As we stated before, we need to make a small check to make sure that everything we assembled before is right in its place and moving properly. Now, we will wire all the hardware together, the NEMA 17 stepper motor with the A4988 stepper motor driver to the brain, the Arduino board. And using a <strong>12V 3A Lithium-Ion battery</strong> to feed the motors with the power it needs.</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="468" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/Wiring-Diagram1.png?resize=770%2C468&#038;ssl=1" alt="Wiring Diagram" class="wp-image-1090" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/Wiring-Diagram1.png?resize=1024%2C623&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/Wiring-Diagram1.png?resize=800%2C487&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/Wiring-Diagram1.png?resize=300%2C183&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/Wiring-Diagram1.png?resize=768%2C468&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/Wiring-Diagram1.png?resize=1536%2C935&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">Wiring Diagram</figcaption></figure>
</div>


<h3 class="wp-block-heading">Arduino Code</h3>



<h4 class="wp-block-heading">AccelStepper Library Installation </h4>



<p class="wp-block-paragraph">The Installation is pretty simple, we need to open Arduino IDE. From the &#8220;Sketch&#8221; menu  select Include Library &#8211;&gt; Manage Libraries&#8230; </p>



<figure class="is-style-default wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="293" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/1lib.jpg?resize=770%2C293&#038;ssl=1" alt="" class="wp-image-1163" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/1lib-scaled.jpg?resize=1024%2C390&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/1lib-scaled.jpg?resize=800%2C305&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/1lib-scaled.jpg?resize=300%2C114&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/1lib-scaled.jpg?resize=768%2C293&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/1lib-scaled.jpg?resize=1536%2C585&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>



<p class="wp-block-paragraph">A new window should appear, search for &#8220;AccelStepper&#8221; and install the library made by &#8220;Mike McCauley&#8221;. Easy right!</p>



<figure class="is-style-default wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="474" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/2lib.jpg?resize=770%2C474&#038;ssl=1" alt="" class="wp-image-1164" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/2lib.jpg?resize=1024%2C631&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/2lib.jpg?resize=800%2C493&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/2lib.jpg?resize=300%2C185&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/2lib.jpg?resize=768%2C473&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/2lib.jpg?resize=1536%2C947&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>



<p class="wp-block-paragraph">After installing the AccelStepper library, you should see it in the examples menu. </p>



<figure class="is-style-default wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="458" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/3lib.jpg?resize=770%2C458&#038;ssl=1" alt="" class="wp-image-1165" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/3lib-scaled.jpg?resize=1024%2C609&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/3lib-scaled.jpg?resize=800%2C475&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/3lib-scaled.jpg?resize=300%2C178&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/3lib-scaled.jpg?resize=768%2C457&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/3lib-scaled.jpg?resize=1536%2C913&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>



<p class="wp-block-paragraph">I wanna make sure that the AccelStepper library is installed correctly and my stepper motor connection with the A4988 motor driver is right and my power management is fine. So, let&#8217;s write some lines of code to run our stepper motor forward and backward.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="true" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">// Bounce stepper test program
// Make a single stepper bounce from one limit to another
// Copyright (C) 2020 makesomestuff.org

#include &lt;AccelStepper.h>

#define stepPin 2
#define dirPin 3

// Define a stepper and the pins it will use
AccelStepper stepper(AccelStepper::DRIVER, stepPin, dirPin);       //create an object. the pin "2" is the step pin, "3" is the direction pin.

void setup()
{  
  // Change these to suit your stepper if you want
  stepper.setMaxSpeed(100);
  stepper.setAcceleration(20);
  stepper.moveTo(500);
}

void loop()
{
    // If at the end of travel go to the other end
    if (stepper.distanceToGo() == 0)
      stepper.moveTo(-stepper.currentPosition());

    stepper.run();
}</pre>



<p class="wp-block-paragraph">The code logic is pretty straightforward, we initialized an object from the AccelStepper library, we defined two constants (stepPin, dirPin) that two digital pins is used by the A4988 stepper motor driver to control the movement of the motor itself.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="true" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">#include &lt;AccelStepper.h>

#define stepPin 2
#define dirPin 3

// Define a stepper and the pins it will use
AccelStepper stepper(AccelStepper::DRIVER, stepPin, dirPin);       //create an object. the pin "2" is the step pin, "3" is the direction pin.</pre>



<p class="wp-block-paragraph">Inside the void setup function, we set the Max. speed of the stepper motor to 100 steps/sec. Also, we set the acceleration/deceleration rate to 20 steps/sec. lastly, we used the moveTo() function to tell the motor to move 500 steps.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">void setup()
{  
  // Change these to suit your stepper if you want
  stepper.setMaxSpeed(100);
  stepper.setAcceleration(20);
  stepper.moveTo(500);
}</pre>



<p class="wp-block-paragraph">Inside the void loop function, we are checking if the motor reached it&#8217;s position or not. If it reached the position, it will bounce back. and if it didn&#8217;t reach it&#8217;s position yet, it will keep running.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">void loop()
{
    // If at the end of travel go to the other end
    if (stepper.distanceToGo() == 0)
      stepper.moveTo(-stepper.currentPosition());

    stepper.run();
}</pre>



<h2 class="wp-block-heading">Camera Slider Full Wireless Control</h2>



<hr class="wp-block-separator has-css-opacity"/>



<p class="wp-block-paragraph">We have done great things so far. Let&#8217;s continue! The next step after testing everything is to work on the mobile app that we will use to control the camera slider movement and send the orders to it. Also, we need to work on the Arduino code that will receive the data from the mobile app and according to these data, it will take some actions like moving the motor, changing speed, acceleration, and so on&#8230;</p>


<div class="wp-block-image is-style-default">
<figure class="aligncenter size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="338" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/Sending-Commands.jpg?resize=770%2C338&#038;ssl=1" alt="" class="wp-image-1226" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/Sending-Commands-scaled.jpg?resize=1024%2C449&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/Sending-Commands-scaled.jpg?resize=800%2C350&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/Sending-Commands-scaled.jpg?resize=300%2C131&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/Sending-Commands-scaled.jpg?resize=768%2C337&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/Sending-Commands-scaled.jpg?resize=1536%2C673&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">Communication Architecture </figcaption></figure>
</div>


<h3 class="wp-block-heading">Building The Mobile App</h3>



<p class="wp-block-paragraph">To build the mobile app, I used the <a href="https://appinventor.mit.edu/" target="_blank" rel="noreferrer noopener">MIT App inventor</a> tool that allows you to create mobile apps that run on any Android smartphone. The tool is pretty simple since you only drag and drop some pre-made code blocks to build the logic of your program, also you use some premade blocks to build the app user interface. You can access the source of the mobile app from the link down below. Feel free to edit and share, it&#8217;s open-source.</p>



<div class="wp-block-buttons is-content-justification-center is-layout-flex wp-container-core-buttons-is-layout-fe48e5de wp-block-buttons-is-layout-flex">
<div class="wp-block-button"><a class="wp-block-button__link has-background has-text-align-center wp-element-button" href="http://ai2.appinventor.mit.edu/?galleryId=4912131416129536" style="border-radius:100px;background-color:#00a99d" target="_blank" rel="noreferrer noopener">mobile app source</a></div>
</div>



<figure class="wp-block-gallery alignwide has-nested-images columns-default is-cropped wp-block-gallery-25 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="387" data-id="1227" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/Screen-Shot-2020-08-28-at-12.28.08-AM.jpg?resize=770%2C387&#038;ssl=1" alt="" class="wp-image-1227" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/Screen-Shot-2020-08-28-at-12.28.08-AM-scaled.jpg?resize=1024%2C515&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/Screen-Shot-2020-08-28-at-12.28.08-AM-scaled.jpg?resize=800%2C403&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/Screen-Shot-2020-08-28-at-12.28.08-AM-scaled.jpg?resize=300%2C151&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/Screen-Shot-2020-08-28-at-12.28.08-AM-scaled.jpg?resize=768%2C387&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/Screen-Shot-2020-08-28-at-12.28.08-AM-scaled.jpg?resize=1536%2C773&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">App UI</figcaption></figure>



<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="387" data-id="1228" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/Screen-Shot-2020-08-28-at-12.28.51-AM.jpg?resize=770%2C387&#038;ssl=1" alt="" class="wp-image-1228" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/Screen-Shot-2020-08-28-at-12.28.51-AM-scaled.jpg?resize=1024%2C514&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/Screen-Shot-2020-08-28-at-12.28.51-AM-scaled.jpg?resize=800%2C401&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/Screen-Shot-2020-08-28-at-12.28.51-AM-scaled.jpg?resize=300%2C150&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/Screen-Shot-2020-08-28-at-12.28.51-AM-scaled.jpg?resize=768%2C385&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/Screen-Shot-2020-08-28-at-12.28.51-AM-scaled.jpg?resize=1536%2C770&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">App logic</figcaption></figure>
</figure>



<p class="wp-block-paragraph">The image down below, a brief explanation for each button function and how it works.</p>


<div class="wp-block-image is-style-default">
<figure class="aligncenter size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="433" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/Cairo-camera-slider-mobile-app-features.jpg?resize=770%2C433&#038;ssl=1" alt="Mobile App Features" class="wp-image-1230" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/Cairo-camera-slider-mobile-app-features.jpg?resize=1024%2C576&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/Cairo-camera-slider-mobile-app-features.jpg?resize=800%2C450&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/Cairo-camera-slider-mobile-app-features.jpg?resize=300%2C169&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/Cairo-camera-slider-mobile-app-features.jpg?resize=768%2C432&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/Cairo-camera-slider-mobile-app-features.jpg?resize=1536%2C864&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>
</div>


<p class="wp-block-paragraph">That mobile app will communicate with the Cairo camera slider wirelessly over Bluetooth communication. So, the next step is to connect a Bluetooth module to the last circuit we built before and upload some lines of code to the Arduino board to be able to establish the communication between the mobile app and the Cairo camera slider.</p>



<h3 class="wp-block-heading">Wiring Diagram</h3>



<p class="wp-block-paragraph">It&#8217;s time to connect all things together, previously we connected the stepper motor, stepper motor driver, Arduino UNO, and the battery together and tested the circuit and it worked fine. Now, and after building the mobile app, we need to connect the HC-05 Bluetooth module to our circuit.</p>



<p class="wp-block-paragraph">To make it wireless we will use the HC-05 Bluetooth module which has wide use, it can be set as slave or master as well (unlike the HC-06 module which can work only as a slave) which means that you can make a Bluetooth connection between two different Arduino boards. the HC-05 Bluetooth module is an SPP (Serial Port Protocol) module, which means that it communicates with the Arduino board via Serial communication. You only need to connect the Tx and the Rx pins between the HC-05 module and the Arduino UNO board.</p>



<figure class="is-style-regular wp-block-table"><table class="has-background" style="background-color:#f3f4f5"><thead><tr><th class="has-text-align-center" data-align="center">Arduino Pin</th><th class="has-text-align-center" data-align="center">HC-05 Pin</th></tr></thead><tbody><tr><td class="has-text-align-center" data-align="center">Rx</td><td class="has-text-align-center" data-align="center">Tx</td></tr><tr><td class="has-text-align-center" data-align="center">Tx</td><td class="has-text-align-center" data-align="center">Rx</td></tr><tr><td class="has-text-align-center" data-align="center">5V</td><td class="has-text-align-center" data-align="center">VCC</td></tr><tr><td class="has-text-align-center" data-align="center">GND</td><td class="has-text-align-center" data-align="center">GND</td></tr></tbody></table><figcaption class="wp-element-caption">HC-05 and Arduino UNO connections</figcaption></figure>



<figure class="is-style-default wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="471" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/Wiring-Diagram.png?resize=770%2C471&#038;ssl=1" alt="HC-05 Wiring Diagram" class="wp-image-1079" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/Wiring-Diagram.png?resize=1024%2C627&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/Wiring-Diagram.png?resize=800%2C489&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/Wiring-Diagram.png?resize=300%2C184&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/Wiring-Diagram.png?resize=768%2C470&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/01/Wiring-Diagram.png?resize=1536%2C940&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">Wiring Diagram</figcaption></figure>



<h3 class="wp-block-heading">Schematic and PCB Fabrication</h3>



<p class="wp-block-paragraph">Man! I don&#8217;t like breadboarding a big circuit like this. So, I designed a super pretty Arduino UNO shield PCB board that keeps all my components in place without worrying about the jumper wires or even the connections. All you need to do is to place your component on the Arduino shield PCB, insert the HC-05 Bluetooth module, A4988 stepper motor driver, and the battery in their places. and install the shield on top of the Arduino board. that&#8217;s it!</p>



<figure class="is-style-default wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="513" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/Schematic.png?resize=770%2C513&#038;ssl=1" alt="Cairo Camera Slider Shield SCH" class="wp-image-1236" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/Schematic.png?resize=1024%2C682&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/Schematic.png?resize=800%2C533&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/Schematic.png?resize=300%2C200&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/Schematic.png?resize=768%2C512&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/Schematic.png?resize=1536%2C1023&amp;ssl=1 1536w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/Schematic.png?resize=270%2C180&amp;ssl=1 270w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/Schematic.png?resize=370%2C245&amp;ssl=1 370w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/Schematic.png?w=2310&amp;ssl=1 2310w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>



<figure class="wp-block-gallery alignwide has-nested-images columns-default is-cropped wp-block-gallery-26 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="514" data-id="1237" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/Top-Layer.png?resize=770%2C514&#038;ssl=1" alt="PCB Top Face" class="wp-image-1237" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/Top-Layer.png?resize=1024%2C683&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/Top-Layer.png?resize=800%2C533&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/Top-Layer.png?resize=300%2C200&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/Top-Layer.png?resize=768%2C512&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/Top-Layer.png?resize=1536%2C1024&amp;ssl=1 1536w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/Top-Layer.png?resize=270%2C180&amp;ssl=1 270w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/Top-Layer.png?resize=770%2C515&amp;ssl=1 770w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/Top-Layer.png?w=2310&amp;ssl=1 2310w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>



<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="514" data-id="1235" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/Bottom-Layer.png?resize=770%2C514&#038;ssl=1" alt="PCB Bottom Face" class="wp-image-1235" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/Bottom-Layer.png?resize=1024%2C683&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/Bottom-Layer.png?resize=800%2C533&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/Bottom-Layer.png?resize=300%2C200&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/Bottom-Layer.png?resize=768%2C512&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/Bottom-Layer.png?resize=1536%2C1024&amp;ssl=1 1536w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/Bottom-Layer.png?resize=270%2C180&amp;ssl=1 270w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/Bottom-Layer.png?resize=770%2C515&amp;ssl=1 770w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/Bottom-Layer.png?w=2310&amp;ssl=1 2310w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>
</figure>



<p class="wp-block-paragraph">I fabricated my PCB at <a href="https://www.pcbway.com/" target="_blank" rel="noreferrer noopener">PCBWay</a> the quality was very good, in a few days the package arrived in Egypt safely. and I paid just 5$ for the fabrication which is amazing. The coolest thing was that I was able to check the order fabrication and processing status online on my account panel and track everything happening to my baby board like I was there inside the factory. </p>



<figure class="wp-block-gallery alignwide has-nested-images columns-default is-cropped wp-block-gallery-27 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="578" data-id="1292" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_8198.jpg?resize=770%2C578&#038;ssl=1" alt="" class="wp-image-1292" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_8198-scaled.jpg?resize=1024%2C768&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_8198-scaled.jpg?resize=600%2C450&amp;ssl=1 600w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_8198-scaled.jpg?resize=800%2C600&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_8198-scaled.jpg?resize=300%2C225&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_8198-scaled.jpg?resize=768%2C576&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_8198-scaled.jpg?resize=1536%2C1152&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>



<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="578" data-id="1293" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_8199.jpg?resize=770%2C578&#038;ssl=1" alt="" class="wp-image-1293" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_8199-scaled.jpg?resize=1024%2C768&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_8199-scaled.jpg?resize=600%2C450&amp;ssl=1 600w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_8199-scaled.jpg?resize=800%2C600&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_8199-scaled.jpg?resize=300%2C225&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_8199-scaled.jpg?resize=768%2C576&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_8199-scaled.jpg?resize=1536%2C1152&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>
</figure>



<figure class="is-style-default wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="578" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_8200.jpg?resize=770%2C578&#038;ssl=1" alt="" class="wp-image-1294" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_8200-scaled.jpg?resize=1024%2C768&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_8200-scaled.jpg?resize=600%2C450&amp;ssl=1 600w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_8200-scaled.jpg?resize=800%2C600&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_8200-scaled.jpg?resize=300%2C225&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_8200-scaled.jpg?resize=768%2C576&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_8200-scaled.jpg?resize=1536%2C1152&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>


<div class="wp-block-image is-style-default">
<figure class="aligncenter size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="362" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/43as.jpg?resize=770%2C362&#038;ssl=1" alt="Cairo Camera Slider Arduino Shield" class="wp-image-1206" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/43as-scaled.jpg?resize=1024%2C482&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/43as-scaled.jpg?resize=800%2C377&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/43as-scaled.jpg?resize=300%2C141&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/43as-scaled.jpg?resize=768%2C362&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/43as-scaled.jpg?resize=1536%2C723&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>
</div>


<p class="wp-block-paragraph">you can download the PCB design source files or even order the Cairo Camera Slider Arduino Shield PCB from the <a href="https://www.pcbway.com/" target="_blank" rel="noreferrer noopener">PCBWay</a> website.</p>



<div class="wp-block-buttons is-content-justification-center is-layout-flex wp-container-core-buttons-is-layout-fe48e5de wp-block-buttons-is-layout-flex">
<div class="wp-block-button"><a class="wp-block-button__link has-background has-text-align-center wp-element-button" href="https://www.pcbway.com/project/shareproject/Arduino_Motorized_Camera_Slider.html" style="border-radius:100px;background-color:#00a99d" target="_blank" rel="noreferrer noopener">pcb source file</a></div>
</div>



<h3 class="wp-block-heading">Arduino Code And Bluetooth Communication</h3>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">#include &lt;MultiStepper.h>
#include &lt;AccelStepper.h>

#define stepPin 2
#define dirPin 3

bool homingPositionFlag = false;
int startupSetupFlag = 0;
bool delayedStart = false;

int incomingData = 0;
int movementDistance = 50;
long steps = 0;       //50cm rail by default @1/8 microstepping.
int microStepResolution = 0;    //4  or  16
long railLength = 0;
int sliderSpeed = 10;

AccelStepper stepper(AccelStepper::DRIVER, stepPin, dirPin);       //create an object. the pin "2" is the step pin, "3" is the direction pin.

void setup() {
  pinMode(stepPin, OUTPUT);
  pinMode(dirPin, OUTPUT);
  Serial.begin(9600);

  stepper.setMaxSpeed(10.00);        //The fastest motor speed that can be reliably supported is about 4000 steps per second at a clock frequency of 16 MHz on Arduino such as Uno
  stepper.setAcceleration(500.00);     //1600 (40%) (Medium Acceleration rate)

  while (startupSetupFlag &lt; 3) {
    if (Serial.available() > 1) {
      unsigned int dataOne = Serial.read();
      unsigned int dataOne1 = Serial.read();
      unsigned int incomingData = (dataOne1 * 256) + dataOne;

      //**************************************************************Motor Homing Part**************************************************
      if (incomingData == 16) {      //left end homing position.
        stepper.setCurrentPosition(steps);
        homingPositionFlag = false;
        startupSetupFlag++;
      } else if (incomingData == 17) {    //right end homing position.
        stepper.setCurrentPosition(-(steps));
        homingPositionFlag = true;
        startupSetupFlag++;
      }
      //**************************************************************microstep resolution Part**************************************************
      if (incomingData == 18) {
        microStepResolution = 4;                   //50cm rail length @1/4 microstep resolution.
        startupSetupFlag++;
      } else if (incomingData == 19) {
        microStepResolution = 16;                  //50cm rail length @1/16 microstep resolution.
        startupSetupFlag++;
      }

      if (incomingData >= 1301 &amp;&amp; incomingData &lt;= 2300) {
        railLength = incomingData - 1300; //from raw data to cm.
        if (microStepResolution == 4) {
          steps = ((6100L * railLength) / 50L);
          startupSetupFlag++;
        }
        else if (microStepResolution == 16) {
          steps = ((25000L * railLength) / 50L);
          startupSetupFlag++;
        }
      }
    }
    //Serial.println(startupSetupFlag);
  }
  /*
   * *********** *********** **********For Debugging Purposes* *********** *********** **********
    Serial.print("rail length: ");
    Serial.print(railLength);
    Serial.print("    number of steps:  ");
    Serial.print(steps);
    Serial.print("    Homing position: ");
    Serial.print(stepper.currentPosition());
    Serial.print("    microstep resolution: ");
    Serial.println(microStepResolution);*/
}

void loop() {

  if (Serial.available() > 1) {

    unsigned int dataOne = Serial.read();
    unsigned int dataOne1 = Serial.read();
    unsigned int incomingData = (dataOne1 * 256) + dataOne;
    //Serial.print("raw data:     ");
    //Serial.println(incomingData);

    //**************************************************************Motor Control Part**************************************************
    if (incomingData == 1 &amp;&amp; stepper.isRunning() == false &amp;&amp; stepper.currentPosition() != 6050 &amp;&amp; homingPositionFlag == true) {
      if (delayedStart == true) { //use millis to delay 15 seconds.
        delay(15000);     //wait 15 seconds.
      }
      stepper.setCurrentPosition(0);
      stepper.moveTo(steps);             //from end to end (@ 1/4 step).
      homingPositionFlag = false;

      /*Serial.print("rail length: ");
        Serial.print(railLength);
        Serial.print("    number of steps:  ");
        Serial.print(steps);
        Serial.print("    Homing position: ");
        Serial.print(stepper.currentPosition());
        Serial.print("    microstep resolution: ");
        Serial.println(microStepResolution);*/
    }

    else if (incomingData == 2 &amp;&amp; stepper.isRunning() == false &amp;&amp; stepper.currentPosition() != -6050 &amp;&amp; homingPositionFlag == false) {
      if (delayedStart == true) { //use millis to delay 15 seconds.
        delay(15000);     //wait 15 seconds.
      }
      stepper.setCurrentPosition(0);
      stepper.moveTo(-(steps));             //from end to end (@ 1/4 step).
      homingPositionFlag = true;

      /*Serial.print("rail length: ");
        Serial.print(railLength);
        Serial.print("    number of steps:  ");
        Serial.print(steps);
        Serial.print("    Homing position: ");
        Serial.print(stepper.currentPosition());
        Serial.print("    microstep resolution: ");
        Serial.println(microStepResolution);*/
    }

    else if (incomingData == 3 &amp;&amp; stepper.isRunning() == true) {
      homing();
    }

    //**************************************************************Set Max. Speed Part**************************************************
    else if (incomingData >= 5001 &amp;&amp; incomingData &lt;= 9000) {
      sliderSpeed = incomingData - 5000;
      stepper.setMaxSpeed(sliderSpeed);
    }

    //**************************************************************Set Delayed Start Part**************************************************
    else if (incomingData == 7) {   //delayed start (15 seconds) is checked "true"
      delayedStart = true;
    }
    else if (incomingData == 8) {   //delayed start (15 seconds) is not checked "false"
      delayedStart = false;
    }

    //**************************************************************Set movement distance Part**************************************************
    else if (incomingData >= 201 &amp;&amp; incomingData &lt;= 1200) {  //convertin from rail length into number of steps. (upto 10 meters)
      movementDistance = incomingData - 200; //from raw data to cm.
      if (microStepResolution == 4) {
        steps = ((6100L * movementDistance) / 50L);
      }
      else if (microStepResolution == 16) {
        steps = ((25000L * movementDistance) / 50L);
      }
      /*Serial.print("rail length:  ");
        Serial.print(movementDistance);
        Serial.print("      number of steps:  ");
        Serial.println(steps);*/
    }

    //**************************************************************Set Acceleration Part**************************************************
    else if (incomingData == 11 &amp;&amp; stepper.isRunning() == false) {          //HIGH
      stepper.setAcceleration(3000);
    }

    else if (incomingData == 12 &amp;&amp; stepper.isRunning() == false) {          //Medium
      stepper.setAcceleration(1000);
    }

    else if (incomingData == 13 &amp;&amp; stepper.isRunning() == false) {          //Low
      stepper.setAcceleration(500);
    }

    else if (incomingData == 14 &amp;&amp; stepper.isRunning() == false) {          //Very High
      stepper.setAcceleration(4000);
    }

    else if (incomingData == 15 &amp;&amp; stepper.isRunning() == false) {          //Very Low
      stepper.setAcceleration(10);
    }
  }
  stepper.run();
}

void homing() {
  if (stepper.currentPosition() > 0) {
    homingPositionFlag = true;
  } else {
    homingPositionFlag = false;
  }
  stepper.moveTo(0);
}</pre>



<h3 class="wp-block-heading">Code Logic</h3>



<p class="wp-block-paragraph">We&#8217;re using the amazing AccelStepper Arduino library that provides an object-oriented interface for 2, 3, 4 pins stepper motors to control it&#8217;s movement precisely. </p>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">#define stepPin 2
#define dirPin 3

bool homingPositionFlag = false;
int startupSetupFlag = 0;
bool delayedStart = false;

int incomingData = 0;
int movementDistance = 50;
long steps = 0;       //50cm rail by default @1/8 microstepping.
int microStepResolution = 0;    //4  or  16
long railLength = 0;
int sliderSpeed = 10;

AccelStepper stepper(AccelStepper::DRIVER, stepPin, dirPin);       //create an object. the pin "2" is the step pin, "3" is the direction pin.
</pre>



<p class="wp-block-paragraph">when you open the mobile app and get connected to the Cairo camera slider it will ask you about the micro-stepping mode that you set the A4988 motor driver to work at. it&#8217;s very important to choose the correct micro-stepping mode. The Cairo camera slider only supports the 1/4 and 1/16 micro-step resolution. If you chose a wrong micro-step mode it will affect the distance calculations causing the camera carriage to hit the slider limits. So, be careful!</p>



<figure class="wp-block-table"><table><thead><tr><th>Micro-step Resolution</th><th>Working Mode</th></tr></thead><tbody><tr><td>1/4</td><td>Smooth</td></tr><tr><td>1/16</td><td>Very Smooth</td></tr></tbody></table></figure>


<div class="wp-block-image is-style-default">
<figure class="aligncenter size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="578" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6496.jpg?resize=770%2C578&#038;ssl=1" alt="" class="wp-image-1247" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6496-scaled.jpg?resize=1024%2C768&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6496-scaled.jpg?resize=600%2C450&amp;ssl=1 600w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6496-scaled.jpg?resize=800%2C600&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6496-scaled.jpg?resize=300%2C225&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6496-scaled.jpg?resize=768%2C576&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6496-scaled.jpg?resize=1536%2C1152&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>
</div>


<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">      //**************************************************************microstep resolution Part**************************************************
      if (incomingData == 18) {
        microStepResolution = 4;                   //50cm rail length @1/4 microstep resolution.
        startupSetupFlag++;
      } else if (incomingData == 19) {
        microStepResolution = 16;                  //50cm rail length @1/16 microstep resolution.
        startupSetupFlag++;
      }
</pre>



<p class="wp-block-paragraph">It sets the camera slider homing if it&#8217;s left or right side homing.  the homing position, once you click on right or left side homing a specific piece of data will get sent from the mobile app to the Arduino board according to the homing position that you have chosen.</p>



<figure class="is-style-default wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="578" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6498.jpg?resize=770%2C578&#038;ssl=1" alt="" class="wp-image-1250" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6498-scaled.jpg?resize=1024%2C768&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6498-scaled.jpg?resize=600%2C450&amp;ssl=1 600w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6498-scaled.jpg?resize=800%2C600&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6498-scaled.jpg?resize=300%2C225&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6498-scaled.jpg?resize=768%2C576&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6498-scaled.jpg?resize=1536%2C1152&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">void setup() {
  pinMode(stepPin, OUTPUT);
  pinMode(dirPin, OUTPUT);
  Serial.begin(9600);

  stepper.setMaxSpeed(10.00);        //The fastest motor speed that can be reliably supported is about 4000 steps per second at a clock frequency of 16 MHz on Arduino such as Uno
  stepper.setAcceleration(500.00);     //1600 (40%) (Medium Acceleration rate)

  while (startupSetupFlag &lt; 3) {
    if (Serial.available() > 1) {
      unsigned int dataOne = Serial.read();
      unsigned int dataOne1 = Serial.read();
      unsigned int incomingData = (dataOne1 * 256) + dataOne;

      //**************************************************************Motor Homing Part**************************************************
      if (incomingData == 16) {      //left end homing position.
        stepper.setCurrentPosition(steps);
        homingPositionFlag = false;
        startupSetupFlag++;
      } else if (incomingData == 17) {    //right end homing position.
        stepper.setCurrentPosition(-(steps));
        homingPositionFlag = true;
        startupSetupFlag++;
      }</pre>



<p class="wp-block-paragraph">now it sets how many steps should the stepper motor moves without hitting the camera carriage with the camera slider right or left legs. it reads and saves the rail length according to the value that the user enters in the mobile app. So, depending on the micro-step resolution that the user selected before, and the rail length I can calculate the number of steps that the motor should rotate to reach the limits of the slider rail without hitting the right or left legs.</p>


<div class="wp-block-image is-style-default">
<figure class="aligncenter size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="578" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6497.jpg?resize=770%2C578&#038;ssl=1" alt="Enter the rail length" class="wp-image-1248" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6497-scaled.jpg?resize=1024%2C768&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6497-scaled.jpg?resize=600%2C450&amp;ssl=1 600w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6497-scaled.jpg?resize=800%2C600&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6497-scaled.jpg?resize=300%2C225&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6497-scaled.jpg?resize=768%2C576&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6497-scaled.jpg?resize=1536%2C1152&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>
</div>


<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">if (incomingData >= 1301 &amp;&amp; incomingData &lt;= 2300) {
        railLength = incomingData - 1300; //from raw data to cm.
        if (microStepResolution == 4) {
          steps = ((6100L * railLength) / 50L);
          startupSetupFlag++;
        }
        else if (microStepResolution == 16) {
          steps = ((25000L * railLength) / 50L);
          startupSetupFlag++;
        }
      }
    }
    //Serial.println(startupSetupFlag);
  }</pre>



<p class="wp-block-paragraph">inside the loop function, it reads the mobile app incoming data and according to these data it takes different actions, like moving the stepper motor clockwise, moving anti-clockwise, stop and return back to the starting point, and changing the travelling speed, so on&#8230;</p>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">void loop() {

  if (Serial.available() > 1) {

    unsigned int dataOne = Serial.read();
    unsigned int dataOne1 = Serial.read();
    unsigned int incomingData = (dataOne1 * 256) + dataOne;
    //Serial.print("raw data:     ");
    //Serial.println(incomingData);

    //**************************************************************Motor Control Part**************************************************
    if (incomingData == 1 &amp;&amp; stepper.isRunning() == false &amp;&amp; stepper.currentPosition() != 6050 &amp;&amp; homingPositionFlag == true) {
      if (delayedStart == true) { //use millis to delay 15 seconds.
        delay(15000);     //wait 15 seconds.
      }
      stepper.setCurrentPosition(0);
      stepper.moveTo(steps);             //from end to end (@ 1/4 step).
      homingPositionFlag = false;

      /*Serial.print("rail length: ");
        Serial.print(railLength);
        Serial.print("    number of steps:  ");
        Serial.print(steps);
        Serial.print("    Homing position: ");
        Serial.print(stepper.currentPosition());
        Serial.print("    microstep resolution: ");
        Serial.println(microStepResolution);*/
    }

    else if (incomingData == 2 &amp;&amp; stepper.isRunning() == false &amp;&amp; stepper.currentPosition() != -6050 &amp;&amp; homingPositionFlag == false) {
      if (delayedStart == true) { //use millis to delay 15 seconds.
        delay(15000);     //wait 15 seconds.
      }
      stepper.setCurrentPosition(0);
      stepper.moveTo(-(steps));             //from end to end (@ 1/4 step).
      homingPositionFlag = true;

      /*Serial.print("rail length: ");
        Serial.print(railLength);
        Serial.print("    number of steps:  ");
        Serial.print(steps);
        Serial.print("    Homing position: ");
        Serial.print(stepper.currentPosition());
        Serial.print("    microstep resolution: ");
        Serial.println(microStepResolution);*/
    }

    else if (incomingData == 3 &amp;&amp; stepper.isRunning() == true) {
      homing();
    }

    //**************************************************************Set Max. Speed Part**************************************************
    else if (incomingData >= 5001 &amp;&amp; incomingData &lt;= 9000) {
      sliderSpeed = incomingData - 5000;
      stepper.setMaxSpeed(sliderSpeed);
    }

    //**************************************************************Set Delayed Start Part**************************************************
    else if (incomingData == 7) {   //delayed start (15 seconds) is checked "true"
      delayedStart = true;
    }
    else if (incomingData == 8) {   //delayed start (15 seconds) is not checked "false"
      delayedStart = false;
    }

    //**************************************************************Set movement distance Part**************************************************
    else if (incomingData >= 201 &amp;&amp; incomingData &lt;= 1200) {  //convertin from rail length into number of steps. (upto 10 meters)
      movementDistance = incomingData - 200; //from raw data to cm.
      if (microStepResolution == 4) {
        steps = ((6100L * movementDistance) / 50L);
      }
      else if (microStepResolution == 16) {
        steps = ((25000L * movementDistance) / 50L);
      }
      /*Serial.print("rail length:  ");
        Serial.print(movementDistance);
        Serial.print("      number of steps:  ");
        Serial.println(steps);*/
    }

    //**************************************************************Set Acceleration Part**************************************************
    else if (incomingData == 11 &amp;&amp; stepper.isRunning() == false) {          //HIGH
      stepper.setAcceleration(3000);
    }

    else if (incomingData == 12 &amp;&amp; stepper.isRunning() == false) {          //Medium
      stepper.setAcceleration(1000);
    }

    else if (incomingData == 13 &amp;&amp; stepper.isRunning() == false) {          //Low
      stepper.setAcceleration(500);
    }

    else if (incomingData == 14 &amp;&amp; stepper.isRunning() == false) {          //Very High
      stepper.setAcceleration(4000);
    }

    else if (incomingData == 15 &amp;&amp; stepper.isRunning() == false) {          //Very Low
      stepper.setAcceleration(10);
    }
  }
  stepper.run();
}

void homing() {
  if (stepper.currentPosition() > 0) {
    homingPositionFlag = true;
  } else {
    homingPositionFlag = false;
  }
  stepper.moveTo(0);
}</pre>



<h2 class="wp-block-heading">Cairo Camera Slider User Guide &amp; troubleshooting </h2>



<p class="wp-block-paragraph">After connecting the 12V power source to the Arduino UNO board that distributes power to the Cairo camera slider Arduino shield as well, turn on the Bluetooth on your mobile, search for new devices, pair with the HC-05 device, and open the mobile app then press on the &#8220;Press here to connect with Cairo camera slider&#8221; button. It will show up the menu of the paired Bluetooth devices, select the HC-05 Bluetooth device.</p>



<figure class="wp-block-gallery alignwide has-nested-images columns-default is-cropped wp-block-gallery-28 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="578" data-id="1256" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6494.jpg?resize=770%2C578&#038;ssl=1" alt="" class="wp-image-1256" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6494-scaled.jpg?resize=1024%2C768&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6494-scaled.jpg?resize=600%2C450&amp;ssl=1 600w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6494-scaled.jpg?resize=800%2C600&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6494-scaled.jpg?resize=300%2C225&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6494-scaled.jpg?resize=768%2C576&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6494-scaled.jpg?resize=1536%2C1152&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>



<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="578" data-id="1257" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6495.jpg?resize=770%2C578&#038;ssl=1" alt="" class="wp-image-1257" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6495-scaled.jpg?resize=1024%2C768&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6495-scaled.jpg?resize=600%2C450&amp;ssl=1 600w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6495-scaled.jpg?resize=800%2C600&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6495-scaled.jpg?resize=300%2C225&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6495-scaled.jpg?resize=768%2C576&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6495-scaled.jpg?resize=1536%2C1152&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>
</figure>



<p class="wp-block-paragraph">After connecting successfully with the Control board, the mobile app will ask you some questions to set up some parameters. The first question will ask you about the micro-step resolution of the stepper motor driver if it&#8217;s smooth(1/4 micro-step), or very smooth(1/16 micro-step). select the mode According to the micro-stepping resolution mode that you set the A4988 driver at. If you selected a wrong mode The Cairo camera slider will not work correctly.</p>


<div class="wp-block-image is-style-default">
<figure class="aligncenter size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="578" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6496.jpg?resize=770%2C578&#038;ssl=1" alt="" class="wp-image-1247" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6496-scaled.jpg?resize=1024%2C768&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6496-scaled.jpg?resize=600%2C450&amp;ssl=1 600w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6496-scaled.jpg?resize=800%2C600&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6496-scaled.jpg?resize=300%2C225&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6496-scaled.jpg?resize=768%2C576&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6496-scaled.jpg?resize=1536%2C1152&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>
</div>


<p class="wp-block-paragraph">Then, it will ask you about the aluminum rail length that you are using in your camera slider. Enter the distance in CM. in my case I&#8217;m using a 50cm rail length.</p>


<div class="wp-block-image is-style-default">
<figure class="aligncenter size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="578" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6497.jpg?resize=770%2C578&#038;ssl=1" alt="Enter the rail length" class="wp-image-1248" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6497-scaled.jpg?resize=1024%2C768&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6497-scaled.jpg?resize=600%2C450&amp;ssl=1 600w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6497-scaled.jpg?resize=800%2C600&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6497-scaled.jpg?resize=300%2C225&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6497-scaled.jpg?resize=768%2C576&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6497-scaled.jpg?resize=1536%2C1152&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>
</div>


<p class="wp-block-paragraph">Lastly, it will ask you about the camera carriage homing position, It&#8217;s very important to place the camera carriage on one of the two rail ends, the right end or the left end. In my case, the camera carriage is on the left end. So, I selected the left end homing.</p>



<figure class="is-style-default wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="578" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6498.jpg?resize=770%2C578&#038;ssl=1" alt="" class="wp-image-1250" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6498-scaled.jpg?resize=1024%2C768&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6498-scaled.jpg?resize=600%2C450&amp;ssl=1 600w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6498-scaled.jpg?resize=800%2C600&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6498-scaled.jpg?resize=300%2C225&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6498-scaled.jpg?resize=768%2C576&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6498-scaled.jpg?resize=1536%2C1152&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>



<p class="wp-block-paragraph">If you started the Cairo camera slider and the camera carriage is on the middle of the rail or not on one of the two rail ends it will cause the carriage to hit the limits when it moves.</p>



<script async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-4043148098486780" crossorigin="anonymous"></script>
<ins class="adsbygoogle" style="display:block; text-align:center;" data-ad-layout="in-article" data-ad-format="fluid" data-ad-client="ca-pub-4043148098486780" data-ad-slot="2430604139"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="wp-block-paragraph">After you finish the set-up process, It will show you the parameters that you have set. And once you click OK, you will be ready to play around with your lovely Cairo camera slider.</p>



<figure class="wp-block-gallery alignwide has-nested-images columns-default is-cropped wp-block-gallery-29 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="578" data-id="1251" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6499.jpg?resize=770%2C578&#038;ssl=1" alt="" class="wp-image-1251" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6499-scaled.jpg?resize=1024%2C768&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6499-scaled.jpg?resize=600%2C450&amp;ssl=1 600w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6499-scaled.jpg?resize=800%2C600&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6499-scaled.jpg?resize=300%2C225&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6499-scaled.jpg?resize=768%2C576&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6499-scaled.jpg?resize=1536%2C1152&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>



<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="578" data-id="1252" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6500.jpg?resize=770%2C578&#038;ssl=1" alt="" class="wp-image-1252" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6500-scaled.jpg?resize=1024%2C768&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6500-scaled.jpg?resize=600%2C450&amp;ssl=1 600w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6500-scaled.jpg?resize=800%2C600&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6500-scaled.jpg?resize=300%2C225&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6500-scaled.jpg?resize=768%2C576&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2020/08/IMG_6500-scaled.jpg?resize=1536%2C1152&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>
</figure>



<h2 class="wp-block-heading">Cairo Camera Slider In-Action</h2>



<hr class="wp-block-separator has-css-opacity"/>



<figure class="wp-embed-aspect-16-9 wp-has-aspect-ratio wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube"><div class="wp-block-embed__wrapper">
<iframe loading="lazy" title="Bluetooth Motorized Arduino Camera Slider" width="770" height="433" src="https://www.youtube.com/embed/7seI5YDwBWc?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
</div></figure>
<p>The post <a href="https://makesomestuff.org/arduino-motorized-camera-slider/">Arduino Motorized Camera Slider</a> appeared first on <a href="https://makesomestuff.org">Make Some Stuff</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://makesomestuff.org/arduino-motorized-camera-slider/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1028</post-id>	</item>
		<item>
		<title>Arduino LED Blinking Hello, World</title>
		<link>https://makesomestuff.org/arduino-led-blinking/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=arduino-led-blinking</link>
					<comments>https://makesomestuff.org/arduino-led-blinking/#respond</comments>
		
		<dc:creator><![CDATA[Ahmed Ibrahim]]></dc:creator>
		<pubDate>Tue, 08 Oct 2019 00:44:14 +0000</pubDate>
				<category><![CDATA[Arduino Basics]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Basics]]></category>
		<category><![CDATA[LED]]></category>
		<guid isPermaLink="false">https://makesomestuff.org/?p=763</guid>

					<description><![CDATA[<p><a href="https://makesomestuff.org">Make Some Stuff</a><br />
<a href="https://makesomestuff.org/arduino-led-blinking/">Arduino LED Blinking Hello, World</a></p>
<p>Today we will learn one of the most basic concepts in the Arduino world, digital outputs, and how to apply that concept on a very cool LED. Hardware Components Component Name Quantity Arduino Uno 1 5mm LED 1 330ohm Resistor 1 Jumpers Male-male 2 Breadbaord 1 Introduction Today we will cover the very first concept [...]</p>
<p>The post <a href="https://makesomestuff.org/arduino-led-blinking/">Arduino LED Blinking Hello, World</a> appeared first on <a href="https://makesomestuff.org">Make Some Stuff</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><a href="https://makesomestuff.org">Make Some Stuff</a><br />
<a href="https://makesomestuff.org/arduino-led-blinking/">Arduino LED Blinking Hello, World</a></p>

<p class="has-text-align-left has-regular-font-size wp-block-paragraph">Today we will learn one of the most basic concepts in the Arduino world, digital outputs, and how to apply that concept on a very cool LED.</p>



<script async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-4043148098486780" crossorigin="anonymous"></script>
<ins class="adsbygoogle" style="display:block; text-align:center;" data-ad-layout="in-article" data-ad-format="fluid" data-ad-client="ca-pub-4043148098486780" data-ad-slot="4972011142"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<figure class="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
<iframe loading="lazy" title="Arduino LED Blinking" width="770" height="433" src="https://www.youtube.com/embed/sXPSoggQUL0?feature=oembed" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div><figcaption>Final Project</figcaption></figure>



<h2 class="wp-block-heading">Hardware Components</h2>



<figure class="wp-block-table"><table><tbody><tr><td><strong>Component Name</strong></td><td><strong>Quantity</strong></td></tr><tr><td><a href="https://store.arduino.cc/usa/arduino-uno-rev3" target="_blank" rel="noreferrer noopener" aria-label="Arduino Uno (opens in a new tab)">Arduino Uno</a></td><td>1</td></tr><tr><td><a href="https://www.sparkfun.com/products/11372" target="_blank" rel="noreferrer noopener" aria-label="5mm LED (opens in a new tab)">5mm LED</a></td><td>1</td></tr><tr><td><a href="https://www.sparkfun.com/products/11507" target="_blank" rel="noreferrer noopener" aria-label="330ohm Resistor  (opens in a new tab)">330ohm Resistor </a></td><td>1</td></tr><tr><td><a href="https://www.sparkfun.com/products/124" target="_blank" rel="noreferrer noopener" aria-label="Jumpers Male-male (opens in a new tab)">Jumpers Male-male</a></td><td>2</td></tr><tr><td><a href="https://www.sparkfun.com/products/12046" target="_blank" rel="noreferrer noopener" aria-label="Breadbaord (opens in a new tab)">Breadbaord</a></td><td>1</td></tr></tbody></table></figure>



<h2 class="wp-block-heading">Introduction</h2>



<hr class="wp-block-separator"/>



<p class="has-regular-font-size wp-block-paragraph">Today we will cover the very first concept that any Arduino beginner must have to know, we will talk about Arduino digital output pins, what does digital output signal mean? and lastly, we will apply those concepts to a very cool LED blinking application.</p>



<h2 class="wp-block-heading">LED! What&#8217;s it?</h2>



<hr class="wp-block-separator"/>



<p class="has-regular-font-size wp-block-paragraph">LED stands for &#8220;Light Emitting Diode&#8221; which is a very easy-to-use component, it&#8217; has two terminals, lights when a specific voltage is applied across its terminals. you can use the LED as a light indicator that lights when some event happens and more</p>



<div class="wp-block-image"><figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="600" height="600" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/09469-1_Infrared_LED_850nm.jpg?resize=600%2C600&#038;ssl=1" alt="LED" class="wp-image-764" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/09469-1_Infrared_LED_850nm.jpg?w=600&amp;ssl=1 600w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/09469-1_Infrared_LED_850nm.jpg?resize=100%2C100&amp;ssl=1 100w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/09469-1_Infrared_LED_850nm.jpg?resize=150%2C150&amp;ssl=1 150w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/09469-1_Infrared_LED_850nm.jpg?resize=300%2C300&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/09469-1_Infrared_LED_850nm.jpg?resize=370%2C370&amp;ssl=1 370w" sizes="auto, (max-width: 600px) 100vw, 600px" /><figcaption>LED</figcaption></figure></div>



<p class="has-regular-font-size wp-block-paragraph">Today we will use the most common 5mm LED, there&#8217;s a lot of LED sizes like the 3mm, 5mm, 10mm this number refers to the diameter of the LED, also it has many colors like red, green, yellow, blue,&#8230;</p>



<figure class="wp-block-image"><img data-recalc-dims="1" loading="lazy" decoding="async" width="723" height="326" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/led-polarity.png?resize=723%2C326&#038;ssl=1" alt="LED polarity" class="wp-image-768" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/led-polarity.png?w=723&amp;ssl=1 723w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/led-polarity.png?resize=300%2C135&amp;ssl=1 300w" sizes="auto, (max-width: 723px) 100vw, 723px" /><figcaption>LED polarity</figcaption></figure>



<p class="has-regular-font-size wp-block-paragraph">The LED is polarized, which means that it requires a specific way of wiring to work properly.</p>



<ul class="wp-block-list"><li><strong>Long terminal:</strong> is the positive lead, should get connected to the power source positive lead</li><li><strong>short terminal: </strong>is the negative lead, should get connected to the power source negative lead</li></ul>


<div class="su-box su-box-style-default" id="" style="border-color:#000000;border-radius:3px;max-width:none"><div class="su-box-title" style="background-color:#333333;color:#FFFFFF;border-top-left-radius:1px;border-top-right-radius:1px">Take Care!</div><div class="su-box-content su-u-clearfix su-u-trim" style="border-bottom-left-radius:1px;border-bottom-right-radius:1px">Any LED has a positive and negative terminal and will not light if you wired it in the wrong way around with a power source.</div></div>



<h2 class="wp-block-heading">The Current Limiting Resistor</h2>



<hr class="wp-block-separator"/>



<p class="has-regular-font-size wp-block-paragraph">Resistors all its job in life is to resist the flow of electrons &#8220;current&#8221; in the circuit, you can tell that from its name.</p>



<p class="has-regular-font-size wp-block-paragraph">the higher the value of the resistor the less current will flow through it, and vice versa.</p>


<div class="su-box su-box-style-default" id="" style="border-color:#000000;border-radius:3px;max-width:none"><div class="su-box-title" style="background-color:#333333;color:#FFFFFF;border-top-left-radius:1px;border-top-right-radius:1px">Take Care!</div><div class="su-box-content su-u-clearfix su-u-trim" style="border-bottom-left-radius:1px;border-bottom-right-radius:1px">Actually, we can&#8217;t connect the LED directly with a power source like a battery that will cause some money losses because you will damage your poor LED.</p>
<p>The LED resistance is very low. which will cause a large amount of current to flow through it causes the LED to heat up very quickly and it will get damaged after few seconds.</p>
<p>To solve this problem we are using a current limiting resistor in parallel with the LED to limit or &#8216;choke&#8217; the current flowing through it.</div></div>



<p class="has-regular-font-size wp-block-paragraph">the LED is actually a simple diode which after a certain amount of voltage drop on its terminals will allow all the available current (unlimited) to flow through it which is not a good idea at all. Here comes the current limiting resistor job is to choke that current flow.</p>



<p class="has-regular-font-size wp-block-paragraph">There is a simple formula <strong><em>V = IR</em></strong>,<strong> </strong>where <strong>V</strong> is <strong>voltage</strong>, <strong>I</strong> is <strong>current</strong>, <strong>R</strong> is <strong>resistance</strong>. this formula is called ohm&#8217;s law. We will use this formula to get out the right resistor value, but to get the right resistor value we need to know the right V and I value to put it in the formula to get the right resistor value. To get the V value we need to know two things, the voltage source and the forward voltage (voltage drop) on the LED.</p>



<div class="wp-block-image"><figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="400" height="342" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/LLED_Current_Limiting_Resistor.png?resize=400%2C342&#038;ssl=1" alt="LED &amp; current limiting resistor circuit" class="wp-image-773" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/LLED_Current_Limiting_Resistor.png?w=400&amp;ssl=1 400w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/LLED_Current_Limiting_Resistor.png?resize=300%2C257&amp;ssl=1 300w" sizes="auto, (max-width: 400px) 100vw, 400px" /><figcaption>LED &amp; current limiting resistor circuit</figcaption></figure></div>



<p class="has-regular-font-size wp-block-paragraph">So to Let&#8217;s say that we are using a 5V power source with a red LED connected in series with it. LEDs have a characteristic called forward voltage &#8220;Vf&#8221; which means the amount of voltage that got lost across the LED terminals. when operated at a certain current which is usually 2omA. Vf primarily depends on the LED color, for example, red, orange, the yellow LED Vf is around 1.8V while green, blue, white, and UV LEDs have a Vf of about 3.3 V. So, the forward voltage &#8220;Vf&#8221; on our red LED is 1.8V.</p>



<p class="wp-block-paragraph">so by subtracting the LED forward voltage &#8220;Vf&#8221;<strong>(1.8V)</strong> from the power source voltage<strong>(5V)</strong> you will get the voltage drop across the resistor that we need to calculate its resistance. and that&#8217;s exactly what we need. </p>


<div class="su-note"  style="border-color:#e5e54c;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><div class="su-note-inner su-u-clearfix su-u-trim" style="background-color:#FFFF66;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;">So the V value that we will use in our formula is equal to 5 &#8211; 1.8 = 3.2V</div></div>



<p class="has-regular-font-size wp-block-paragraph">Now, we need to get the I value that we will use in the formula, which is the amount of current that we need it to flow through the LED to light properly without killing it. in any LED datasheet you find a characteristic called <strong>If</strong> or <strong>Imax</strong> which is the maximum continuous current rating this often around 25mA or 30mA, which means the typical current rating is around 20mA</p>


<div class="su-note"  style="border-color:#e5e54c;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><div class="su-note-inner su-u-clearfix su-u-trim" style="background-color:#FFFF66;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;">So, 20mA is the current that we are hoping to get when we are picking the resistor value and that is the current value &#8220;I&#8221; that we will use in the formula.</div></div>


<div class="su-box su-box-style-default" id="" style="border-color:#000000;border-radius:3px;max-width:none"><div class="su-box-title" style="background-color:#333333;color:#FFFFFF;border-top-left-radius:1px;border-top-right-radius:1px">Take Care!</div><div class="su-box-content su-u-clearfix su-u-trim" style="border-bottom-left-radius:1px;border-bottom-right-radius:1px">Actually, LEDs can handle higher current values upto 25mA but it comes at cost of your batteries, also it&#8217;s not very recommended to run the LED near the maximum current rating values because it will decrease it&#8217;s life span and may kill it due to the over heating. I think 20mA is a very good current value.</div></div>



<p class="has-regular-font-size wp-block-paragraph">After getting the formula&#8217;s <strong>V</strong> and <strong>I</strong> values. Now, we are ready to calculate the <strong>resistor</strong> value easily.</p>


<div class="su-note"  style="border-color:#e5e54c;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><div class="su-note-inner su-u-clearfix su-u-trim" style="background-color:#FFFF66;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;">3.2 V / 20 mA = 3.2 V / 0.02 A  =  160 Ω</div></div>



<p class="has-regular-font-size wp-block-paragraph">Now, the 160Ω resistor value will allow 20mA of current to flow through the LED at 5V which is exactly what we need.</p>


<div class="su-box su-box-style-default" id="" style="border-color:#000000;border-radius:3px;max-width:none"><div class="su-box-title" style="background-color:#333333;color:#FFFFFF;border-top-left-radius:1px;border-top-right-radius:1px">Don't have a 160Ω resistor?!</div><div class="su-box-content su-u-clearfix su-u-trim" style="border-bottom-left-radius:1px;border-bottom-right-radius:1px">If you don&#8217;t have a 160Ω resistor, don&#8217;t worry! it&#8217;s not necessarily to use the same exact calculated value. To be in the safe side, we generally select the next higher nearest resistor value.</p>
<p>the higher the value of the resistor you go with the less current will flow through the LED the less LED brightness.<br />
</div></div>



<figure class="wp-block-table"><table><tbody><tr><td><strong>LED Color</strong></td><td><strong>Forward Voltage(Vf)</strong></td><td><strong>Forward Current (If)</strong></td></tr><tr><td>Blue, White, Warm White,<br>Green, Pink, UV</td><td>3.2V &#8211; 3.8V</td><td>20mA &#8211; 30mA</td></tr><tr><td>Red, Yellow, Orange</td><td>1.8V &#8211; 2.2V</td><td>20mA &#8211; 30mA</td></tr></tbody></table></figure>



<h2 class="wp-block-heading">Wiring Diagram</h2>



<hr class="wp-block-separator"/>



<div class="wp-block-image"><figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="332" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Super-Waasa.png?resize=770%2C332&#038;ssl=1" alt="Wiring Diagram" class="wp-image-789" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Super-Waasa.png?w=1170&amp;ssl=1 1170w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Super-Waasa.png?resize=800%2C345&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Super-Waasa.png?resize=300%2C129&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Super-Waasa.png?resize=768%2C331&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Super-Waasa.png?resize=1024%2C442&amp;ssl=1 1024w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption>Wiring Diagram</figcaption></figure></div>



<p class="has-regular-font-size wp-block-paragraph">The wiring is pretty straightforward, we are connecting the long leg of the LED to the Arduino digital pin 7 through a resistor, and the LED short leg to the GND. That&#8217;s it!</p>



<script async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-4043148098486780" crossorigin="anonymous"></script>
<ins class="adsbygoogle" style="display:block; text-align:center;" data-ad-layout="in-article" data-ad-format="fluid" data-ad-client="ca-pub-4043148098486780" data-ad-slot="4972011142"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<h2 class="wp-block-heading">Arduino Code</h2>



<hr class="wp-block-separator"/>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">const int redLED = 7; 			//initialize a constant named "redLED" it's value 7 which refers to the pin number which the red LED is connected to.

void setup()
{
  pinMode(redLED, OUTPUT);	    //set the GPIO pin 7 as an output pin.
}

void loop()
{
  digitalWrite(redLED, HIGH);	//output a logic level "HIGH" which means 5V on the digital pin number 7 to turn the LED ON. 
  delay(1000); 					// Wait for 1000 millisecond(s).
  digitalWrite(redLED, LOW);	//output a logic level "LOW" which means 0V on the digital pin number 7 to turn the LED OFF.
  delay(1000); 					// Wait for 1000 millisecond(s).
}</pre>



<h2 class="wp-block-heading">Code Explanation</h2>



<hr class="wp-block-separator"/>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">const int redLED = 7;</pre>



<p class="has-regular-font-size wp-block-paragraph">initializing a constant named &#8220;redLED&#8221; with a value 7 that refers to the Arduino pin number 7 which the LED is connected to.</p>


<div class="su-note"  style="border-color:#e5e54c;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><div class="su-note-inner su-u-clearfix su-u-trim" style="background-color:#FFFF66;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;">This step is not mandatory, you can use the pin number directly in the code instead of the variable name, but it&#8217;s a good practice to give each pin a name to easily debug and understand your code  </div></div>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">void setup()
{
  pinMode(redLED, OUTPUT);
}</pre>



<p class="has-regular-font-size wp-block-paragraph">the <code>setup()</code> function is called once at the beginning of the program when the sketch starts or after the reset of the board, we use it to initialize variables, constants, take library objects, or to write some actions that we need to execute only once at the beginning of the program.</p>



<p class="has-regular-font-size wp-block-paragraph">inside the <code>setup()</code> function, we set the Arduino pin number <strong>7</strong> as an output pin, which means that we are telling the Arduino board &#8220;Yo, make the pin number 7 ready to write a 5V or 0V output at any time.&#8221;</p>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">void loop()
{
  digitalWrite(redLED, HIGH);
  delay(1000);
  digitalWrite(redLED, LOW);
  delay(1000);
}</pre>



<p class="has-regular-font-size wp-block-paragraph">After creating the <code>setup()</code> function which initializes and sets the initial values, the <code>loop()</code> function does precisely what its name suggests, inside the loop() function you write the main program that you need to get executed over and over again until you force shutdown your Arduino board.</p>



<p class="has-regular-font-size wp-block-paragraph">inside the <code>loop() </code>function, we are telling the Arduino pin number 7 to write a logic level <strong>HIGH</strong> which means output 5V to the LED to light it.</p>



<p class="has-regular-font-size wp-block-paragraph">Then wait 1 sec.</p>



<p class="has-regular-font-size wp-block-paragraph">In the Next line, we are telling the Arduino pin number 7 to write a logic level <strong>LOW</strong> which means output 0V (GND) to the LED to turn it off.</p>



<p class="has-regular-font-size wp-block-paragraph">Then wait another 1 sec. before it returns back to the first line inside the <code>loop()</code> function.</p>



<h2 class="wp-block-heading">Troubleshooting</h2>



<hr class="wp-block-separator"/>



<p class="has-regular-font-size wp-block-paragraph">If your LED doesn&#8217;t take any actions:</p>



<ul class="wp-block-list"><li>Make sure that your LED wiring polarity is correct, LED long lead with the positive and the short one with the negative.</li><li>make sure that you are connecting a current limiting resistor that more than 160Ω</li><li>Make sure that you uploaded the Arduino code to the board Successfully.</li></ul>



<script async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-4043148098486780" crossorigin="anonymous"></script>
<ins class="adsbygoogle" style="display:block; text-align:center;" data-ad-layout="in-article" data-ad-format="fluid" data-ad-client="ca-pub-4043148098486780" data-ad-slot="4972011142"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<h2 class="wp-block-heading">Final</h2>



<hr class="wp-block-separator"/>



<p class="has-regular-font-size wp-block-paragraph">CONGRATS on your very first Arduino project fam! Today we have learned how to connect an LED on the Arduino board, and how to use it. Then we blinked an LED by writing some lines of code.</p>
<p>The post <a href="https://makesomestuff.org/arduino-led-blinking/">Arduino LED Blinking Hello, World</a> appeared first on <a href="https://makesomestuff.org">Make Some Stuff</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://makesomestuff.org/arduino-led-blinking/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">763</post-id>	</item>
		<item>
		<title>IoT Using ESP8266-01 and Arduino</title>
		<link>https://makesomestuff.org/iot-using-esp8266-01-and-arduino/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=iot-using-esp8266-01-and-arduino</link>
					<comments>https://makesomestuff.org/iot-using-esp8266-01-and-arduino/#comments</comments>
		
		<dc:creator><![CDATA[Ahmed Ibrahim]]></dc:creator>
		<pubDate>Fri, 06 Sep 2019 05:24:03 +0000</pubDate>
				<category><![CDATA[Arduino Projects]]></category>
		<category><![CDATA[ESP-01]]></category>
		<category><![CDATA[IoT]]></category>
		<guid isPermaLink="false">https://makesomestuff.org/?p=207</guid>

					<description><![CDATA[<p><a href="https://makesomestuff.org">Make Some Stuff</a><br />
<a href="https://makesomestuff.org/iot-using-esp8266-01-and-arduino/">IoT Using ESP8266-01 and Arduino</a></p>
<p>Ever asked how to control your home appliances from any place in the world? In this step by step tutorial, we will learn how to control things wirelessly through the internet using our Awesome Arduino board. Hardware Used Software Introduction Today, we will build a device that connects to the internet and allow the user [...]</p>
<p>The post <a href="https://makesomestuff.org/iot-using-esp8266-01-and-arduino/">IoT Using ESP8266-01 and Arduino</a> appeared first on <a href="https://makesomestuff.org">Make Some Stuff</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><a href="https://makesomestuff.org">Make Some Stuff</a><br />
<a href="https://makesomestuff.org/iot-using-esp8266-01-and-arduino/">IoT Using ESP8266-01 and Arduino</a></p>

<p class="has-text-align-left has-regular-font-size wp-block-paragraph">Ever asked how to control your home appliances from any place in the world? In this step by step tutorial, we will learn how to control things wirelessly through the internet using our Awesome Arduino board.</p>



<figure class="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube aligncenter wp-embed-aspect-16-9 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
<iframe loading="lazy" title="IoT Using Arduino And ESP8266-01 Module" width="770" height="433" src="https://www.youtube.com/embed/eKL7U6VFYIw?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
</div><figcaption class="wp-element-caption">Cool, Ha!</figcaption></figure>



<script async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-4043148098486780" crossorigin="anonymous"></script>
<ins class="adsbygoogle" style="display:block; text-align:center;" data-ad-layout="in-article" data-ad-format="fluid" data-ad-client="ca-pub-4043148098486780" data-ad-slot="9966560791"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<h2 class="wp-block-heading">Hardware</h2>



<hr class="wp-block-separator has-css-opacity is-style-wide"/>



<ol class="wp-block-list">
<li><a href="https://www.ebay.com/itm/Nano-V3-0-Mini-USB-ATmega328-5V-16MHz-Micro-Controller-CH340G-Driver-For-Arduino/273743114225?hash=item3fbc5c6ff1:g:Hw4AAOSw5LZcfJzv">Arduino Nano</a></li>



<li><a href="https://www.ebay.com/itm/ESP8266-01-Serial-WIFI-Wireless-Transceiver-Module-Send-Receive-LWIP-AP-STA/112016580768?epid=2278627962&amp;hash=item1a14b560a0:g:hXUAAOSwkvFae8Mq">ESP8266-01</a></li>



<li><a href="https://www.ebay.com/itm/5V-Two-2-Channel-Relay-Module-With-optocoupler-For-PIC-AVR-DSP-ARM-Arduino/181026509345?hash=item2a26055221:g:e1IAAOSw2QxcfybT">Two-channel Relay</a></li>



<li>any AC load.</li>



<li><a href="https://www.ebay.com/itm/New-200Pcs-3mm-5mm-LED-Light-White-Yellow-Red-Blue-Green-Assortment-Diodes-Kit/222785956373?epid=2133731918&amp;hash=item33df13ea15:g:KDsAAOSwEVZaUaux">Two LEDs.</a></li>



<li><a href="https://www.ebay.com/itm/MB-102-MB102-Solderless-Breadboard-830-Points-PCB-BreadBoard/322666932715?hash=item4b2072a9eb:g:6H8AAOSwoA9ZhEk0">Breadboard.</a></li>



<li><a href="https://www.ebay.com/itm/100Pcs-1-4W-0-25W-Carbon-Film-Resistor-5-1K-910K-Ohm-1-K-910-K/192128181191?hash=item2cbbbb63c7:m:mb9RImDVMDlqhR8yC4ITlsA">Bunch of resistors</a> (1K, 2.2K).</li>



<li><a href="https://www.ebay.com/itm/65Pcs-Solderless-Flexible-Breadboard-Male-to-Male-Jumper-Cable-Wires-For-Arduino/122354484494?hash=item1c7ce5450e:g:x9cAAOSwBnZbFjO1">Bunch of jumpers</a> (Male-female, male-male).</li>
</ol>



<h2 class="wp-block-heading">Used Software</h2>



<hr class="wp-block-separator has-css-opacity is-style-wide"/>



<ol class="wp-block-list">
<li><a href="https://www.arduino.cc/en/main/software">Arduino IDE</a>.</li>



<li><a href="https://code.visualstudio.com/download">Visual Studio Code</a> (optional).</li>



<li><a href="https://www.autodesk.com/products/eagle/free-download">Autodesk Eagle</a> (Optional).</li>



<li>Any web Browser.</li>
</ol>



<h2 class="wp-block-heading">Introduction</h2>



<hr class="wp-block-separator has-css-opacity is-style-wide"/>



<p class="has-regular-font-size wp-block-paragraph">Today, we will build a device that connects to the internet and allow the user to control his/her home remotely over wifi. we will use the Arduino board(any model will do the job well) with the ESP8266-01 wifi module to make this device. Let&#8217;s get started!</p>



<script async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-4043148098486780" crossorigin="anonymous"></script>
<ins class="adsbygoogle" style="display:block; text-align:center;" data-ad-layout="in-article" data-ad-format="fluid" data-ad-client="ca-pub-4043148098486780" data-ad-slot="9966560791"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<h4 class="wp-block-heading">What&#8217;s a smart home?</h4>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p class="wp-block-paragraph">Smart home technology uses devices such as linking sensors, features and other appliances connected to the internet of things (IoT) that can be remotely monitored, controlled or accessed and provide services that respond to the needs of the users.</p>
<cite>Wikipedia</cite></blockquote>



<h2 class="wp-block-heading">Working Scenario</h2>



<hr class="wp-block-separator has-css-opacity is-style-wide"/>



<h4 class="wp-block-heading">The Control Panel</h4>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="418" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/finla-web-app.jpg?resize=770%2C418&#038;ssl=1" alt="the final web page" class="wp-image-214" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/finla-web-app.jpg?w=1366&amp;ssl=1 1366w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/finla-web-app.jpg?resize=800%2C434&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/finla-web-app.jpg?resize=300%2C163&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/finla-web-app.jpg?resize=768%2C417&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/finla-web-app.jpg?resize=1024%2C555&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/finla-web-app.jpg?resize=1026%2C557&amp;ssl=1 1026w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/finla-web-app.jpg?resize=675%2C366&amp;ssl=1 675w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">the final web page</figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph">We will build a simple web page that will work as a control panel for the user allows him to control any home appliance connected to our system. To build the web page we will use:</p>



<ul class="wp-block-list">
<li>HTML</li>



<li>CSS</li>



<li>Jquery</li>
</ul>



<h4 class="wp-block-heading">The Embedded Hardware</h4>



<p class="has-regular-font-size wp-block-paragraph">the web page sends some orders to the ESP8266-01 which is working as a web server connected to the Arduino board. And according to the incoming data, the Arduino board will take some actions like turning on the bulb, turning off the TV and in this part, we will use:</p>



<ul class="wp-block-list">
<li>Arduino</li>



<li>ESP8266-01</li>
</ul>



<h2 class="wp-block-heading">Getting Started with the ESP8266-01</h2>



<hr class="wp-block-separator has-css-opacity is-style-wide"/>



<p class="has-regular-font-size wp-block-paragraph">As we stated before, we need our Arduino board to get connected to the Internet but the Arduino Nano the version which we are using today doesn&#8217;t have that feature. So, we will use the ESP8266-01 wifi module to add the wifi feature to our tiny Arduino board.</p>



<p class="has-regular-font-size wp-block-paragraph">there are a lot of ESP wifi modules models out there, which one should I choose?! Well, almost all the ESP family wifi modules out there will do the job well but each one has its own features and specifications. I encourage you to look at each one specifications and features to choose the most suitable one for your needs.</p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="433" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/ESP8266_Versions.png?resize=770%2C433&#038;ssl=1" alt="the ESP Family" class="wp-image-219" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/ESP8266_Versions.png?w=1024&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/ESP8266_Versions.png?resize=800%2C450&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/ESP8266_Versions.png?resize=300%2C169&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/ESP8266_Versions.png?resize=768%2C432&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/ESP8266_Versions.png?resize=675%2C380&amp;ssl=1 675w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">the ESP Family</figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph">According to my needs, I found the ESP8266-01 is the most suitable one and that&#8217;s for many reasons. It&#8217;s very famous in the makers community. As a result, it got a very solid online community that you can find an answer to almost any question or problem you face with this awesome small module. Also, its price is very cheap(around 1.5$). Also, it&#8217;s very easy to use with the Arduino board since its a Serial wifi module it can communicate with the Arduino board over the serial communication. It has a built-in Microcontroller which means that you can use it as a standalone microcontroller and wifi module in one combo which is super cool. It has built-in two GPIOs. Only with 1.5$, you will get all of these features which is super cool, actually.<br> let&#8217;s get a closer look at this module.</p>



<h2 class="wp-block-heading">ESP8266-01 Pinout</h2>



<hr class="wp-block-separator has-css-opacity is-style-wide"/>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="499" height="368" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/ESP8266-PINOUT.png?resize=499%2C368&#038;ssl=1" alt="ESP8266-01 module" class="wp-image-228" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/ESP8266-PINOUT.png?w=499&amp;ssl=1 499w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/ESP8266-PINOUT.png?resize=300%2C221&amp;ssl=1 300w" sizes="auto, (max-width: 499px) 100vw, 499px" /><figcaption class="wp-element-caption">ESP8266-01 module</figcaption></figure>
</div>


<ul class="wp-block-list">
<li><strong>VCC</strong>: connect to +3.3V power source. <em>don&#8217;t connect it with a 5V source it will get damaged</em>.</li>



<li><strong>GND:</strong> -ve pin, connect it to the ground of your circuit.</li>



<li><strong>CH_PD: </strong>chip enables pin &#8211; Active HIGH. connect it to a logic value HIGH to allow the module to boot up.</li>



<li><strong>RST:</strong> Chip Reset pin &#8211; Active LOW, when it pulled LOW it Resets the module.</li>



<li><strong>GPIO0, GPIO2: </strong>General purpose input/output pins.</li>



<li><strong>Tx: </strong>connect to the Rx of the microcontroller(Arduino) to establish serial communication.</li>



<li><strong>Rx: </strong>connect to the Tx of the microcontroller(Arduino) to establish serial communication.</li>
</ul>



<h2 class="wp-block-heading">ESP8266-01 Configuration</h2>



<hr class="wp-block-separator has-css-opacity is-style-wide"/>



<p class="has-regular-font-size wp-block-paragraph">As we stated before the ESP8266-01 module communicates with the Arduino board over the Serial communication, which means that we need to connect it with the Arduino&#8217;s Serial pins 0, 1(Tx, Rx). But the problem here is that these pins will be busy because we will use the Arduino Serial monitor alongside the ESP8266-01 for debugging purposes. So, we need to find another two Serial communication pins to use them with the ESP8266-01. <br><br>Fortunately, Arduino made this easy. There&#8217;s a library called &#8220;SoftwareSerial&#8221; which was developed to allow serial communication on other digital pins of the Arduino, using software to replicate the functionality. For example, by using this library I can set the pins 2, 3(SoftwareSerial) as Rx and Tx alongside the pins 0, 1(Hardware Serial).</p>



<p class="has-regular-font-size wp-block-paragraph">&#8220;SoftwareSerial&#8221; library works great as long as the transmission speed is less than 19,200 baud. But, there&#8217;s a small problem here! the ESP8266-01 wifi module comes from the factory programmed to communicate at speed 115,200 baud which is somehow hard at the &#8220;SoftwareSerial&#8221; library to communicate at. So, we need to reprogram our wifi module to set the communication speed to 9600 baud which works pretty good with the &#8220;SoftwareSerial&#8221; library. To do that we will use some &#8220;AT Commands&#8221;.</p>



<h2 class="wp-block-heading">Changing the ESP8266-01 communication speed</h2>



<hr class="wp-block-separator has-css-opacity"/>



<h4 class="wp-block-heading">First step: Upload an empty program to the Arduino board</h4>



<figure class="wp-block-image"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="417" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/bareMinimun.jpg?resize=770%2C417&#038;ssl=1" alt="Upload an Empty program" class="wp-image-244" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/bareMinimun.jpg?w=1366&amp;ssl=1 1366w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/bareMinimun.jpg?resize=800%2C433&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/bareMinimun.jpg?resize=300%2C162&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/bareMinimun.jpg?resize=768%2C415&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/bareMinimun.jpg?resize=1024%2C554&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/bareMinimun.jpg?resize=1026%2C555&amp;ssl=1 1026w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/bareMinimun.jpg?resize=675%2C365&amp;ssl=1 675w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">Upload an Empty program</figcaption></figure>



<p class="has-regular-font-size wp-block-paragraph">At this step, we are uploading an empty code to the Arduino board. Just to be sure that there&#8217;s nothing is Executing in the background by the Arduino board.</p>



<h4 class="wp-block-heading">Second Step: Wiring the ESP8266-01 with the Arduino board</h4>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="786" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/ReprogramModuleNano.png?resize=770%2C786&#038;ssl=1" alt="Reconfigurations Wiring" class="wp-image-249" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/ReprogramModuleNano.png?w=1029&amp;ssl=1 1029w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/ReprogramModuleNano.png?resize=800%2C816&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/ReprogramModuleNano.png?resize=294%2C300&amp;ssl=1 294w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/ReprogramModuleNano.png?resize=768%2C784&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/ReprogramModuleNano.png?resize=1004%2C1024&amp;ssl=1 1004w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/ReprogramModuleNano.png?resize=1026%2C1047&amp;ssl=1 1026w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/ReprogramModuleNano.png?resize=675%2C689&amp;ssl=1 675w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">Reconfigurations Wiring</figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph">To Reconfigure the ESP8266-01 and change the communication speed(baud rate) we use the AT-commands. Simply, AT commands are some instructions used to control modems, mobile phones, Bluetooth modules, wifi modules, GSM Modules, &#8230; with these commands we can get basic information about our mobile phone or GSM Modules like the name of the manufacturer, model number, IMEI and so on.</p>



<p class="has-regular-font-size wp-block-paragraph">&#8220;AT&#8221; is an abbreviation for &#8220;ATtention&#8221; and it&#8217;s called AT-commands because every command starts with &#8220;AT&#8221;. the &#8220;AT&#8221; prefix is not a part of the commands itself it just tells the module the start of the commands.</p>



<h2 class="wp-block-heading">Some Important AT Commands</h2>



<hr class="wp-block-separator has-css-opacity"/>



<figure class="wp-block-table aligncenter is-style-regular"><table><tbody><tr><td>N<strong>o.</strong></td><td><strong>Command</strong></td><td><strong>Example</strong></td><td><strong>Parameters</strong></td><td><strong>Description</strong></td><td><strong>returns</strong></td></tr><tr><td>1</td><td>AT</td><td>AT</td><td>Nothing</td><td>Check if the module <br>is working properly.</td><td>OK</td></tr><tr><td>2</td><td>AT+RST</td><td>AT+RST</td><td>Nothing</td><td>Resets the Module.</td><td>OK</td></tr><tr><td>3</td><td>AT+CWMODE=&lt;MODE&gt;</td><td>AT+CWMODE=1</td><td>1 = Station<br>2 = AP<br>3 = Both</td><td>sets the Wifi mode</td><td>OK</td></tr><tr><td>4</td><td>AT+CIOBAUD=&lt;baud&gt;<br><strong>OR</strong><br>AT+UART_DEF=&lt;baud&gt;,8,1,0,0</td><td>AT+CIOBAUD=9600<br><strong>OR</strong><br>AT+UART_DEF=9600,8,1,0,0</td><td>baud rate</td><td>changes the module<br>communication <br>speed.</td><td>OK</td></tr><tr><td>5</td><td>AT+CWJAP=<br>&lt;SSID&gt;,&lt;PASS&gt;</td><td>AT+CWJAP=&#8221;meme&#8221;, &#8220;69696969696&#8221;</td><td>SSID = Wifi Network name<br>PASS = Wifi <br>Password</td><td>Connects<br>to a Wifi Network</td><td>WIFI CONNECTED<br>WIFI GOT IP</td></tr><tr><td>6</td><td>AT+CIFSR</td><td>AT+CIFSR</td><td>Nothing</td><td>Tells you the <br>module IP address<br>and the MAC Address</td><td>IP Address<br>Mac Address</td></tr><tr><td>7</td><td>AT+CIPSERVER=&lt;MODE&gt;,&lt;PORT&gt;</td><td>AT+CIPSERVER=1,80</td><td>MODE = 0 to close the server, <br>1 to open the server.<br>PORT = port number</td><td>Sets the module as a server.</td><td>OK</td></tr></tbody></table></figure>



<p class="has-regular-font-size wp-block-paragraph">Command number &#8220;4&#8221; depends on your ESP8266-01 firmware version, if this command doesn&#8217;t work with you <code>AT+CIOBAUD=&lt;baud&gt;</code> Try this one <code>AT+UART_DEF=&lt;baud&gt;,8,1,0,0</code> </p>



<h4 class="wp-block-heading">Step 1: Open the Serial Monitor</h4>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="740" height="185" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/SM.png?resize=740%2C185&#038;ssl=1" alt="Arduino IDE Serial monitor" class="wp-image-132" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/SM.png?w=740&amp;ssl=1 740w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/SM.png?resize=300%2C75&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/SM.png?resize=675%2C169&amp;ssl=1 675w" sizes="auto, (max-width: 740px) 100vw, 740px" /><figcaption class="wp-element-caption">Arduino IDE Serial monitor</figcaption></figure>
</div>


<h4 class="wp-block-heading">Step 2: Set the Communication speed to 115,200 baud</h4>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="682" height="41" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/115200.jpg?resize=682%2C41&#038;ssl=1" alt="Communication Speed" class="wp-image-274" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/115200.jpg?w=682&amp;ssl=1 682w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/115200.jpg?resize=300%2C18&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/115200.jpg?resize=675%2C41&amp;ssl=1 675w" sizes="auto, (max-width: 682px) 100vw, 682px" /><figcaption class="wp-element-caption">Communication Speed</figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph">As we stated before, the ESP comes from the manufacturer programmed to communicate at speed 115,200 baud. So we need to set the Arduino communication speed to <strong>115,200</strong> too for the first time only then we will change that later.<br><br>Also, you should select <strong>&#8220;Both NL &amp; CR&#8221;</strong>.</p>



<h4 class="wp-block-heading">Step 3: Send &#8220;AT&#8221; and wait for the response to be sure that the ESP module is hearing you.</h4>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="680" height="225" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/AT-OK.jpg?resize=680%2C225&#038;ssl=1" alt="send just AT" class="wp-image-275" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/AT-OK.jpg?w=680&amp;ssl=1 680w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/AT-OK.jpg?resize=300%2C99&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/AT-OK.jpg?resize=675%2C223&amp;ssl=1 675w" sizes="auto, (max-width: 680px) 100vw, 680px" /><figcaption class="wp-element-caption">send just AT</figcaption></figure>
</div>


<h4 class="wp-block-heading">Step 4: Now, change the ESP8266-01 communication speed</h4>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="99" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-27-at-10.28.11-PM.png?resize=770%2C99&#038;ssl=1" alt="AT Response" class="wp-image-280" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-27-at-10.28.11-PM.png?w=2048&amp;ssl=1 2048w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-27-at-10.28.11-PM.png?resize=800%2C102&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-27-at-10.28.11-PM.png?resize=300%2C38&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-27-at-10.28.11-PM.png?resize=768%2C98&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-27-at-10.28.11-PM.png?resize=1024%2C131&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-27-at-10.28.11-PM.png?resize=1026%2C131&amp;ssl=1 1026w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-27-at-10.28.11-PM.png?resize=675%2C86&amp;ssl=1 675w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-27-at-10.28.11-PM.png?w=1540&amp;ssl=1 1540w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">AT Response</figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph">My ESP8266-01 module loaded firmware is 1.6. and this command <code>AT+UART_DEF=&lt;baud&gt;,8,1,0,0</code>  works well for me. If it doesn&#8217;t work with you, try this <code>AT+CIOBAUD=&lt;baud&gt;</code> .<br><br>If it responds with &#8220;OK&#8221; now your ESP module communication baud rate changed from 115,200 baud to 9600 baud. CONGRATS! </p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="155" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-27-at-10.28.18-PM.png?resize=770%2C155&#038;ssl=1" alt="Responds with &quot;OK&quot;" class="wp-image-284" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-27-at-10.28.18-PM.png?w=2048&amp;ssl=1 2048w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-27-at-10.28.18-PM.png?resize=800%2C161&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-27-at-10.28.18-PM.png?resize=300%2C60&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-27-at-10.28.18-PM.png?resize=768%2C154&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-27-at-10.28.18-PM.png?resize=1024%2C206&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-27-at-10.28.18-PM.png?resize=1026%2C206&amp;ssl=1 1026w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-27-at-10.28.18-PM.png?resize=675%2C136&amp;ssl=1 675w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-27-at-10.28.18-PM.png?w=1540&amp;ssl=1 1540w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">Responds with &#8220;OK&#8221;</figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph">Let&#8217;s change the Serial monitor communication speed back to 9600 and send &#8220;AT&#8221; again to see if the ESP module can hear us at the new Speed(9600) or not.</p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="300" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-27-at-10.40.43-PM.png?resize=770%2C300&#038;ssl=1" alt="Change comm. speed" class="wp-image-286" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-27-at-10.40.43-PM.png?w=2048&amp;ssl=1 2048w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-27-at-10.40.43-PM.png?resize=800%2C311&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-27-at-10.40.43-PM.png?resize=300%2C117&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-27-at-10.40.43-PM.png?resize=768%2C299&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-27-at-10.40.43-PM.png?resize=1024%2C398&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-27-at-10.40.43-PM.png?resize=1026%2C399&amp;ssl=1 1026w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-27-at-10.40.43-PM.png?resize=675%2C263&amp;ssl=1 675w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-27-at-10.40.43-PM.png?w=1540&amp;ssl=1 1540w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">Change comm. speed</figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph">LOOK! it&#8217;s working. the ESP8266-01 now can communicate with the Arduino board at 9600 baud rate instead of 115,200 baud rate. <br><br><strong>Now, let&#8217;s try to connect with the Wifi network</strong></p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="673" height="75" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/AT-commands.jpg?resize=673%2C75&#038;ssl=1" alt="Connecting to the Wifi Network" class="wp-image-288" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/AT-commands.jpg?w=673&amp;ssl=1 673w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/AT-commands.jpg?resize=300%2C33&amp;ssl=1 300w" sizes="auto, (max-width: 673px) 100vw, 673px" /><figcaption class="wp-element-caption">Connecting to the Wifi Network</figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph">Once you press enter, the ESP8266-01 will search for this network and connect with it. If the process succeeds it will return this <br><code>WIFI CONNECTED</code><br><code>WIFI GOT IP</code><br><br>At this point, we successfully changed the ESP8266-01 communication speed from 115,200 baud to 9600 baud. Now, we need to build the control panel(Web Page) which the user will use to control his home appliances. So, let&#8217;s build it!</p>



<h2 class="wp-block-heading">What&#8217;s the Internet?</h2>



<hr class="wp-block-separator has-css-opacity"/>



<p class="has-regular-font-size wp-block-paragraph">Actually, the internet is a wire buried under the ground it can be fiber optics, copper, or even a satellite but the internet is simply a wire.<br>Any two computers connected to that wire can communicate. If the computer is connected directly to that wire it&#8217;s called a server and if it is not connected directly to that wire it&#8217;s called a <strong>client</strong>.</p>



<p class="has-regular-font-size wp-block-paragraph"><br><strong>Server:</strong> is a special computer that runs a specific Operating system like Apache, this special computer saves some web pages, files, databases on its disk drive. any server connected to the internet has a unique IP Address like  <strong>172.217.171.228</strong>, the IP address is just like a phone number that helps people to find each other easily. Since that IP Address is not very easy for humans to remember. So, we just gave it a name like: <strong>google.com</strong>(Domain name).</p>



<p class="has-regular-font-size wp-block-paragraph"><strong>Client:</strong> it&#8217;s a computer like what you and I are using every day, it&#8217;s connected indirectly to the internet through an internet service provider(ISP) and it also has a unique IP address. </p>



<h2 class="wp-block-heading">Working Scenario</h2>



<hr class="wp-block-separator has-css-opacity"/>



<p class="has-regular-font-size wp-block-paragraph">Simply, it starts with a request sent from a web browser(Client) like google chrome, firefox and ends with the response received from the webserver.<br><br>You entered the website URL makesomestuff.org in a browser from a computer(client), then this browser sends a request to the webserver that hosts the website, the webserver then returns a response containing HTML page or any other document format to the browser to display it.</p>



<script async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-4043148098486780" crossorigin="anonymous"></script>
<ins class="adsbygoogle" style="display:block; text-align:center;" data-ad-layout="in-article" data-ad-format="fluid" data-ad-client="ca-pub-4043148098486780" data-ad-slot="9966560791"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-regular-font-size wp-block-paragraph">Exactly, that&#8217;s what we need to do today in our project. We need to send a request from the web browser(Client) to the ESP8266-01(Webserver) which both of them are connected to the same local network. This request contains some data which tells the Arduino what to do turn on or off a light bulb. So, let&#8217;s build the web page!</p>



<h2 class="wp-block-heading">Building The Web Page</h2>



<hr class="wp-block-separator has-css-opacity"/>



<p class="has-regular-font-size wp-block-paragraph">To build our web page we have to deal with HTML, CSS, Javascript. if you never heard about these names before, don&#8217;t worry I got you.<br><br><strong>HTML:</strong> Stands for &#8220;HyperText markup language&#8221;  we use it to build any web page main structure. Like adding some buttons, images, paragraphs, headers, tables, and many more elements.  it consists of a series of elements that tell the browser how to display the web page content. these elements represent by something called tags.</p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="125" height="300" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-04-at-6.04.48-PM.png?resize=125%2C300&#038;ssl=1" alt="HTML" class="wp-image-391" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-04-at-6.04.48-PM.png?resize=125%2C300&amp;ssl=1 125w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-04-at-6.04.48-PM.png?w=270&amp;ssl=1 270w" sizes="auto, (max-width: 125px) 100vw, 125px" /><figcaption class="wp-element-caption">HTML</figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph"><strong>CSS:</strong> It stands for cascading style sheet. After building the web page main structure, you need to make this structure looks nice here comes CSS to make some styling. it&#8217;s a language that describes the style of an HTML element. it consists of some selectors and deceleration blocks.</p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="105" height="300" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-04-at-6.04.53-PM.png?resize=105%2C300&#038;ssl=1" alt="CSS" class="wp-image-393" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-04-at-6.04.53-PM.png?resize=105%2C300&amp;ssl=1 105w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-04-at-6.04.53-PM.png?w=224&amp;ssl=1 224w" sizes="auto, (max-width: 105px) 100vw, 105px" /><figcaption class="wp-element-caption">CSS</figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph"><strong>Javascript:</strong> it&#8217;s a programming language that we will use to make the web page more interactive like adding some animations, maps and it allows us to make some complex things on the web page. Mainly, we will use it today to send an HTTP request from the client(web browser) to the webserver(ESP8266-01) to take some actions like turning on or off a light bulb.</p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="109" height="300" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-04-at-6.04.58-PM.png?resize=109%2C300&#038;ssl=1" alt="JS" class="wp-image-394" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-04-at-6.04.58-PM.png?resize=109%2C300&amp;ssl=1 109w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-04-at-6.04.58-PM.png?w=234&amp;ssl=1 234w" sizes="auto, (max-width: 109px) 100vw, 109px" /><figcaption class="wp-element-caption">JS</figcaption></figure>
</div>


<h2 class="wp-block-heading">Build The Web Page Structure</h2>



<hr class="wp-block-separator has-css-opacity"/>



<p class="has-regular-font-size wp-block-paragraph"><strong><em>To easily understand the upcoming explanation, I recommend Reading this cool </em></strong><a href="https://www.w3schools.com/html/html_intro.asp"><strong><em>HTML intro</em></strong></a><strong><em>.</em></strong></p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="417" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/no-css.jpg?resize=770%2C417&#038;ssl=1" alt="HTML Web Page" class="wp-image-300" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/no-css.jpg?w=1366&amp;ssl=1 1366w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/no-css.jpg?resize=800%2C433&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/no-css.jpg?resize=300%2C162&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/no-css.jpg?resize=768%2C415&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/no-css.jpg?resize=1024%2C554&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/no-css.jpg?resize=1026%2C555&amp;ssl=1 1026w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/no-css.jpg?resize=675%2C365&amp;ssl=1 675w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">HTML Web Page</figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph">As we see our control panel is very simple, it contains two headers each one has a different size, one image, and two buttons one for turning on an LED and the second one for turning it off.</p>



<h4 class="wp-block-heading">Code</h4>



<pre class="EnlighterJSRAW" data-enlighter-language="html" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">&lt;!DOCTYPE html>
&lt;html>

&lt;head>
    &lt;title>Smart Home System&lt;/title>
&lt;/head>

&lt;body>

    &lt;h1> Smart Home Control Panel&lt;/h1>                               
    &lt;h4>Sorry But I'm a Meme Addict!&lt;/h4>
    &lt;img src="dogMeme.jpg" width="400px" height="400px">
    &lt;br>
    &lt;button id="111" class="button">LAMP ON&lt;/button>
    &lt;br>
    &lt;button id="110" class="button">LAMP OFF&lt;/button>
&lt;/body>

&lt;/html></pre>



<h4 class="wp-block-heading">Code Explanation</h4>



<ul class="wp-block-list">
<li><strong>&lt;!DOCTYPE html>:</strong> declaration defines that this document is an HMTL5 document.</li>



<li><strong>&lt;html>:</strong> the root element of an HTML page.</li>



<li><strong>&lt;head>:</strong> contains meta-information about the page.</li>



<li><strong>&lt;title>:</strong> specifies the title of the document. this title appears on the web page browser tab.</li>



<li><strong>&lt;body>:</strong> contains the visible web page content.</li>



<li><strong>&lt;h1>: </strong> defines a large element.</li>



<li><strong>&lt;h4>:</strong> defines a smaller header. when the header value decreases the font decreases.</li>



<li><strong>&lt;img>:</strong> adds an image to the web page. the image that you want to display should be in the same project folder.</li>



<li><strong>&lt;br>:</strong> advance the cursor to a new line.</li>



<li><strong>&lt;button>:</strong> adds a button to the page content.</li>
</ul>



<p class="has-regular-font-size wp-block-paragraph">Each button is our web page has very important two attributes the <code>id</code>, and the <code>class</code> attributes. we will talk about why we assigned these two values to the buttons in the Jquery code explanation.</p>



<h2 class="wp-block-heading">Styling The Web Page</h2>



<hr class="wp-block-separator has-css-opacity"/>



<p class="has-regular-font-size wp-block-paragraph"><strong><em>To easily understand the upcoming explanation, I recommend Reading this cool <a href="https://www.w3schools.com/css/css_intro.asp">CSS intro</a>.</em></strong></p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="401" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/web-app.jpg?resize=770%2C401&#038;ssl=1" alt="" class="wp-image-307" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/web-app.jpg?w=1366&amp;ssl=1 1366w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/web-app.jpg?resize=800%2C416&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/web-app.jpg?resize=300%2C156&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/web-app.jpg?resize=768%2C400&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/web-app.jpg?resize=1024%2C533&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/web-app.jpg?resize=1026%2C534&amp;ssl=1 1026w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/web-app.jpg?resize=675%2C351&amp;ssl=1 675w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">CSS Added</figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph">Now, the web page looks nicer (NOT TOO MUCH xD) we gave it a cool green background color, we make the page content centered aligned, and we change the headers font color and font family which made the web page more alive. We used CSS to do all of this styling stuff.</p>



<h4 class="wp-block-heading">Code</h4>



<pre class="EnlighterJSRAW" data-enlighter-language="html" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">&lt;!DOCTYPE html>
&lt;html>

&lt;head>
    &lt;title>Smart Home System&lt;/title>
&lt;/head>

&lt;body style="background-color: seagreen; color: seashell; text-align: center;">

    &lt;h1> Smart Home Control Panel&lt;/h1>                               
    &lt;h4>Sorry But I'm a Meme Addict!&lt;/h4>
    &lt;img src="dogMeme.jpg" width="400px" height="400px">
    &lt;br>
    &lt;button style="margin: 10px;" id="111" class="button">LAMP ON&lt;/button>
    &lt;br>
    &lt;button style="margin:10px;" id="110" class="button"> LAMP OFF&lt;/button>
&lt;/body>

&lt;/html></pre>



<h4 class="wp-block-heading">Code Explanation</h4>



<p class="has-regular-font-size wp-block-paragraph">We added some few lines of code to make our web page looks nicer. We added <code>style="background-color: seagreen; color: seashell; text-align: center;"</code> inside the <em><strong>body</strong></em><strong> tag </strong>to make all the web page content<strong> in the center of the page</strong> and to <strong>set the background color to seagreen</strong> also to <strong>set the font color to seashell</strong>.<br><br>Also, we added <code>style="margin: 10px;"</code> inside the two <strong>button tags</strong> to set a margin of 10 pixels around the four sides of each button.</p>



<h2 class="wp-block-heading">Sending a Request To The Webserver</h2>



<hr class="wp-block-separator has-css-opacity"/>



<p class="has-regular-font-size wp-block-paragraph"><strong><em>To easily understand the upcoming explanation, I recommend Reading this cool <a href="https://www.w3schools.com/jquery/default.asp">Jquery intro</a>.</em></strong></p>



<p class="has-regular-font-size wp-block-paragraph">Now, after building our web page structure and styling it we need to add some functionality to the two buttons which we added earlier in the web page. we need when the user clicks the &#8220;LAMP ON&#8221; button his/her browser sends a request contains some unique data to the server(ESP8266-01) this unique data tells the Arduino to turn on the lamp. The same thing with the second button &#8220;LAMP OFF&#8221; when the user clicks it, the browser will send a request contains some unique data to the server(ESP8266-01) this unique data tells the Arduino to turn off the lamp. Let&#8217;s take a look at the code.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="html" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">&lt;!DOCTYPE html>
&lt;html>

&lt;head>
    &lt;title>Smart Home System&lt;/title>
    &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js">&lt;/script>
&lt;/head>

&lt;body style="background-color: seagreen; color: seashell; text-align: center;">

    &lt;h1> Smart Home Control Panel&lt;/h1>                               
    &lt;h4>Sorry But I'm a Meme Addict!&lt;/h4>
    &lt;img src="dogMeme.jpg" width="400px" height="400px">
    &lt;br>
    &lt;button style="margin: 10px;" id="111" class="button">LAMP ON&lt;/button>
    &lt;br>
    &lt;button style="margin:10px;" id="110" class="button"> LAMP OFF&lt;/button>
        &lt;script>                                                        //starting Javascript.
        $(".button").click(function () {                            //if any button from the ".button" class is clicked
            var p = $(this).attr('id');                             //get this button id and store it inside the "p" variable.
            pin: p                                                  //a dictionary contains the button id to get sent to the web server.
            $.get("http://192.168.1.4:80/", {                      //then send a get request to the web server"http://192.168.1.4:80/" (":80" means port number 80) with some data in a form of dictionary {pin: p} which is the butoon id. IMPORTANT NOTE: DON'T FORGET TO CHANGE THE IP ADDRESS WITH YOUR ESP8266 NEW IP ADDRESS.
            pin: p
            });
        });
    &lt;/script>
&lt;/body>

&lt;/html></pre>



<h4 class="wp-block-heading">Code Explanation</h4>



<p class="has-regular-font-size wp-block-paragraph">First Things First, we need to import the Jquery library in our code. So, we added this line in the <strong><em>head tag</em></strong>.<br><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"&gt;&lt;/script&gt;</code><br><br>All the magic happens in this interesting part.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="js" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">    &lt;script>                                                        //starting Javascript.
        $(".button").click(function () {                            //if any button from the ".button" class is clicked
            var p = $(this).attr('id');                             //get this button id and store it inside the "p" variable.
            pin: p                                                  //a dictionary contains the button id to get sent to the web server.
            $.get("http://192.168.1.4:80/", {                      //then send a get request to the web server"http://192.168.1.4:80/" (":80" means port number 80) with some data in a form of dictionary {pin: p} which is the butoon id. IMPORTANT NOTE: DON'T FORGET TO CHANGE THE IP ADDRESS WITH YOUR ESP8266 NEW IP ADDRESS.
            pin: p
            });
        });
    &lt;/script></pre>



<p class="has-regular-font-size wp-block-paragraph"><code>$(".button").click(function () {</code><br>When the user clicks on any button associated with the class <strong>&#8220;button&#8221;</strong>, trigger the following function.<br><br><code>var p = $(this).attr('id');</code><br>Get the value of the clicked button attribute <strong>&#8220;id&#8221;</strong>  and store it inside the <strong>&#8220;p&#8221;</strong> variable.<br><br><code>pin: p</code><br>Put the variable &#8220;p&#8221; value in a dictionary (key-value) it&#8217;s key is &#8220;pin&#8221; and the value is &#8220;p&#8221; variable value.<br><br><code>$.get("http://172.20.10.11:80/", { pin: p });});</code><br>Then, send a GET request to the webserver which it&#8217;s IP address is &#8220;172.20.10.11&#8221;. this <strong>GET</strong> request contains the value of the attribute <strong>id</strong> pressed button.</p>



<p class="has-regular-font-size wp-block-paragraph">In case the user pressed the &#8220;LAMP ON&#8221; button this id value will be 111, so the GET request header will contain some data like this <strong>pin=111</strong>. look at the next figure!</p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="168" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/http-header.png?resize=770%2C168&#038;ssl=1" alt="HTTP request header" class="wp-image-319" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/http-header.png?w=1608&amp;ssl=1 1608w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/http-header.png?resize=800%2C174&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/http-header.png?resize=300%2C65&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/http-header.png?resize=768%2C167&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/http-header.png?resize=1024%2C223&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/http-header.png?resize=1026%2C223&amp;ssl=1 1026w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/http-header.png?resize=675%2C147&amp;ssl=1 675w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/http-header.png?w=1540&amp;ssl=1 1540w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">HTTP request header</figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph">At the opposite side, if the user pressed &#8220;LAMP OFF&#8221; button the request will contain this data <strong>pin=110</strong>.</p>



<h4 class="wp-block-heading">Code Logic</h4>



<p class="has-regular-font-size wp-block-paragraph">I know you asking now why the heck did he choose <strong>111</strong> and <strong>110</strong> specifically? Ok, Lemme answer you fam. Actually, the number <strong>111</strong> and <strong>110</strong> divides into two parts. </p>



<ul class="wp-block-list">
<li><strong> Part one:</strong> is the first two numbers which are in both cases will be &#8220;11&#8221;, it refers to the Arduino pin number which the load I need to control is connected on.</li>



<li><strong> Part two:</strong> is the third number which changes between 1 and 0 depending on the clicked button. And it refers to the pin state(ON or OFF).</li>
</ul>



<p class="has-regular-font-size wp-block-paragraph">In the Arduino code, we will receive this data and separate these two parts from each other and save each part in a different variable, part one in variable <code>pinNumber</code> and the second part in variable <code>pinState</code>, then we will write this simple line of code to control the connected load<br><code>digitalWrite(pinNumber, pinState);</code></p>



<h2 class="wp-block-heading">Connecting The Load</h2>



<hr class="wp-block-separator has-css-opacity"/>



<p class="has-regular-font-size wp-block-paragraph">Now,  we need to connect the load with the Arduino board to control it. Before connecting any high voltage device like the air conditioner or even the TV, we need to test our circuit and the code with some low voltage stuff like LEDs only to make sure that everything is working well. Here&#8217;s the wiring diagram</p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="722" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/oneLED.png?resize=770%2C722&#038;ssl=1" alt="Connecting the load" class="wp-image-397" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/oneLED.png?w=1191&amp;ssl=1 1191w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/oneLED.png?resize=800%2C750&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/oneLED.png?resize=300%2C281&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/oneLED.png?resize=768%2C720&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/oneLED.png?resize=1024%2C960&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/oneLED.png?resize=1026%2C961&amp;ssl=1 1026w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/oneLED.png?resize=675%2C632&amp;ssl=1 675w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">Connecting the load</figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph">The wiring is pretty simple, we are connecting the LED positive leg to the Arduino digital pin 11, and the negative leg to the GND through a 1k ohm resistor.</p>



<h4 class="wp-block-heading">Arduino Code</h4>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">#include &lt;SoftwareSerial.h>                         //including the SoftwareSerial library will allow you to use the pin no. 2,3 as Rx, Tx.
SoftwareSerial esp8266(2,3);                        //set the Rx ==> Pin 2; TX ==> Pin3.

#define serialCommunicationSpeed 9600               // &lt;========= define a constant named "serialCommunicationSpeed" with a value 9600. it referes to the Software and hardware serial communication speed(baud rate).
#define DEBUG true                                  //make a constant named "DEBUG" and it's value true. we will use it later.

int redLED =12;                                     //assign a variable named "redLED" with an integer value 12, it refers to the pin which the red LED is connected on.
int blueLED =11;                                    //assign a variable named "blueLED" with an integer value 11, it refers to the pin which the blue LED is connected on.


void setup()

{
  pinMode(redLED,OUTPUT);                           //set the pin number 12 as an output pin.
  pinMode(blueLED,OUTPUT);                          //set the pin number 11 as an output pin.
  
  digitalWrite(redLED,LOW);                         //turn the red LED off at the beginning of the program.
  digitalWrite(blueLED,HIGH);                       //turn the blue LED on at the beginning of the program.

  Serial.begin(serialCommunicationSpeed);           //begin the Hardware serial communication (0, 1) at speed 9600.
  esp8266.begin(serialCommunicationSpeed);          //begin the software serial communication (2, 3) at speed 9600.

  InitWifiModule();                                 //call this user-defined function "InitWifiModule()" to initialize a communication between the ESP8266 and your access point (Home Router or even your mobile hotspot).

  digitalWrite(blueLED,LOW);                        //after finishing the initialization successfully, turn off the blue LED (just an indicator).
}

void loop()                                                         //our main program, some fun are about to start)
{

  if(esp8266.available())                                           //if there's any data received and stored in the serial receive buffer, go and excute the if-condition body. If not, dont excute the if-condition body at all.
  {
    if(esp8266.find("+IPD,"))                                       //search for the "+IPD," string in the incoming data. if it exists the ".find()" returns true and if not it returns false.
    {
      delay(1000);                                                  //wait 1 second to fill up the buffer with the data.
      int connectionId = esp8266.read()-48;                         //Subtract 48 because the read() function returns the ASCII decimal value. And 0 (the first decimal number) starts at 48. We use it to convert from ASCI decimal value to a character value.
      esp8266.find("pin=");                                         //Advance the cursor to the "pin=" part in the request header to read the incoming bytes after the "pin=" part which is the pinNumer and it's state.
      int pinNumber = (esp8266.read()-48)*10;                       //read the first Byte from the Arduino input buffer(i.e. if the pin 12 then the 1st number is 1) then multiply this number by 10. So, the final value of the "pinNumber" variable will be 10.
      pinNumber = pinNumber + (esp8266.read()-48);                  //read the second Byte from the Arduino input buffer(i.e. if the pin number is 12 then the 2nd number is 2) then add this number to the first number. So, the final value of the "pinNumber" variable will be 12.
      int statusLed =(esp8266.read()-48);                           //read the third byte from the Arduino input buffer. then save it inside the "statusLed" variable. At any case, it will be 1 or 0.

      digitalWrite(pinNumber, statusLed);                           //then turn the LED at "pinNumber" on or off depending on the "statusLed" variable value.

      Serial.println(connectionId);                                 //print the "connectionId" value on the serial monitor for debugging purposes.
      Serial.print(pinNumber);                                      //print the "pinNumber" value on the serial monitor for debugging purposes.
      Serial.print("      ");                                       //print some spaces on the serial monitor to make it more readable.
      Serial.println(statusLed);                                    //print the "statusLed" value on the serial monitor for debugging purposes.

      String closeCommand = "AT+CIPCLOSE=";                         //close the TCP/IP connection.
      closeCommand+=connectionId;                                   //append the "connectionId" value to the string.
      closeCommand+="\r\n";                                         //append the "\r\n" to the string. it simulates the keyboard enter press.
      sendData(closeCommand,1000,DEBUG);                            //then send this command to the ESP8266 module to excute it.
      
    }
  }
}

/******************************************************************************************************************************************************************************************
* Name: sendData
* Description: this Function regulates how the AT Commands will ge sent to the ESP8266.
* 
* Params: command - the AT Command to send 
*                 - timeout - the time to wait for a response 
*                 - debug - print to Serial window?(true = yes, false = no)
*                 
* Returns: The response from the esp8266 (if there is a reponse)
*/
String sendData(String command, const int timeout, boolean debug)
{
    String response = "";                                             //initialize a String variable named "response". we will use it later.
    
    esp8266.print(command);                                           //send the AT command to the esp8266 (from ARDUINO to ESP8266).
    long int time = millis();                                         //get the operating time at this specific moment and save it inside the "time" variable.
    while( (time+timeout) > millis())                                 //excute only whitin 1 second.
    {      
      while(esp8266.available())                                      //is there any response came from the ESP8266 and saved in the Arduino input buffer?
      {
        char c = esp8266.read();                                      //if yes, read the next character from the input buffer and save it in the "response" String variable.
        response+=c;                                                  //append the next character to the response variabl. at the end we will get a string(array of characters) contains the response.
      }  
    }    
    if(debug)                                                         //if the "debug" variable value is TRUE, print the response on the Serial monitor.
    {
      Serial.print(response);
    }    
    return response;                                                  //return the String response.
}



/******************************************************************************************************************************************************************************************
* Name: InitWifiModule
* Description: this Function gives the commands that we need to send to the sendData() function to send it.
* 
* Params: Nothing.
*                 
* Returns: Nothing (void).
*/
void InitWifiModule()
{
  sendData("AT+RST\r\n", 2000, DEBUG);                                                  //reset the ESP8266 module.
  //delay(1000);
  sendData("AT+CWJAP=\"PUT YOUR SSID\",\"PUT YOUR PASSWORD\"\r\n", 2000, DEBUG);        //connect to the WiFi network.
  delay (3000);
  sendData("AT+CWMODE=1\r\n", 1500, DEBUG);                                             //set the ESP8266 WiFi mode to station mode.
  delay (1000);
  sendData("AT+CIFSR\r\n", 1500, DEBUG);                                                //Show IP Address, and the MAC Address.
  delay (1000);
  sendData("AT+CIPMUX=1\r\n", 1500, DEBUG);                                             //Multiple conections.
  delay (1000);
  sendData("AT+CIPSERVER=1,80\r\n", 1500, DEBUG);                                       //start the communication at port 80, port 80 used to communicate with the web servers through the http requests.
}</pre>



<h4 class="wp-block-heading">code explanation</h4>



<p class="has-regular-font-size wp-block-paragraph">the code is pretty straightforward, we implemented two different functions <code>InitWifiModule()</code> and <code>sendData()</code> <br><br>the <code>sendData()</code> function job is regulating how the AT commands will get sent to the ESP8266-01 module.<br>the <code>InitWifiModule()</code> function job is to provide the <code>sendData()</code> function the AT commands that we need to send to the ESP8266-01.<br><br>in the <code>loop()</code> function we read the income HTTP request header and search for the <strong>&#8220;+IPD,&#8221;</strong> which means that the request has successfully arrived, then we read the pin value which it will be &#8220;111&#8221; if the user clicked the &#8220;LAMP ON&#8221; button and &#8220;110&#8221; if the user clicked &#8220;LAMP OFF&#8221; button. </p>



<p class="has-regular-font-size wp-block-paragraph">don&#8217;t forget to put your wifi <strong>SSID</strong> and <strong>Password</strong> in the Arduino code <strong>line no. 103</strong><br><code>sendData("AT+CWJAP=\"PUT YOUR SSID\",\"PUT YOUR PASSWORD\"\r\n", 2000, DEBUG);        //connect to the WiFi network.</code><br><br><strong><em>for more code explanayion please read the comments in the code, it&#8217;s well documented</em></strong></p>



<h2 class="wp-block-heading">How It Works</h2>



<hr class="wp-block-separator has-css-opacity"/>



<p class="has-regular-font-size wp-block-paragraph">After uploading the code to the Arduino board, open the Serial monitor and read the responses that the ESP module is sending.</p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="303" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-04-at-12.43.20-AM.png?resize=770%2C303&#038;ssl=1" alt="Arduino serial monitor" class="wp-image-354" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-04-at-12.43.20-AM.png?w=2048&amp;ssl=1 2048w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-04-at-12.43.20-AM.png?resize=800%2C314&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-04-at-12.43.20-AM.png?resize=300%2C118&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-04-at-12.43.20-AM.png?resize=768%2C302&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-04-at-12.43.20-AM.png?resize=1024%2C402&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-04-at-12.43.20-AM.png?resize=1026%2C403&amp;ssl=1 1026w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-04-at-12.43.20-AM.png?resize=675%2C265&amp;ssl=1 675w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-04-at-12.43.20-AM.png?w=1540&amp;ssl=1 1540w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">Arduino serial monitor</figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph">at the beginning of the program, if you see something like the previous figure with <strong>&#8220;OK&#8221;</strong> at the end of the page, it means that the ESP8266-01 module is successfully connected to your wifi (Access point) and got an IP  and MAC address . Now, you can open your fancy web page and try to control some stuff <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f609.png" alt="😉" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>


<div class="wp-block-image">
<figure class="aligncenter"><img loading="lazy" decoding="async" width="2048" height="934" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-04-at-12.47.14-AM.png?fit=1024%2C467&amp;ssl=1" alt="Arduino serial monitor" class="wp-image-355" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-04-at-12.47.14-AM.png?w=2048&amp;ssl=1 2048w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-04-at-12.47.14-AM.png?resize=800%2C365&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-04-at-12.47.14-AM.png?resize=300%2C137&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-04-at-12.47.14-AM.png?resize=768%2C350&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-04-at-12.47.14-AM.png?resize=1024%2C467&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-04-at-12.47.14-AM.png?resize=1026%2C468&amp;ssl=1 1026w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-04-at-12.47.14-AM.png?resize=675%2C308&amp;ssl=1 675w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-04-at-12.47.14-AM.png?w=1540&amp;ssl=1 1540w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption"><em>Arduino serial monitor</em></figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph">But, if you see something like the previous figure with a <strong>&#8220;FAIL&#8221;</strong> or <strong>&#8220;ERROR&#8221;</strong> at the end of the page, it means that your ESP module cant connect to your wifi (Access point) for some reasons, try to check if entered the right SSID and password for your network.</p>



<h2 class="wp-block-heading">Adding a High Voltage Load</h2>



<hr class="wp-block-separator has-css-opacity"/>



<p class="has-regular-font-size wp-block-paragraph">After we tested our code and got sure that everything is working like a charm, we need to replace this boring LED with a High volage load like an air conditioner, TV or a light bulb. But to control all of these high voltage appliances we have to deal with relays.</p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="425" height="425" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/relay-module.jpg?resize=425%2C425&#038;ssl=1" alt="Two-channel relay module" class="wp-image-358" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/relay-module.jpg?w=425&amp;ssl=1 425w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/relay-module.jpg?resize=100%2C100&amp;ssl=1 100w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/relay-module.jpg?resize=150%2C150&amp;ssl=1 150w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/relay-module.jpg?resize=300%2C300&amp;ssl=1 300w" sizes="auto, (max-width: 425px) 100vw, 425px" /><figcaption class="wp-element-caption">Two-channel relay module</figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph">What&#8217;s and why relay? Ok, the relay is a mechanical switch, which is toggled on or off by energizing a coil. it’s mainly used to control a high powered circuit using a low power signal (5V or 0V). So we can control a high powered device like an air conditioner or an AC lamp turning it on or off only by a 5V or 0V signal. Which is amazing!</p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="390" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/2-channel-relay.jpg?resize=770%2C390&#038;ssl=1" alt="Relay module pinout" class="wp-image-359" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/2-channel-relay.jpg?w=1449&amp;ssl=1 1449w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/2-channel-relay.jpg?resize=800%2C405&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/2-channel-relay.jpg?resize=300%2C152&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/2-channel-relay.jpg?resize=768%2C389&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/2-channel-relay.jpg?resize=1024%2C518&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/2-channel-relay.jpg?resize=1026%2C519&amp;ssl=1 1026w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/2-channel-relay.jpg?resize=675%2C341&amp;ssl=1 675w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">Relay module pinout</figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph">The Two-channel relay module has two control pins(IN1, IN2) these pins should get connected to two Arduino digital pins to control the state of the two coils, closes or opens the load circuit.</p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="536" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-04-at-1.19.32-AM.png?resize=770%2C536&#038;ssl=1" alt="AC Load relay wiring " class="wp-image-362" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-04-at-1.19.32-AM.png?w=994&amp;ssl=1 994w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-04-at-1.19.32-AM.png?resize=800%2C557&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-04-at-1.19.32-AM.png?resize=300%2C209&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-04-at-1.19.32-AM.png?resize=768%2C535&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-04-at-1.19.32-AM.png?resize=675%2C470&amp;ssl=1 675w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">AC Load relay wiring </figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph">At the opposite side of the relay module, the COM(common) should get connected to one end of the load. the other end of the load is either connected to the <strong>NC(Normally Close)</strong> or <strong>NO(Normally open)</strong>, if connected to the NO the load remains Disconnected before trigger and vice versa.</p>



<h4 class="wp-block-heading">Wiring Diagram</h4>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="584" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/RelayModuleAdded.png?resize=770%2C584&#038;ssl=1" alt="Adding two-channel relay module" class="wp-image-398" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/RelayModuleAdded.png?w=1722&amp;ssl=1 1722w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/RelayModuleAdded.png?resize=800%2C606&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/RelayModuleAdded.png?resize=300%2C227&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/RelayModuleAdded.png?resize=768%2C582&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/RelayModuleAdded.png?resize=1024%2C776&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/RelayModuleAdded.png?resize=1026%2C778&amp;ssl=1 1026w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/RelayModuleAdded.png?resize=675%2C512&amp;ssl=1 675w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/RelayModuleAdded.png?w=1540&amp;ssl=1 1540w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">Adding two-channel relay module</figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph">As you see, we are using a two-channel relay module that gives us the ability to control two different AC loads. We are connecting the <strong>first relay</strong> at <strong>digital output pin</strong> <strong>11(Arduino)</strong> and the <strong>second relay</strong> to <strong>digital output pin 12(Arduino)</strong><br><br>We will make a small modification to our web page, we will add another <strong>two buttons(ON and OFF)</strong> to control the second connected load.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="html" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">&lt;!DOCTYPE html>
&lt;html>

&lt;head>
    &lt;title>Smart Home System&lt;/title>
    &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js">&lt;/script>
&lt;/head>

&lt;body style="background-color: seagreen; color: seashell; text-align: center;">

    &lt;h1> Smart Home Control Panel&lt;/h1>                               
    &lt;h4>Sorry But I'm a Meme Addict!&lt;/h4>
    &lt;img src="dogMeme.jpg" width="400px" height="400px">
    &lt;br>
    &lt;button style="margin: 10px;" id="111" class="button">Blue LED ON&lt;/button>
    &lt;button id="110" class="button">Blue LED OFF&lt;/button>
    &lt;br>
    &lt;button style="margin:10px;" id="121" class="button"> Red LED ON&lt;/button>
    &lt;button id="120" class="button">Red LED OFF&lt;/button>
    &lt;script>                                                        //starting Javascript.
        $(".button").click(function () {                            //if any button from the ".button" class is clicked
            var p = $(this).attr('id');                             //get this button id and store it inside the "p" variable.
            pin: p                                                  //a dictionary contains the button id to get sent to the web server.
            $.get("http://192.168.1.4:80/", {                       //then send a get request to the web server"http://192.168.1.4:80/" (":80" means port number 80) with some data in a form of dictionary {pin: p} which is the butoon id. IMPORTANT NOTE: DON'T FORGET TO CHANGE THE IP ADDRESS WITH YOUR ESP8266 NEW IP ADDRESS.
            pin: p
            });
        });
    &lt;/script>
&lt;/body>

&lt;/html></pre>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="357" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-04-at-1.35.11-AM.png?resize=770%2C357&#038;ssl=1" alt="the final web page" class="wp-image-366" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-04-at-1.35.11-AM.png?w=2048&amp;ssl=1 2048w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-04-at-1.35.11-AM.png?resize=800%2C371&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-04-at-1.35.11-AM.png?resize=300%2C139&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-04-at-1.35.11-AM.png?resize=768%2C356&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-04-at-1.35.11-AM.png?resize=1024%2C475&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-04-at-1.35.11-AM.png?resize=1026%2C476&amp;ssl=1 1026w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-04-at-1.35.11-AM.png?resize=675%2C313&amp;ssl=1 675w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-04-at-1.35.11-AM.png?w=1540&amp;ssl=1 1540w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">the final web page</figcaption></figure>
</div>


<h2 class="wp-block-heading">How It Works</h2>



<hr class="wp-block-separator has-css-opacity"/>



<p class="has-regular-font-size wp-block-paragraph">Just like the last trial, You upload the Arduino code to the board (if not uploaded yet) and open the serial monitor and make sure that your ESP module is connected successfully to your access point and got an IP and MAC address.<br><br>Then open your fancy web page and start controlling your stuff <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f609.png" alt="😉" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>



<h2 class="wp-block-heading">Make it more professional!</h2>



<p class="has-regular-font-size wp-block-paragraph">What about transferring our breadboard circuit to a professional printed circuit board<strong> (PCB)</strong> to make our project more rigid and solid, I designed the project circuit using Autodesk Eagle software. all the PCB files are open-source you can access it from the following link. we love open source <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f609.png" alt="😉" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>



<div class="wp-block-button aligncenter"><a class="wp-block-button__link has-background wp-element-button" href="https://www.pcbway.com/project/shareproject/IoT_Using_Arduino_and_ESP8266_01.html" style="border-radius:100px;background-color:#00a99d">PCB Files</a></div>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="358" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/ESP8266-01-PCB-schematic.png?resize=770%2C358&#038;ssl=1" alt="Schematic" class="wp-image-409" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/ESP8266-01-PCB-schematic.png?w=2048&amp;ssl=1 2048w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/ESP8266-01-PCB-schematic.png?resize=800%2C372&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/ESP8266-01-PCB-schematic.png?resize=300%2C139&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/ESP8266-01-PCB-schematic.png?resize=768%2C357&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/ESP8266-01-PCB-schematic.png?resize=1024%2C476&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/ESP8266-01-PCB-schematic.png?resize=1026%2C477&amp;ssl=1 1026w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/ESP8266-01-PCB-schematic.png?resize=675%2C314&amp;ssl=1 675w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/ESP8266-01-PCB-schematic.png?w=1540&amp;ssl=1 1540w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">Schematic</figcaption></figure>
</div>

<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="533" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/ESP8266-01-PCB-Merged.png?resize=770%2C533&#038;ssl=1" alt="Bottom and Top Layer PCB Image" class="wp-image-401" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/ESP8266-01-PCB-Merged.png?w=2048&amp;ssl=1 2048w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/ESP8266-01-PCB-Merged.png?resize=800%2C554&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/ESP8266-01-PCB-Merged.png?resize=300%2C208&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/ESP8266-01-PCB-Merged.png?resize=768%2C532&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/ESP8266-01-PCB-Merged.png?resize=1024%2C709&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/ESP8266-01-PCB-Merged.png?resize=1026%2C711&amp;ssl=1 1026w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/ESP8266-01-PCB-Merged.png?resize=675%2C467&amp;ssl=1 675w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/ESP8266-01-PCB-Merged.png?w=1540&amp;ssl=1 1540w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">Bottom and Top Layer PCB Image</figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph"><strong>You can order your own PCB From <a href="https://www.pcbway.com/">PCBWay</a> company these guys have a very good reputation in this field and they ship to more than 170 countries around the world with reasonable prices. all you have to do is to open the project <a href="https://www.pcbway.com/project/shareproject/IoT_Using_Arduino_and_ESP8266_01.html">PCB files link</a> and press &#8220;Add to cart&#8221;. That&#8217;s it!</strong><br><a href="https://www.pcbway.com/project/shareproject/IoT_Using_Arduino_and_ESP8266_01.html"></a></p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="467" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-06-at-7.30.04-AM.png?resize=770%2C467&#038;ssl=1" alt="How to add to cart" class="wp-image-403" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-06-at-7.30.04-AM.png?w=2048&amp;ssl=1 2048w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-06-at-7.30.04-AM.png?resize=800%2C485&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-06-at-7.30.04-AM.png?resize=300%2C182&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-06-at-7.30.04-AM.png?resize=768%2C466&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-06-at-7.30.04-AM.png?resize=1024%2C621&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-06-at-7.30.04-AM.png?resize=1026%2C622&amp;ssl=1 1026w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-06-at-7.30.04-AM.png?resize=675%2C409&amp;ssl=1 675w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-06-at-7.30.04-AM.png?w=1540&amp;ssl=1 1540w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">How to add to cart</figcaption></figure>
</div>


<h2 class="wp-block-heading"> Troubleshooting</h2>



<hr class="wp-block-separator has-css-opacity"/>



<ul class="wp-block-list">
<li><strong>if your ESP Module is successfully connected to your access point but there is no action happens when you click the web page buttons</strong>
<ul class="wp-block-list">
<li>make sure that your PC or Laptop and the ESP module is connected to the same Access point.</li>



<li>In Jquery code, make sure that you wrote the right ESP module IP address.</li>



<li>make sure that you are sending the request from your web browser from port 80(HTTP). example: <code>$.get("http://192.168.1.4:80/"</code></li>



<li>Make sure that you are connecting the load at Arduino digital pins 11 and 12.</li>
</ul>
</li>
</ul>



<p class="has-regular-font-size wp-block-paragraph">Don&#8217;t forget to save the Web page code file after any change or modification, and reload the web page in the web browser after any code modification to take effect.</p>



<script async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-4043148098486780" crossorigin="anonymous"></script>
<ins class="adsbygoogle" style="display:block; text-align:center;" data-ad-layout="in-article" data-ad-format="fluid" data-ad-client="ca-pub-4043148098486780" data-ad-slot="9966560791"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<h2 class="wp-block-heading">Final</h2>



<hr class="wp-block-separator has-css-opacity"/>



<p class="has-regular-font-size wp-block-paragraph">We are done! in today&#8217;s tutorial, we learned how to build a simple web page using HTML, CSS, and jquery. Also, we learned how to control an AC load wirelessly from a web-based control panel, and how to use the awesome ESP8266-01 Wifi module with the Arduino board.</p>



<p class="has-regular-font-size wp-block-paragraph"><strong>Lastly, if you have any questions drop it in the comments section below, I will be more than happy to hear from you <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f609.png" alt="😉" class="wp-smiley" style="height: 1em; max-height: 1em;" /></strong></p>
<p>The post <a href="https://makesomestuff.org/iot-using-esp8266-01-and-arduino/">IoT Using ESP8266-01 and Arduino</a> appeared first on <a href="https://makesomestuff.org">Make Some Stuff</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://makesomestuff.org/iot-using-esp8266-01-and-arduino/feed/</wfw:commentRss>
			<slash:comments>8</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">207</post-id>	</item>
		<item>
		<title>Bluetooth-Controlled 2WD Robot</title>
		<link>https://makesomestuff.org/how-to-control-2wd-robot-wirelessly-through-processing/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-control-2wd-robot-wirelessly-through-processing</link>
					<comments>https://makesomestuff.org/how-to-control-2wd-robot-wirelessly-through-processing/#respond</comments>
		
		<dc:creator><![CDATA[Ahmed Ibrahim]]></dc:creator>
		<pubDate>Wed, 21 Aug 2019 06:30:55 +0000</pubDate>
				<category><![CDATA[Arduino Projects]]></category>
		<category><![CDATA[Bluetooth]]></category>
		<category><![CDATA[Robot]]></category>
		<guid isPermaLink="false">https://makesomestuff.org/?p=99</guid>

					<description><![CDATA[<p><a href="https://makesomestuff.org">Make Some Stuff</a><br />
<a href="https://makesomestuff.org/how-to-control-2wd-robot-wirelessly-through-processing/">Bluetooth-Controlled 2WD Robot</a></p>
<p>Wanna Control your Robot wirelessly through your laptop?! We gonna do that in this step-by-step tutorial Using the awesome Arduino board and Processing. Hardware Components Used Software Introduction In this tutorial, we gonna build a 2WD Robot controlled wirelessly from your laptop or PC through a simple GUI built on Processing IDE. We gonna divide [...]</p>
<p>The post <a href="https://makesomestuff.org/how-to-control-2wd-robot-wirelessly-through-processing/">Bluetooth-Controlled 2WD Robot</a> appeared first on <a href="https://makesomestuff.org">Make Some Stuff</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><a href="https://makesomestuff.org">Make Some Stuff</a><br />
<a href="https://makesomestuff.org/how-to-control-2wd-robot-wirelessly-through-processing/">Bluetooth-Controlled 2WD Robot</a></p>

<p class="has-text-align-left has-regular-font-size wp-block-paragraph">Wanna Control your Robot wirelessly through your laptop?! We gonna do that in this step-by-step tutorial Using the awesome Arduino board and Processing.</p>



<script async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-4043148098486780" crossorigin="anonymous"></script>
<ins class="adsbygoogle" style="display:block; text-align:center;" data-ad-layout="in-article" data-ad-format="fluid" data-ad-client="ca-pub-4043148098486780" data-ad-slot="9912528396"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<figure class="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
<iframe loading="lazy" title="Arduino Wireless Controlled Robot" width="770" height="433" src="https://www.youtube.com/embed/untpjVQAGTQ?feature=oembed" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div></figure>



<h2 class="wp-block-heading">Hardware Components</h2>



<hr class="wp-block-separator has-css-opacity is-style-wide"/>



<ol class="wp-block-list">
<li><a href="https://www.ebay.com/itm/Original-Official-Genuine-Arduino-Uno-R3-ATmega328-MEGA328P-USB-Board-16MHz-I-O/162854440047?hash=item25eae18c6f:g:EyMAAOSwZlZaPN3n">Arduino Uno</a></li>



<li><a href="https://www.ebay.com/itm/2WD-Smart-Robot-Car-Chassis-Kit-Speed-encoder-Battery-Box-Arduino-2-motor-1-48/283477666132?hash=item420095e954:g:UvIAAOSw8q5c0pUW">2WD Robot Chassis Kit (Includes Two DC Motors).</a></li>



<li><a href="https://www.ebay.com/itm/New-L298N-DC-Stepper-Motor-Driver-Module-Dual-H-Bridge-Control-Board-for-Arduino/191674305541?epid=21024969493&amp;hash=item2ca0adcc05:g:Jb0AAOSwESNZ7v2s">L298N Dual H-bridge Motor Driver</a></li>



<li>7.4V 1500mAh Rechargeable battery</li>
</ol>



<h2 class="wp-block-heading">Used Software</h2>



<hr class="wp-block-separator has-css-opacity"/>



<ul class="wp-block-list">
<li><a href="https://www.arduino.cc/en/Main/Software">Arduino IDE</a></li>



<li><a href="https://processing.org/download/">Processing IDE</a></li>
</ul>



<h2 class="wp-block-heading">Introduction</h2>



<hr class="wp-block-separator has-css-opacity"/>



<p class="has-regular-font-size wp-block-paragraph">In this tutorial, we gonna build a 2WD Robot controlled wirelessly from your laptop or PC through a simple GUI built on Processing IDE. We gonna divide this tutorial into two main parts:</p>



<p class="has-regular-font-size wp-block-paragraph"><strong>Control the Two DC Motors from the Arduino Serial Monitor</strong></p>



<ul class="wp-block-list">
<li>How Does DC Motors Work?</li>



<li>What is the H-bridge circuit and why we need it?</li>



<li>what&#8217;s the L298N motor driver module and how to use it with the Arduino board.</li>



<li>What&#8217;s the Arduino Serial Monitor.</li>



<li>code explanation.</li>
</ul>



<p class="has-regular-font-size wp-block-paragraph"><strong>Control the Two DC Motors from the Processing&nbsp;Control Panel GUI</strong></p>



<ul class="wp-block-list">
<li>How to build our User Interface using Processing IDE.</li>



<li>What&#8217;s the HC-05 Bluetooth module and how to use it with Arduino.</li>



<li>code modification explanation.</li>
</ul>



<script async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-4043148098486780" crossorigin="anonymous"></script>
<ins class="adsbygoogle" style="display:block; text-align:center;" data-ad-layout="in-article" data-ad-format="fluid" data-ad-client="ca-pub-4043148098486780" data-ad-slot="9912528396"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<h2 class="wp-block-heading">First Part: Control the Two DC Motors from the Arduino Serial Monitor</h2>



<hr class="wp-block-separator has-css-opacity"/>



<h4 class="wp-block-heading has-text-align-left"><strong>Working Scenario </strong></h4>



<p class="has-text-align-left has-very-dark-gray-color has-text-color has-regular-font-size wp-block-paragraph">the user will control the two DC Motors from the Arduino serial monitor according to the characters he/she send.</p>



<ul class="wp-block-list">
<li>by sending the char &#8216;f&#8217;, the two motors will rotate <strong>FORWARD</strong>.</li>



<li>sending the char &#8216;b&#8217;, the two motors will rotate <strong>BACKWARD</strong>.</li>



<li>by sending the char &#8216;r&#8217;, the left motor will rotate <strong>FORWARD</strong> and the right motor will rotate <strong>BACKWARD</strong>.</li>



<li>sending the char &#8216;l&#8217;, the right motor will rotate <strong>FORWARD</strong> and the left motor will rotate <strong>BACKWARD</strong>.</li>



<li>by sending the char &#8216;s&#8217;, the two motors will <strong>STOP</strong> rotating.</li>
</ul>



<h4 class="wp-block-heading has-text-align-left"><strong>How DC Motor Works?</strong></h4>



<p class="has-regular-font-size wp-block-paragraph">Simply, DC motor is a component that converts electrical energy into mechanical energy. we will not dive deep into that Electromagnetism, induction, and magnetic field stuff. actually, I don&#8217;t care about that, what I care about is how to drive this dc motor thing.</p>


<div class="wp-block-image">
<figure class="aligncenter is-resized"><img data-recalc-dims="1" loading="lazy" decoding="async" width="201" height="251" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/momo.jpg?resize=201%2C251&#038;ssl=1" alt="Meme Lord Baby" class="wp-image-100" style="width:201px;height:251px"/><figcaption class="wp-element-caption">Meme Lord Baby</figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph">The DC motor will start rotating only when a current flow through it, the motor rotation direction depends on the current flow direction. (See Fig 1) By changing the polarity of the power source with the motor, motor rotation direction will get reversed. (NOTE: DC motors have no polarity).</p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="520" height="272" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/motor-rotation-direction-and-polarity.jpg?resize=520%2C272&#038;ssl=1" alt="DC Motor Rotation direction and power source polarity" class="wp-image-101" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/motor-rotation-direction-and-polarity.jpg?w=520&amp;ssl=1 520w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/motor-rotation-direction-and-polarity.jpg?resize=300%2C157&amp;ssl=1 300w" sizes="auto, (max-width: 520px) 100vw, 520px" /><figcaption class="wp-element-caption">DC Motor Rotation direction and power source polarity</figcaption></figure>
</div>


<h4 class="wp-block-heading"><strong>How to drive the DC motor from the Awesome Arduino board?</strong></h4>



<p class="has-regular-font-size wp-block-paragraph">Actually, DC motors draw a large amount of current while rotating up to 500mA each (500mA in our case. but actually, it depends on the motor size and its power rating), but our Arduino board only can provide 40mA at 5V on its digital pins. so we need to use an external power source(battery) to provide the motors with the required power to operate properly without damaging the Arduino board. Also, we need to separate that power circuit(External power source) from the control circuit(Arduino Board).</p>



<ul class="wp-block-list">
<li>We will use a 7.4V 1.5Ah battery as a power source to provide the required power to our motors. (power circuit)</li>



<li>and of course, the Arduino UNO board to control the Motors. (Control circuit)</li>
</ul>



<p class="has-regular-font-size wp-block-paragraph">we can use a BJT Transistor like the 2N2222a NPN Transistor to separate the power circuit from the control circuit.&nbsp;<strong>Some 2N2222a Specs before using it:</strong></p>



<ul class="wp-block-list">
<li>Collector-Emitter Voltage is 30V.</li>



<li>The continuous collector current is 800mA.</li>



<li>Base current is 5mA max.</li>
</ul>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="634" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/wiring-Diagram.png?resize=770%2C634&#038;ssl=1" alt="Single DC Motor with Transistor" class="wp-image-125" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/wiring-Diagram.png?w=951&amp;ssl=1 951w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/wiring-Diagram.png?resize=800%2C659&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/wiring-Diagram.png?resize=300%2C247&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/wiring-Diagram.png?resize=768%2C632&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/wiring-Diagram.png?resize=675%2C556&amp;ssl=1 675w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">Single DC Motor with Transistor</figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph"><strong>In the Above circuit,</strong>&nbsp;We are using the transistor as a switch, when the voltage across the Base-emitter transistor is HIGH (5V) it will close the connection between the collector and the emitter. So, the current will flow through the motor which will make it rotates.<br><br>if the voltage across the Base-emitter transistor is LOW (0V) it will open the connection between the transistor collector and emitter and the motor will stop rotating.<br><br>don&#8217;t forget to use a current limiting resistor on the transistor base pin&nbsp;(1k Ohm)&nbsp;to prevent it from damaging. Also,<em> use a diode in parallel with your motor to protect your Arduino from any back EMF</em>&nbsp;<em>returning from the motor.</em><br><br>But this circuit will allow us to only control one direction of the motor ON and OFF. So, what if we want to control its rotation direction? we will need an H-bridge circuit.</p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="740" height="491" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/H-bridge-circuit.jpeg?resize=740%2C491&#038;ssl=1" alt="Single H-bridge Circuit" class="wp-image-126" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/H-bridge-circuit.jpeg?w=740&amp;ssl=1 740w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/H-bridge-circuit.jpeg?resize=300%2C199&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/H-bridge-circuit.jpeg?resize=675%2C448&amp;ssl=1 675w" sizes="auto, (max-width: 740px) 100vw, 740px" /><figcaption class="wp-element-caption">Single H-bridge Circuit</figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph">Simply, the H-bridge circuit inverts the direction of the current flow through the motor. this circuit contains four switching elements(transistors in our case) by activating two particular switches at the same time we can change the direction of the current flow thus change the motor rotation direction. for example:</p>



<ul class="wp-block-list">
<li>when Q1 &amp; Q4 are activated and the Q2 &amp; Q3 are deactivated, the current will flow from the VCC of the power source passing through the Q1 then to the motor(from the left terminal to the right terminal) then to Q4 then to the GND. which will make the motor to rotate in the clockwise direction.</li>



<li>when Q2 &amp; Q3 are activated and the Q1 &amp; Q4 are deactivated, the current will flow from the VCC of the power source passing through the Q3 then to the motor(from the right terminal to the left terminal) then to Q2 then to the GND. which will make the motor to rotate in the anti-clockwise direction.</li>
</ul>



<p class="has-regular-font-size wp-block-paragraph">So, using only two output pins(A, B) from the Arduino board you can control the state of the four switching elements(transistors) thus controlling the motor rotation direction.</p>



<ul class="wp-block-list">
<li>&#8216;A&#8217; pin Controls transistor Q1, and Q4.</li>



<li>&#8216;B&#8217; pin Controls transistor Q2, and Q3.</li>
</ul>



<p class="has-regular-font-size wp-block-paragraph"><strong>GUESS WHAT! </strong>I have some good news for you, you don&#8217;t need to build this H-bridge circuit from scratch. we will use the L298N H-bridge Motor driver module which gives us all these functionalities.</p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="580" height="575" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/L298N_motor_driver.png?resize=580%2C575&#038;ssl=1" alt="L298N Motor Driver Module" class="wp-image-127" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/L298N_motor_driver.png?w=580&amp;ssl=1 580w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/L298N_motor_driver.png?resize=100%2C100&amp;ssl=1 100w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/L298N_motor_driver.png?resize=150%2C150&amp;ssl=1 150w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/L298N_motor_driver.png?resize=300%2C297&amp;ssl=1 300w" sizes="auto, (max-width: 580px) 100vw, 580px" /><figcaption class="wp-element-caption">L298N Motor Driver Module</figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph">Simply, the L298N Motor driver module is a dual H-bridge circuit that allows you to&nbsp;<strong>feed</strong>&nbsp;the motors with the needed power from an external power source, also allows you to&nbsp;<strong>control</strong>&nbsp;the motors rotation direction from your Arduino board.</p>



<p class="has-regular-font-size wp-block-paragraph">the L298N Motor driver module is a two-channel driver which means that you can connect two different DC motors and control each one independently. the L298N Module can drive DC motors that have a voltage between 5-35V with 2A peak current at each channel.</p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="718" height="448" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/L298-Module-pinout.png?resize=718%2C448&#038;ssl=1" alt="L298N Module Pinout" class="wp-image-128" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/L298-Module-pinout.png?w=718&amp;ssl=1 718w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/L298-Module-pinout.png?resize=300%2C187&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/L298-Module-pinout.png?resize=675%2C421&amp;ssl=1 675w" sizes="auto, (max-width: 718px) 100vw, 718px" /><figcaption class="wp-element-caption">L298N Module Pinout</figcaption></figure>
</div>


<ul class="wp-block-list">
<li>Motor A &#8211;> First Motor Terminal.</li>



<li>Motor B &#8211;> Second Motor Terminal.</li>



<li>12V jumper &#8211;> if your using a power source more than 12V remove this jumper to not damage the onboard voltage regulator.</li>



<li>pin (Vs) &#8211;> is the pin where the motor power source is connected to, the input voltage should be between 5V and 35V.</li>



<li>Pin(GND) &#8211;> is the pin where both the GND of the battery and the GND of the Arduino board is connected on.</li>



<li>Power pin(5V IN/OUT) &#8211;> you can source 5V from this pin only if the 12V jumper is connected. but if the 12V jumper is disconnected you should feed the L298N IC with 5V input to operate properly.</li>



<li>Enable pins(Enable A) &#8211;> by sending a PWM signal from your Arduino PWM Output pin you can control the speed of motor A.</li>



<li>Enable pins(Enable B) &#8211;> by sending a PWM signal from your Arduino PWM Output pin you can control the speed of motor B.</li>



<li>Logic pins(input1 &amp; input2) &#8211;> by sending a digital signal from your Arduino digital Output pin you can control the rotation direction of the Motor A.</li>



<li>Logic pins(input3 &amp; input4) &#8211;> by sending a digital signal from your Arduino digital Output pin you can control the rotation direction of the Motor B.</li>
</ul>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="740" height="337" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/L298N-logic-Control.jpeg?resize=740%2C337&#038;ssl=1" alt="motor rotation direction Logic Control" class="wp-image-129" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/L298N-logic-Control.jpeg?w=740&amp;ssl=1 740w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/L298N-logic-Control.jpeg?resize=300%2C137&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/L298N-logic-Control.jpeg?resize=675%2C307&amp;ssl=1 675w" sizes="auto, (max-width: 740px) 100vw, 740px" /><figcaption class="wp-element-caption">motor rotation direction Logic Control</figcaption></figure>
</div>


<h4 class="wp-block-heading" id="toc-l298n-motor-driver-module-wiring-with-arduino-2">L298N Motor Driver Module Wiring With Arduino</h4>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="740" height="507" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Wiring-Diagram-one.jpeg?resize=740%2C507&#038;ssl=1" alt="Wiring Diagram" class="wp-image-130" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Wiring-Diagram-one.jpeg?w=740&amp;ssl=1 740w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Wiring-Diagram-one.jpeg?resize=300%2C206&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Wiring-Diagram-one.jpeg?resize=675%2C462&amp;ssl=1 675w" sizes="auto, (max-width: 740px) 100vw, 740px" /><figcaption class="wp-element-caption">Wiring Diagram</figcaption></figure>
</div>


<ul class="wp-block-list">
<li>connecting the four logic input pins(L298n Module logical pins) with any four Arduino digital output pins to control the motors rotation direction.</li>



<li>connecting the two enable pins with any two Arduino PWM output pins to control the motors rotation speed. (0 for lowest speed and 255 for highest speed).</li>



<li>Connect the +VE terminal of the battery to the +12V pin of the L298N Module, also connect the -VE terminal of the battery to the GND pin of the L298N module.<strong> Don&#8217;t forget to connect the Arduino GND pin as well to the L298N Module GND Pin.</strong></li>
</ul>



<h4 class="wp-block-heading"><strong>Sending/Receiving Data between the laptop and the Arduino board.</strong></h4>



<p class="has-regular-font-size wp-block-paragraph">Serial communication is the process of sending data one bit at a time, sequentially, over a communication channel or computer bus. Source:&nbsp;<a href="http://wikipedia.com/">Wikipedia.com</a><br><br>Let&#8217;s give an example, imagine that you have an Ultrasonic sensor(it&#8217;s a sensor that measures the distance between it and an object.) and you want to send this distance value to your computer to do some further actions. one simple solution is to connect your Arduino board with your computer via USB and send that data using Serial communication. And fortunately, that Arduino already has built-in functions to communicate with the serial port. You may also want to control your RC car motors remotely. in this case, you need to send your orders from your laptop or smartphone to the Arduino board also over the Serial communication.<br><br>To use Arduino serial port, you need to set the speed at which your computer will communicate with the Arduino board(it&#8217;s called baud rate). in your program inside the&nbsp;<em>void setup() function,</em>&nbsp;use the&nbsp;<em><strong><a href="https://www.arduino.cc/reference/en/language/functions/communication/serial/begin/">.begin</a></strong></em>&nbsp;function with the builtin object&nbsp;<em><strong><a href="https://www.arduino.cc/reference/en/language/functions/communication/serial/">Serial</a></strong></em>&nbsp;to set that speed. to see the valid baud rate values and for more details see the&nbsp;<a href="https://www.arduino.cc/reference/en/language/functions/communication/serial/">Arduino reference</a>.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="atomic" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">Serial.begin(9600);</pre>



<h4 class="wp-block-heading"><strong>Some methods you need to know more about:</strong></h4>



<ul class="wp-block-list">
<li><strong><em><a href="https://www.arduino.cc/reference/en/language/functions/communication/serial/available/">Serial.available()</a></em></strong> &#8211;> Get the number of bytes (characters) available for reading from the serial port</li>



<li><strong><em><a href="https://www.arduino.cc/reference/en/language/functions/communication/serial/read/">Serial.read()</a></em></strong> &#8211;> Reads incoming serial data.</li>



<li><em><strong><a href="https://www.arduino.cc/reference/en/language/functions/communication/serial/println/">Serial.println()</a></strong></em> &#8211;> prints data to the serial port as human-readable text with a line break at the end.</li>



<li><em><strong><a href="https://www.arduino.cc/reference/en/language/functions/communication/serial/print/">Serial.print()</a></strong></em> &#8211;> same as the <strong>Serial.println()</strong> but without a line break at the end.</li>



<li><em><strong><a href="https://www.arduino.cc/reference/en/language/functions/communication/serial/write/">Serial.write()</a></strong></em> &#8211;> Writes binary data to the serial port. This data is sent as a byte or series of bytes.</li>
</ul>



<h4 class="wp-block-heading">Source Code</h4>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="twilight" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">#define in1 4                                                           //defining const. variable named "in1" with value 0, which refers to the PICO D0.                
#define in2 5                                                           //defining const. variable named "in2" with value 1, which refers to the PICO D1.                
#define in3 7                                                           //defining const. variable named "in3" with value 2, which refers to the PICO D2.                
#define in4 8                                                           //defining const. variable named "in4" with value 3, which refers to the PICO D3.                
#define motorASpeedPin 9                
#define motorBSpeedPin 3                
char val;            
              
/*                
  forward function takes four arguments x, y, motorSpeed, speedPin.                
  this function returns nothing.                
  responsible for running motor A forward by a specific speed.                
*/             
             
void forward(int x, int y, int motorSpeed, int speedPin) {                
 digitalWrite(x, HIGH);                
 digitalWrite(y, LOW);                
 analogWrite(speedPin, motorSpeed);                
}           
               
/*                
  backward function takes four arguments x, y, motorSpeed, speedPin.                
  this function returns nothing.                
  responsible for running motor B backward with a specific speed.                
*/             
             
void backward(int x, int y, int motorSpeed, int speedPin) {                
 digitalWrite(x, LOW);                
 digitalWrite(y, HIGH);                
 analogWrite(speedPin, motorSpeed);                
}                
          
void right(int motorSpeed) {                
 forward(in1, in2, motorSpeed, motorASpeedPin);                
 backward(in3, in4, motorSpeed, motorBSpeedPin);                
}             
             
void left(int motorSpeed) {                
 forward(in3, in4, motorSpeed, motorBSpeedPin);                
 backward(in1, in2, motorSpeed, motorASpeedPin);                
}             
             
void stopAll() {                
 digitalWrite(in1, LOW);                
 digitalWrite(in2, LOW);                
 digitalWrite(in3, LOW);                
 digitalWrite(in4, LOW);                
}               
           
void setup() {                
 for (int i = 3 ; i &lt;= 5 ; i++) {                
   pinMode(i, OUTPUT);                
 }                
 for (int i = 7 ; i &lt;= 9 ; i++) {                
   pinMode(i, OUTPUT);                
 }                
 Serial.begin(9600);                
 Serial.println("Please enter 'f' to run the motor FORWARD, or 'b' to run the motor BACKWARD");                
 Serial.println("or 'r' to run the motor RIGHT, or 'l' to run the motor LEFT, or 's' to STOP all motors. ");                
}               
           
void loop() {                
 if (Serial.available() > 0) {                
   val = Serial.read();                
 }                
 if (val == 'f') {                
   forward(in1, in2, 255, motorASpeedPin);                
   forward(in3, in4, 255, motorBSpeedPin);                
   Serial.println("forward");                
 }                
 if (val == 'b') {                
   backward(in1, in2, 255, motorASpeedPin);                
   backward(in3, in4, 255, motorBSpeedPin);                
   Serial.println("backward");                
 }                
 if (val == 'r') {                
   right(255);                
   Serial.println("right");                
 }                
 if (val == 'l') {                
   left(255);                
   Serial.println("left");                
 }                
 if (val == 's') {                
   stopAll();                
   Serial.println("stopAll");                
 }                
}                </pre>



<h4 class="wp-block-heading">Code Logic</h4>



<p class="has-regular-font-size wp-block-paragraph">inside the&nbsp;<code>setup()</code>&nbsp;function where we set up our program,</p>



<ul class="wp-block-list">
<li>set the pins 3, 4, 5, 7, 8, 9 as output pins.</li>



<li>then start the Serial Communication between the Arduino and our computer at baud rate 9600 using the <em><code>.begin()</code></em> function.</li>



<li>then print this sentence one the Serial monitor is opened &#8220;<em>Please enter &#8216;f&#8217; to run the motor FORWARD, or &#8216;b&#8217; to run the motor BACKWARD or &#8216;r&#8217; to run the motor RIGHT, or &#8216;l&#8217; to run the motor LEFT, or &#8216;s&#8217; to STOP all motors.</em>&#8220;</li>
</ul>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="twilight" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">void setup() {                
 for (int i = 3 ; i &lt;= 5 ; i++) {                
   pinMode(i, OUTPUT);                
 }                
 for (int i = 7 ; i &lt;= 9 ; i++) {                
   pinMode(i, OUTPUT);                
 }                
 Serial.begin(9600);                
 Serial.println("Please enter 'f' to run the motor FORWARD, or 'b' to run the motor BACKWARD");                
 Serial.println("or 'r' to run the motor RIGHT, or 'l' to run the motor LEFT, or 's' to STOP all motors. ");                
}               </pre>



<p class="has-regular-font-size wp-block-paragraph">Inside the&nbsp;<code><em>loop()</em></code>&nbsp;function, which is going to repeat over and over as long as our program is running. we just need to read the data coming from the Serial monitor if there&#8217;s any. Then store it inside the &#8220;val&#8221; variable which we created earlier.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="twilight" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">if (Serial.available() > 0) {                
   val = Serial.read();                
 }   </pre>



<p class="has-regular-font-size wp-block-paragraph">after reading the data,</p>



<ul class="wp-block-list">
<li>if the received character is &#8216;<strong>f</strong>&#8216;. call the <strong>forward</strong> function and print &#8220;<strong>forward</strong>&#8221; on the serial monitor to make the debugging process easier.</li>



<li>the received character is &#8216;<strong>r</strong>&#8216; call the <strong>right</strong> function and print &#8220;<strong>right</strong>&#8221; on the serial monitor to make the debugging process easier.</li>



<li>if the received character is &#8216;<strong>l</strong>&#8216; call the <strong>left</strong> function and print &#8220;<strong>left</strong>&#8221; on the serial monitor to make the debugging process easier.</li>



<li>the received character is &#8216;<strong>s</strong>&#8216; call the <strong>stopAll</strong> function and print &#8220;<strong>stopAll</strong>&#8221; on the serial monitor to make the debugging process easier.</li>



<li>if the received character is &#8216;<strong>b</strong>&#8216; call the <strong>backward</strong> function and print &#8220;<strong>backward</strong>&#8221; on the serial monitor to make the debugging process easier.</li>
</ul>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="twilight" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">if (val == 'f') {                
   forward(in1, in2, 255, motorASpeedPin);                
   forward(in3, in4, 255, motorBSpeedPin);                
   Serial.println("forward");                
 }                
 if (val == 'b') {                
   backward(in1, in2, 255, motorASpeedPin);                
   backward(in3, in4, 255, motorBSpeedPin);                
   Serial.println("backward");                
 }                
 if (val == 'r') {                
   right(255);                
   Serial.println("right");                
 }                
 if (val == 'l') {                
   left(255);                
   Serial.println("left");                
 }                
 if (val == 's') {                
   stopAll();                
   Serial.println("stopAll");                
 }                
}                </pre>



<p class="has-regular-font-size wp-block-paragraph">After Uploading and Running the Code, you have to open the Arduino Serial Monitor from this pin.</p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="740" height="185" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/SM.png?resize=740%2C185&#038;ssl=1" alt="Code Snippet" class="wp-image-132" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/SM.png?w=740&amp;ssl=1 740w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/SM.png?resize=300%2C75&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/SM.png?resize=675%2C169&amp;ssl=1 675w" sizes="auto, (max-width: 740px) 100vw, 740px" /><figcaption class="wp-element-caption">Code Snippet</figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph">Now, you should see this window</p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="563" height="555" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/SM2.png?resize=563%2C555&#038;ssl=1" alt="Serial monitor output" class="wp-image-133" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/SM2.png?w=563&amp;ssl=1 563w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/SM2.png?resize=100%2C100&amp;ssl=1 100w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/SM2.png?resize=300%2C296&amp;ssl=1 300w" sizes="auto, (max-width: 563px) 100vw, 563px" /><figcaption class="wp-element-caption">Serial monitor output</figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph">Now, type &#8216;f&#8217; in the upper bar and press the &#8216;send&#8217; button or just press enter. you will notice that your motors are now running forward.</p>



<script async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-4043148098486780" crossorigin="anonymous"></script>
<ins class="adsbygoogle" style="display:block; text-align:center;" data-ad-layout="in-article" data-ad-format="fluid" data-ad-client="ca-pub-4043148098486780" data-ad-slot="9912528396"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-regular-font-size wp-block-paragraph"><strong>CONGRATS!</strong> now you are able to control your motors from the serial monitor. Let&#8217;s go to the second step!</p>



<h2 class="wp-block-heading" id="toc-second-part--control-the-two-dc-motors-from-the-processing-control-panel-gui-5">Second Part: Control the Two DC Motors from the Processing Control Panel GUI</h2>



<hr class="wp-block-separator has-css-opacity"/>



<h4 class="wp-block-heading">Working Scenario</h4>



<p class="has-regular-font-size wp-block-paragraph">We will build a GUI control panel using Processing IDE to control the motors from it instead of the Serial Monitor. the way of communication between the Processing IDE and the Serial port(Arduino IDE) is also a Serial Communication. So, we will build our logic upon the same concepts that we discussed in&nbsp;<strong>part one.</strong>&nbsp;Luckily, Processing comes with a Serial library designed for just this kind of thing!<br><br>to be able to use the Serial communication on processing you have to set the speed at which your computer will communicate with the Serial port(Arduino IDE) which is called the baud rate. Remember how we set&nbsp;<code>Serial.begin(9600)</code>&nbsp;in Arduino? we will do the same thing with processing but with a little change in the syntax.</p>



<ul class="wp-block-list">
<li>First things first, you have to import the Serial library.</li>
</ul>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="286" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-4.34.09-PM.png?resize=770%2C286&#038;ssl=1" alt="Importing Serial Library" class="wp-image-139" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-4.34.09-PM.png?w=2024&amp;ssl=1 2024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-4.34.09-PM.png?resize=800%2C297&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-4.34.09-PM.png?resize=300%2C111&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-4.34.09-PM.png?resize=768%2C285&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-4.34.09-PM.png?resize=1024%2C380&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-4.34.09-PM.png?resize=1026%2C381&amp;ssl=1 1026w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-4.34.09-PM.png?resize=675%2C251&amp;ssl=1 675w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-4.34.09-PM.png?w=1540&amp;ssl=1 1540w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">Importing Serial Library</figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph">You should now see at the top of your sketch a line like</p>



<pre class="EnlighterJSRAW" data-enlighter-language="java" data-enlighter-theme="mootools" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">import processing.serial.*;</pre>



<ul class="wp-block-list">
<li>The next line we need to take an object from the Serial class, i will name it &#8220;port&#8221; <em>(you can name it as you want)</em> this Serial object allows you to listen to any Serial communication incoming data.</li>
</ul>



<pre class="EnlighterJSRAW" data-enlighter-language="java" data-enlighter-theme="twilight" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">Serial port;</pre>



<p class="has-regular-font-size wp-block-paragraph">For our&nbsp;<code>setup()</code>&nbsp;method in Processing, we&#8217;re going to find the Serial port our Arduino is connected to and set up our Serial object to listen to that port.<br><br>just like Arduino has <code>setup()</code> and <code>loop()</code>, processing has <code>setup()</code> and <code>draw()</code> (instead of loop)<br><br><strong>For windows users</strong>, it will look something like this. you just have to change the &#8220;<code>COM6</code>&#8221; value according to your Arduino Serial port.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="java" data-enlighter-theme="twilight" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">port = new Serial(this, "COM6", 9600);</pre>



<h4 class="wp-block-heading">How to know my Arduino Serial port?</h4>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="350" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/UNO_Port.jpg?resize=770%2C350&#038;ssl=1" alt="Windows Serial port" class="wp-image-140" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/UNO_Port.jpg?w=800&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/UNO_Port.jpg?resize=300%2C137&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/UNO_Port.jpg?resize=768%2C349&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/UNO_Port.jpg?resize=675%2C307&amp;ssl=1 675w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">Windows Serial port</figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph"><strong>For macOS or Linux users</strong>, it will look something like this. you just have to change the &#8220;<code>/dev/tty.usbmodem143101</code>&#8221; value according to your Arduino Serial port.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="java" data-enlighter-theme="twilight" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">port = new Serial(this, "/dev/tty.usbmodem143101", 9600);</pre>



<h4 class="wp-block-heading">How to know my Arduino Serial port?</h4>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="299" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-5.08.11-AM.png?resize=770%2C299&#038;ssl=1" alt="macOS &amp; Linux Serial port" class="wp-image-141" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-5.08.11-AM.png?w=1737&amp;ssl=1 1737w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-5.08.11-AM.png?resize=800%2C311&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-5.08.11-AM.png?resize=300%2C117&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-5.08.11-AM.png?resize=768%2C298&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-5.08.11-AM.png?resize=1024%2C398&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-5.08.11-AM.png?resize=1026%2C399&amp;ssl=1 1026w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-5.08.11-AM.png?resize=675%2C262&amp;ssl=1 675w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-5.08.11-AM.png?w=1540&amp;ssl=1 1540w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">macOS &amp; Linux Serial port</figcaption></figure>
</div>


<h4 class="wp-block-heading">GUI: Working Scenario</h4>



<figure class="wp-block-image"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="546" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-3.18.32-AM.png?resize=770%2C546&#038;ssl=1" alt="Final GUI" class="wp-image-142" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-3.18.32-AM.png?w=1224&amp;ssl=1 1224w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-3.18.32-AM.png?resize=800%2C567&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-3.18.32-AM.png?resize=300%2C213&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-3.18.32-AM.png?resize=768%2C545&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-3.18.32-AM.png?resize=1024%2C726&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-3.18.32-AM.png?resize=1026%2C728&amp;ssl=1 1026w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-3.18.32-AM.png?resize=675%2C479&amp;ssl=1 675w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">Final GUI</figcaption></figure>



<p class="has-regular-font-size wp-block-paragraph">Building the App GUI is pretty simple, we gonna divide it into three main parts to make it clear.</p>



<ul class="wp-block-list">
<li>Build the App Window.</li>
</ul>



<p class="has-regular-font-size wp-block-paragraph">Building the App Window means Defining the dimension of the display window width and height in units of pixels and setting its color. Also, we will create a simple text to place it on the top of the window as a title.</p>



<ul class="wp-block-list">
<li>Placing the buttons on the window.</li>
</ul>



<p class="has-regular-font-size wp-block-paragraph">After building the App window, we need to create five buttons and position them on the App window to allow the user to interact with the app easily, each button is responsible for sending a specific order to the Arduino board. For example, when the user presses the &#8220;forward&#8221; button the Processing IDE will send a specific character to the Arduino port via the Serial Communication. And according to this character, Arduino IDE will trigger a specific event&nbsp;<em>(Rotating the motors forward)</em>.</p>



<ul class="wp-block-list">
<li>Buttons Functionality.</li>
</ul>



<p class="has-regular-font-size wp-block-paragraph">After placing the buttons correctly on the App Window, we need to give each button a functionality. which means a specific event will get triggered according to which button is clicked. enough talking, let&#8217;s build some stuff!</p>



<h4 class="wp-block-heading">Build the App Window</h4>



<pre class="EnlighterJSRAW" data-enlighter-language="java" data-enlighter-theme="twilight" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">void setup() {              
 size(500, 300);              
}              
void draw() {              
 background(150, 0, 150);              
 fill(255);              
 text("Motor Control GUI", 195, 30);              
}   </pre>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="546" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-1.44.05-AM.png?resize=770%2C546&#038;ssl=1" alt="Empty Window" class="wp-image-144" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-1.44.05-AM.png?w=1224&amp;ssl=1 1224w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-1.44.05-AM.png?resize=800%2C567&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-1.44.05-AM.png?resize=300%2C213&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-1.44.05-AM.png?resize=768%2C545&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-1.44.05-AM.png?resize=1024%2C726&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-1.44.05-AM.png?resize=1026%2C728&amp;ssl=1 1026w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-1.44.05-AM.png?resize=675%2C479&amp;ssl=1 675w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">Empty Window</figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph"><strong>inside the&nbsp;</strong><code><strong>setup()</strong></code><strong>&nbsp;function</strong></p>



<ul class="wp-block-list">
<li>We used the <code>size(500, 300);</code> Method to create the App Window with 500px width and 300px height.</li>
</ul>



<p class="has-regular-font-size wp-block-paragraph"><strong>inside the&nbsp;</strong><code><strong>draw()</strong></code><strong>&nbsp;function</strong></p>



<ul class="wp-block-list">
<li>we used the <code>background(150, 0, 150);</code> method with these RGB values to set the background color of the Processing window, This method is typically used within the <code>draw()</code> function to clear the display window at the beginning of each frame.</li>



<li>then we used the <code>fill(255);</code> method to set the color of any subsequent component to the white color.</li>



<li>then we used the <code>text("Motor Control GUI", 195, 30);</code> method to create a text on the X-coordinate 195 and the Y-coordinate 30.</li>
</ul>



<p class="has-regular-font-size wp-block-paragraph">the coordinate system for pixels in a computer window, however, is reversed along the y-axis. (0,0) can be found at the top left with the positive direction to the right horizontally and down vertically.&nbsp;<em>(See the next Figure)</em></p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="517" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Computer-Screen-coordinate-system.png?resize=770%2C517&#038;ssl=1" alt="Computer Screen Coordinates System" class="wp-image-145" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Computer-Screen-coordinate-system.png?w=1331&amp;ssl=1 1331w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Computer-Screen-coordinate-system.png?resize=800%2C537&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Computer-Screen-coordinate-system.png?resize=300%2C202&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Computer-Screen-coordinate-system.png?resize=768%2C516&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Computer-Screen-coordinate-system.png?resize=1024%2C688&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Computer-Screen-coordinate-system.png?resize=1026%2C689&amp;ssl=1 1026w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Computer-Screen-coordinate-system.png?resize=675%2C453&amp;ssl=1 675w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">Computer Screen Coordinates System</figcaption></figure>
</div>


<h4 class="wp-block-heading">Placing the buttons on the window</h4>



<pre class="EnlighterJSRAW" data-enlighter-language="java" data-enlighter-theme="twilight" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">import controlP5.*;                  //import ControlP5 library              
              
ControlP5 cp5;                       //create ControlP5 object              
              
void setup() {              
 size(500, 300);              
 cp5 = new ControlP5(this);          //take an object from the ControlP5 Class            
              
 cp5.addButton("forward")            //add new button            
   .setPosition(190, 50)              
   .setSize(120, 70)                    
   ;                 
 cp5.addButton("backward")           //add new button                    
   .setPosition(190, 210)              
   .setSize(120, 70)                    
   ;              
 cp5.addButton("right")              //add new button                  
   .setPosition(350, 130)            
   .setSize(120, 70)            
   ;              
 cp5.addButton("left")               //add new button             
   .setPosition(30, 130)                
   .setSize(120, 70)                   
   ;              
 cp5.addButton("stop")               //add new button                 
   .setPosition(190, 130)                
   .setSize(120, 70)             
   ;              
}              
void draw() {              
 background(150, 0, 150);              
 fill(255);              
 text("Motor Control GUI", 195, 30);              
}    </pre>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="546" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-3.18.32-AM.png?resize=770%2C546&#038;ssl=1" alt="Adding the buttons to the window" class="wp-image-142" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-3.18.32-AM.png?w=1224&amp;ssl=1 1224w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-3.18.32-AM.png?resize=800%2C567&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-3.18.32-AM.png?resize=300%2C213&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-3.18.32-AM.png?resize=768%2C545&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-3.18.32-AM.png?resize=1024%2C726&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-3.18.32-AM.png?resize=1026%2C728&amp;ssl=1 1026w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-3.18.32-AM.png?resize=675%2C479&amp;ssl=1 675w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">Adding the buttons to the window</figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph">we will use the&nbsp;ControlP5 library&nbsp;which allows us to add some buttons to our App, this library uses not limited on buttons only, it also gives you many more features like adding sliders, checkboxes, radio buttons, canvas, drop-down lists, &#8230;</p>



<script async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-4043148098486780" crossorigin="anonymous"></script>
<ins class="adsbygoogle" style="display:block; text-align:center;" data-ad-layout="in-article" data-ad-format="fluid" data-ad-client="ca-pub-4043148098486780" data-ad-slot="9912528396"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-regular-font-size wp-block-paragraph">installing any library in Processing is very simple, you just need to go to the sketch tab-&gt; Import Library-&gt; Add Library.</p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="373" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-2.41.04-AM.png?resize=770%2C373&#038;ssl=1" alt="Adding a new library to processing" class="wp-image-146" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-2.41.04-AM.png?w=1446&amp;ssl=1 1446w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-2.41.04-AM.png?resize=800%2C387&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-2.41.04-AM.png?resize=300%2C145&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-2.41.04-AM.png?resize=768%2C372&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-2.41.04-AM.png?resize=1024%2C496&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-2.41.04-AM.png?resize=1026%2C497&amp;ssl=1 1026w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-2.41.04-AM.png?resize=675%2C327&amp;ssl=1 675w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">Adding a new library to processing</figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph">After this window appears, search for ControlP5, then select the&nbsp;<strong>ControlP5</strong> library and press&nbsp;install. The installation process will take only a few minutes.</p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="700" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-2.41.10-AM.png?resize=770%2C700&#038;ssl=1" alt="Installing a new library" class="wp-image-147" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-2.41.10-AM.png?w=1724&amp;ssl=1 1724w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-2.41.10-AM.png?resize=800%2C728&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-2.41.10-AM.png?resize=300%2C273&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-2.41.10-AM.png?resize=768%2C699&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-2.41.10-AM.png?resize=1024%2C931&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-2.41.10-AM.png?resize=1026%2C933&amp;ssl=1 1026w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-2.41.10-AM.png?resize=675%2C614&amp;ssl=1 675w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-2.41.10-AM.png?w=1540&amp;ssl=1 1540w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">Installing a new library</figcaption></figure>
</div>


<ul class="wp-block-list">
<li>Import the ControlP5 library to our sketch <code>import controlP5.*;</code></li>



<li>Take an Object from the ControlP5 class <code>ControlP5 cp5;</code> . I will name it &#8220;cp5&#8221; <em>(you can name it as you want)</em> this cp5 object allows you to use the ControlP5 library methods to add buttons, sliders, checkboxes, etc&#8230;</li>
</ul>



<p class="has-regular-font-size wp-block-paragraph"><strong>inside the&nbsp;</strong><code><strong>setup()</strong></code><strong>&nbsp;function</strong></p>



<ul class="wp-block-list">
<li>Set up the cp5 object cp5 = <code>new ControlP5(this);</code></li>



<li>adding buttons using the ControlP5 library is very simple, you just need to use the <code>.addButton("name")</code> method to give it a name. and use the <code>.setPosition(x, y)</code> method to position it on the screen, and the .<code>setSize(w, h)</code> method to set its dimensions. that&#8217;s it.</li>
</ul>



<h4 class="wp-block-heading">Buttons Functionality</h4>



<pre class="EnlighterJSRAW" data-enlighter-language="java" data-enlighter-theme="twilight" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">import controlP5.*;             //import ControlP5 library            
import processing.serial.*;     //import the Serial Library            
            
ControlP5 cp5;                  //create ControlP5 object            
Serial port;                    //create Serial object            
            
void setup() {              
size(500, 300);              
cp5 = new ControlP5(this);            
port = new Serial(this, "/dev/tty.usbmodem143101", 9600);            
            
cp5.addButton("forward")                  
  .setPosition(190, 50)              
  .setSize(120, 70)                    
  ;                 
cp5.addButton("backward")                    
  .setPosition(190, 210)              
  .setSize(120, 70)                    
  ;              
cp5.addButton("right")                  
  .setPosition(350, 130)            
  .setSize(120, 70)            
  ;              
cp5.addButton("left")             
  .setPosition(30, 130)                
  .setSize(120, 70)                   
  ;              
cp5.addButton("stop")                 
  .setPosition(190, 130)                
  .setSize(120, 70)             
  ;              
}              
            
void draw() {              
background(150, 0, 150);              
fill(255);              
text("Motor Control GUI", 195, 30);              
}             
             
void forward() {            
 port.write('f');            
}            
void backward() {            
 port.write('b');            
}            
void right() {            
 port.write('r');            
}            
void left() {            
 port.write('l');            
}            
void stop() {            
 port.write('s');            
} </pre>



<p class="has-regular-font-size wp-block-paragraph">We will implement 5 different methods, one method for each button. the method name should be the same name as the button. this method will get called once the button gets clicked.<br><br><strong>For Example,</strong> when we click the &#8220;right&#8221; button, the&nbsp;<code>right()</code>&nbsp;method will get called. So, the Processing IDE will send the character &#8216;r&#8217; to the Arduino Serial port via Serial Communication.</p>



<h4 class="wp-block-heading">How to use it</h4>



<ul class="wp-block-list">
<li>Now all you have to do is to connect your Arduino board using the USB cable with your laptop and upload the Arduino code.</li>



<li>Then run the Processing program and enjoy your Work!</li>
</ul>



<h2 class="wp-block-heading">Make it wireless</h2>



<p class="has-regular-font-size wp-block-paragraph">Voilaaa! Now we are able to control the Motors from Processing through the Serial Communication, but what about getting rid of the ugly USB cable. Cool, Right!<br><br>To make it wireless we will use the HC-05 Bluetooth module which has wide use, it can set as slave or master as well (unlike the HC-06 module which can work only as a slave) which means that you can make a Bluetooth connection between two different Arduino boards. the HC-05 Bluetooth module is an SPP (Serial Port Protocol) module, which means that it communicates with the Arduino board via Serial communication.</p>



<h4 class="wp-block-heading">Circuit Diagram</h4>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="605" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/final-wiringEdited.png?resize=770%2C605&#038;ssl=1" alt="Adding the Bluetooth Module" class="wp-image-148" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/final-wiringEdited.png?w=1971&amp;ssl=1 1971w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/final-wiringEdited.png?resize=800%2C628&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/final-wiringEdited.png?resize=300%2C236&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/final-wiringEdited.png?resize=768%2C603&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/final-wiringEdited.png?resize=1024%2C804&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/final-wiringEdited.png?resize=1026%2C806&amp;ssl=1 1026w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/final-wiringEdited.png?resize=675%2C530&amp;ssl=1 675w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/final-wiringEdited.png?w=1540&amp;ssl=1 1540w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">Adding the Bluetooth Module</figcaption></figure>
</div>


<h4 class="wp-block-heading">Processing Code Modification (macOS &amp; Linux)</h4>



<p class="has-regular-font-size wp-block-paragraph">we need to make a slight modification in our Processing Code, we need to update our port name&nbsp;<code>"/dev/tty.usbmodem143101"</code>&nbsp;to the new HC-05 port name.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="java" data-enlighter-theme="twilight" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">port = new Serial(this, "/dev/tty.usbmodem143101", 9600);</pre>



<ul class="wp-block-list">
<li><strong>First, </strong>you need to pair your laptop with the HC-05, after powering up your Arduino board go to your Bluetooth preference on your laptop and pair with the Bluetooth module, if asked you for a passcode enter &#8220;1234&#8221;.</li>
</ul>


<div class="wp-block-image">
<figure class="aligncenter"><img loading="lazy" decoding="async" width="1560" height="1088" src="https://i1.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-5.20.16-AM.png?fit=1024%2C714&amp;ssl=1" alt="Pair with the HC-05" class="wp-image-149" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-5.20.16-AM.png?w=1560&amp;ssl=1 1560w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-5.20.16-AM.png?resize=800%2C558&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-5.20.16-AM.png?resize=300%2C209&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-5.20.16-AM.png?resize=768%2C536&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-5.20.16-AM.png?resize=1024%2C714&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-5.20.16-AM.png?resize=1026%2C716&amp;ssl=1 1026w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-5.20.16-AM.png?resize=675%2C471&amp;ssl=1 675w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">Pair with the HC-05</figcaption></figure>
</div>


<ul class="wp-block-list">
<li>Create a new Processing sketch and paste this code in the new sketch and run it, after running the program it will print all the available Serial Ports on the console, choose the HC-05-DevB port.</li>
</ul>



<pre class="EnlighterJSRAW" data-enlighter-language="java" data-enlighter-theme="twilight" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">import processing.serial.*;          
Serial port;          
          
void setup(){          
 printArray(Serial.list());          
}          
void draw(){          
} </pre>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="869" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-5.20.46-AM.png?resize=770%2C869&#038;ssl=1" alt="printing all the available Serial ports" class="wp-image-150" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-5.20.46-AM.png?w=1668&amp;ssl=1 1668w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-5.20.46-AM.png?resize=800%2C903&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-5.20.46-AM.png?resize=266%2C300&amp;ssl=1 266w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-5.20.46-AM.png?resize=768%2C867&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-5.20.46-AM.png?resize=908%2C1024&amp;ssl=1 908w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-5.20.46-AM.png?resize=1026%2C1158&amp;ssl=1 1026w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-5.20.46-AM.png?resize=675%2C762&amp;ssl=1 675w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/Screen-Shot-2019-08-21-at-5.20.46-AM.png?w=1540&amp;ssl=1 1540w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">printing all the available Serial ports</figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph">So in my case, I will update this line</p>



<pre class="EnlighterJSRAW" data-enlighter-language="java" data-enlighter-theme="twilight" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">port = new Serial(this, "/dev/tty.usbmodem143101", 9600);</pre>



<p class="has-regular-font-size wp-block-paragraph">To</p>



<pre class="EnlighterJSRAW" data-enlighter-language="java" data-enlighter-theme="twilight" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">port = new Serial(this, "/dev/tty.HC-05-DevB", 9600);</pre>



<h4 class="wp-block-heading">Processing Code Modification (Windows)</h4>



<ul class="wp-block-list">
<li><strong>First,</strong> you need to pair your laptop with the HC-05, after powering up your Arduino board go to your Bluetooth preference on your laptop and pair with the Bluetooth module, if asked you for a passcode enter &#8220;1234&#8221;. the Bluetooth device needs to be set up to use a COM port, open up the Bluetooth settings and press <em>More Bluetooth Options</em>.</li>
</ul>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="502" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/1.png?resize=770%2C502&#038;ssl=1" alt="Pairing Bluetooth" class="wp-image-151" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/1.png?w=971&amp;ssl=1 971w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/1.png?resize=800%2C522&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/1.png?resize=300%2C196&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/1.png?resize=768%2C501&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/1.png?resize=675%2C440&amp;ssl=1 675w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">Pairing Bluetooth</figcaption></figure>
</div>


<ul class="wp-block-list">
<li>Switch to the <em>COM Ports</em> tab and then press the <em>Add</em> button</li>
</ul>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="423" height="504" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/2.png?resize=423%2C504&#038;ssl=1" alt="Pairing Bluetooth" class="wp-image-152" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/2.png?w=423&amp;ssl=1 423w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/2.png?resize=252%2C300&amp;ssl=1 252w" sizes="auto, (max-width: 423px) 100vw, 423px" /><figcaption class="wp-element-caption"><em>Pairing Bluetooth</em></figcaption></figure>
</div>


<ul class="wp-block-list">
<li>In the <em>Add COM Port</em> dialog select the <em>Outgoing</em> radio button. Choose the <em>HC-05</em> device under <em>Device that will use the COM Port</em> drop-down and then click <em>OK</em>.</li>
</ul>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="492" height="360" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/3.png?resize=492%2C360&#038;ssl=1" alt="Pairing Bluetooth" class="wp-image-153" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/3.png?w=492&amp;ssl=1 492w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/3.png?resize=300%2C220&amp;ssl=1 300w" sizes="auto, (max-width: 492px) 100vw, 492px" /><figcaption class="wp-element-caption"><em>Pairing Bluetooth</em></figcaption></figure>
</div>


<ul class="wp-block-list">
<li>It will assign the device to a COM port, click <em>OK</em> out of the <em>Bluetooth settings</em></li>
</ul>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="423" height="504" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/4.png?resize=423%2C504&#038;ssl=1" alt="" class="wp-image-154" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/4.png?w=423&amp;ssl=1 423w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/4.png?resize=252%2C300&amp;ssl=1 252w" sizes="auto, (max-width: 423px) 100vw, 423px" /><figcaption class="wp-element-caption"><em>Pairing Bluetooth</em></figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph">So, in this case, I will update this line</p>



<pre class="EnlighterJSRAW" data-enlighter-language="java" data-enlighter-theme="twilight" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">port = new Serial(this, "/dev/tty.usbmodem143101", 9600);</pre>



<p class="has-regular-font-size wp-block-paragraph">To</p>



<pre class="EnlighterJSRAW" data-enlighter-language="java" data-enlighter-theme="twilight" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">port = new Serial(this, "COM10", 9600);</pre>



<h4 class="wp-block-heading">How to use it?</h4>



<ul class="wp-block-list">
<li>After uploading the code to the Arduino board, Remove the USB cable and power up the Arduino board using the external battery.</li>



<li>connect with the HC-05 Bluetooth module from your laptop (passcode 1234).</li>



<li>Modify the Processing Code Serial Port name According to your connected Serial Port name.</li>



<li>Run the Processing Code, AND ENJOY PLAYING!</li>
</ul>



<h2 class="wp-block-heading">Thanks!</h2>



<p class="has-regular-font-size wp-block-paragraph">TADA, WE ARE DONE! if you have any questions, don&#8217;t hesitate to drop them in the comments section. And if you like this tutorial, send me some memes on my</p>



<div class="wp-block-button aligncenter"><a class="wp-block-button__link has-background wp-element-button" href="https://www.facebook.com/AhmeddEbrahem" style="border-radius:100px;background-color:#00a99d">Facebook account</a></div>



<script async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-4043148098486780" crossorigin="anonymous"></script>
<ins class="adsbygoogle" style="display:block; text-align:center;" data-ad-layout="in-article" data-ad-format="fluid" data-ad-client="ca-pub-4043148098486780" data-ad-slot="9912528396"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>
<p>The post <a href="https://makesomestuff.org/how-to-control-2wd-robot-wirelessly-through-processing/">Bluetooth-Controlled 2WD Robot</a> appeared first on <a href="https://makesomestuff.org">Make Some Stuff</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://makesomestuff.org/how-to-control-2wd-robot-wirelessly-through-processing/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">99</post-id>	</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 
Minified using Disk

Served from: makesomestuff.org @ 2026-07-31 15:18:09 by W3 Total Cache
-->