<?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>Tutorials Archives &#8211; Make Some Stuff</title>
	<atom:link href="https://makesomestuff.org/tutorials/feed/" rel="self" type="application/rss+xml" />
	<link>https://makesomestuff.org/tutorials/</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</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>Tutorials Archives &#8211; Make Some Stuff</title>
	<link>https://makesomestuff.org/tutorials/</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">165766821</site>	<item>
		<title>Tiny-Cairoduino Open-Source DIY Kit</title>
		<link>https://makesomestuff.org/tiny-cairoduino-kit/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=tiny-cairoduino-kit</link>
					<comments>https://makesomestuff.org/tiny-cairoduino-kit/#respond</comments>
		
		<dc:creator><![CDATA[Ahmed Ibrahim]]></dc:creator>
		<pubDate>Thu, 03 Feb 2022 15:09:05 +0000</pubDate>
				<category><![CDATA[Electronics Projects]]></category>
		<category><![CDATA[Attiny85]]></category>
		<category><![CDATA[Cairoduino]]></category>
		<category><![CDATA[Tiny-Cairoduino]]></category>
		<guid isPermaLink="false">https://makesomestuff.org/?p=1616</guid>

					<description><![CDATA[<p><a href="https://makesomestuff.org">Make Some Stuff</a><br />
<a href="https://makesomestuff.org/tiny-cairoduino-kit/">Tiny-Cairoduino Open-Source DIY Kit</a></p>
<p>Introduction And The Big Picture Tiny-Ciaroduino is a small-sized Development board based on the beautiful ATtiny85 chip from Atmel. Don’t get fooled by its small size, it’s powerful with great potential and well-documented resources built around it. We wanted to make a small-sized and low-cost development board that fits in any project without hesitation. You [...]</p>
<p>The post <a href="https://makesomestuff.org/tiny-cairoduino-kit/">Tiny-Cairoduino Open-Source DIY Kit</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/tiny-cairoduino-kit/">Tiny-Cairoduino Open-Source DIY Kit</a></p>

<h2 class="has-text-align-left wp-block-heading" id="introduction-and-the-big-picture" style="text-transform:capitalize">Introduction And The Big Picture</h2>



<p class="wp-block-paragraph">Tiny-Ciaroduino is a small-sized Development board based on the beautiful ATtiny85 chip from Atmel. Don’t get fooled by its small size, it’s powerful with great potential and well-documented resources built around it. We wanted to make a small-sized and low-cost development board that fits in any project without hesitation. You don’t need to give up your expensive Arduino or Raspberry pi board anymore to build your project. Blow up your cheap Tiny-Cairoduino board and buy another one, EASY!</p>



<figure class="wp-block-gallery 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-full"><a href="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/20220203_151803-scaled.jpg?ssl=1"><img data-recalc-dims="1" fetchpriority="high" decoding="async" width="770" height="578" data-id="1762" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/20220203_151803-scaled.jpg?resize=770%2C578&#038;ssl=1" alt="" class="wp-image-1762" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/20220203_151803-scaled.jpg?w=2048&amp;ssl=1 2048w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/20220203_151803-scaled.jpg?resize=300%2C225&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/20220203_151803-scaled.jpg?resize=1024%2C768&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/20220203_151803-scaled.jpg?resize=1536%2C1152&amp;ssl=1 1536w" sizes="(max-width: 770px) 100vw, 770px" /></a></figure>
</figure>



<p class="wp-block-paragraph">There are a lot of open-source Duinos out there, I’m building one more open-source Duino-inspired board but with some addons and features that I was searching for. Tiny-Cairoduino is mainly inspired by the Digispark and the Trinket boards. Thanks to the open-source community. The main goal of the Tiny-Cairoduino board is to integrate the strength points from all the available ATTiny85 based dev boards and come out with a new beast that is easy to program and easy to play with on the hardware level too. And, totally open-source!</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="1333888114"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">Our plan is to develop a whole set of shields that helps hobbyists and newbies to easily implement their hardware projects like if they are assembling lego bricks. We are currently working on that and we will be publishing these shields very soon.</p>



<figure class="wp-block-image size-full"><a href="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Tiny-Shields-1024x768.jpg?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="578" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Tiny-Shields.jpg?resize=770%2C578&#038;ssl=1" alt="" class="wp-image-1708" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Tiny-Shields.jpg?w=1200&amp;ssl=1 1200w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Tiny-Shields.jpg?resize=300%2C225&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Tiny-Shields.jpg?resize=1024%2C768&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Tiny-Shields.jpg?resize=600%2C450&amp;ssl=1 600w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Tiny-Shields.jpg?resize=800%2C600&amp;ssl=1 800w" sizes="auto, (max-width: 770px) 100vw, 770px" /></a></figure>



<p class="wp-block-paragraph">I told you before, Don’t get fooled with its size! Despite being so small The Attiny85 chip has 8K bytes of flash memory and 5 I/O pins. All the 5 GPIO pins can be programmed as digital inputs or digital outputs. Including ADC(analog input) on four pins, PWM(analog outputs) on three pins -more can be achieved with software PWM-. It literally plug and play thanks to the preloaded bootloader that helps you to reprogram the board over USB like any Arduino board. Tiny-Cairoduino is also compatible with Arduino IDE. Even though you can program your Tiny-Cairoduino using the Arduino IDE, it&#8217;s not fully 100% Arduino-compatible. There are some things you trade-off for such a small and low-cost microcontroller!</p>



<ul class="wp-block-list"><li>Tiny-Cairoduino does not have a Serial port connection for debugging so the serial port monitor will not be able to send/receive data. But, you still can reprogram your board through the USB connection.</li></ul>


<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;">Some computers&#8217; USB v3 ports don&#8217;t recognize the Tiny-Cairoduino’s bootloader. Simply use a USB v2 port or a USB hub in between</div></div>



<h2 class="wp-block-heading" id="tiny-cairoduino-specifications">Tiny-Cairoduino specifications:</h2>



<ol class="wp-block-list"><li>Support for the Arduino IDE 1.0 and later (OS X, Windows, and Linux).</li><li>Built-in USB for programming.</li><li>5 I/O pins (2 are used for USB only if your program actively communicates over USB, otherwise you can use all 5 even if you are programming via USB).</li><li>8 KB flash memory (about 6 KB after bootloader),</li><li>I2C and SPI (vis USI).</li><li>PWM on 3 pins (more possible with Software PWM).</li><li>ADC on 4 pins.</li><li>On-board power indicator LED.</li><li>On-board WS2818B addressable RGB led (connected on pin 4).</li><li>Keyboard or other HID devices emulation (mouse, gamepad &#8230;).</li><li>Handy pinout header to easily connect your Tiny-Cairoduino with the outside world.</li><li>On-board RESET button.</li><li>A whole set of shields to maximize and expand the board functionality.</li><li>Four mounting holes!</li></ol>



<h2 class="wp-block-heading" id="guided-tour">Guided Tour</h2>



<figure class="wp-block-image size-full"><a href="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Tiny-Cairoduino-Guided-Tour_resized-scaled.jpg?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="579" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Tiny-Cairoduino-Guided-Tour_resized-scaled.jpg?resize=770%2C579&#038;ssl=1" alt="Cairoduino Board" class="wp-image-1694" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Tiny-Cairoduino-Guided-Tour_resized-scaled.jpg?w=2048&amp;ssl=1 2048w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Tiny-Cairoduino-Guided-Tour_resized-scaled.jpg?resize=300%2C226&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Tiny-Cairoduino-Guided-Tour_resized-scaled.jpg?resize=1024%2C770&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Tiny-Cairoduino-Guided-Tour_resized-scaled.jpg?resize=768%2C578&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Tiny-Cairoduino-Guided-Tour_resized-scaled.jpg?resize=1536%2C1155&amp;ssl=1 1536w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Tiny-Cairoduino-Guided-Tour_resized-scaled.jpg?resize=600%2C450&amp;ssl=1 600w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Tiny-Cairoduino-Guided-Tour_resized-scaled.jpg?resize=800%2C602&amp;ssl=1 800w" sizes="auto, (max-width: 770px) 100vw, 770px" /></a><figcaption>Tiny-Cairoduino Board</figcaption></figure>



<p class="wp-block-paragraph">Let me take you a tour through your Tiny-Cairoduino development board, Each board is assembled here at Make Some Stuff with love.</p>



<ul class="wp-block-list"><li><strong>Mini-B USB</strong>: We settled on the Mini-B USB for powering the board and code uploading for many reasons. The Mini-B USB is very rigid and solid on the PCB unlike other connector types like the Micro-B connectors which can rip off the PCB easily. Also, the Mini-B USB is a proper connector type, you can grab any USB cable with any length from any hardware store. Some Attiny85 Dev. boards use a PCB that slides into a USB port to cut costs, but that makes it hard to re-program and annoying to power with an external battery pack.</li></ul>



<figure class="wp-block-image size-full"><a href="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/usb-scaled.jpeg?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="579" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/usb-scaled.jpeg?resize=770%2C579&#038;ssl=1" alt="" class="wp-image-1752" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/usb-scaled.jpeg?w=2048&amp;ssl=1 2048w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/usb-scaled.jpeg?resize=300%2C226&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/usb-scaled.jpeg?resize=1024%2C770&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/usb-scaled.jpeg?resize=1536%2C1155&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></a></figure>



<ul class="wp-block-list"><li><strong>Power LED</strong>: A cool power indicator LED. It lets you know when your board is powered up by being so lit!</li></ul>



<figure class="wp-block-image size-full"><a href="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/pow_led-scaled.jpeg?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="579" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/pow_led-scaled.jpeg?resize=770%2C579&#038;ssl=1" alt="" class="wp-image-1749" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/pow_led-scaled.jpeg?w=2048&amp;ssl=1 2048w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/pow_led-scaled.jpeg?resize=300%2C226&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/pow_led-scaled.jpeg?resize=1024%2C770&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/pow_led-scaled.jpeg?resize=768%2C578&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/pow_led-scaled.jpeg?resize=1536%2C1155&amp;ssl=1 1536w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/pow_led-scaled.jpeg?resize=600%2C450&amp;ssl=1 600w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/pow_led-scaled.jpeg?resize=800%2C602&amp;ssl=1 800w" sizes="auto, (max-width: 770px) 100vw, 770px" /></a></figure>



<ul class="wp-block-list"><li><strong>Reset Push-button</strong>: An onboard reset push-button launches the bootloader program when pressed. Making it easy to reprogram the board without unplugging and replugging the board to the computer.</li></ul>



<figure class="wp-block-image size-full"><a href="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/reset-scaled.jpeg?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="579" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/reset-scaled.jpeg?resize=770%2C579&#038;ssl=1" alt="" class="wp-image-1750" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/reset-scaled.jpeg?w=2048&amp;ssl=1 2048w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/reset-scaled.jpeg?resize=300%2C226&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/reset-scaled.jpeg?resize=1024%2C770&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/reset-scaled.jpeg?resize=1536%2C1155&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></a></figure>



<ul class="wp-block-list"><li><strong>External reset pin</strong>: We bring out the reset pin so you can reset your board without reaching the onboard reset button. It’s handy when your board is inside an enclosure or a box and it’s hard to reach out, you can wire up a button to this pin to reset your board on the road.</li></ul>



<figure class="wp-block-image size-full"><a href="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/rest_pin_ext-scaled.jpeg?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="579" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/rest_pin_ext-scaled.jpeg?resize=770%2C579&#038;ssl=1" alt="" class="wp-image-1751" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/rest_pin_ext-scaled.jpeg?w=2048&amp;ssl=1 2048w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/rest_pin_ext-scaled.jpeg?resize=300%2C226&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/rest_pin_ext-scaled.jpeg?resize=1024%2C770&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/rest_pin_ext-scaled.jpeg?resize=1536%2C1155&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></a></figure>



<ul class="wp-block-list"><li><strong>Breadboard-friendly header</strong>: You can easily plug the board on a breadboard and have a bigger space to wire things up.</li></ul>



<figure class="wp-block-image size-full"><a href="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/friendly_header-scaled.jpeg?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="579" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/friendly_header-scaled.jpeg?resize=770%2C579&#038;ssl=1" alt="" class="wp-image-1748" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/friendly_header-scaled.jpeg?w=2048&amp;ssl=1 2048w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/friendly_header-scaled.jpeg?resize=300%2C226&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/friendly_header-scaled.jpeg?resize=1024%2C770&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/friendly_header-scaled.jpeg?w=1540&amp;ssl=1 1540w" sizes="auto, (max-width: 770px) 100vw, 770px" /></a></figure>



<ul class="wp-block-list"><li><strong>WS2818B RGB LED</strong>: An onboard WS2818B addressable RGB LED connected on pin #4. You can easily control it to make some cool stuff according to your needs.</li></ul>



<figure class="wp-block-image size-full"><a href="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/WS2818B-scaled.jpg?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="579" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/WS2818B-scaled.jpg?resize=770%2C579&#038;ssl=1" alt="" class="wp-image-1753" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/WS2818B-scaled.jpg?w=2048&amp;ssl=1 2048w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/WS2818B-scaled.jpg?resize=300%2C226&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/WS2818B-scaled.jpg?resize=1024%2C770&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/WS2818B-scaled.jpg?resize=1536%2C1155&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></a></figure>



<ul class="wp-block-list"><li><strong>AMS1117-5V regulator</strong>: An onboard 5V 1A voltage regulator. It allows you to supply voltage from 7V to 12V on the Vin pin without fearing the needed 5V for the microcontroller. It does the work for you. Making the Tiny-Cairoduino proper for DIY projects and very easy to connect to a wall adapter, power bank, battery, or any other kind of power source.</li></ul>



<figure class="wp-block-image size-full"><a href="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/AMS_regulator-scaled.jpeg?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="579" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/AMS_regulator-scaled.jpeg?resize=770%2C579&#038;ssl=1" alt="" class="wp-image-1747" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/AMS_regulator-scaled.jpeg?w=2048&amp;ssl=1 2048w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/AMS_regulator-scaled.jpeg?resize=300%2C226&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/AMS_regulator-scaled.jpeg?resize=1024%2C770&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/AMS_regulator-scaled.jpeg?w=1540&amp;ssl=1 1540w" sizes="auto, (max-width: 770px) 100vw, 770px" /></a></figure>



<h2 class="wp-block-heading" id="tiny-cairoduino-pinout">Tiny-Cairoduino Pinout</h2>



<figure class="wp-block-image size-full"><a href="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Pinout.jpg?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="339" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Pinout.jpg?resize=770%2C339&#038;ssl=1" alt="" class="wp-image-1698" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Pinout.jpg?w=1396&amp;ssl=1 1396w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Pinout.jpg?resize=300%2C132&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Pinout.jpg?resize=1024%2C451&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Pinout.jpg?resize=800%2C352&amp;ssl=1 800w" sizes="auto, (max-width: 770px) 100vw, 770px" /></a></figure>



<h3 class="wp-block-heading" id="power-pins"><strong>Power Pins</strong></h3>



<p class="wp-block-paragraph">Let’s start with the power pins. On the top of the board, you will see three different power pins 5V pin, VIN pin, and GND pin.</p>



<ul class="wp-block-list"><li><strong>5V pin</strong>: It’s a power positive pin connected to the output terminal of the voltage regulator and also connected to the USB 5V terminal. If you are powering your Tiny-Cairoduino board from your computer through the USB cable, you can use this pin to get 5V upto 500mA coming from your computer USB port, with it you can charge a battery, or control some output devices. If you are powering your Tiny-Cairoduino board from an external power source like a battery, power bank, or any other kind of power source through the VIN pin, you can use this pin to get 5V upto 1A coming from the onboard voltage regulator.</li></ul>


<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 use this pin to directly supply 5V power to power up your board. But, we don’t recommend that</div></div>



<ul class="wp-block-list"><li><strong>VIN pin</strong>: You can use this pin to power up your Tiny-Cairoduino board from a battery, power bank, power adapter, or any other type of power source. Connect the positive terminal(+) of your power source to this pin and the ground terminal(-) to the Tiny-Cairoduino GND pin. Your power source needs to be between 7V and upto 12V.</li><li><strong>GND Pin</strong>: It&#8217;s the common ground pin of the Tiny-Cairoduino used for logic and power. It is connected to the USB ground and the AMS1117 voltage regulator. This is the pin you&#8217;ll want to use for any and all ground connections.</li></ul>



<h3 class="wp-block-heading" id="gpio-pins"><strong>GPIO Pins</strong></h3>



<p class="wp-block-paragraph">All the GPIO pins can be used as digital input or digital output pins, you can use them to read data from a sensor, control an LED, reading switch state, … They are all 5V logic pins. Each pin can provide upto 20mA of current. Don’t connect any component that draws more than 20mA directly to the GPIO pins like motors for example. You can use a transistor, relay, or motor driver instead.&nbsp;</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="1333888114"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">The first three GPIO pins(#0, #1, #2) are all completely free you can program them without worrying about USB communication interference.</p>



<ul class="wp-block-list"><li><strong>GPIO #0</strong>: It’s connected to the ATtiny85 PB0 pin, it can be used as an output PWM pin, also can be used as MOSI pin(SPI communication), also can be used as I2C data pin(SDA I2C Pin).</li><li><strong>GPIO #1</strong>: It’s connected to the ATtiny85 PB1 pin, it can be used as an output PWM pin, also can be used as MISO pin(SPI communication).</li><li><strong>GPIO #3</strong>: It’s connected to the ATtiny85 PB1 pin, also can be used as SCK(SPI communication clock pin), also can be used as I2C clock pin(SCL I2C pin), also can be used as an analog input pin which is known as A1.</li></ul>



<p class="wp-block-paragraph">The remaining two GPIO pins(#3, #4) are connected to the USB port for USB programming. When the board is in the bootloader mode or in the middle of a program uploading these two pins are used to send/receive data to/from the computer. So, it’s highly recommended to not use them while you are reprogramming your board. Also, it’s recommended to disconnect any connections from these pins while uploading your program.</p>



<ul class="wp-block-list"><li><strong>GPIO #3</strong>: It’s connected directly to the ATtiny85 PB3 pin, It’s also used for USB programming, it also can be used as an analog input pin which is known as A3. it also can be used as a PWM output pin.</li><li><strong>GPIO #4</strong>: It’s connected directly to the ATtiny85 PB4 pin, It’s also used for USB programming, it also can be used as an analog input pin which is known as A2. it also can be used as a PWM output pin. It’s also connected to the onboard WS2818B LED.</li></ul>



<ul class="wp-block-list"><li><strong>RST</strong>: The reset pin is connected directly to the ATtiny85 reset pin and to the reset push button. It can be used to restart your board in case you want to reset it. Or to enter the bootloader mode to easily reprogram your board without unplugging and replugging the USB cable. You can wire a simple push-button from the reset pin to the ground and press it if you want to enter the bootloader mode in case the board is inside an enclosure or a box and it’s hard to reach.</li></ul>



<h2 class="wp-block-heading" id="installing-the-board-drivers">Installing The Board Drivers</h2>



<p class="wp-block-paragraph">To be able to program your board and make it recognizable by your laptop, you need to install some drivers. MAC and Linux operating systems already have the drivers installed. So, MAC and Linux users don’t need this step. Only Windows users need to install the board drivers.&nbsp;</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;">Windows 10 users probably can skip this step, because Windows 10 already has many drivers built-in. Try skipping the installation first to see if it&#8217;s unnecessary.</div></div>



<p class="wp-block-paragraph">We need to download the Digispark bootloader Windows drivers from the link down below. After extracting the .zip file, if you are using a 64-bit Windows OS you will need to use this installer “DPinst64”. And, if you are using a 32-bit Windows OS you will need to use this installer “DPinst”.</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 is-style-fill"><a class="wp-block-button__link has-white-color has-vivid-green-cyan-background-color has-text-color has-background" href="https://github.com/digistump/DigistumpArduino/releases/download/1.6.7/Digistump.Drivers.zip" style="border-radius:50px">Donwload Drivers</a></div>
</div>



<figure class="wp-block-image size-full"><a href="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/DP_instal.jpg?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="416" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/DP_instal.jpg?resize=770%2C416&#038;ssl=1" alt="" class="wp-image-1755" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/DP_instal.jpg?w=1366&amp;ssl=1 1366w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/DP_instal.jpg?resize=300%2C162&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/DP_instal.jpg?resize=1024%2C553&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/DP_instal.jpg?resize=800%2C432&amp;ssl=1 800w" sizes="auto, (max-width: 770px) 100vw, 770px" /></a></figure>



<p class="wp-block-paragraph">After finishing the installation process. Plug in your Cairoduino board to your laptop and open the device manager on your windows. Now you should find your Tiny-Cairoduino board listed under the “libusb-win32 devices” as “Digispark Bootloader”.&nbsp;</p>



<figure class="wp-block-image size-full"><a href="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/Digistump_libUSB.jpg?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="553" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/Digistump_libUSB.jpg?resize=770%2C553&#038;ssl=1" alt="" class="wp-image-1756" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/Digistump_libUSB.jpg?w=986&amp;ssl=1 986w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/Digistump_libUSB.jpg?resize=300%2C215&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/Digistump_libUSB.jpg?resize=800%2C574&amp;ssl=1 800w" sizes="auto, (max-width: 770px) 100vw, 770px" /></a></figure>



<p class="wp-block-paragraph">If you did not find it. Click on the “View” tab from the top menu bar and select “Show hidden devices”. Now, you should see “Unknown device” under “Other devices”.&nbsp;</p>



<figure class="wp-block-image size-full"><a href="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/show_hidden_devices.jpg?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="553" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/show_hidden_devices.jpg?resize=770%2C553&#038;ssl=1" alt="" class="wp-image-1757" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/show_hidden_devices.jpg?w=981&amp;ssl=1 981w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/show_hidden_devices.jpg?resize=300%2C216&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/show_hidden_devices.jpg?resize=800%2C575&amp;ssl=1 800w" sizes="auto, (max-width: 770px) 100vw, 770px" /></a></figure>



<p class="wp-block-paragraph">Press right-click on “Unknown device” and select “Update Driver Software…”</p>



<figure class="wp-block-image size-full"><a href="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/updated_board_driver.jpg?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="550" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/updated_board_driver.jpg?resize=770%2C550&#038;ssl=1" alt="" class="wp-image-1758" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/updated_board_driver.jpg?w=982&amp;ssl=1 982w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/updated_board_driver.jpg?resize=300%2C214&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/updated_board_driver.jpg?resize=800%2C572&amp;ssl=1 800w" sizes="auto, (max-width: 770px) 100vw, 770px" /></a></figure>



<p class="wp-block-paragraph">select “Browse my computer for driver software”. Then select the location for the drivers we installed in the previous step. You can use the “Browse” button to select the drivers location.</p>



<figure class="wp-block-image size-full"><a href="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/Browse_select-_driver_loc.jpg?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="553" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/Browse_select-_driver_loc.jpg?resize=770%2C553&#038;ssl=1" alt="" class="wp-image-1759" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/Browse_select-_driver_loc.jpg?w=979&amp;ssl=1 979w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/Browse_select-_driver_loc.jpg?resize=300%2C215&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/Browse_select-_driver_loc.jpg?resize=800%2C574&amp;ssl=1 800w" sizes="auto, (max-width: 770px) 100vw, 770px" /></a></figure>



<p class="wp-block-paragraph">Once you finish that and see the message “Windows has successfully updated your driver software” now unplug your board and plug it in again. You should now find your Tiny-Cairoduino board listed under the “libusb-win32 devices” as “Digispark Bootloader”.</p>



<figure class="wp-block-image size-full"><a href="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/Digistump_libUSB.jpg?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="553" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/Digistump_libUSB.jpg?resize=770%2C553&#038;ssl=1" alt="" class="wp-image-1756" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/Digistump_libUSB.jpg?w=986&amp;ssl=1 986w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/Digistump_libUSB.jpg?resize=300%2C215&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/Digistump_libUSB.jpg?resize=800%2C574&amp;ssl=1 800w" sizes="auto, (max-width: 770px) 100vw, 770px" /></a></figure>



<h2 class="wp-block-heading" id="how-to-program-your-board">How To Program Your Board</h2>



<p class="wp-block-paragraph">After installing the DigiSpark drivers, we are now ready to program our Tiny-Cairoduino board. By default, Arduino IDE does not contain the Digispark boards so we need to add these boards manually by ourselves. To do that, from the Arduino IDE top menu bar press on File &gt; Preferences and add the link below in the Additional Boards Manager URLs then click ‘OK.</p>



<pre class="wp-block-code"><code>http:&#47;&#47;digistump.com/package_digistump_index.json</code></pre>



<figure class="wp-block-image size-full"><a href="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/device-manager-min.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="564" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/device-manager-min.png?resize=770%2C564&#038;ssl=1" alt="" class="wp-image-1696" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/device-manager-min.png?w=1824&amp;ssl=1 1824w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/device-manager-min.png?resize=300%2C220&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/device-manager-min.png?resize=1024%2C750&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/device-manager-min.png?resize=1536%2C1125&amp;ssl=1 1536w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/device-manager-min.png?resize=800%2C586&amp;ssl=1 800w" sizes="auto, (max-width: 770px) 100vw, 770px" /></a></figure>



<p class="wp-block-paragraph">After that, from the Arduino IDE top menu bar press on tools &gt; Board &gt; Boards Manager and search by “Digistump AVR” then select “Digistump AVR Boards by Digistump” and click on install.&nbsp;</p>



<div class="wp-block-jetpack-slideshow aligncenter" data-effect="slide"><div class="wp-block-jetpack-slideshow_container swiper-container"><ul class="wp-block-jetpack-slideshow_swiper-wrapper swiper-wrapper"><li class="wp-block-jetpack-slideshow_slide swiper-slide"><figure><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="729" alt="" class="wp-block-jetpack-slideshow_image wp-image-1699" data-id="1699" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Screen-Shot-2022-01-24-at-1.36.36-PM-min.png?resize=770%2C729&#038;ssl=1" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Screen-Shot-2022-01-24-at-1.36.36-PM-min.png?w=1790&amp;ssl=1 1790w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Screen-Shot-2022-01-24-at-1.36.36-PM-min.png?resize=300%2C284&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Screen-Shot-2022-01-24-at-1.36.36-PM-min.png?resize=1024%2C969&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Screen-Shot-2022-01-24-at-1.36.36-PM-min.png?resize=1536%2C1454&amp;ssl=1 1536w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Screen-Shot-2022-01-24-at-1.36.36-PM-min.png?resize=800%2C757&amp;ssl=1 800w" sizes="(max-width: 770px) 100vw, 770px" /></figure></li><li class="wp-block-jetpack-slideshow_slide swiper-slide"><figure><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="474" alt="" class="wp-block-jetpack-slideshow_image wp-image-1700" data-id="1700" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Screen-Shot-2022-01-24-at-1.37.16-PM-min.png?resize=770%2C474&#038;ssl=1" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Screen-Shot-2022-01-24-at-1.37.16-PM-min.png?w=1824&amp;ssl=1 1824w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Screen-Shot-2022-01-24-at-1.37.16-PM-min.png?resize=300%2C185&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Screen-Shot-2022-01-24-at-1.37.16-PM-min.png?resize=1024%2C631&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Screen-Shot-2022-01-24-at-1.37.16-PM-min.png?resize=1536%2C947&amp;ssl=1 1536w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Screen-Shot-2022-01-24-at-1.37.16-PM-min.png?resize=800%2C493&amp;ssl=1 800w" sizes="(max-width: 770px) 100vw, 770px" /></figure></li></ul><a class="wp-block-jetpack-slideshow_button-prev swiper-button-prev swiper-button-white" role="button"></a><a class="wp-block-jetpack-slideshow_button-next swiper-button-next swiper-button-white" role="button"></a><a aria-label="Pause Slideshow" class="wp-block-jetpack-slideshow_button-pause" role="button"></a><div class="wp-block-jetpack-slideshow_pagination swiper-pagination swiper-pagination-white"></div></div></div>



<p class="wp-block-paragraph">After installing the board on your Arduino IDE, now you can select the “Digispark (Default 16.5MHz)” board from Tools &gt; Board under the Digispark AVR Boards.</p>



<figure class="wp-block-image size-full"><a href="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Screen-Shot-2022-01-24-at-1.44.55-PM-min.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="553" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Screen-Shot-2022-01-24-at-1.44.55-PM-min.png?resize=770%2C553&#038;ssl=1" alt="" class="wp-image-1701" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Screen-Shot-2022-01-24-at-1.44.55-PM-min.png?w=2348&amp;ssl=1 2348w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Screen-Shot-2022-01-24-at-1.44.55-PM-min.png?resize=300%2C215&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Screen-Shot-2022-01-24-at-1.44.55-PM-min.png?resize=1024%2C735&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Screen-Shot-2022-01-24-at-1.44.55-PM-min.png?resize=1536%2C1103&amp;ssl=1 1536w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Screen-Shot-2022-01-24-at-1.44.55-PM-min.png?resize=2048%2C1471&amp;ssl=1 2048w" sizes="auto, (max-width: 770px) 100vw, 770px" /></a></figure>



<p class="wp-block-paragraph">Now, you are ready to upload your first program to the Tiny-Cairoduino board. Copy the code down below, paste it into your Arduino IDE and press the upload button. Once you see the message “Plug in device now … (Will timeout after 60 seconds)” in the messages display place on the bottom of the Arduino IDE program, press on the reset button of the Tiny-Cairoduino board. The code will get uploaded on your Tiny-Cairoduino board and the Arduino IDE will display “Micronucleus done. Thank you!”.&nbsp;</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">// NeoPixel Ring simple sketch (c) 2013 Shae Erisson
// released under the GPLv3 license to match the rest of the AdaFruit NeoPixel library
#include &lt;Adafruit_NeoPixel.h>

// Which pin on the Arduino is connected to the NeoPixels?
#define PIN            4

// How many NeoPixels are attached to the Arduino?
#define NUMPIXELS      1

// When we setup the NeoPixel library, we tell it how many pixels, and which pin to use to send signals.
// Note that for older NeoPixel strips you might need to change the third parameter--see the strandtest
// example for more information on possible values.
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_RGB + NEO_KHZ800);

int delayval = 5; // delay for half a second

void setup() {
  pixels.begin(); // This initializes the NeoPixel library.
}

void loop() {
  for (int i = 0 ; i &lt;= 255 ; i++) {
    pixels.setPixelColor(0, pixels.Color(i, 0, 0)); // Moderately bright green color.
    pixels.show(); // This sends the updated pixel color to the hardware.
    delay(delayval); // Delay for a period of time (in milliseconds).
  }
  delay(80);
  for (int i = 255 ; i >= 0 ; i--) {
    pixels.setPixelColor(0, pixels.Color(i, 0, 0)); // Moderately bright green color.
    pixels.show(); // This sends the updated pixel color to the hardware.
    delay(delayval); // Delay for a period of time (in milliseconds).
  }
  for (int i = 0 ; i &lt;= 255 ; i++) {
    pixels.setPixelColor(0, pixels.Color(0, i, 0)); // Moderately bright green color.
    pixels.show(); // This sends the updated pixel color to the hardware.
    delay(delayval); // Delay for a period of time (in milliseconds).
  }
  delay(80);
  for (int i = 255 ; i >= 0 ; i--) {
    pixels.setPixelColor(0, pixels.Color(0, i, 0)); // Moderately bright green color.
    pixels.show(); // This sends the updated pixel color to the hardware.
    delay(delayval); // Delay for a period of time (in milliseconds).
  }
  for (int i = 0 ; i &lt;= 255 ; i++) {
    pixels.setPixelColor(0, pixels.Color(0, 0, i)); // Moderately bright green color.
    pixels.show(); // This sends the updated pixel color to the hardware.
    delay(delayval); // Delay for a period of time (in milliseconds).
  }
  delay(80);
  for (int i = 255 ; i >= 0 ; i--) {
    pixels.setPixelColor(0, pixels.Color(0, 0, i)); // Moderately bright green color.
    pixels.show(); // This sends the updated pixel color to the hardware.
    delay(delayval); // Delay for a period of time (in milliseconds).
  }
  delay(100);
}</pre>



<div class="wp-block-jetpack-slideshow aligncenter" data-effect="slide"><div class="wp-block-jetpack-slideshow_container swiper-container"><ul class="wp-block-jetpack-slideshow_swiper-wrapper swiper-wrapper"><li class="wp-block-jetpack-slideshow_slide swiper-slide"><figure><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="579" alt="" class="wp-block-jetpack-slideshow_image wp-image-1703" data-id="1703" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Screen-Shot-2022-01-24-at-2.17.38-PM-min.png?resize=770%2C579&#038;ssl=1" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Screen-Shot-2022-01-24-at-2.17.38-PM-min.png?w=2184&amp;ssl=1 2184w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Screen-Shot-2022-01-24-at-2.17.38-PM-min.png?resize=300%2C226&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Screen-Shot-2022-01-24-at-2.17.38-PM-min.png?resize=1024%2C770&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Screen-Shot-2022-01-24-at-2.17.38-PM-min.png?resize=1536%2C1155&amp;ssl=1 1536w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Screen-Shot-2022-01-24-at-2.17.38-PM-min.png?resize=2048%2C1540&amp;ssl=1 2048w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Screen-Shot-2022-01-24-at-2.17.38-PM-min.png?resize=768%2C577&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Screen-Shot-2022-01-24-at-2.17.38-PM-min.png?resize=600%2C450&amp;ssl=1 600w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Screen-Shot-2022-01-24-at-2.17.38-PM-min.png?resize=800%2C601&amp;ssl=1 800w" sizes="(max-width: 770px) 100vw, 770px" /></figure></li><li class="wp-block-jetpack-slideshow_slide swiper-slide"><figure><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="580" alt="" class="wp-block-jetpack-slideshow_image wp-image-1705" data-id="1705" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Screen-Shot-2022-01-24-at-2.18.02-PM-min.png?resize=770%2C580&#038;ssl=1" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Screen-Shot-2022-01-24-at-2.18.02-PM-min.png?w=2180&amp;ssl=1 2180w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Screen-Shot-2022-01-24-at-2.18.02-PM-min.png?resize=300%2C226&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Screen-Shot-2022-01-24-at-2.18.02-PM-min.png?resize=1024%2C771&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Screen-Shot-2022-01-24-at-2.18.02-PM-min.png?resize=1536%2C1157&amp;ssl=1 1536w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Screen-Shot-2022-01-24-at-2.18.02-PM-min.png?resize=2048%2C1543&amp;ssl=1 2048w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Screen-Shot-2022-01-24-at-2.18.02-PM-min.png?resize=768%2C578&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Screen-Shot-2022-01-24-at-2.18.02-PM-min.png?resize=87%2C67&amp;ssl=1 87w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Screen-Shot-2022-01-24-at-2.18.02-PM-min.png?resize=800%2C603&amp;ssl=1 800w" sizes="(max-width: 770px) 100vw, 770px" /></figure></li></ul><a class="wp-block-jetpack-slideshow_button-prev swiper-button-prev swiper-button-white" role="button"></a><a class="wp-block-jetpack-slideshow_button-next swiper-button-next swiper-button-white" role="button"></a><a aria-label="Pause Slideshow" class="wp-block-jetpack-slideshow_button-pause" role="button"></a><div class="wp-block-jetpack-slideshow_pagination swiper-pagination swiper-pagination-white"></div></div></div>



<p class="wp-block-paragraph">After successfully uploading the code on your Tiny-Cairoduino board, The on-board WS2818B LED should now start breathing between red, green, and blue colors. Congrats! You uploaded your first Arduino code to your Tiny-Cairoduino board.</p>


	<div class="wp-block-jetpack-gif aligncenter">
		<figure>
							<div class="wp-block-jetpack-gif-wrapper" style="padding-top:56%">
					<iframe src="https://giphy.com/embed/mdC1YnkF1otwGt4TQ8" title="https://media.giphy.com/media/mdC1YnkF1otwGt4TQ8/giphy.gif"></iframe>
				</div>
								</figure>
	</div>
	


<h2 class="wp-block-heading" id="board-design">Board Design</h2>



<p class="wp-block-paragraph">Before designing the schematic file, We must settle on the parts and the specific footprints that we will use to build this board. Since we want to make this board as small as possible. We decided to use only SMD parts. All the resistors and capacitors are in 1206 SMD footprint except only one capacitor in 0805 SMD footprint. To regulate the input voltage, we used an AMS1117-5V voltage regulator since it comes in a relatively small form factor but with great power. We used two Schottky diodes, one on the USB port and the other one on the voltage regulator output pin to protect them from any possible reverse current.</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="1333888114"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">To identify our Tiny-Cairoduino board as a USB device to the host, we need to implement the USB communication circuit. Since, the signaling on the D+ and D− lines should be within 0V to 3.3V rails, while the host-supplied voltage is 5V. So we used two 3.3V Zener diodes on the D+ and D- lines to pull those lines two 3.3V. Ali Shtarbanov explained that part in an amazing way is this <a href="http://fab.cba.mit.edu/classes/863.16/doc/tutorials/FabISP/FabISP_Demystified.html" target="_blank" rel="noreferrer noopener">blog</a>.</p>



<p class="wp-block-paragraph">We put a 5050 SMD 5V addressable LED(WS2818B) on the board. It’s connected directly to pin #4 on the ATtniy85 chip. We used two 22uf SMD 0805 capacitors on the input and output pins of the voltage regulator to eliminate any ripples(noise) from those lines. We used one green 0805 SMD LED connected directly to the 5V line which acts as a power indicator. We used a generic two-pin SMD push button that connected to the ATtiny85 reset pin.</p>



<div class="wp-block-jetpack-slideshow aligncenter" data-effect="slide"><div class="wp-block-jetpack-slideshow_container swiper-container"><ul class="wp-block-jetpack-slideshow_swiper-wrapper swiper-wrapper"><li class="wp-block-jetpack-slideshow_slide swiper-slide"><figure><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="626" alt="" class="wp-block-jetpack-slideshow_image wp-image-1725" data-id="1725" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/sch.png?resize=770%2C626&#038;ssl=1" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/sch.png?w=9022&amp;ssl=1 9022w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/sch.png?resize=300%2C244&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/sch.png?resize=1024%2C832&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/sch.png?resize=1536%2C1248&amp;ssl=1 1536w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/sch.png?resize=2048%2C1664&amp;ssl=1 2048w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/sch.png?resize=768%2C624&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/sch.png?resize=800%2C650&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/sch.png?w=2310&amp;ssl=1 2310w" sizes="(max-width: 770px) 100vw, 770px" /></figure></li><li class="wp-block-jetpack-slideshow_slide swiper-slide"><figure><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="1258" alt="" class="wp-block-jetpack-slideshow_image wp-image-1724" data-id="1724" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/brf.png?resize=770%2C1258&#038;ssl=1" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/brf.png?w=1956&amp;ssl=1 1956w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/brf.png?resize=184%2C300&amp;ssl=1 184w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/brf.png?resize=627%2C1024&amp;ssl=1 627w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/brf.png?resize=940%2C1536&amp;ssl=1 940w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/brf.png?resize=1253%2C2048&amp;ssl=1 1253w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/brf.png?resize=768%2C1255&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/brf.png?resize=800%2C1307&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/brf.png?w=1540&amp;ssl=1 1540w" sizes="(max-width: 770px) 100vw, 770px" /></figure></li></ul><a class="wp-block-jetpack-slideshow_button-prev swiper-button-prev swiper-button-white" role="button"></a><a class="wp-block-jetpack-slideshow_button-next swiper-button-next swiper-button-white" role="button"></a><a aria-label="Pause Slideshow" class="wp-block-jetpack-slideshow_button-pause" role="button"></a><div class="wp-block-jetpack-slideshow_pagination swiper-pagination swiper-pagination-white"></div></div></div>



<p class="wp-block-paragraph">We love the open-source community! You can download the PCB Eagle source design files from this link</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-vivid-green-cyan-background-color has-background" href="https://github.com/ahmedibrrahim/Tiny-Cairoduino" style="border-radius:50px" target="_blank" rel="noreferrer noopener">Eagle Source Files</a></div>
</div>



<h2 class="wp-block-heading" id="board-fabrication">Board Fabrication</h2>



<p class="wp-block-paragraph">Before sending the Gerber files to PCBWay to manufacture the Tiny-Cairoduino board, I machined a test board on my Milling machine to test all the functionalities and to make sure that everything is working fine. After that, I sent the Gerber files to <a href="http://www.pcbway.com" target="_blank" rel="noreferrer noopener sponsored nofollow">PCBWay</a> who sponsors this build!</p>



<div class="wp-block-jetpack-slideshow aligncenter" data-effect="slide"><div class="wp-block-jetpack-slideshow_container swiper-container"><ul class="wp-block-jetpack-slideshow_swiper-wrapper swiper-wrapper"><li class="wp-block-jetpack-slideshow_slide swiper-slide"><figure><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="578" alt="" class="wp-block-jetpack-slideshow_image wp-image-1697" data-id="1697" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/PCB_fab.jpg?resize=770%2C578&#038;ssl=1" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/PCB_fab.jpg?w=1200&amp;ssl=1 1200w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/PCB_fab.jpg?resize=300%2C225&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/PCB_fab.jpg?resize=1024%2C768&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/PCB_fab.jpg?resize=600%2C450&amp;ssl=1 600w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/PCB_fab.jpg?resize=800%2C600&amp;ssl=1 800w" sizes="(max-width: 770px) 100vw, 770px" /></figure></li><li class="wp-block-jetpack-slideshow_slide swiper-slide"><figure><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="578" alt="" class="wp-block-jetpack-slideshow_image wp-image-1728" data-id="1728" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/20211216_151534-scaled.jpg?resize=770%2C578&#038;ssl=1" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/20211216_151534-scaled.jpg?w=2048&amp;ssl=1 2048w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/20211216_151534-scaled.jpg?resize=300%2C225&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/20211216_151534-scaled.jpg?resize=1024%2C768&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/20211216_151534-scaled.jpg?resize=1536%2C1152&amp;ssl=1 1536w" sizes="(max-width: 770px) 100vw, 770px" /></figure></li><li class="wp-block-jetpack-slideshow_slide swiper-slide"><figure><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="1077" alt="" class="wp-block-jetpack-slideshow_image wp-image-1729" data-id="1729" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/20211216_182553-1-scaled.jpg?resize=770%2C1077&#038;ssl=1" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/20211216_182553-1-scaled.jpg?w=1464&amp;ssl=1 1464w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/20211216_182553-1-scaled.jpg?resize=214%2C300&amp;ssl=1 214w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/20211216_182553-1-scaled.jpg?resize=732%2C1024&amp;ssl=1 732w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/20211216_182553-1-scaled.jpg?resize=1098%2C1536&amp;ssl=1 1098w" sizes="(max-width: 770px) 100vw, 770px" /></figure></li><li class="wp-block-jetpack-slideshow_slide swiper-slide"><figure><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="579" alt="" class="wp-block-jetpack-slideshow_image wp-image-1734" data-id="1734" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Tiny-Cairoduino-Guided-Tour_2-scaled.jpg?resize=770%2C579&#038;ssl=1" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Tiny-Cairoduino-Guided-Tour_2-scaled.jpg?w=2048&amp;ssl=1 2048w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Tiny-Cairoduino-Guided-Tour_2-scaled.jpg?resize=300%2C226&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Tiny-Cairoduino-Guided-Tour_2-scaled.jpg?resize=1024%2C770&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Tiny-Cairoduino-Guided-Tour_2-scaled.jpg?resize=768%2C578&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Tiny-Cairoduino-Guided-Tour_2-scaled.jpg?resize=1536%2C1155&amp;ssl=1 1536w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Tiny-Cairoduino-Guided-Tour_2-scaled.jpg?resize=600%2C450&amp;ssl=1 600w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Tiny-Cairoduino-Guided-Tour_2-scaled.jpg?resize=800%2C602&amp;ssl=1 800w" sizes="(max-width: 770px) 100vw, 770px" /></figure></li></ul><a class="wp-block-jetpack-slideshow_button-prev swiper-button-prev swiper-button-white" role="button"></a><a class="wp-block-jetpack-slideshow_button-next swiper-button-next swiper-button-white" role="button"></a><a aria-label="Pause Slideshow" class="wp-block-jetpack-slideshow_button-pause" role="button"></a><div class="wp-block-jetpack-slideshow_pagination swiper-pagination swiper-pagination-white"></div></div></div>



<p class="wp-block-paragraph">To make the PCB traces I used a 0.1mm v-bit. And, a 1.5mm 2 flutes square endmill to cut the PCB outline.&nbsp;</p>



<div class="wp-block-jetpack-slideshow aligncenter" data-effect="slide"><div class="wp-block-jetpack-slideshow_container swiper-container"><ul class="wp-block-jetpack-slideshow_swiper-wrapper swiper-wrapper"><li class="wp-block-jetpack-slideshow_slide swiper-slide"><figure><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="578" alt="" class="wp-block-jetpack-slideshow_image wp-image-1766" data-id="1766" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/20220203_163012_edited-scaled.jpg?resize=770%2C578&#038;ssl=1" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/20220203_163012_edited-scaled.jpg?w=2048&amp;ssl=1 2048w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/20220203_163012_edited-scaled.jpg?resize=300%2C225&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/20220203_163012_edited-scaled.jpg?resize=1024%2C768&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/20220203_163012_edited-scaled.jpg?w=1540&amp;ssl=1 1540w" sizes="(max-width: 770px) 100vw, 770px" /></figure></li><li class="wp-block-jetpack-slideshow_slide swiper-slide"><figure><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="578" alt="" class="wp-block-jetpack-slideshow_image wp-image-1768" data-id="1768" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/20220203_163137_edited-scaled.jpg?resize=770%2C578&#038;ssl=1" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/20220203_163137_edited-scaled.jpg?w=2048&amp;ssl=1 2048w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/20220203_163137_edited-scaled.jpg?resize=300%2C225&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/20220203_163137_edited-scaled.jpg?resize=1024%2C768&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/20220203_163137_edited-scaled.jpg?resize=768%2C576&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/20220203_163137_edited-scaled.jpg?resize=1536%2C1152&amp;ssl=1 1536w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/20220203_163137_edited-scaled.jpg?resize=600%2C450&amp;ssl=1 600w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/20220203_163137_edited-scaled.jpg?resize=800%2C600&amp;ssl=1 800w" sizes="(max-width: 770px) 100vw, 770px" /></figure></li></ul><a class="wp-block-jetpack-slideshow_button-prev swiper-button-prev swiper-button-white" role="button"></a><a class="wp-block-jetpack-slideshow_button-next swiper-button-next swiper-button-white" role="button"></a><a aria-label="Pause Slideshow" class="wp-block-jetpack-slideshow_button-pause" role="button"></a><div class="wp-block-jetpack-slideshow_pagination swiper-pagination swiper-pagination-white"></div></div></div>



<p class="wp-block-paragraph">PCBWay is a PCB manufacturer and PCB assembler based in Shenzhen. They offer a broad spectrum of PCB prototyping, assembly, design, and CNC/3D printing services across five factories that are staffed by more than 520 employees. The coolest feature I use a lot before ordering my PCBs is the instant quote tool. PCBWay&#8217;s website is well designed and convenient. You can use the online instant quote tool to get an estimated cost for your board according to the fabrication parameters you select. Which made PCB ordering very easy and fast.</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-vivid-green-cyan-background-color has-background" href="https://www.pcbway.com/project/shareproject/Tiny_Cairoduino_Open_Source_DIY_Kiy_fa3aa062.html" style="border-radius:50px" target="_blank" rel="noreferrer noopener">Project On PCBWay</a></div>
</div>



<h2 class="wp-block-heading" id="uploading-the-bootloader">Uploading the bootloader</h2>



<p class="wp-block-paragraph">To be able to program your Tiny-Cairoduino board directly using the USB port, there’s a special program called “Bootloader” that runs on the microcontroller once you supply power to the board. The bootloader program is responsible for making the Tiny-Cairoduino board a USB recognizable device. and taking new programs from you and flashing them on the ATtiny85 chip memory. By default, the ATtiny85 does not come with the bootloader preloaded with any bootloaders. So we need to upload the bootloader to the ATtiny85 microcontroller manually. This is a one-time process.&nbsp;</p>



<p class="wp-block-paragraph">We will use the same bootloader runs on the Digispark board “micronucleus tiny85” boot-loader, originally written by Bluebie. You can use any AVR programmer to upload the bootloader to the Tiny-Cairoduino board or use an Arduino UNO board which we will use in this step.</p>



<p class="wp-block-paragraph">In the first step, we need to configure our Arduino UNO board as an ISP(In-System Programming) to work as an AVR programmer to the Tiny-Cairoduino board. Connect your Arduino UNO to your computer and open Arduino IDE then navigate to File &gt; Example &gt; ArduinoISP and upload the Arduino ISP code.</p>



<div class="wp-block-jetpack-slideshow aligncenter" data-effect="slide"><div class="wp-block-jetpack-slideshow_container swiper-container"><ul class="wp-block-jetpack-slideshow_swiper-wrapper swiper-wrapper"><li class="wp-block-jetpack-slideshow_slide swiper-slide"><figure><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="702" alt="" class="wp-block-jetpack-slideshow_image wp-image-1706" data-id="1706" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Screen-Shot-2022-01-24-at-2.58.33-PM-min.png?resize=770%2C702&#038;ssl=1" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Screen-Shot-2022-01-24-at-2.58.33-PM-min.png?resize=1024%2C934&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Screen-Shot-2022-01-24-at-2.58.33-PM-min.png?resize=300%2C274&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Screen-Shot-2022-01-24-at-2.58.33-PM-min.png?resize=1536%2C1401&amp;ssl=1 1536w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Screen-Shot-2022-01-24-at-2.58.33-PM-min.png?resize=800%2C730&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Screen-Shot-2022-01-24-at-2.58.33-PM-min.png?resize=768%2C701&amp;ssl=1 768w" sizes="(max-width: 770px) 100vw, 770px" /></figure></li><li class="wp-block-jetpack-slideshow_slide swiper-slide"><figure><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="693" alt="" class="wp-block-jetpack-slideshow_image wp-image-1707" data-id="1707" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Screen-Shot-2022-01-24-at-2.59.07-PM-min.png?resize=770%2C693&#038;ssl=1" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Screen-Shot-2022-01-24-at-2.59.07-PM-min.png?resize=1024%2C921&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Screen-Shot-2022-01-24-at-2.59.07-PM-min.png?resize=300%2C270&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Screen-Shot-2022-01-24-at-2.59.07-PM-min.png?resize=1536%2C1381&amp;ssl=1 1536w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Screen-Shot-2022-01-24-at-2.59.07-PM-min.png?resize=800%2C719&amp;ssl=1 800w" sizes="(max-width: 770px) 100vw, 770px" /></figure></li></ul><a class="wp-block-jetpack-slideshow_button-prev swiper-button-prev swiper-button-white" role="button"></a><a class="wp-block-jetpack-slideshow_button-next swiper-button-next swiper-button-white" role="button"></a><a aria-label="Pause Slideshow" class="wp-block-jetpack-slideshow_button-pause" role="button"></a><div class="wp-block-jetpack-slideshow_pagination swiper-pagination swiper-pagination-white"></div></div></div>



<p class="wp-block-paragraph">In the second step, we need to connect the Arduino UNO board to the Tiny-Cairoduino board as the wiring diagram down below. We are using a 10uf polarized capacitor on the reset and GND pin of the Arduino board.</p>



<figure class="wp-block-image size-full"><a href="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Fritzing_wiring_bb.jpg?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="505" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Fritzing_wiring_bb.jpg?resize=770%2C505&#038;ssl=1" alt="" class="wp-image-1735" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Fritzing_wiring_bb.jpg?w=1761&amp;ssl=1 1761w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Fritzing_wiring_bb.jpg?resize=300%2C197&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Fritzing_wiring_bb.jpg?resize=1024%2C672&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Fritzing_wiring_bb.jpg?resize=1536%2C1007&amp;ssl=1 1536w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/01/Fritzing_wiring_bb.jpg?resize=800%2C525&amp;ssl=1 800w" sizes="auto, (max-width: 770px) 100vw, 770px" /></a></figure>



<p class="wp-block-paragraph">In the third step, Connect your Arduino UNO board to your computer and open Arduino IDE. Find which port is your Arduino board connected to. In my case, my Arduino UNO board is connected to <code>COM6</code> .We will need that information in the next steps</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;">In this step, you will need to use a machine running Windows operating system.</div></div>



<figure class="wp-block-image size-full"><a href="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/08/UNO_Port.jpg?ssl=1"><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="" 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" /></a></figure>



<p class="wp-block-paragraph">After this, download the bootloader burning files from the link down below. open the &#8220;Burn_AT85_bootloader.bat&#8221; and change the COM port number &#8220;PCOM5&#8221; with whatever COM port number your Uno is connected to. Save the changes before exiting.</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-vivid-green-cyan-background-color has-background" href="https://github.com/ahmedibrrahim/Attiny85-Bootloader-Files" style="border-radius:50px" target="_blank" rel="noreferrer noopener">Bootloader Upload Files</a></div>
</div>



<figure class="wp-block-image size-full"><a href="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/Screen-Shot-2022-02-01-at-2.03.50-AM-1024x91.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="69" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/Screen-Shot-2022-02-01-at-2.03.50-AM.png?resize=770%2C69&#038;ssl=1" alt="" class="wp-image-1739" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/Screen-Shot-2022-02-01-at-2.03.50-AM.png?w=1254&amp;ssl=1 1254w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/Screen-Shot-2022-02-01-at-2.03.50-AM.png?resize=300%2C27&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/Screen-Shot-2022-02-01-at-2.03.50-AM.png?resize=1024%2C91&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/Screen-Shot-2022-02-01-at-2.03.50-AM.png?resize=800%2C71&amp;ssl=1 800w" sizes="auto, (max-width: 770px) 100vw, 770px" /></a></figure>



<p class="wp-block-paragraph">Now move the edited &#8220;Burn_AT85_bootloader.bat&#8221; and &#8220;ATtiny85.hex&#8221; files into the Arduino IDE root folder (C:\Program Files (x86)\Arduino). After that right-click on the &#8220;Burn_AT85_bootloader.bat&#8221; and select “Run as administrator” it will take about 5 or 6 seconds to burn the bootloader to the Tiny-Cairoduino board. If all went well, you should receive this message &#8220;AVRdude done. Thank you. Press any key to continue&#8230;&#8221;.&nbsp;</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><a href="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/Flashing-Boot-loader-on-ATtiny85.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="500" height="110" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/Flashing-Boot-loader-on-ATtiny85.png?resize=500%2C110&#038;ssl=1" alt="" class="wp-image-1740" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/Flashing-Boot-loader-on-ATtiny85.png?w=500&amp;ssl=1 500w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2022/02/Flashing-Boot-loader-on-ATtiny85.png?resize=300%2C66&amp;ssl=1 300w" sizes="auto, (max-width: 500px) 100vw, 500px" /></a></figure></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="1333888114"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">Now, your ATtiny85 chip is flashed successfully with the bootloader. You can now connect the Tiny-Cairoduino board directly to your laptop and use it like any development board.</p>
<p>The post <a href="https://makesomestuff.org/tiny-cairoduino-kit/">Tiny-Cairoduino Open-Source DIY Kit</a> appeared first on <a href="https://makesomestuff.org">Make Some Stuff</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://makesomestuff.org/tiny-cairoduino-kit/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1616</post-id>	</item>
		<item>
		<title>How I Made My Tiny AVR Programmer</title>
		<link>https://makesomestuff.org/how-i-made-my-avr-programmer/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-i-made-my-avr-programmer</link>
					<comments>https://makesomestuff.org/how-i-made-my-avr-programmer/#respond</comments>
		
		<dc:creator><![CDATA[Ahmed Ibrahim]]></dc:creator>
		<pubDate>Mon, 29 Mar 2021 23:28:34 +0000</pubDate>
				<category><![CDATA[Electronics Projects]]></category>
		<category><![CDATA[AVR]]></category>
		<category><![CDATA[AVR Programmer]]></category>
		<category><![CDATA[Programmer]]></category>
		<guid isPermaLink="false">https://makesomestuff.org/?p=1337</guid>

					<description><![CDATA[<p><a href="https://makesomestuff.org">Make Some Stuff</a><br />
<a href="https://makesomestuff.org/how-i-made-my-avr-programmer/">How I Made My Tiny AVR Programmer</a></p>
<p>Recently, I have been using a lot of AVR chips and I faced few problems regarding burning the code on these chips using commercial AVR programmers. So, I decided why not building my own AVR programmer and get rid of all of this hassle. And, why not customize it according to my needs. Tiny AVR [...]</p>
<p>The post <a href="https://makesomestuff.org/how-i-made-my-avr-programmer/">How I Made My Tiny AVR Programmer</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-i-made-my-avr-programmer/">How I Made My Tiny AVR Programmer</a></p>

<p class="wp-block-paragraph">Recently, I have been using a lot of AVR chips and I faced few problems regarding burning the code on these chips using commercial AVR programmers. So, I decided why not building my own AVR programmer and get rid of all of this hassle. And, why not customize it according to my needs.</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="7344212982"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<h2 class="wp-block-heading">Tiny AVR Programmer Background</h2>



<p class="wp-block-paragraph">Today, we will take a look at how this board is designed, and I will take you on a journey on how each component is working in this design.</p>



<p class="wp-block-paragraph">If you have just an AVR chip, you need something to program it. the most common way is through ICSP(In-circuit serial programmer). simply, it&#8217;s a board that has 6 pins usually a 0.1&#8243; pitch header that can talk to your AVR chip through the SPI protocol. At the other end, it also can talk with your PC through the USB protocol. So, after compiling your C code using avr-gcc, the programmer board will take and send it to your AVR chip directly. You can think of it as a bridge between your PC and your AVR chip.</p>



<figure class="wp-block-gallery aligncenter 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"><a href="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/avr_programming_workflow.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="632" height="404" data-id="1341" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/avr_programming_workflow.png?resize=632%2C404&#038;ssl=1" alt="AVR Toolchain" class="wp-image-1341" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/avr_programming_workflow.png?w=632&amp;ssl=1 632w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/avr_programming_workflow.png?resize=300%2C192&amp;ssl=1 300w" sizes="auto, (max-width: 632px) 100vw, 632px" /></a></figure>
</figure>



<p class="wp-block-paragraph">I did my research for AVR programmers and I found a lot of cool resources. <a href="http://fab.cba.mit.edu/classes/863.16/doc/tutorials/FabISP/FabISP_Demystified.html" target="_blank" rel="noreferrer noopener">this one </a>specifically caught my eye. It&#8217;s the <a href="http://fab.cba.mit.edu/classes/863.16/doc/tutorials/FabISP/FabISP_Demystified.html" target="_blank" rel="noreferrer noopener">FabOptimus AVR programmer</a> built by Ali Shtarbanov which built on the <a href="http://academy.cba.mit.edu/classes/embedded_programming/hello.ISP.44.png" target="_blank" rel="noreferrer noopener">FabISP programmer</a> built by prof. Neil from MIT Media Lab. the FabOptimus documentation is very good and easy to follow if you are a newbie. I decided to make a very small modification to the FabOptimus AVR programmer since it doesn&#8217;t have a power indicator LED, I wanna add one!</p>



<figure class="wp-block-gallery aligncenter 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"><a href="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/hello.ISP_.44.res_.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="483" height="1024" data-id="1345" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/hello.ISP_.44.res_.png?resize=483%2C1024&#038;ssl=1" alt="" class="wp-image-1345" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/hello.ISP_.44.res_.png?resize=483%2C1024&amp;ssl=1 483w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/hello.ISP_.44.res_.png?resize=800%2C1696&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/hello.ISP_.44.res_.png?resize=142%2C300&amp;ssl=1 142w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/hello.ISP_.44.res_.png?resize=725%2C1536&amp;ssl=1 725w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/hello.ISP_.44.res_.png?resize=966%2C2048&amp;ssl=1 966w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/hello.ISP_.44.res_.png?w=1066&amp;ssl=1 1066w" sizes="auto, (max-width: 483px) 100vw, 483px" /></a><figcaption class="wp-element-caption">FabISP bt Prof. Neil</figcaption></figure>



<figure class="wp-block-image size-large"><a href="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/FabOptimus2-1.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="511" height="1024" data-id="1347" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/FabOptimus2-1.png?resize=511%2C1024&#038;ssl=1" alt="" class="wp-image-1347" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/FabOptimus2-1.png?resize=511%2C1024&amp;ssl=1 511w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/FabOptimus2-1.png?resize=600%2C1202&amp;ssl=1 600w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/FabOptimus2-1.png?resize=150%2C300&amp;ssl=1 150w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/FabOptimus2-1.png?resize=767%2C1536&amp;ssl=1 767w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/FabOptimus2-1.png?w=783&amp;ssl=1 783w" sizes="auto, (max-width: 511px) 100vw, 511px" /></a><figcaption class="wp-element-caption">FabOptimus by Ali Shtarbanov</figcaption></figure>
</figure>



<h2 class="wp-block-heading">PCB Design And Circuit In-depth Analysis</h2>



<p class="wp-block-paragraph">First, we need to understand how this board is designed and how each component in this circuit is behaving. </p>



<figure class="wp-block-gallery aligncenter has-nested-images columns-default wp-block-gallery-4 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><a href="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Original_FaOptimus_SCH_board.jpg?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="602" data-id="1353" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Original_FaOptimus_SCH_board.jpg?resize=770%2C602&#038;ssl=1" alt="" class="wp-image-1353" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Original_FaOptimus_SCH_board.jpg?resize=1024%2C800&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Original_FaOptimus_SCH_board.jpg?resize=800%2C625&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Original_FaOptimus_SCH_board.jpg?resize=300%2C234&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Original_FaOptimus_SCH_board.jpg?resize=87%2C67&amp;ssl=1 87w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Original_FaOptimus_SCH_board.jpg?w=1208&amp;ssl=1 1208w" sizes="auto, (max-width: 770px) 100vw, 770px" /></a><figcaption class="wp-element-caption">FabOptimus Original Schematic and Board Layout</figcaption></figure>
</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="7344212982"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



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



<p class="wp-block-paragraph">This AVR programmer is based on the <a href="http://ww1.microchip.com/downloads/en/devicedoc/Atmel-7701_Automotive-Microcontrollers-ATtiny24-44-84_Datasheet.pdf" target="_blank" rel="noreferrer noopener">ATtiny44 AVR chip</a> which by default it comes blank, no code or anything is uploaded to it like any microcontroller chip you buy. Since we are building an AVR programmer, we need to upload a very specific firmware to the ATtiny44 chip that tells exactly the role it should follow and execute. Simply, which is sending some hex files to other AVR microcontrollers. This firmware is called <a href="http://archive.fabacademy.org/archives/2016/doc/programming_FabISP.html" target="_blank" rel="noreferrer noopener">FabISP firmware</a>(more on that later.) </p>



<p class="wp-block-paragraph">So, we need to be able to upload the FabISP firmware to the programmer AVR chip then disable the possibility of reprogramming it. </p>



<figure class="wp-block-gallery aligncenter has-nested-images columns-default wp-block-gallery-5 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><a href="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/FabOptimus2-2.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="511" height="1024" data-id="1357" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/FabOptimus2-2.png?resize=511%2C1024&#038;ssl=1" alt="" class="wp-image-1357" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/FabOptimus2-2.png?resize=511%2C1024&amp;ssl=1 511w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/FabOptimus2-2.png?resize=600%2C1202&amp;ssl=1 600w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/FabOptimus2-2.png?resize=150%2C300&amp;ssl=1 150w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/FabOptimus2-2.png?resize=767%2C1536&amp;ssl=1 767w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/FabOptimus2-2.png?w=783&amp;ssl=1 783w" sizes="auto, (max-width: 511px) 100vw, 511px" /></a></figure>
</figure>



<p class="wp-block-paragraph">To be able to upload the FabISP firmware to the programmer AVR chip we need to pull its reset pin to LOW(0 volts). and to disable the possibility of reprogramming it once it has been programmed, we need to pull its reset pin to be always HIGH(5 volts). So, we need to design the circuit in such a way that the reset pin is HIGH(5 volts) by default. But, once another programmer is connected to it, it can pull the programmer AVR chip reset pin to LOW(0 volts). That&#8217;s why we are using a 10k ohm pull-up resistor on the reset pin.</p>



<p class="wp-block-paragraph">As you notice the ATtiny44 chip reset pin is connected to the RST pin on the ISP pin header through a 0 ohm resistor. after uploading the firmware to the ATtiny44 chip we will remove this zero ohm resistor to disable the possibility of reprogramming the board again.</p>



<figure class="wp-block-gallery aligncenter has-nested-images columns-default wp-block-gallery-6 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><a href="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/FabOptimus2-copy.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="511" height="1024" data-id="1361" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/FabOptimus2-copy.png?resize=511%2C1024&#038;ssl=1" alt="" class="wp-image-1361" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/FabOptimus2-copy.png?resize=511%2C1024&amp;ssl=1 511w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/FabOptimus2-copy.png?resize=600%2C1202&amp;ssl=1 600w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/FabOptimus2-copy.png?resize=150%2C300&amp;ssl=1 150w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/FabOptimus2-copy.png?resize=767%2C1536&amp;ssl=1 767w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/FabOptimus2-copy.png?w=783&amp;ssl=1 783w" sizes="auto, (max-width: 511px) 100vw, 511px" /></a></figure>
</figure>



<p class="wp-block-paragraph">Since we need to use our programmer board to program other AVR boards, our programmer board will need to be able to provide the reset signal to the other AVR boards that we need to program. So, we are also connecting an I/O pin from the ATtiny44 chip to the RST pin of the ISP pin header to provide the reset signal to the other AVR chips that we need to program.</p>



<figure class="wp-block-gallery aligncenter has-nested-images columns-default wp-block-gallery-7 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><a href="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/FabOptimus2-copy-2.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="511" height="1024" data-id="1367" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/FabOptimus2-copy-2.png?resize=511%2C1024&#038;ssl=1" alt="" class="wp-image-1367" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/FabOptimus2-copy-2.png?resize=511%2C1024&amp;ssl=1 511w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/FabOptimus2-copy-2.png?resize=600%2C1202&amp;ssl=1 600w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/FabOptimus2-copy-2.png?resize=150%2C300&amp;ssl=1 150w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/FabOptimus2-copy-2.png?resize=767%2C1536&amp;ssl=1 767w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/FabOptimus2-copy-2.png?w=783&amp;ssl=1 783w" sizes="auto, (max-width: 511px) 100vw, 511px" /></a></figure>
</figure>



<p class="wp-block-paragraph">To reduce any high frequency noise or any voltage drops coming from the power supply we are using 1uf decoupling capacitor between the VCC(5 volts) and GND. </p>



<figure class="wp-block-gallery aligncenter has-nested-images columns-default wp-block-gallery-8 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><a href="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/FabOptimus2-copy-5.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="511" height="1024" data-id="1368" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/FabOptimus2-copy-5.png?resize=511%2C1024&#038;ssl=1" alt="" class="wp-image-1368" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/FabOptimus2-copy-5.png?resize=511%2C1024&amp;ssl=1 511w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/FabOptimus2-copy-5.png?resize=600%2C1202&amp;ssl=1 600w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/FabOptimus2-copy-5.png?resize=150%2C300&amp;ssl=1 150w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/FabOptimus2-copy-5.png?resize=767%2C1536&amp;ssl=1 767w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/FabOptimus2-copy-5.png?w=783&amp;ssl=1 783w" sizes="auto, (max-width: 511px) 100vw, 511px" /></a></figure>
</figure>



<p class="wp-block-paragraph">We also using a 20MHz resonator as a clock source for the ATTiny44 chip instead of it&#8217;s internal clock to achieve more accuracy.</p>



<figure class="wp-block-gallery aligncenter has-nested-images columns-default wp-block-gallery-9 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><a href="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/FabOptimus2-copy-4-1.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="511" height="1024" data-id="1370" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/FabOptimus2-copy-4-1.png?resize=511%2C1024&#038;ssl=1" alt="" class="wp-image-1370" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/FabOptimus2-copy-4-1.png?resize=511%2C1024&amp;ssl=1 511w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/FabOptimus2-copy-4-1.png?resize=600%2C1202&amp;ssl=1 600w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/FabOptimus2-copy-4-1.png?resize=150%2C300&amp;ssl=1 150w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/FabOptimus2-copy-4-1.png?resize=767%2C1536&amp;ssl=1 767w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/FabOptimus2-copy-4-1.png?w=783&amp;ssl=1 783w" sizes="auto, (max-width: 511px) 100vw, 511px" /></a></figure>
</figure>



<p class="wp-block-paragraph">We are using two 3.3v Zener diodes as voltage clippers to regulate the voltage from 5v to 3.3v. According to the V-USB and USB specifications, the voltage on the USB data lines should not exceed 3.3v. Also, we are using a 1.5k ohm pull-up resistor on the D- pin of the USB to make it recognizable as a low-speed device on the host side.</p>



<figure class="wp-block-gallery 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"><a href="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/FaOptimus_sch_edited_new_new-scaled.jpg?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="537" data-id="1373" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/FaOptimus_sch_edited_new_new.jpg?resize=770%2C537&#038;ssl=1" alt="" class="wp-image-1373" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/FaOptimus_sch_edited_new_new-scaled.jpg?resize=1024%2C714&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/FaOptimus_sch_edited_new_new-scaled.jpg?resize=800%2C558&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/FaOptimus_sch_edited_new_new-scaled.jpg?resize=300%2C209&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/FaOptimus_sch_edited_new_new-scaled.jpg?resize=1536%2C1071&amp;ssl=1 1536w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/FaOptimus_sch_edited_new_new-scaled.jpg?resize=768%2C535&amp;ssl=1 768w" sizes="auto, (max-width: 770px) 100vw, 770px" /></a></figure>
</figure>



<p class="wp-block-paragraph">Finally, I made a simple edit to the board. I added a power indicator LED to the board.</p>



<p class="wp-block-paragraph">It&#8217;s a best practice to disconnect the VCC pin on the ISP pin header to make sure that the AVR programmer is not attempting to supply power to the board that we want to program. the board that we want to program should provide its own power. If we didn&#8217;t disconnect the VCC pin on the ISP header, the AVR programmer and the board being programmed will draw their current from the USB port(from your computer). if your USB port can&#8217;t supply that much current or at any short circuit circumstances, that may cause a huge problem to your computer.</p>



<h2 class="wp-block-heading">PCB Manufacturing</h2>



<figure class="wp-block-gallery 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"><a href="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2021-03-15-at-11.40.33-AM.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="426" data-id="1380" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2021-03-15-at-11.40.33-AM.png?resize=770%2C426&#038;ssl=1" alt="" class="wp-image-1380" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2021-03-15-at-11.40.33-AM.png?resize=1024%2C566&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2021-03-15-at-11.40.33-AM.png?resize=800%2C443&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2021-03-15-at-11.40.33-AM.png?resize=300%2C166&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2021-03-15-at-11.40.33-AM.png?resize=1536%2C849&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></a></figure>
</figure>



<p class="wp-block-paragraph">As you can see, I fabricated this board using a CNC milling machine at Fab Lab Egypt. But, if you are searching for high-quality PCB manufacturing with a solder mask and silkscreen at a very fair price and fast worldwide shipping with no minimum requirements you may order as small as 10 pieces for 5$. you can order yours from <a href="https://www.pcbway.com/" target="_blank" rel="noreferrer noopener">PCBWay</a>. You can also support me by just ordering this board from my link. </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/Tiny_AVR_Programmer.html" style="border-radius:100px;background-color:#00a99d" target="_blank" rel="noreferrer noopener">pcbway</a></div>
</div>



<p class="wp-block-paragraph"><br>We love open source. You can download all the board source files from my Github repo.</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://github.com/ahmedibrrahim/Tiny-AVR-Programmer" style="border-radius:100px;background-color:#00a99d" target="_blank" rel="noreferrer noopener">github</a></div>
</div>



<h2 class="wp-block-heading">PCB Soldering And Components Placings</h2>



<figure class="wp-block-gallery aligncenter 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"><a href="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/EgyptISPComponents.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="684" height="1024" data-id="1376" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/EgyptISPComponents.png?resize=684%2C1024&#038;ssl=1" alt="" class="wp-image-1376" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/EgyptISPComponents.png?resize=684%2C1024&amp;ssl=1 684w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/EgyptISPComponents.png?resize=800%2C1197&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/EgyptISPComponents.png?resize=200%2C300&amp;ssl=1 200w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/EgyptISPComponents.png?resize=1026%2C1536&amp;ssl=1 1026w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/EgyptISPComponents.png?resize=1369%2C2048&amp;ssl=1 1369w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/EgyptISPComponents.png?w=1684&amp;ssl=1 1684w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/EgyptISPComponents.png?w=1540&amp;ssl=1 1540w" sizes="auto, (max-width: 684px) 100vw, 684px" /></a></figure>



<figure class="wp-block-image size-large"><a href="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/IMG_7095-1-scaled.jpeg?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="578" data-id="1379" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/IMG_7095-1.jpeg?resize=770%2C578&#038;ssl=1" alt="An old pencil drawing of Don Quixote and Sancho Panza sitting on their horses, by Wilhelm Marstrand." class="wp-image-1379" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/IMG_7095-1-scaled.jpeg?resize=1024%2C768&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/IMG_7095-1-scaled.jpeg?resize=600%2C450&amp;ssl=1 600w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/IMG_7095-1-scaled.jpeg?resize=800%2C600&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/IMG_7095-1-scaled.jpeg?resize=300%2C225&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/IMG_7095-1-scaled.jpeg?resize=1536%2C1152&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></a></figure>
</figure>



<figure class="is-style-regular wp-block-table"><table><tbody><tr><td><strong>Part Name</strong></td><td><strong>Quantity</strong></td></tr><tr><td>ATTINY44A microcontroller chip</td><td>1</td></tr><tr><td>CER RESONATOR 20.00MHZ SMD</td><td>1</td></tr><tr><td>MINI USB2.0 5POS</td><td>1</td></tr><tr><td>6 Positions Header Connector 0.100&#8243; SMD</td><td>1</td></tr><tr><td>CAP CER 1UF 50V 10% SMD 1206</td><td>1</td></tr><tr><td>RES 10.0K OHM 1-4W 1% 1206 SMD</td><td>1</td></tr><tr><td>RES 1.0K OHM 1-4W 1% 1206 SMD</td><td>1</td></tr><tr><td>RES 499 OHM 1-4W 1% 1206 SMD</td><td>2</td></tr><tr><td>RES 100 OHM 1-4W 1% 1206 SMD</td><td>2</td></tr><tr><td>DIODE ZENER 500MW 3.3V SOD123-</td><td>2</td></tr><tr><td>LED Blue CLEAR 1206 SMD-</td><td>1</td></tr></tbody></table><figcaption class="wp-element-caption">AVR Programmer Board Components </figcaption></figure>



<h2 class="wp-block-heading">Uploading The Firmware To The Programmer</h2>



<p class="wp-block-paragraph">To upload the FabISP firmware to the FabISP AVR programmer board, we need another programmer to help us upload the firmware to our FabISP board. we will use an Arduino UNO board as an ISP programmer and we will connect it to our FabISP AVR programmer board. </p>



<p class="wp-block-paragraph">First, we need to upload the &#8220;ArduinoISP&#8221; sketch to the Arduino UNO board. You can find that sketch from <strong>files-&gt;Examples-&gt;ArduinoISP-&gt;ArduinoISP.</strong> </p>



<figure class="wp-block-gallery has-nested-images columns-default wp-block-gallery-13 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-full"><a href="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2021-03-15-at-12.40.21-PM.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="429" data-id="1392" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2021-03-15-at-12.40.21-PM.png?resize=770%2C429&#038;ssl=1" alt="" class="wp-image-1392" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2021-03-15-at-12.40.21-PM.png?w=1674&amp;ssl=1 1674w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2021-03-15-at-12.40.21-PM.png?resize=800%2C445&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2021-03-15-at-12.40.21-PM.png?resize=300%2C167&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2021-03-15-at-12.40.21-PM.png?resize=1024%2C570&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2021-03-15-at-12.40.21-PM.png?resize=1536%2C855&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></a></figure>
</figure>



<p class="wp-block-paragraph">After uploading it to the Arduino UNO board. Let&#8217;s connect our FabISP AVR programmer(Target) with the Arduino UNO board(Programmer).</p>



<figure class="wp-block-gallery aligncenter has-nested-images columns-default wp-block-gallery-14 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><a href="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/ISP_Wiring_Arduino.jpg?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="753" height="1024" data-id="1393" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/ISP_Wiring_Arduino.jpg?resize=753%2C1024&#038;ssl=1" alt="" class="wp-image-1393" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/ISP_Wiring_Arduino.jpg?resize=753%2C1024&amp;ssl=1 753w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/ISP_Wiring_Arduino.jpg?resize=800%2C1089&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/ISP_Wiring_Arduino.jpg?resize=220%2C300&amp;ssl=1 220w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/ISP_Wiring_Arduino.jpg?w=915&amp;ssl=1 915w" sizes="auto, (max-width: 753px) 100vw, 753px" /></a></figure>
</figure>



<p class="has-text-align-center wp-block-paragraph">D10(Arduino) &#8211;&gt; Reset (Target)<br>D11(Arduino) &#8211;&gt; MOSI (Target)<br>D12(Arduino) &#8211;&gt; MISO (Target)<br>D13(Arduino) &#8211;&gt; SCK (Target)<br>GND(Arduino) &#8211;&gt; GND (Target)</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="7344212982"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



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



<p class="wp-block-paragraph">As you can notice we are connecting a 10uf capacitor between the Reset and the GND pin of the Arduino UBO board. As you notice, we are not providing power to our target board directly from the Arduino board. We are providing power to the FabISP AVR programmer board(target) by connecting it separately to the laptop through the USB port. And don’t forget to make a common GND between the two boards by connecting the GND of the FabISP AVR programmer board(target) board to the GND of the Arduino UNO(programmer).</p>



<figure class="wp-block-gallery 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-full"><a href="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/IMG_7102-scaled.jpeg?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="578" data-id="1395" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/IMG_7102-scaled.jpeg?resize=770%2C578&#038;ssl=1" alt="" class="wp-image-1395" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/IMG_7102-scaled.jpeg?w=2048&amp;ssl=1 2048w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/IMG_7102-scaled.jpeg?resize=600%2C450&amp;ssl=1 600w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/IMG_7102-scaled.jpeg?resize=800%2C600&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/IMG_7102-scaled.jpeg?resize=300%2C225&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/IMG_7102-scaled.jpeg?resize=1024%2C768&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/IMG_7102-scaled.jpeg?resize=1536%2C1152&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></a></figure>
</figure>



<p class="wp-block-paragraph">After connecting the Arduino UNO board(Programmer) To the FabISP board(Target) we need to compile the FabISP firmware and upload it to the FabISP board. The Arduino UNO board will act as a bridge between my Laptop and the FabISP board. Since I&#8217;m using a Mac machine, I will download <a href="https://www.obdev.at/products/crosspack/index.html" target="_blank" rel="noreferrer noopener">AVR CrossPack</a>. CrossPack is a development environment for Atmel’s AVR® microcontrollers running on Apple’s Mac OS X, similar to AVR Studio on Windows. It consists of the GNU compiler suite, a C library for the AVR, the AVRDUDE uploader, and several other useful tools.” After heading to the AVR CrossPack website, click the “Download” button and install the&nbsp;<strong>.dmg file</strong>. That’s it!</p>



<figure class="wp-block-gallery aligncenter 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-full"><a href="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2020-03-26-at-1.08.29-AM-scaled.jpg?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="468" data-id="1400" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2020-03-26-at-1.08.29-AM-scaled.jpg?resize=770%2C468&#038;ssl=1" alt="An old pencil drawing of Don Quixote and Sancho Panza sitting on their horses, by Wilhelm Marstrand." class="wp-image-1400" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2020-03-26-at-1.08.29-AM-scaled.jpg?w=2048&amp;ssl=1 2048w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2020-03-26-at-1.08.29-AM-scaled.jpg?resize=800%2C486&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2020-03-26-at-1.08.29-AM-scaled.jpg?resize=300%2C182&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2020-03-26-at-1.08.29-AM-scaled.jpg?resize=1024%2C622&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2020-03-26-at-1.08.29-AM-scaled.jpg?resize=1536%2C933&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></a></figure>



<figure class="wp-block-image size-full"><a href="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2020-03-26-at-1.08.46-AM-scaled.jpg?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="468" data-id="1401" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2020-03-26-at-1.08.46-AM-scaled.jpg?resize=770%2C468&#038;ssl=1" alt="An old pencil drawing of Don Quixote and Sancho Panza sitting on their horses, by Wilhelm Marstrand." class="wp-image-1401" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2020-03-26-at-1.08.46-AM-scaled.jpg?w=2048&amp;ssl=1 2048w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2020-03-26-at-1.08.46-AM-scaled.jpg?resize=800%2C486&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2020-03-26-at-1.08.46-AM-scaled.jpg?resize=300%2C182&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2020-03-26-at-1.08.46-AM-scaled.jpg?resize=1024%2C622&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2020-03-26-at-1.08.46-AM-scaled.jpg?resize=1536%2C933&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></a></figure>
</figure>



<p class="wp-block-paragraph">Then we need to download the FabISP firmware from the link below. The&nbsp;<strong>Makefile</strong>&nbsp;which is inside the original firmware folder is ready to use with the&nbsp;<strong><em>avrisp2</em></strong>&nbsp;or the&nbsp;<strong><em>usbtiny,</em></strong>&nbsp;if you will use a different programmer from these two options it will not work. So, I made some tweaks to that&nbsp;<strong>Makefile</strong>&nbsp;to make it compatible with the&nbsp;<strong>Arduino Uno</strong>&nbsp;that I use as a programmer. And it&#8217;s now ready to use with your Arduino UNO as a programmer you can download it from the link down below.</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://makesomestuff.org/wp-content/uploads/2021/03/fabISP_mac.0.8.2_firmware.zip" style="border-radius:100px;background-color:#00a99d" target="_blank" rel="noreferrer noopener">fabisp firmware download</a></div>
</div>



<p class="wp-block-paragraph"><br>Now, we will open the terminal and navigate to the firmware folder. Then,&nbsp;<strong>clean</strong>&nbsp;any previously compiled files by writing&nbsp;<code>make clean</code>.&nbsp;Then we need to generate a new&nbsp;<strong>.hex</strong>&nbsp;that meets our new&nbsp;<strong>MakeFile</strong>. We will use the&nbsp;<code>make hex</code>&nbsp;command.</p>



<figure class="wp-block-gallery aligncenter 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"><a href="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2020-03-26-at-9.02.15-PM.jpg?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="517" data-id="1406" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2020-03-26-at-9.02.15-PM.jpg?resize=770%2C517&#038;ssl=1" alt="An old pencil drawing of Don Quixote and Sancho Panza sitting on their horses, by Wilhelm Marstrand." class="wp-image-1406" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2020-03-26-at-9.02.15-PM.jpg?resize=1024%2C687&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2020-03-26-at-9.02.15-PM.jpg?resize=800%2C537&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2020-03-26-at-9.02.15-PM.jpg?resize=300%2C201&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2020-03-26-at-9.02.15-PM.jpg?resize=1536%2C1030&amp;ssl=1 1536w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2020-03-26-at-9.02.15-PM.jpg?resize=270%2C180&amp;ssl=1 270w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2020-03-26-at-9.02.15-PM.jpg?w=1756&amp;ssl=1 1756w" sizes="auto, (max-width: 770px) 100vw, 770px" /></a></figure>



<figure class="wp-block-image size-large"><a href="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2020-03-26-at-9.05.39-PM.jpg?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="508" data-id="1407" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2020-03-26-at-9.05.39-PM.jpg?resize=770%2C508&#038;ssl=1" alt="" class="wp-image-1407" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2020-03-26-at-9.05.39-PM.jpg?resize=1024%2C675&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2020-03-26-at-9.05.39-PM.jpg?resize=800%2C528&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2020-03-26-at-9.05.39-PM.jpg?resize=300%2C198&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2020-03-26-at-9.05.39-PM.jpg?resize=1536%2C1013&amp;ssl=1 1536w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2020-03-26-at-9.05.39-PM.jpg?resize=370%2C245&amp;ssl=1 370w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2020-03-26-at-9.05.39-PM.jpg?w=1786&amp;ssl=1 1786w" sizes="auto, (max-width: 770px) 100vw, 770px" /></a></figure>
</figure>



<p class="wp-block-paragraph">Then&nbsp;we need to write the <code>make fuse</code> command&nbsp;to set the fuses so the board will use the external clock. You should see a response like the one in the first image. Lastly, use the command&nbsp;<code>make program</code>&nbsp;to burn our firmware to the board to work as an AVR Programmer.</p>



<figure class="wp-block-gallery aligncenter 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"><a href="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/fuses-ok.jpg?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="744" height="1024" data-id="1408" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/fuses-ok.jpg?resize=744%2C1024&#038;ssl=1" alt="An old pencil drawing of Don Quixote and Sancho Panza sitting on their horses, by Wilhelm Marstrand." class="wp-image-1408" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/fuses-ok.jpg?resize=744%2C1024&amp;ssl=1 744w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/fuses-ok.jpg?resize=800%2C1101&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/fuses-ok.jpg?resize=218%2C300&amp;ssl=1 218w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/fuses-ok.jpg?resize=1116%2C1536&amp;ssl=1 1116w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/fuses-ok.jpg?w=1364&amp;ssl=1 1364w" sizes="auto, (max-width: 744px) 100vw, 744px" /></a></figure>



<figure class="wp-block-image size-large"><a href="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2020-02-27-at-1.59.59-AM.jpg?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="744" height="1024" data-id="1409" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2020-02-27-at-1.59.59-AM.jpg?resize=744%2C1024&#038;ssl=1" alt="" class="wp-image-1409" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2020-02-27-at-1.59.59-AM.jpg?resize=744%2C1024&amp;ssl=1 744w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2020-02-27-at-1.59.59-AM.jpg?resize=800%2C1101&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2020-02-27-at-1.59.59-AM.jpg?resize=218%2C300&amp;ssl=1 218w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2020-02-27-at-1.59.59-AM.jpg?resize=1116%2C1536&amp;ssl=1 1116w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2020-02-27-at-1.59.59-AM.jpg?w=1364&amp;ssl=1 1364w" sizes="auto, (max-width: 744px) 100vw, 744px" /></a></figure>
</figure>



<h2 class="wp-block-heading">FabISP AVR Programmer Testing</h2>



<p class="wp-block-paragraph">After finishing the previous steps, your computer should now recognize the board as an ISP. Since i’m using a MAC machine, click on the Apple logo, then click in “About This MAC”, then “System Report”.</p>



<figure class="wp-block-gallery aligncenter has-nested-images columns-2 wp-block-gallery-19 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-full"><a href="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2020-03-28-at-3.17.34-AM.jpg?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="403" data-id="1412" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2020-03-28-at-3.17.34-AM.jpg?resize=770%2C403&#038;ssl=1" alt="" class="wp-image-1412" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2020-03-28-at-3.17.34-AM.jpg?w=1768&amp;ssl=1 1768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2020-03-28-at-3.17.34-AM.jpg?resize=800%2C419&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2020-03-28-at-3.17.34-AM.jpg?resize=300%2C157&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2020-03-28-at-3.17.34-AM.jpg?resize=1024%2C536&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2020-03-28-at-3.17.34-AM.jpg?resize=1536%2C804&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></a></figure>



<figure class="wp-block-image size-full"><a href="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2020-03-28-at-3.18.46-AM.jpg?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="434" data-id="1411" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2020-03-28-at-3.18.46-AM.jpg?resize=770%2C434&#038;ssl=1" alt="" class="wp-image-1411" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2020-03-28-at-3.18.46-AM.jpg?w=1316&amp;ssl=1 1316w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2020-03-28-at-3.18.46-AM.jpg?resize=800%2C451&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2020-03-28-at-3.18.46-AM.jpg?resize=300%2C169&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2020-03-28-at-3.18.46-AM.jpg?resize=1024%2C577&amp;ssl=1 1024w" sizes="auto, (max-width: 770px) 100vw, 770px" /></a></figure>



<figure class="wp-block-image size-full"><a href="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2020-03-28-at-3.19.05-AM.jpg?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="492" data-id="1410" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2020-03-28-at-3.19.05-AM.jpg?resize=770%2C492&#038;ssl=1" alt="" class="wp-image-1410" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2020-03-28-at-3.19.05-AM.jpg?w=1396&amp;ssl=1 1396w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2020-03-28-at-3.19.05-AM.jpg?resize=800%2C511&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2020-03-28-at-3.19.05-AM.jpg?resize=300%2C192&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2020-03-28-at-3.19.05-AM.jpg?resize=1024%2C654&amp;ssl=1 1024w" sizes="auto, (max-width: 770px) 100vw, 770px" /></a></figure>
</figure>



<p class="wp-block-paragraph">Then from the left side menu under the “Hardware” section click on “USB”. your programmer should be recognized by your computer with the name&nbsp;<strong>FabISB</strong>. Which means your AVR ISP is now ready to work!</p>



<figure class="wp-block-gallery aligncenter 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"><a href="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2020-03-28-at-3.24.47-AM.jpg?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="564" data-id="1418" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2020-03-28-at-3.24.47-AM.jpg?resize=770%2C564&#038;ssl=1" alt="" class="wp-image-1418" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2020-03-28-at-3.24.47-AM.jpg?resize=1024%2C750&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2020-03-28-at-3.24.47-AM.jpg?resize=800%2C586&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2020-03-28-at-3.24.47-AM.jpg?resize=300%2C220&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2020-03-28-at-3.24.47-AM.jpg?resize=1536%2C1125&amp;ssl=1 1536w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/Screen-Shot-2020-03-28-at-3.24.47-AM.jpg?w=1726&amp;ssl=1 1726w" sizes="auto, (max-width: 770px) 100vw, 770px" /></a></figure>



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



<h2 class="wp-block-heading">FabISP AVR Programmer 3d Printed Enclosure</h2>



<p class="wp-block-paragraph">I designed an enclosure for the Tiny AVR programmer you can download it from the links down below. I 3d printed these parts with 20% infill without supports.</p>



<figure class="wp-block-gallery aligncenter 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"><a href="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/IMG_8269-scaled.jpeg?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="578" data-id="1459" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/IMG_8269.jpeg?resize=770%2C578&#038;ssl=1" alt="" class="wp-image-1459" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/IMG_8269-scaled.jpeg?resize=1024%2C768&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/IMG_8269-scaled.jpeg?resize=600%2C450&amp;ssl=1 600w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/IMG_8269-scaled.jpeg?resize=800%2C600&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/IMG_8269-scaled.jpeg?resize=300%2C225&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/IMG_8269-scaled.jpeg?resize=1536%2C1152&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></a></figure>



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



<figure class="wp-block-gallery 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"><a href="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/IMG_8267-scaled.jpeg?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="578" data-id="1397" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/IMG_8267.jpeg?resize=770%2C578&#038;ssl=1" alt="" class="wp-image-1397" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/IMG_8267-scaled.jpeg?resize=1024%2C768&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/IMG_8267-scaled.jpeg?resize=600%2C450&amp;ssl=1 600w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/IMG_8267-scaled.jpeg?resize=800%2C600&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/IMG_8267-scaled.jpeg?resize=300%2C225&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2021/03/IMG_8267-scaled.jpeg?resize=1536%2C1152&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></a></figure>
</figure>



<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://makesomestuff.org/wp-content/uploads/2021/03/Tiny-AVR-Programmer-STLs.zip" style="border-radius:100px;background-color:#00a99d" target="_blank" rel="noreferrer noopener">stl files download</a></div>
</div>



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



<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://makesomestuff.org/wp-content/uploads/2021/03/AVR-Programmer-Case.zip" style="border-radius:100px;background-color:#00a99d" target="_blank" rel="noreferrer noopener">step file download</a></div>
</div>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></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="7344212982"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



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



<p class="wp-block-paragraph">Here comes the end of the tutorial, thanks for your patience and check our upcoming tutorials on how to use this Tiny AVR programmer and how to program your own circuit boards. Don&#8217;t hesitate to drop down any question you want!</p>
<p>The post <a href="https://makesomestuff.org/how-i-made-my-avr-programmer/">How I Made My Tiny AVR Programmer</a> appeared first on <a href="https://makesomestuff.org">Make Some Stuff</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://makesomestuff.org/how-i-made-my-avr-programmer/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1337</post-id>	</item>
		<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 loading="lazy" 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-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="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-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="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-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="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-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="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-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="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-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="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-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="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-30 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-31 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-32 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-33 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-34 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-35 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-36 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-37 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-38 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-39 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-40 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-41 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-42 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-43 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-44 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-45 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-46 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-47 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-48 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-49 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-50 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-51 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>ATmega328P Standalone Board</title>
		<link>https://makesomestuff.org/atmega328p-standalone-board/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=atmega328p-standalone-board</link>
					<comments>https://makesomestuff.org/atmega328p-standalone-board/#respond</comments>
		
		<dc:creator><![CDATA[Ahmed Ibrahim]]></dc:creator>
		<pubDate>Mon, 23 Dec 2019 00:37:54 +0000</pubDate>
				<category><![CDATA[Electronics Projects]]></category>
		<guid isPermaLink="false">https://makesomestuff.org/?p=911</guid>

					<description><![CDATA[<p><a href="https://makesomestuff.org">Make Some Stuff</a><br />
<a href="https://makesomestuff.org/atmega328p-standalone-board/">ATmega328P Standalone Board</a></p>
<p>Today we will learn how to build a standalone ATmega328p board. The same chip used in the Arduino UNO board. It&#8217;s Arduino UNO compatible which means that you can program it from the Arduino IDE without any hustle. Used Components Component Quantity ATmega328p microcontroller 1 L7805 voltage regulator 1 PCB DC Socket 1 Slide switch [...]</p>
<p>The post <a href="https://makesomestuff.org/atmega328p-standalone-board/">ATmega328P Standalone Board</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/atmega328p-standalone-board/">ATmega328P Standalone Board</a></p>

<p class="has-regular-font-size wp-block-paragraph">Today we will learn how to build a standalone ATmega328p board. The same chip used in the Arduino UNO board. It&#8217;s Arduino UNO compatible which means that you can program it from the Arduino IDE without any hustle.</p>



<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="Cairoduino Hello World!" width="770" height="433" src="https://www.youtube.com/embed/E2UeiOZyZiI?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div></figure>



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



<figure class="is-style-regular wp-block-table"><table><tbody><tr><td><strong>Component</strong></td><td><strong>Quantity</strong></td></tr><tr><td><a href="https://www.ebay.com/itm/DIP-28-ATMEGA328P-PU-Microcontrolle-r-With-ARDUINO-UNO-R3-Bootloader-or-Not-with/272453803548?hash=item3f6f831e1c:m:mHcrn16MSB_3T0buye-pBRQ">ATmega328p microcontroller</a></td><td>1</td></tr><tr><td><a href="https://www.ebay.com/itm/5PCS-IC-L7805CV-L7805-7805-TO-220-Voltage-Regulator-5V-ST-NEW-AF/232444699461?hash=item361ec8a345:g:dngAAOSwuO5ZjnRO">L7805 voltage regulator</a></td><td>1</td></tr><tr><td><a href="https://www.ebay.com/itm/10Pcs-PCB-Mount-5-5-x-2-1-mm-Black-Female-DC-Power-Jack-Plug-Socket-Connector/152836566600?epid=4005059362&amp;hash=item2395c4ee48:g:XcAAAOSwbtNaO21O">PCB DC Socket</a></td><td>1</td></tr><tr><td><a href="https://www.ebay.com/itm/20PCS-3Pin-SS12D00G3-2-Position-SPDT-1P2T-PCB-Panel-Mini-Vertical-Slide-Switch-A/232402751383?epid=872709924&amp;hash=item361c488f97:g:m7MAAOSwYS9ZYfSv">Slide switch</a></td><td>1</td></tr><tr><td><a href="https://www.ebay.com/itm/100pcs-Micro-switch-push-button-6-6-5-mm-new-good-quality/400985254448?hash=item5d5c956a30:g:TDsAAOSwcu5UNir1">Push button</a></td><td>1</td></tr><tr><td><a href="https://www.ebay.com/itm/200Pcs-3V-20mA-3mm-5mm-Round-LED-Light-Emitting-Diodes-Assorted-Kit-5-Colors/273858732261?hash=item3fc340a0e5:m:mYz6mjuwPK14dAIiMKPEdFQ">5mm LED</a></td><td>2</td></tr><tr><td><a href="https://www.ebay.com/itm/10PCS-32-768Khz-125Mhz-Active-Crystal-Oscillators-HC-49S-16MHz-16-000MHz-16M/191964483715?hash=item2cb1f99083:m:m7n-ceLhSJ1IxSY9nPBzLOg">16MHz crystal oscillator</a></td><td>1</td></tr><tr><td><a href="https://www.ebay.com/itm/100nF-100N-Ceramic-Disc-Capacitor-5mm-Pitch-25V-Pack-of-20/113761999708?hash=item1a7cbe5b5c:g:HmAAAOSw4OJc6mHm">100n ceramic capacitor</a></td><td>1</td></tr><tr><td><a href="https://www.ebay.com/itm/100Stks-22pF-50Volt-Ceramic-Disc-Capacitors-10-to-85-20-2-5x-Rated-Voltage/272304121542?hash=item3f669726c6:g:~TMAAOSwAPlXg6gr">22PF ceramic capacitor</a></td><td>2</td></tr><tr><td><a href="https://www.ebay.com/itm/50PCS-50V-10uF-50Volt-10MFD-NP-Non-polarized-Electrolytic-Capacitor-5-11mm/392239567019?hash=item5b534cd0ab:g:6scAAOSwUmpc7pbC">10uf polarized capacitor</a></td><td>1</td></tr><tr><td>330 ohm resistor</td><td>2</td></tr><tr><td>10 kohm resistor</td><td>1</td></tr><tr><td><a href="https://www.ebay.com/itm/10PCS-2-54mm-Header-15Pin-Single-Row-Female-Pin-Socket-connector/283261250485?hash=item41f3afabb5:g:DiQAAOSwWz5b7Qk5">2.54mm Female pin header</a></td><td>2</td></tr></tbody></table></figure>



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



<h2 class="wp-block-heading">ATmega328P Bare minimum configuration</h2>



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



<p class="has-regular-font-size wp-block-paragraph">Before building our standalone ATmega328P chip Arduino compatible board, let&#8217;s take a look at the awesome Arduino UNO board and see the main components that used to build that beautiful thing.</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="550" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/11/Arduino_uno_r3.jpg?resize=770%2C550&#038;ssl=1" alt="Arduino UNO board" class="wp-image-937" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/11/Arduino_uno_r3-scaled.jpg?resize=1024%2C731&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/11/Arduino_uno_r3-scaled.jpg?resize=800%2C571&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/11/Arduino_uno_r3-scaled.jpg?resize=300%2C214&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/11/Arduino_uno_r3-scaled.jpg?resize=768%2C548&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/11/Arduino_uno_r3-scaled.jpg?resize=1536%2C1097&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">Arduino UNO</figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph">The first main component is the ATmega328P chip which is the brain of the board. A Voltage regulator that regulates the input voltage to a 5V clean output which gets used mainly by the ATmega320p chip. The 16MHz crystal oscillator, that creates an electric signal with a given frequency. Simply it counts the seconds so you don&#8217;t have to. Some LEDs to make you sure that the board is running smoothly and still alive. DC Plug allows you to connect the board to a DC power source. USB Port allows you to connect the board to your computer. Some pin headers to interface it with the external world(sensors, motors, LEDs, ..) through some jumper wires.</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="9818672392"></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">After knowing the main components used in the Arduino UNO board, we can make one using the same main components that we stated before which is called the <strong>ATmega328P bare minimum configuration</strong>.</p>



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



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



<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="621" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/11/bareMinimumConfiguration.png?resize=770%2C621&#038;ssl=1" alt="Bare Minimum Configuration" class="wp-image-946" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/11/bareMinimumConfiguration.png?resize=1024%2C826&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/11/bareMinimumConfiguration.png?resize=800%2C646&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/11/bareMinimumConfiguration.png?resize=300%2C242&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/11/bareMinimumConfiguration.png?resize=768%2C620&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/11/bareMinimumConfiguration.png?w=1098&amp;ssl=1 1098w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">Bare Minimum Configuration</figcaption></figure>



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



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


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="388" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/11/bareMinimumConfigurationBB.png?resize=770%2C388&#038;ssl=1" alt="Bare Minimum Configuration On Breadboard" class="wp-image-948" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/11/bareMinimumConfigurationBB.png?resize=1024%2C516&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/11/bareMinimumConfigurationBB.png?resize=800%2C403&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/11/bareMinimumConfigurationBB.png?resize=300%2C151&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/11/bareMinimumConfigurationBB.png?resize=768%2C387&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/11/bareMinimumConfigurationBB.png?w=1458&amp;ssl=1 1458w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">Bare Minimum Configuration On Breadboard</figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph">As you can see, the <strong>bare minimum configuration</strong> means using the smallest possible quantity of components that makes that thing runs without problems. but later on, we will add some more components like LEDs, buttons, pin headers, .. to spice things up.</p>



<p class="has-regular-font-size wp-block-paragraph">the ATmega328P works at 5V that must be well regulated without any spikes that&#8217;s why we are using a 10microfarad capacitor between the 5V power line. in order to make the ATmega328p runs, you have to apply a HIGH logic value &#8220;5V&#8221; on the &#8220;reset&#8221; pin.</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;Reset&#8221; pin is an active low pin, which means if you applied a LOW logic value &#8220;0V&#8221; on it, it will restart the chip. So we keep it HIGH to make it disabled.</div></div>



<p class="has-regular-font-size wp-block-paragraph">Usually, the ATmega328P chip works on a 16MHz crystal oscillator placed on the pins 9 and 10 but in order to make it oscillate it needs two 22Picofarad capacitors connected to the GND.</p>



<p class="has-regular-font-size wp-block-paragraph">But we want to spice things up, let us add some more components to give the board more features and make it more user-friendly.</p>



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



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



<figure class="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/2019/11/PCB-Schmeatic.png?resize=770%2C513&#038;ssl=1" alt="Final Schematic " class="wp-image-950" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/11/PCB-Schmeatic-scaled.png?resize=1024%2C682&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/11/PCB-Schmeatic-scaled.png?resize=800%2C533&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/11/PCB-Schmeatic-scaled.png?resize=300%2C200&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/11/PCB-Schmeatic-scaled.png?resize=768%2C512&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/11/PCB-Schmeatic-scaled.png?resize=1536%2C1024&amp;ssl=1 1536w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/11/PCB-Schmeatic-scaled.png?resize=270%2C180&amp;ssl=1 270w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/11/PCB-Schmeatic-scaled.png?resize=370%2C245&amp;ssl=1 370w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">Final Schematic </figcaption></figure>



<h3 class="wp-block-heading">Cairoduino V1.0 Board</h3>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="525" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/Cairoduino-board.png?resize=770%2C525&#038;ssl=1" alt="Cairoduino board" class="wp-image-1023" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/Cairoduino-board.png?resize=1024%2C698&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/Cairoduino-board.png?resize=800%2C545&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/Cairoduino-board.png?resize=300%2C204&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/Cairoduino-board.png?resize=768%2C523&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/Cairoduino-board.png?resize=1536%2C1047&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">Cairoduino board</figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph">We added some new components to the bare minimum configuration that we discussed before to add more features to the board and make it more simple to use like a very normal Arduino UNO board.</p>



<ol class="wp-block-list">
<li class="">DC Power plug to make connecting the board to a power source easy and fast.</li>



<li class="">L7805 voltage regulator, so you can plug it to any power source ranged between 7V-12V and the L7805 chip will regulate that voltage and give the ATmega328p chip a well-regulated 5V. The difference between the input voltage and the output voltage will go in a form of heat.</li>



<li class="">Reset button, to be able to reset the board easily in case of any misbehaving.</li>



<li class="">power LED as an indicator that tells the user if the board is connected to the power source or not.</li>



<li class="">On&amp;Off switch.</li>



<li class="">pin headers to allow the user to connect any electronic components like sensors, LEDs, switches, &#8230; to the board easily using some jumpers, like any Arduino board.</li>



<li class="">FTDI breakout board, to be able to connect the board to the laptop so you can program and upload the code to it easily without removing the ATmega chip itself.</li>
</ol>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="526" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/Board-components-value.png?resize=770%2C526&#038;ssl=1" alt="Components Value" class="wp-image-1021" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/Board-components-value.png?resize=1024%2C700&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/Board-components-value.png?resize=800%2C547&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/Board-components-value.png?resize=300%2C205&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/Board-components-value.png?resize=768%2C525&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/Board-components-value.png?resize=1536%2C1050&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">Components Value</figcaption></figure>
</div>


<h2 class="wp-block-heading">PCB Manufacturing</h2>



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



<p class="has-regular-font-size wp-block-paragraph">This board is designed on <a href="https://www.autodesk.com/products/eagle/overview">Eagle from Autodesk</a>. You don&#8217;t have to be a PCB design expert to make or own this board because it&#8217;s fully open-source you can download the whole project from this link.</p>



<p class="wp-block-paragraph">If you need this eagle project as a template so you can customize it according to your needs, you are very welcome to do anything you want to the project.</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://github.com/ahmedibrrahim/Cairoduino-PCB" style="border-radius:100px;background-color:#00a99d" target="_blank" rel="noreferrer noopener">Github</a></div>
</div>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="546" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/PCB.png?resize=770%2C546&#038;ssl=1" alt="Cairoduino PCB Board" class="wp-image-981" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/PCB.png?resize=1024%2C726&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/PCB.png?resize=800%2C567&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/PCB.png?resize=300%2C213&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/PCB.png?resize=768%2C544&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/PCB.png?resize=1536%2C1088&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">Cairoduino PCB Board</figcaption></figure>
</div>


<p class="wp-block-paragraph">You can order your own Cairoduino board from <a href="https://www.pcbway.com/">PCBWay</a> in just Two clicks. from this link.</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/Cairoduino.html" style="border-radius:100px;background-color:#00a99d" target="_blank" rel="noreferrer noopener">PCBWay</a></div>
</div>



<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="383" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/Screen-Shot-2019-12-21-at-8.09.34-AM.png?resize=770%2C383&#038;ssl=1" alt="PCBWay project page" class="wp-image-987" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/Screen-Shot-2019-12-21-at-8.09.34-AM.png?resize=1024%2C509&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/Screen-Shot-2019-12-21-at-8.09.34-AM.png?resize=800%2C398&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/Screen-Shot-2019-12-21-at-8.09.34-AM.png?resize=300%2C149&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/Screen-Shot-2019-12-21-at-8.09.34-AM.png?resize=768%2C382&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/Screen-Shot-2019-12-21-at-8.09.34-AM.png?resize=1536%2C764&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">PCBWay project page</figcaption></figure>



<p class="wp-block-paragraph">From my point of view, <strong>PCBWay</strong> has the most user-friendly web-based interaction design in the industry! You can instantly get the quotation of your PCB, you can also check the order fabrication and processing status online in your account panel, After your PCBs are sent out to your address, you can track your order shipping status online and a lot more.</p>



<h2 class="wp-block-heading">Uploading the bootloader to the chip</h2>



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



<p class="wp-block-paragraph">To be able to use the Arduino IDE to program the chip, we need to burn the bootloader to the Atmega chip. At this step, we need an Arduino UNO board we will use it as a programmer by connecting the MOSI, MISO, SCK pins between the ATmega328p chip and the Arduino UNO board.</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="9818672392"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



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



<p class="wp-block-paragraph">If you already have an ATmega chip with the Arduino bootloader pre-loaded you don&#8217;t need to do these steps.</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="336" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/Uploading-the-bootloader.png?resize=770%2C336&#038;ssl=1" alt="Uploading bootloader wiring" class="wp-image-993" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/Uploading-the-bootloader.png?resize=1024%2C447&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/Uploading-the-bootloader.png?resize=800%2C350&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/Uploading-the-bootloader.png?resize=300%2C131&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/Uploading-the-bootloader.png?resize=768%2C336&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/Uploading-the-bootloader.png?resize=1536%2C671&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">Uploading bootloader wiring</figcaption></figure>
</div>


<p class="wp-block-paragraph">After connecting the ATmega chip with the Arduino board, we need to open the <strong>Arduino IDE &#8211;&gt; File &#8211;&gt; Examples &#8211;&gt; ArduinoISP &#8211;&gt; ArduinoISP </strong></p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="216" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/Screen-Shot-2019-12-21-at-8.53.12-AM.png?resize=770%2C216&#038;ssl=1" alt="ArduinoISP Code" class="wp-image-994" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/Screen-Shot-2019-12-21-at-8.53.12-AM.png?resize=1024%2C287&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/Screen-Shot-2019-12-21-at-8.53.12-AM.png?resize=800%2C224&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/Screen-Shot-2019-12-21-at-8.53.12-AM.png?resize=300%2C84&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/Screen-Shot-2019-12-21-at-8.53.12-AM.png?resize=768%2C215&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/Screen-Shot-2019-12-21-at-8.53.12-AM.png?resize=1536%2C430&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">ArduinoISP Code</figcaption></figure>
</div>


<p class="wp-block-paragraph">Then, set the Programmer to Arduino as ISP. <strong>Tools &#8211;&gt; Programmer &#8211;&gt; Arduino as ISP.</strong></p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="311" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/Screen-Shot-2019-12-21-at-8.54.00-AM.png?resize=770%2C311&#038;ssl=1" alt="Setting the programmer" class="wp-image-995" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/Screen-Shot-2019-12-21-at-8.54.00-AM.png?resize=1024%2C414&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/Screen-Shot-2019-12-21-at-8.54.00-AM.png?resize=800%2C323&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/Screen-Shot-2019-12-21-at-8.54.00-AM.png?resize=300%2C121&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/Screen-Shot-2019-12-21-at-8.54.00-AM.png?resize=768%2C311&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/Screen-Shot-2019-12-21-at-8.54.00-AM.png?resize=1536%2C621&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">Setting the programmer</figcaption></figure>
</div>


<p class="wp-block-paragraph">Now, it&#8217;s the time to burn the bootloader, <strong>Tools &#8211;&gt; Burn Bootloader.</strong></p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="314" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/Screen-Shot-2019-12-21-at-8.54.12-AM.png?resize=770%2C314&#038;ssl=1" alt="Burn the bootloader" class="wp-image-996" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/Screen-Shot-2019-12-21-at-8.54.12-AM.png?resize=1024%2C417&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/Screen-Shot-2019-12-21-at-8.54.12-AM.png?resize=800%2C326&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/Screen-Shot-2019-12-21-at-8.54.12-AM.png?resize=300%2C122&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/Screen-Shot-2019-12-21-at-8.54.12-AM.png?resize=768%2C313&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/Screen-Shot-2019-12-21-at-8.54.12-AM.png?resize=1536%2C626&amp;ssl=1 1536w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/Screen-Shot-2019-12-21-at-8.54.12-AM.png?w=1698&amp;ssl=1 1698w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">Burn the bootloader</figcaption></figure>
</div>


<h3 class="wp-block-heading">FTDI breakout board</h3>



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


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="640" height="480" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/ftdi_breakout.jpg?resize=640%2C480&#038;ssl=1" alt="FTDI breakout board" class="wp-image-1001" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/ftdi_breakout.jpg?w=640&amp;ssl=1 640w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/ftdi_breakout.jpg?resize=600%2C450&amp;ssl=1 600w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/ftdi_breakout.jpg?resize=300%2C225&amp;ssl=1 300w" sizes="auto, (max-width: 640px) 100vw, 640px" /><figcaption class="wp-element-caption">FTDI breakout board</figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph">As we stated before, we are using the FTDI module to connect the Cairoduino board to the laptop so we can program and upload the code to it, also you can send, read some stuff back and forth to the serial monitor through the established serial communication.</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="459" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/Connecting-the-FTDI.png?resize=770%2C459&#038;ssl=1" alt="connecting the FTDI breakout board" class="wp-image-1007" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/Connecting-the-FTDI.png?resize=1024%2C611&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/Connecting-the-FTDI.png?resize=800%2C477&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/Connecting-the-FTDI.png?resize=300%2C179&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/Connecting-the-FTDI.png?resize=768%2C458&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/Connecting-the-FTDI.png?w=1458&amp;ssl=1 1458w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">connecting the FTDI breakout board</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="628" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/IMG_6234.jpg?resize=770%2C628&#038;ssl=1" alt="Connecting to the laptop" class="wp-image-1002" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/IMG_6234-scaled.jpg?resize=1024%2C835&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/IMG_6234-scaled.jpg?resize=800%2C652&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/IMG_6234-scaled.jpg?resize=300%2C245&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/IMG_6234-scaled.jpg?resize=768%2C626&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/IMG_6234-scaled.jpg?resize=1536%2C1252&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">Connecting to the laptop</figcaption></figure>
</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;">Don&#8217;t connect a DC Power source to the board while you&#8217;re connecting it to the laptop. connecting the board to two power sources at the same time is too heavy on it to handle.</div></div>



<h2 class="wp-block-heading">LED Blinking</h2>



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



<p class="wp-block-paragraph">Let&#8217;s try to upload a hello world code to the board to see if it behaving as expected or not. open Arduino IDE &#8211;&gt; Examples &#8211;&gt; Basics &#8211;&gt; Blink</p>



<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="184" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/Screen-Shot-2019-12-23-at-1.48.11-AM.png?resize=770%2C184&#038;ssl=1" alt="" class="wp-image-1004" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/Screen-Shot-2019-12-23-at-1.48.11-AM.png?resize=1024%2C245&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/Screen-Shot-2019-12-23-at-1.48.11-AM.png?resize=800%2C192&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/Screen-Shot-2019-12-23-at-1.48.11-AM.png?resize=300%2C72&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/Screen-Shot-2019-12-23-at-1.48.11-AM.png?resize=768%2C184&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/12/Screen-Shot-2019-12-23-at-1.48.11-AM.png?resize=1536%2C368&amp;ssl=1 1536w" sizes="auto, (max-width: 770px) 100vw, 770px" /></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="9818672392"></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 connecting the board to your laptop and hitting the upload button, you should see the built-in LED which is connected to pin 13 blinking every 1 second. if you want to know more details about how LED blinking works you can check this tutorial which we published before.</p>



<figure class="wp-block-embed aligncenter is-type-wp-embed is-provider-make-some-stuff wp-block-embed-make-some-stuff"><div class="wp-block-embed__wrapper">
<blockquote class="wp-embedded-content" data-secret="xfwXusxVsN"><a href="https://makesomestuff.org/arduino-led-blinking/">Arduino LED Blinking</a></blockquote><iframe loading="lazy" class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  title="&#8220;Arduino LED Blinking&#8221; &#8212; Make Some Stuff" src="https://makesomestuff.org/arduino-led-blinking/embed/#?secret=xfwXusxVsN" data-secret="xfwXusxVsN" width="600" height="338" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
</div></figure>
<p>The post <a href="https://makesomestuff.org/atmega328p-standalone-board/">ATmega328P Standalone Board</a> appeared first on <a href="https://makesomestuff.org">Make Some Stuff</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://makesomestuff.org/atmega328p-standalone-board/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">911</post-id>	</item>
		<item>
		<title>Custom-Made Handclap AC Switch Control Board</title>
		<link>https://makesomestuff.org/handclap-ac-switch-control/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=handclap-ac-switch-control</link>
					<comments>https://makesomestuff.org/handclap-ac-switch-control/#respond</comments>
		
		<dc:creator><![CDATA[Ahmed Ibrahim]]></dc:creator>
		<pubDate>Thu, 10 Oct 2019 20:37:34 +0000</pubDate>
				<category><![CDATA[Electronics Projects]]></category>
		<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Logic Control]]></category>
		<guid isPermaLink="false">https://makesomestuff.org/?p=803</guid>

					<description><![CDATA[<p><a href="https://makesomestuff.org">Make Some Stuff</a><br />
<a href="https://makesomestuff.org/handclap-ac-switch-control/">Custom-Made Handclap AC Switch Control Board</a></p>
<p>Makers always look at the simplest and shortest way to get things done. So, today we will learn how to control our home light switch in the simplest and quickest way. Hardware Components Component Quantity Condensor MIC 1 UA741 op-amp IC 1 Decade counter IC 4017 1 5VDC 5-pin relay 1 2n2222 Transistor 1 1n4007 [...]</p>
<p>The post <a href="https://makesomestuff.org/handclap-ac-switch-control/">Custom-Made Handclap AC Switch Control Board</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/handclap-ac-switch-control/">Custom-Made Handclap AC Switch Control Board</a></p>

<p class="has-regular-font-size wp-block-paragraph">Makers always look at the simplest and shortest way to get things done. So, today we will learn how to control our home light switch in the simplest and quickest way. </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="1309125976"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<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="Handclap AC Electronic Switch" width="770" height="433" src="https://www.youtube.com/embed/4ooOUjQTPz0?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"/>



<figure class="is-style-regular wp-block-table"><table class="has-background" style="background-color:#f3f4f5"><tbody><tr><td class="has-text-align-left" data-align="left"><strong>Component</strong></td><td><strong>Quantity</strong></td></tr><tr><td class="has-text-align-left" data-align="left"><a href="https://www.ebay.com/itm/2x-Mini-MIC-9x7mm-Capsule-Electret-Condenser-Microphone-CR-CZN-15E-micro/192238576954?hash=item2cc24fe53a:g:ErkAAOSw7PJbxaov" target="_blank" rel="noreferrer noopener" aria-label=" (opens in a new tab)">Condensor MIC</a></td><td>1</td></tr><tr><td class="has-text-align-left" data-align="left"><a href="https://www.ebay.com/itm/TI-UA741CP-Single-Op-AMP-DIL-8/133203844579?hash=item1f03915de3:g:n7YAAOSwYZJdpcA8" target="_blank" rel="noreferrer noopener" aria-label=" (opens in a new tab)">UA741 op-amp IC</a></td><td>1</td></tr><tr><td class="has-text-align-left" data-align="left"><a href="https://www.ebay.com/itm/5-10-20PCS-CD4017-CD4017BE-4017-DECADE-COUNTER-DIVIDER-IC/263788022713?_trkparms=ispr%3D1&amp;hash=item3d6afdcbb9:m:mgIBoOY90oyujpgKbKyladg&amp;enc=AQAEAAACQBPxNw%2BVj6nta7CKEs3N0qWycvEz6V5ckS90SvrTcvg2KOiUu7bGg58%2Fgsxb0%2F5uqIW8jz6K%2Bkge%2Bm3yyHPZta6PUKn9%2BB4PQSOsSqofjNQSqNpq2UNizssfQxM%2BpVh%2FRZ46sKXTCFUmbbxdT4uLRaRb8fZ%2FFQsVTXFMTAgD2npvaM%2FTYsusK0udWRhOXpVjRlJiBZm5krXOpV3Spxlt33l9o3WoEnmZZQUAkoWoUfNYJyvo2gpYUDCcE9eDUsadKFdvREVjDxzb6hO249B9YrGnXaiSvu1pXLnIZkreJZeksh3%2Fps69jhZmx1gaMNmFdZVMo1OYQw8R091n5JDzI1%2Bvd1LHBpRFSjB%2Blgvo%2FaMi3nijOOEpFoZ75X%2BhKIfZqmhuA7oJMG3c86D3Liz4gs50h3kBoklMUgEp3PVfbyzq2qgydC0UE5Y5y%2FivlrDPyYG0DaUAjunhoXm2DFXRZDgs2hZoLhk7xSEY3o7QctVM8y8kUyDOWtGYPYraYISBis%2B3SxPra0JOGFNv0mXHMYV8FvOpUOWLdta%2FaKl3WHSvd9yS4xkY7CrXEwxOKT9QDb3Fo3wI6Xuf0u4JJGkYKHTpPJ9V6Nhlitta%2BsLZoUYkeKaL3gNDdAVMM7pwyDWwnMl%2Bq0qmX2VkawZTXCC4%2BXRIvOBm50fTC01xvFwpz8OvBEwZ%2Bt87vFq7W0HKORz9prqHXLeBTUu%2BtWtmK6y2t5petwkvRJJgWnYa8z%2BDeMJBml6hiO5t%2FNgeb0rER%2BiXiA%3D%3D&amp;checksum=263788022713965f4199ec6b45d5b028a8b0135f5149&amp;enc=AQAEAAACQBPxNw%2BVj6nta7CKEs3N0qWycvEz6V5ckS90SvrTcvg2KOiUu7bGg58%2Fgsxb0%2F5uqIW8jz6K%2Bkge%2Bm3yyHPZta6PUKn9%2BB4PQSOsSqofjNQSqNpq2UNizssfQxM%2BpVh%2FRZ46sKXTCFUmbbxdT4uLRaRb8fZ%2FFQsVTXFMTAgD2npvaM%2FTYsusK0udWRhOXpVjRlJiBZm5krXOpV3Spxlt33l9o3WoEnmZZQUAkoWoUfNYJyvo2gpYUDCcE9eDUsadKFdvREVjDxzb6hO249B9YrGnXaiSvu1pXLnIZkreJZeksh3%2Fps69jhZmx1gaMNmFdZVMo1OYQw8R091n5JDzI1%2Bvd1LHBpRFSjB%2Blgvo%2FaMi3nijOOEpFoZ75X%2BhKIfZqmhuA7oJMG3c86D3Liz4gs50h3kBoklMUgEp3PVfbyzq2qgydC0UE5Y5y%2FivlrDPyYG0DaUAjunhoXm2DFXRZDgs2hZoLhk7xSEY3o7QctVM8y8kUyDOWtGYPYraYISBis%2B3SxPra0JOGFNv0mXHMYV8FvOpUOWLdta%2FaKl3WHSvd9yS4xkY7CrXEwxOKT9QDb3Fo3wI6Xuf0u4JJGkYKHTpPJ9V6Nhlitta%2BsLZoUYkeKaL3gNDdAVMM7pwyDWwnMl%2Bq0qmX2VkawZTXCC4%2BXRIvOBm50fTC01xvFwpz8OvBEwZ%2Bt87vFq7W0HKORz9prqHXLeBTUu%2BtWtmK6y2t5petwkvRJJgWnYa8z%2BDeMJBml6hiO5t%2FNgeb0rER%2BiXiA%3D%3D&amp;checksum=263788022713965f4199ec6b45d5b028a8b0135f5149" target="_blank" rel="noreferrer noopener" aria-label="Decade counter IC 4017 (opens in a new tab)">Decade counter IC 4017</a></td><td>1</td></tr><tr><td class="has-text-align-left" data-align="left"><a href="https://www.ebay.com/itm/10pcs-Mini-Power-Relay-5V-DC-SRD-5VDC-SL-C-SRD-5VDC-SL-C-PCB/401563774618?hash=item5d7f10ee9a:m:mf_NTXRyZpicTHzkrToOXYw" target="_blank" rel="noreferrer noopener" aria-label="5VDC 5-pin relay (opens in a new tab)">5VDC 5-pin relay</a></td><td>1</td></tr><tr><td class="has-text-align-left" data-align="left"><a href="https://www.ebay.com/itm/100Pcs-NPN-Transistor-TO-92-2N2222A-2N2222-NEW/311607067106?epid=1001943867&amp;_trkparms=ispr%3D1&amp;hash=item488d3a81e2:g:SQMAAOSwIgNXotih&amp;enc=AQAEAAACMBPxNw%2BVj6nta7CKEs3N0qWeMXkn2F0vRozoVCfXBkbq5yMS9M3q%2BHhhriXLspRjRZC329ZxJDdeo6S6Z8J84wjP642DKOaOmpTsWekCwxEEiza7naG1JltnETr%2FNLI3pr%2Btajkz%2F9it9l4AVCmm%2B2ct8p3phAjpmq7bdRVCqP%2BMIjEpmRvmMlSvxZcRfZ0YFeAjDvX%2B4ClxGbQ6iLQQ1KpLm20AUtZxjM%2BD0eR07xb3P7aekQHA%2FEqdysn2YozMdnwQd5UCBsmlSlz7F55mT%2BaGeEu3cBF5y5YuYvgTIRxwRX1l%2BxPlXQU2gygRjKzMxPWooAzT9qdEfeTHSOwZPLEQ6KM98h8GuwWkiRPJ2EBLWJaZGg%2FRBc1Pxel7ktU%2FklnYKZRpoFQL4eE%2BLYgT4l7S2bIoWComUIp%2BTpdyOwS0A80lfBrz5%2FEbcepmuye9AVrSQ8XQga%2Bo9xoRbtnwI0cI9p6VPCl8DNENXZgqPMqk0GN2O%2FOgnk97%2Bwsbk3vrvyrbgacmL9Bvm1uDznDOmSM1JH8RWUjUDl2NeKY1aikaptvmA%2B2vy7QVBUZH3LHQrwzVgtI2TgTTTwZfpDSKeqpLDSK8Lj9qqfqKsHYQXBiMGv6kW90dEtXZ2JjxEPKQYr2EQb6Bu%2FJHygOvZkPlzz4F8MolyO5fmEjS4k2vaK5eMvPYzR0Nw%2F4za8Im6ll5L1zt%2Bd%2F%2BFLVSKLDtK25e6X2EssRiGXytNMMetKqqRV8m&amp;checksum=3116070671063f6c4fc0cb2248f494ea352a0c3864b2&amp;enc=AQAEAAACMBPxNw%2BVj6nta7CKEs3N0qWeMXkn2F0vRozoVCfXBkbq5yMS9M3q%2BHhhriXLspRjRZC329ZxJDdeo6S6Z8J84wjP642DKOaOmpTsWekCwxEEiza7naG1JltnETr%2FNLI3pr%2Btajkz%2F9it9l4AVCmm%2B2ct8p3phAjpmq7bdRVCqP%2BMIjEpmRvmMlSvxZcRfZ0YFeAjDvX%2B4ClxGbQ6iLQQ1KpLm20AUtZxjM%2BD0eR07xb3P7aekQHA%2FEqdysn2YozMdnwQd5UCBsmlSlz7F55mT%2BaGeEu3cBF5y5YuYvgTIRxwRX1l%2BxPlXQU2gygRjKzMxPWooAzT9qdEfeTHSOwZPLEQ6KM98h8GuwWkiRPJ2EBLWJaZGg%2FRBc1Pxel7ktU%2FklnYKZRpoFQL4eE%2BLYgT4l7S2bIoWComUIp%2BTpdyOwS0A80lfBrz5%2FEbcepmuye9AVrSQ8XQga%2Bo9xoRbtnwI0cI9p6VPCl8DNENXZgqPMqk0GN2O%2FOgnk97%2Bwsbk3vrvyrbgacmL9Bvm1uDznDOmSM1JH8RWUjUDl2NeKY1aikaptvmA%2B2vy7QVBUZH3LHQrwzVgtI2TgTTTwZfpDSKeqpLDSK8Lj9qqfqKsHYQXBiMGv6kW90dEtXZ2JjxEPKQYr2EQb6Bu%2FJHygOvZkPlzz4F8MolyO5fmEjS4k2vaK5eMvPYzR0Nw%2F4za8Im6ll5L1zt%2Bd%2F%2BFLVSKLDtK25e6X2EssRiGXytNMMetKqqRV8m&amp;checksum=3116070671063f6c4fc0cb2248f494ea352a0c3864b2" target="_blank" rel="noreferrer noopener" aria-label="2n2222 Transistor (opens in a new tab)">2n2222 Transistor</a></td><td>1</td></tr><tr><td class="has-text-align-left" data-align="left"><a href="https://www.ebay.com/itm/100pcs-1N4007-Diode-MIC-DO-41-1A-1000V-Rectifie-Diodes-NEW/301924671073?hash=item464c1cde61:g:4f8AAOSwuTxWAg3m" target="_blank" rel="noreferrer noopener" aria-label="1n4007 Diode (opens in a new tab)">1n4007 Diode</a></td><td>1</td></tr><tr><td class="has-text-align-left" data-align="left"><a href="https://www.ebay.com/itm/20Pcs-1W-1-Watt-Metal-Film-Resistor-1-1K-910K-Ohm-1-K-910-K-Free-Shipping/192252609011?_trkparms=ispr%3D1&amp;hash=item2cc32601f3:m:mR2rCX05fL53k9RopChCPFw&amp;enc=AQAEAAACQBPxNw%2BVj6nta7CKEs3N0qV3B7vV1K4PzE5%2Fv%2FTVh6yTMvSd%2FQzVXUQbZlRdlRWNu9TFhtuzshbZ%2BowFXmArbUDgTczLd289kcBy7WkLuQMig5Ltt8IpLRtHlHVCzTP6uMp%2BFySXhLu9BnO4ZsThSmIcYkIiyBVyBAl%2Fsz3YDyES%2BQPTv6nmX5cOWBZt0ezdYlSp9CnEmisgLYOErkIxrcxE%2BEgFGHZCCitFbi60r2BODcQd7AcMPpwZaOZPLv435YSz0qe4ci1GRQY8EeXxiutN862ZsPFKQnpnrH98XMro6KkuI2hmsqzJ92ToPPrE5rZtkp6b8X6bln3Qrv2Esx18NSRFCYjfzMXitkKmzm8F7NbPGiUlhGyg0lRxq81xjQQv0v%2Fa%2B0LRXAm%2F3oWbEWKp%2BMfacoQfh4eIzZP9Pl%2BL1IuTXtFzFcXDSXTThJ%2B8I5VKoxLg3GW785Mak%2B4qVSmCwjS8hkt%2B%2F5XrgKc%2FLtmCVfpfGFf6BP6hAEgzn9v74VGh2IXuB8vk5BujnrX1UAUDmgJ4ZDL8UwxU8G7%2BVoVpMcUTLmxmUO5NchPRzjvufn4VMmPL4jLN%2Bn%2FZJyEcL3FMnXvd0jqN78iXFodgLesg2U3QoxkxPdMfOiBJv66CMI6KDxsRvKVT42sf2%2B9yWK%2Bk7dxLM3DamX%2BzylWY9ufM%2FB8ObFyYvDKfvwfunjLyfLDNivN5BURoblfGen30vqY86vseiCO6omOpwyIiWgUDRPcpZYy4sjxEiUXGKqiJ1w%3D%3D&amp;checksum=192252609011c1068ae05e8943578f48a0ed283c0a1b&amp;enc=AQAEAAACQBPxNw%2BVj6nta7CKEs3N0qV3B7vV1K4PzE5%2Fv%2FTVh6yTMvSd%2FQzVXUQbZlRdlRWNu9TFhtuzshbZ%2BowFXmArbUDgTczLd289kcBy7WkLuQMig5Ltt8IpLRtHlHVCzTP6uMp%2BFySXhLu9BnO4ZsThSmIcYkIiyBVyBAl%2Fsz3YDyES%2BQPTv6nmX5cOWBZt0ezdYlSp9CnEmisgLYOErkIxrcxE%2BEgFGHZCCitFbi60r2BODcQd7AcMPpwZaOZPLv435YSz0qe4ci1GRQY8EeXxiutN862ZsPFKQnpnrH98XMro6KkuI2hmsqzJ92ToPPrE5rZtkp6b8X6bln3Qrv2Esx18NSRFCYjfzMXitkKmzm8F7NbPGiUlhGyg0lRxq81xjQQv0v%2Fa%2B0LRXAm%2F3oWbEWKp%2BMfacoQfh4eIzZP9Pl%2BL1IuTXtFzFcXDSXTThJ%2B8I5VKoxLg3GW785Mak%2B4qVSmCwjS8hkt%2B%2F5XrgKc%2FLtmCVfpfGFf6BP6hAEgzn9v74VGh2IXuB8vk5BujnrX1UAUDmgJ4ZDL8UwxU8G7%2BVoVpMcUTLmxmUO5NchPRzjvufn4VMmPL4jLN%2Bn%2FZJyEcL3FMnXvd0jqN78iXFodgLesg2U3QoxkxPdMfOiBJv66CMI6KDxsRvKVT42sf2%2B9yWK%2Bk7dxLM3DamX%2BzylWY9ufM%2FB8ObFyYvDKfvwfunjLyfLDNivN5BURoblfGen30vqY86vseiCO6omOpwyIiWgUDRPcpZYy4sjxEiUXGKqiJ1w%3D%3D&amp;checksum=192252609011c1068ae05e8943578f48a0ed283c0a1b" target="_blank" rel="noreferrer noopener" aria-label="1kohm resistor (opens in a new tab)">1kohm resistor</a></td><td>4</td></tr><tr><td class="has-text-align-left" data-align="left"><a href="https://www.ebay.com/itm/3mm-5mm-monochrome-flash-light-red-blue-white-emerald-green-orange-yellow-LED/293081666256?hash=item443d0752d0:m:mmyBl8s76nluOWJ59z7zGCQ" target="_blank" rel="noreferrer noopener" aria-label="5mm LEDs (opens in a new tab)">5mm LEDs</a></td><td>3</td></tr><tr><td class="has-text-align-left" data-align="left"><a href="https://www.ebay.com/itm/20Pcs-1W-1-Watt-Metal-Film-Resistor-1-1K-910K-Ohm-1-K-910-K-Free-Shipping/192252609011?_trkparms=ispr%3D1&amp;hash=item2cc32601f3:m:mR2rCX05fL53k9RopChCPFw&amp;enc=AQAEAAACQBPxNw%2BVj6nta7CKEs3N0qV3B7vV1K4PzE5%2Fv%2FTVh6yTMvSd%2FQzVXUQbZlRdlRWNu9TFhtuzshbZ%2BowFXmArbUDgTczLd289kcBy7WkLuQMig5Ltt8IpLRtHlHVCzTP6uMp%2BFySXhLu9BnO4ZsThSmIcYkIiyBVyBAl%2Fsz3YDyES%2BQPTv6nmX5cOWBZt0ezdYlSp9CnEmisgLYOErkIxrcxE%2BEgFGHZCCitFbi60r2BODcQd7AcMPpwZaOZPLv435YSz0qe4ci1GRQY8EeXxiutN862ZsPFKQnpnrH98XMro6KkuI2hmsqzJ92ToPPrE5rZtkp6b8X6bln3Qrv2Esx18NSRFCYjfzMXitkKmzm8F7NbPGiUlhGyg0lRxq81xjQQv0v%2Fa%2B0LRXAm%2F3oWbEWKp%2BMfacoQfh4eIzZP9Pl%2BL1IuTXtFzFcXDSXTThJ%2B8I5VKoxLg3GW785Mak%2B4qVSmCwjS8hkt%2B%2F5XrgKc%2FLtmCVfpfGFf6BP6hAEgzn9v74VGh2IXuB8vk5BujnrX1UAUDmgJ4ZDL8UwxU8G7%2BVoVpMcUTLmxmUO5NchPRzjvufn4VMmPL4jLN%2Bn%2FZJyEcL3FMnXvd0jqN78iXFodgLesg2U3QoxkxPdMfOiBJv66CMI6KDxsRvKVT42sf2%2B9yWK%2Bk7dxLM3DamX%2BzylWY9ufM%2FB8ObFyYvDKfvwfunjLyfLDNivN5BURoblfGen30vqY86vseiCO6omOpwyIiWgUDRPcpZYy4sjxEiUXGKqiJ1w%3D%3D&amp;checksum=192252609011c1068ae05e8943578f48a0ed283c0a1b&amp;enc=AQAEAAACQBPxNw%2BVj6nta7CKEs3N0qV3B7vV1K4PzE5%2Fv%2FTVh6yTMvSd%2FQzVXUQbZlRdlRWNu9TFhtuzshbZ%2BowFXmArbUDgTczLd289kcBy7WkLuQMig5Ltt8IpLRtHlHVCzTP6uMp%2BFySXhLu9BnO4ZsThSmIcYkIiyBVyBAl%2Fsz3YDyES%2BQPTv6nmX5cOWBZt0ezdYlSp9CnEmisgLYOErkIxrcxE%2BEgFGHZCCitFbi60r2BODcQd7AcMPpwZaOZPLv435YSz0qe4ci1GRQY8EeXxiutN862ZsPFKQnpnrH98XMro6KkuI2hmsqzJ92ToPPrE5rZtkp6b8X6bln3Qrv2Esx18NSRFCYjfzMXitkKmzm8F7NbPGiUlhGyg0lRxq81xjQQv0v%2Fa%2B0LRXAm%2F3oWbEWKp%2BMfacoQfh4eIzZP9Pl%2BL1IuTXtFzFcXDSXTThJ%2B8I5VKoxLg3GW785Mak%2B4qVSmCwjS8hkt%2B%2F5XrgKc%2FLtmCVfpfGFf6BP6hAEgzn9v74VGh2IXuB8vk5BujnrX1UAUDmgJ4ZDL8UwxU8G7%2BVoVpMcUTLmxmUO5NchPRzjvufn4VMmPL4jLN%2Bn%2FZJyEcL3FMnXvd0jqN78iXFodgLesg2U3QoxkxPdMfOiBJv66CMI6KDxsRvKVT42sf2%2B9yWK%2Bk7dxLM3DamX%2BzylWY9ufM%2FB8ObFyYvDKfvwfunjLyfLDNivN5BURoblfGen30vqY86vseiCO6omOpwyIiWgUDRPcpZYy4sjxEiUXGKqiJ1w%3D%3D&amp;checksum=192252609011c1068ae05e8943578f48a0ed283c0a1b" target="_blank" rel="noreferrer noopener" aria-label="10kohm resistor (opens in a new tab)">10kohm resistor</a></td><td>1</td></tr><tr><td class="has-text-align-left" data-align="left"><a href="https://www.sparkfun.com/products/8433" target="_blank" rel="noreferrer noopener" aria-label="Terminal block 3-legs (opens in a new tab)">Terminal block 3-legs</a></td><td>1</td></tr><tr><td class="has-text-align-left" data-align="left"><a href="https://www.sparkfun.com/products/9806" target="_blank" rel="noreferrer noopener" aria-label="Small rotary potentiometer 103 (opens in a new tab)">Small rotary potentiometer 103</a></td><td>1</td></tr><tr><td class="has-text-align-left" data-align="left">Custom PCB manufacture  </td><td>1</td></tr><tr><td class="has-text-align-left" data-align="left"><a href="https://www.sparkfun.com/products/107" target="_blank" rel="noreferrer noopener" aria-label="LM7805 voltage regulator (opens in a new tab)">LM7805 voltage regulator</a></td><td>1</td></tr><tr><td class="has-text-align-left" data-align="left"><a href="https://www.sparkfun.com/products/119" target="_blank" rel="noreferrer noopener" aria-label="DC Plug socket (opens in a new tab)">DC Plug socket</a></td><td>1</td></tr><tr><td class="has-text-align-left" data-align="left"><a href="https://www.ebay.com/itm/Electrolytic-Capacitor-400V-1uF-2-2uF-3-3uF-4-7uF-6-8uF-8-2uF-10uF-15uF-22uF-MFD/253868081098?_trkparms=ispr%3D1&amp;hash=item3b1bb77fca:m:meSEyfOe3-BtuyT-AjTECow&amp;enc=AQAEAAACQBPxNw%2BVj6nta7CKEs3N0qWCutv4hY0VZQN1ROmap%2BrdD8x7r3GrmZGpHZq7B%2Ba9q8jvnDsMVNie7nijDCWwD8LPkfriJemfPJz1uIsgr8d7OV5n5Xn8C9PROelWb3IbJpqVtj5nZhW8QeFO3ARjhLIyqTpXywyz6TgC4Jw9VQDbodQWykaFw1oRhd67ZL0SCgu5BGg%2FQ3U7bwlCeBcShfRHz15o%2B6F0thy2yPiC317PQdjSS1ezSgOS9c7m%2BOk%2FLkhyuEALlJN%2BZP0Se9ev8Hh498dIeuCZgdJY2IQ4ZoeGsErEI9SIlshUUvKAUXZZa67p%2BDxk7mqqSI9xDt8mRz8q8EG5eqwoN8MqGnr2iwl8OYg0QowSFI%2FOZwLgqQsQGP4%2FZJcO2rJldq3Oe3XxUK6z09Q3QpntQyFTiSTWvWWJocJeDC47aDAhdQZxqYcT2FXGjrUMaRrWL2PtDdJRdrVXQ5JqB9bEY7RC3yBXaMjp%2BugNdKKo0Vc7uU7UF2vhfG%2F33v8%2FGHAqGTKEbIF8LQ7fjLzjRhd8c%2F7nNS%2BosKVhOKtqle5T4GhZyTFV0S54xjoeDy%2FX7Up%2FuElrD66ubA7b6x2ivWbnRYC3OFTtk%2FGybMHquAuZ6jJYavUEssO4G35Y9qkqgMrIaEfCLCK9nuo3wp98Xc19h4NRXS9QwM2wcUg6MxM7FT2Qcn8hSWRj9Tk9tQvoSwXRD4iCROEo56Nqodc3sYgCM2yQ0YPnynkIQ95BxHH3YN7e94hITDSypg%3D%3D&amp;checksum=253868081098108cf4971fbc492298adeebbab8fd020&amp;enc=AQAEAAACQBPxNw%2BVj6nta7CKEs3N0qWCutv4hY0VZQN1ROmap%2BrdD8x7r3GrmZGpHZq7B%2Ba9q8jvnDsMVNie7nijDCWwD8LPkfriJemfPJz1uIsgr8d7OV5n5Xn8C9PROelWb3IbJpqVtj5nZhW8QeFO3ARjhLIyqTpXywyz6TgC4Jw9VQDbodQWykaFw1oRhd67ZL0SCgu5BGg%2FQ3U7bwlCeBcShfRHz15o%2B6F0thy2yPiC317PQdjSS1ezSgOS9c7m%2BOk%2FLkhyuEALlJN%2BZP0Se9ev8Hh498dIeuCZgdJY2IQ4ZoeGsErEI9SIlshUUvKAUXZZa67p%2BDxk7mqqSI9xDt8mRz8q8EG5eqwoN8MqGnr2iwl8OYg0QowSFI%2FOZwLgqQsQGP4%2FZJcO2rJldq3Oe3XxUK6z09Q3QpntQyFTiSTWvWWJocJeDC47aDAhdQZxqYcT2FXGjrUMaRrWL2PtDdJRdrVXQ5JqB9bEY7RC3yBXaMjp%2BugNdKKo0Vc7uU7UF2vhfG%2F33v8%2FGHAqGTKEbIF8LQ7fjLzjRhd8c%2F7nNS%2BosKVhOKtqle5T4GhZyTFV0S54xjoeDy%2FX7Up%2FuElrD66ubA7b6x2ivWbnRYC3OFTtk%2FGybMHquAuZ6jJYavUEssO4G35Y9qkqgMrIaEfCLCK9nuo3wp98Xc19h4NRXS9QwM2wcUg6MxM7FT2Qcn8hSWRj9Tk9tQvoSwXRD4iCROEo56Nqodc3sYgCM2yQ0YPnynkIQ95BxHH3YN7e94hITDSypg%3D%3D&amp;checksum=253868081098108cf4971fbc492298adeebbab8fd020" target="_blank" rel="noreferrer noopener" aria-label="1uf electrolytic capacitor (opens in a new tab)">1uf electrolytic capacitor</a></td><td>1</td></tr><tr><td class="has-text-align-left" data-align="left"><a href="https://www.sparkfun.com/products/8375" target="_blank" rel="noreferrer noopener" aria-label="100n capacitor (opens in a new tab)">100n capacitor</a></td><td>1</td></tr></tbody></table></figure>



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



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



<p class="has-regular-font-size wp-block-paragraph">Today, we will learn how to control home light switches by just hand-clapping, Cool ha! to build that project we will use some new electronic components like the decade counter CD4017 IC and the UA741 op-amp, and a condenser MIC as a sound sensor. So, let&#8217;s do it</p>



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



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



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



<p class="has-regular-font-size wp-block-paragraph">The main part of the project is sensing the hand-clap, we used an <strong>electret condenser MIC</strong> to do that job. which converts sound energy into electrical energy. this electrical signal will be an input signal to the UA741 IC. that electret MIC is very sensitive, easy to use, and cheap.</p>



<figure class="wp-block-image"><img data-recalc-dims="1" loading="lazy" decoding="async" width="760" height="588" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Circuit-using-Electret-Condenser-Microphone.png?resize=760%2C588&#038;ssl=1" alt="Condenser MIC output signal" class="wp-image-852" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Circuit-using-Electret-Condenser-Microphone.png?w=760&amp;ssl=1 760w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Circuit-using-Electret-Condenser-Microphone.png?resize=300%2C232&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Circuit-using-Electret-Condenser-Microphone.png?resize=260%2C200&amp;ssl=1 260w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Circuit-using-Electret-Condenser-Microphone.png?resize=87%2C67&amp;ssl=1 87w" sizes="auto, (max-width: 760px) 100vw, 760px" /><figcaption class="wp-element-caption">Condenser MIC output signal</figcaption></figure>



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



<p class="has-regular-font-size wp-block-paragraph">After sensing the hand-clap, the generated electrical signal will go to the input pin of the <strong>UA741 op-amp</strong> which works in this project as a comparator, the UA741 IC will compare the MIC input signal with a specific reference voltage if the input signal is higher than that reference voltage it will output logic value <strong>&#8220;HIGH&#8221;</strong>. And will output <strong>&#8220;LOW&#8221;</strong> when the reference voltage is higher than the input voltage.</p>



<p class="wp-block-paragraph">We are using a potentiometer connected with the UA741 chip to adjust the reference voltage, which works just as setting the sensitivity of the circuit.</p>



<p class="has-regular-font-size wp-block-paragraph">The UA741 IC output value goes to the <strong>&#8220;Clock&#8221;</strong> pin of the <strong>counter 4017 IC</strong> to turn on and off the relay.</p>



<ul class="wp-block-list">
<li class=""><strong>Driving high voltage/current load </strong></li>
</ul>



<p class="has-regular-font-size wp-block-paragraph">You know, we are building this circuit to control AC high voltage loads. So, we used a 5VDC relay to make our small poor circuit able to communicate with that beefy AC high voltage load.</p>



<h2 class="wp-block-heading">UA741 op-amp works as a comparator</h2>



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


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="600" height="287" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/UA741CN-IC.jpg?resize=600%2C287&#038;ssl=1" alt="UA741 IC" class="wp-image-865" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/UA741CN-IC.jpg?w=600&amp;ssl=1 600w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/UA741CN-IC.jpg?resize=300%2C144&amp;ssl=1 300w" sizes="auto, (max-width: 600px) 100vw, 600px" /><figcaption class="wp-element-caption">UA741 IC</figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph">The typical use of the UA741 IC is to amplify a specific signal. Essentially it takes an input voltage, amplifies it by a specific gain, then outputs an amplified voltage. That&#8217;s it. It&#8217;s mostly used in the speaker circuits to amplify the input signal to make the sound loud and clear.</p>



<p class="wp-block-paragraph">But today, we will use the UA741 op-amp as a comparator, not as an amplifier. </p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="500" height="284" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/4aefab13524603cb961d26705d54bfdf.png?resize=500%2C284&#038;ssl=1" alt="UA741 as comparator" class="wp-image-820" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/4aefab13524603cb961d26705d54bfdf.png?w=500&amp;ssl=1 500w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/4aefab13524603cb961d26705d54bfdf.png?resize=300%2C170&amp;ssl=1 300w" sizes="auto, (max-width: 500px) 100vw, 500px" /><figcaption class="wp-element-caption">UA741 as comparator</figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph">As you can see, there&#8217;s a positive pin called &#8220;non-inverting terminal&#8221; and the negative pin called &#8220;inverting terminal&#8221;. these two pins are the input voltage pins. Also, there&#8217;s the voltage output &#8220;Vo&#8221; pin, and obviously the two power supply pins VCC, and GND.</p>



<p class="has-regular-font-size wp-block-paragraph">Since the gain naturally of the op-amp is very huge, then what happens when we feed the op-amp two input pins?  </p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="500" height="284" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/higher-than-.png?resize=500%2C284&#038;ssl=1" alt="Comparator work logic" class="wp-image-823" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/higher-than-.png?w=500&amp;ssl=1 500w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/higher-than-.png?resize=300%2C170&amp;ssl=1 300w" sizes="auto, (max-width: 500px) 100vw, 500px" /><figcaption class="wp-element-caption">Comparator work logic</figcaption></figure>
</div>


<p class="wp-block-paragraph">If the input voltage on the positive terminal<strong>&#8220;Non-inverting pin&#8221;</strong> is higher than the input voltage on the negative terminal <strong>&#8220;Inverting pin&#8221;</strong> Even by a tiny amount. the op-amp will try to amplify the difference between those two inputs by a huge gain and the output voltage from the op-amp will equal <strong><em>(the difference between the two input voltages * the huge gain)</em></strong> which is a very large amount like hundred and hundred thousands of volts or something. But it can&#8217;t do it since you are powering your circuit by a 12V or 5V or even 15V. </p>



<p class="wp-block-paragraph">As a result, it will saturate at the amount of voltage which you are powering your op-amp with. Which is the<strong> VCC</strong>.</p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="500" height="284" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/higher-than-1-1.png?resize=500%2C284&#038;ssl=1" alt="Comparator work logic" class="wp-image-824" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/higher-than-1-1.png?w=500&amp;ssl=1 500w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/higher-than-1-1.png?resize=300%2C170&amp;ssl=1 300w" sizes="auto, (max-width: 500px) 100vw, 500px" /><figcaption class="wp-element-caption"><em>Comparator work logic</em></figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph">Vice versa, if the input voltage on the negative pin &#8220;inverting terminal&#8221; is higher than the input voltage on the positive pin &#8220;non-inverting terminal&#8221; even by a tiny amount, the output voltage will equal the <strong>-VCC (GND)</strong>.</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;"> As a general rule, when the positive pin(Non-inverting pin) input voltage &gt; the negative pin(inverting pin), the output voltage will equal to +VCC. And if opposite the output voltage will equal to GND</div></div>



<h4 class="wp-block-heading">UA741 Op-amp Pinout</h4>



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


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="385" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/800px-741_pin_assignment_01_dPengo.svg_.png?resize=770%2C385&#038;ssl=1" alt="UA741 pinout" class="wp-image-819" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/800px-741_pin_assignment_01_dPengo.svg_.png?w=800&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/800px-741_pin_assignment_01_dPengo.svg_.png?resize=300%2C150&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/800px-741_pin_assignment_01_dPengo.svg_.png?resize=768%2C384&amp;ssl=1 768w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption"><em>UA741 pinout</em></figcaption></figure>
</div>


<ul class="wp-block-list">
<li class=""><strong>Pin 1 and 5</strong> <strong>(Offset null)</strong></li>
</ul>



<p class="has-regular-font-size wp-block-paragraph">We can set the op-amp <strong>gain value</strong> by connecting a capacitor on pins <strong>1</strong> and <strong>5</strong> but we don&#8217;t have to use those pins in this application, we will keep them unconnected.</p>



<ul class="wp-block-list">
<li class=""><strong>Pin 2 and 3</strong> <strong>(Inputs)</strong></li>
</ul>



<p class="wp-block-paragraph">Voltage input pins. We are connecting a potentiometer on the negative terminal (Inverting pin) to adjust the sound sensor sensitivity (Reference voltage). So, you can make the sensor very sensitive and feel the hand-clap from a long distance. Or decrease the sensitivity if there&#8217;s a lot of noise around you or something.</p>



<ul class="wp-block-list">
<li class=""><strong>Pins 4 and 7</strong> <strong>(GND, VCC)</strong></li>
</ul>



<p class="has-regular-font-size wp-block-paragraph">Easy! it&#8217;s the power supply pins. Pin 7 is VCC and 4 is GND. This chip can handle an input voltage from 5V to 15V.</p>



<ul class="wp-block-list">
<li class=""><strong>Pin 6</strong> <strong>(Output)</strong></li>
</ul>



<p class="has-regular-font-size wp-block-paragraph">The voltage output pin.</p>



<ul class="wp-block-list">
<li class=""><strong>Pin 8</strong> <strong>(Not Connected)</strong></li>
</ul>



<p class="has-regular-font-size wp-block-paragraph">Pin 8 is unconnected.</p>



<h2 class="wp-block-heading">CD4017 IC Decade Counter</h2>



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


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


<p class="wp-block-paragraph">Each output of this chip will turn on, one at a time, sequentially or in succession. For example, let&#8217;s say that we are connecting ten LEDs with the chip. Each LED is connected on a different output pin, each LED will light, one at a time unless all have been turned on at the same time. After it reaches the last output pin<strong>(Q9)</strong> it will start over again and repeats and repeats infinitely.</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 IC called decade counter because it&#8217;s simply can count from 0 to 9 or from 1 to 10 and that&#8217;s why this IC named &#8220;Decade&#8221; (remember it, a decade is made up of 10 years) Actually, I wanna kiss the guy who came up with that name.</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="1309125976"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



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



<p class="wp-block-paragraph">This counting behavior is working by a command from the 4017 IC <strong>&#8220;Clock&#8221;</strong> pin which plays a big role in <strong>4017</strong> <strong>chip</strong>, without this pin the chip will not work at all. Once the <strong>&#8220;Clock&#8221;</strong> pin goes from <strong>LOW</strong> to <strong>HIGH</strong>, at this point the chip knows that it is the time to turn off the <strong>current</strong> output and turn on the <strong>next</strong> output. So, it knows when to act based on the <strong>clock signal</strong>.</p>



<h4 class="wp-block-heading">CD4017 IC Pinout</h4>



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


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="840" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/IC4017.png?resize=770%2C840&#038;ssl=1" alt="4017 Chip Pinout" class="wp-image-842" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/IC4017.png?w=939&amp;ssl=1 939w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/IC4017.png?resize=800%2C872&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/IC4017.png?resize=275%2C300&amp;ssl=1 275w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/IC4017.png?resize=768%2C838&amp;ssl=1 768w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">4017 Chip Pinout</figcaption></figure>
</div>


<ul class="wp-block-list">
<li class=""><strong>Pins 1,2,3,4,5,6,7,9,10,11</strong></li>
</ul>



<p class="has-regular-font-size wp-block-paragraph">It&#8217;s the output pins where we place the load which we need to control. The outputs are numbered from <strong>Q0 to Q9.</strong> In our case, we will use only two output pins <strong>(Q0, Q1)</strong> to turn on and off the relay, the transistor which controls the relay state will be connected on <strong>Q0</strong>, and a normal LED on <strong>Q1</strong> to indicate that the relay state is off.</p>



<ul class="wp-block-list">
<li class=""><strong>Pins 8 and 16</strong> <strong>(GND, VDD)</strong></li>
</ul>



<p class="has-regular-font-size wp-block-paragraph">Power supply pins, this chip can handle an input voltage from <strong>3.3V to 18V</strong>.</p>



<ul class="wp-block-list">
<li class=""><strong>Pin 15</strong> <strong>(Reset)</strong></li>
</ul>



<p class="has-regular-font-size wp-block-paragraph">It resets the count back down to <strong>output 0 (Q0)</strong>, normally it&#8217;s grounded. This means when it brought to a <strong>HIGH</strong> logic level it will reset the count down back to<strong> output 0 (Q0)</strong>.</p>



<ul class="wp-block-list">
<li class=""><strong>Pin 14</strong> <strong>(CLK)</strong></li>
</ul>



<p class="has-regular-font-size wp-block-paragraph">As we stated before, It&#8217;s the pin that tells the chip when to start/stop counting.</p>



<ul class="wp-block-list">
<li class=""><strong>Pin 13</strong> <strong>(EN)</strong></li>
</ul>



<p class="has-regular-font-size wp-block-paragraph">The enable pin is an active low pin, which means it will normally be connected to the ground to make the chip active and operating properly, once it is brought to a HIGH logic level, the chip will stop operating.</p>



<ul class="wp-block-list">
<li class=""><strong>Pin 12 (CO)</strong></li>
</ul>



<p class="has-regular-font-size wp-block-paragraph">The carry-out pin remains HIGH as long as the counting is on the first half<strong>(Q0 &#8211; Q4)</strong> and it turns LOW when the counter reaches the second half<strong>(Q5 &#8211; Q9)</strong>.</p>



<h2 class="wp-block-heading">Control high voltage appliances</h2>



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



<p class="wp-block-paragraph">Relay is an electromagnetic switch that turns on/off a circuit with a low power signal. Like in our case we need to drive a 220VAC load. But, our circuit can&#8217;t do that on its own so we added a relay to switch the AC on/off by the CD4017 output signal.</p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="500" height="362" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/5v-relay-driver-circuit-module-circuit-diagram_0.png?resize=500%2C362&#038;ssl=1" alt="" class="wp-image-845" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/5v-relay-driver-circuit-module-circuit-diagram_0.png?w=500&amp;ssl=1 500w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/5v-relay-driver-circuit-module-circuit-diagram_0.png?resize=300%2C217&amp;ssl=1 300w" sizes="auto, (max-width: 500px) 100vw, 500px" /></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph">It&#8217;s very important to add a diode to protect your controller or your IC from any back-EMF. </p>



<p class="wp-block-paragraph">We a re using a 5VDC relay which has 5 pins as shown in the figure below.</p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="486" height="249" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Relay-Pinout.png?resize=486%2C249&#038;ssl=1" alt="Relay pinout" class="wp-image-854" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Relay-Pinout.png?w=486&amp;ssl=1 486w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Relay-Pinout.png?resize=300%2C154&amp;ssl=1 300w" sizes="auto, (max-width: 486px) 100vw, 486px" /><figcaption class="wp-element-caption">Relay pinout</figcaption></figure>
</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">How Do Relays Work?</div><div class="su-box-content su-u-clearfix su-u-trim" style="border-bottom-left-radius:1px;border-bottom-right-radius:1px">Simply, the relay is just an electromagnetic switch operated by a small voltage that can control another high voltage/current circuit.</p>
<p>Relay&#8217;s most important component is the coil, it consists of a coil that turns into a magnet once a current flows through it. when a current flows through the coil there is a magnetic field that will get generated to attract a contact to turn on (close) the load circuit.</p>
<p>And vice versa, when there is no current is flowing through the coil, a spring will attract the contact back to its original position to turn off(open) the load circuit.</div></div>



<p class="has-regular-font-size wp-block-paragraph">The <strong>&#8220;COM&#8221;</strong> is the contact that closes or opens the load circuit based on the coil state, is it energized or not?  <br><br>The <strong>&#8220;Normally Closed&#8221; (NC)&#8221;</strong> is the pin that is closed by default when there is no current flowing through the coil, it will get disconnected from the <strong>COM</strong> pin only when current flows through the coil. <strong>&#8220;Normally Open&#8221; (NO</strong>) is the pin that is opened by default when there&#8217;s no current flowing through the coil, it will get connected with the <strong>COM</strong> pin only when current flows through the coil.</p>



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



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


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="301" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Hand-clap-circuit-schematicEdited.png?resize=770%2C301&#038;ssl=1" alt="Circuit Schematic" class="wp-image-857" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Hand-clap-circuit-schematicEdited.png?w=1170&amp;ssl=1 1170w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Hand-clap-circuit-schematicEdited.png?resize=800%2C312&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Hand-clap-circuit-schematicEdited.png?resize=300%2C117&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Hand-clap-circuit-schematicEdited.png?resize=768%2C300&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Hand-clap-circuit-schematicEdited.png?resize=1024%2C400&amp;ssl=1 1024w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">Circuit Schematic</figcaption></figure>
</div>


<p class="wp-block-paragraph"><strong>This circuit works on 12V, not 9V.</strong></p>



<h2 class="wp-block-heading">PCB Manufacturing</h2>



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



<p class="wp-block-paragraph">I designed this circuit using Autodesk Eagle software. all the PCB files are open-source you can access it from the following link. Because we love open source.</p>



<div class="aligncenter wp-block-button"><a class="wp-block-button__link has-background wp-element-button" href="https://www.pcbway.com/project/shareproject/Handclap_AC_circuit_Control.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="395" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/PCB.png?resize=770%2C395&#038;ssl=1" alt="PCB Board" class="wp-image-850" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/PCB.png?w=1170&amp;ssl=1 1170w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/PCB.png?resize=800%2C410&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/PCB.png?resize=300%2C154&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/PCB.png?resize=768%2C394&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/PCB.png?resize=1024%2C526&amp;ssl=1 1024w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">PCB Board</figcaption></figure>
</div>


<p class="wp-block-paragraph"><strong>You can order your own PCB From&nbsp;<a href="https://www.pcbway.com/" target="_blank" rel="noreferrer noopener" aria-label=" (opens in a new tab)">PCBWay</a>&nbsp;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&nbsp;<a rel="noreferrer noopener" aria-label="PCB files link (opens in a new tab)" href="https://www.pcbway.com/project/shareproject/Handclap_AC_circuit_Control.html" target="_blank">PCB files link</a>&nbsp;and press “Add to cart”. That’s it!</strong></p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="440" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-19-at-2.49.34-AM.png?resize=770%2C440&#038;ssl=1" alt="Add to cart!" class="wp-image-862" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-19-at-2.49.34-AM.png?w=1170&amp;ssl=1 1170w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-19-at-2.49.34-AM.png?resize=800%2C457&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-19-at-2.49.34-AM.png?resize=300%2C171&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-19-at-2.49.34-AM.png?resize=768%2C438&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-19-at-2.49.34-AM.png?resize=1024%2C584&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-19-at-2.49.34-AM.png?resize=900%2C515&amp;ssl=1 900w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">Add to cart!</figcaption></figure>
</div>


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



<p class="wp-block-paragraph">I will assume that you built it and you are happy now. CONGRATS FAM! in this tutorial we learned how does the CD4017 decade decoder IC work, also we learned how to use the UA741 op-amp as a comparator, and how to drive an AC voltage load using a simple relay. Lastly, we build a hand-clap AC control switch which is dope! </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="1309125976"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>
<p>The post <a href="https://makesomestuff.org/handclap-ac-switch-control/">Custom-Made Handclap AC Switch Control Board</a> appeared first on <a href="https://makesomestuff.org">Make Some Stuff</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://makesomestuff.org/handclap-ac-switch-control/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">803</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 Raspberry Pi and Firebase and Android</title>
		<link>https://makesomestuff.org/iot-using-raspberry-pi-and-firebase-and-android/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=iot-using-raspberry-pi-and-firebase-and-android</link>
					<comments>https://makesomestuff.org/iot-using-raspberry-pi-and-firebase-and-android/#respond</comments>
		
		<dc:creator><![CDATA[Ahmed Ibrahim]]></dc:creator>
		<pubDate>Thu, 03 Oct 2019 11:32:17 +0000</pubDate>
				<category><![CDATA[Raspberry Pi Projects]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Firebase]]></category>
		<category><![CDATA[IoT]]></category>
		<category><![CDATA[Raspberry Pi]]></category>
		<guid isPermaLink="false">https://makesomestuff.org/?p=448</guid>

					<description><![CDATA[<p><a href="https://makesomestuff.org">Make Some Stuff</a><br />
<a href="https://makesomestuff.org/iot-using-raspberry-pi-and-firebase-and-android/">IoT Using Raspberry Pi and Firebase and Android</a></p>
<p>Ever asked how to control your home light system wirelessly over the Internet from any place in the world?! in this step-by-step tutorial we will learn how to do that. Used Components Component Name Quantity Raspberry Pi 3 Model B 1 Darlington Transistor TIP 122 3 2-screws Terminal Block 3 1K ohm Resistors 3 3-pins [...]</p>
<p>The post <a href="https://makesomestuff.org/iot-using-raspberry-pi-and-firebase-and-android/">IoT Using Raspberry Pi and Firebase and Android</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-raspberry-pi-and-firebase-and-android/">IoT Using Raspberry Pi and Firebase and Android</a></p>

<p class="has-regular-font-size wp-block-paragraph">Ever asked how to control your home light system wirelessly over the Internet from any place in the world?! in this step-by-step tutorial we will learn how to do that.</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="5056799298"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<figure class="aligncenter 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="IoT using Raspberry Pi and firebase and android" width="770" height="433" src="https://www.youtube.com/embed/LoanD1NIfGA?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">Final Project</figcaption></figure>



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



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



<figure class="is-style-regular wp-block-table"><table><tbody><tr><td><strong><span style="text-decoration: underline;">Component Name</span></strong></td><td><strong><span style="text-decoration: underline;">Quantity </span></strong></td></tr><tr><td><a href="https://www.raspberrypi.org/products/raspberry-pi-3-model-b/">Raspberry Pi 3 Model B</a></td><td>1</td></tr><tr><td><a href="https://www.ebay.com/itm/10PCS-TIP122-5A-100V-NPN-TO-220-Darlington-transistor/232424590421?hash=item361d95cc55:g:CI8AAOSwM8ZZeCJC">Darlington Transistor TIP 122 </a></td><td>3</td></tr><tr><td><a href="https://www.sparkfun.com/products/10571">2-screws Terminal Block</a></td><td>3</td></tr><tr><td><a href="https://www.sparkfun.com/products/14492">1K ohm Resistors</a></td><td>3</td></tr><tr><td><a href="https://www.sparkfun.com/products/9609">3-pins slide switch</a></td><td>1</td></tr><tr><td><a href="https://www.sparkfun.com/products/14017">20&#215;2 Female Pin Header </a></td><td>1</td></tr><tr><td><a href="https://www.pcbway.com/project/shareproject/IoT_Using_Raspberry_Pi_and_Firebase_and_Android.html">PCBWay Custom PCB Manufacturing</a></td><td>1</td></tr><tr><td><a href="https://www.ebay.com/itm/5V-12V24V-Lighting-Transformer-5A-10A-Switching-Power-Supply-60W-120W-150W-360W/233343017898?hash=item365453e3aa:m:m5ReQeegdY0R0CweUFJL9RQ">12V 5A Power Supply</a></td><td>1</td></tr><tr><td><a href="https://www.sparkfun.com/products/8431">Male-male Jumper wires</a></td><td>10</td></tr></tbody></table></figure>



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



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



<ul class="wp-block-list">
<li class=""><a href="https://www.autodesk.com/products/eagle/overview">Autodesk Eaglecad</a> (Optional).</li>



<li class=""><a href="https://firebase.google.com/docs/database">Firebase Database</a>.</li>



<li class="">Python Editor (Any Editor will work fine).</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">Today, we will learn how to control any RGB LED Strip ambient light wirelessly over Wifi using a custom-built Andoird application connected with the awesome Raspberry Pi board through the Firebase database.</p>



<p class="has-regular-font-size wp-block-paragraph">To build this project we need to deal with some stuff like how to build an android mobile app, how to build a firebase database server, how to connect the raspberry pi and the android app together through firebase, how to take different actions based on the incoming data, some power management, electronics Wiring, &#8230; <br>But yo hold on! Don&#8217;t worry we will cover all these topics in detail in today&#8217;s tutorial. So, bear with me and I promise it will be worth it.</p>



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



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



<p class="has-regular-font-size wp-block-paragraph">Simply, today we will build a smart device that allows the user to control his/her home ambient lighting system wirelessly over Wifi using any android smartphone, our project is divided into four main parts</p>



<ul class="wp-block-list">
<li class=""><strong>Android mobile application.<br></strong>the mobile app is the control panel which the user will interact with to send his/her commands to the lighting system.</li>



<li class=""><strong>Database.</strong><br>is the global server which acts as a postman who takes mails from one person to deliver it to someone else. Firebase database will receive some data from the mobile app and send it to the raspberry pi to take some actions like changing the LED strip light intensity or light color, and other many stuff.</li>



<li class=""><strong>Electronic and control circuit.</strong><br>the control circuit will be based on the raspberry pi board which running a python script reading the incoming data from the firebase database and according to these data will take some different actions.</li>



<li class=""><strong>Power management.</strong><br>it&#8217;s the most crucial part, it&#8217;s the part which responsible for providing the device with the necessary power to operate properly without damages.</li>
</ul>



<h2 class="wp-block-heading">How does the project work?</h2>



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


<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/09/project-working-logic.png?resize=770%2C433&#038;ssl=1" alt="Project Working Logic" class="wp-image-461" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/project-working-logic.png?w=1920&amp;ssl=1 1920w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/project-working-logic.png?resize=800%2C450&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/project-working-logic.png?resize=300%2C169&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/project-working-logic.png?resize=768%2C432&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/project-working-logic.png?resize=1024%2C576&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/project-working-logic.png?resize=1026%2C577&amp;ssl=1 1026w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/project-working-logic.png?resize=675%2C380&amp;ssl=1 675w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/project-working-logic.png?w=1540&amp;ssl=1 1540w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">Project Working Logic</figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph">Simply, the mobile app and the raspberry pi board are connected to the same firebase database. this database saves the data which comes from the mobile app and syncs it with the raspberry pi board in milliseconds, according to these data the raspberry pi board will take some specific actions like turning on the light, changing its brightness, and so on.</p>



<h2 class="wp-block-heading">Control Three LEDs brightness using GPIO PWM</h2>



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



<p class="has-regular-font-size wp-block-paragraph">To control the RGB LED Strip light brightness you need to be familiar with the PWM technique in the raspberry pi world and how to use it. So, let&#8217;s start by a simple one and start controlling some normal 5mm LEDs brightness to get familiar with the PWM technique. As I promised you at the beginning of the tutorial, we will start it from scratch to understand every part of the project.</p>



<p class="has-regular-font-size wp-block-paragraph">PWM stands for &#8220;Pulse Width Modulation&#8221; which is used to generate analog values using a digital technique. PWM is usually used to control LEDs brightness, DC Motor speed control, Servo motor rotation angle and that happens by outputting some variable voltage level.<br><br>But as we all know that the RPi and any computer is entirely digital system. But at the same time, we need to generate some analog signals from it. So, we need to find a way to convert that digital output signal to an analog output signal. Here comes the PWM technique!</p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="214" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/pwm-signal.png?resize=770%2C214&#038;ssl=1" alt="PWM signal Chart" class="wp-image-466" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/pwm-signal.png?w=815&amp;ssl=1 815w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/pwm-signal.png?resize=800%2C223&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/pwm-signal.png?resize=300%2C84&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/pwm-signal.png?resize=768%2C214&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/pwm-signal.png?resize=675%2C188&amp;ssl=1 675w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">PWM signal Chart</figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph">Most of the devices around us are responding relatively in the world of electronics slowly to the signal that they are getting. So, let&#8217;s take a normal DC motor as an example, let&#8217;s say that we need to run this DC motor at its half speed. So, we need to give it half of its voltage to run at half of its speed. Basically, we are only capable of giving a 3.3V(logic 1) or 0V (logic 0) we can&#8217;t give value in between because it&#8217;s a digital system as we said before. But here comes the PWM role to modulate the signal up(3.3V) for half the time and down(0V) for half the time with a square wave which is called the <strong>duty cycle</strong>. that process happens very very rapidly and the motor can&#8217;t respond instantaneously to the change of the voltage so it takes some time to accelerate and decelerate which results, the motor averaging the voltage to something near 1.6V and will run at half of its speed. And you can change the motor speed by changing the duty cycle value.</p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="542" height="342" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Duty_Cycle_Examples.png?resize=542%2C342&#038;ssl=1" alt="Duty cycle value change" class="wp-image-469" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Duty_Cycle_Examples.png?w=542&amp;ssl=1 542w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Duty_Cycle_Examples.png?resize=300%2C189&amp;ssl=1 300w" sizes="auto, (max-width: 542px) 100vw, 542px" /><figcaption class="wp-element-caption">Duty cycle value change</figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph">If we take a normal LED as an example we will do the same previous process applying PWM, but because the LED is a simple diode it responds fairly quickly (faster than the motor) to the change of the signal, so your eyes as a human will make the averaging thing. As a result, you will see the LED changing its brightness.</p>



<ul class="wp-block-list">
<li class=""><strong>Period:</strong> It&#8217;s the sum of the HIGH(3.3V) time and the LOW(0V) time.</li>



<li class=""><strong>Duty Cycle: </strong>Its the percentage of time where the signal was HIGH(3.3V) during the time of period.</li>
</ul>



<p class="has-regular-font-size wp-block-paragraph">Enough Theory! Let&#8217;s make some stuff. Let&#8217;s take a look at the wiring diagram.</p>



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



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


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="923" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/three_LED_PWM.png?resize=770%2C923&#038;ssl=1" alt="Wiring Diagram" class="wp-image-473" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/three_LED_PWM.png?w=1116&amp;ssl=1 1116w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/three_LED_PWM.png?resize=800%2C959&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/three_LED_PWM.png?resize=250%2C300&amp;ssl=1 250w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/three_LED_PWM.png?resize=768%2C921&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/three_LED_PWM.png?resize=854%2C1024&amp;ssl=1 854w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/three_LED_PWM.png?resize=1026%2C1230&amp;ssl=1 1026w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/three_LED_PWM.png?resize=675%2C809&amp;ssl=1 675w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">Wiring Diagram</figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph">The wiring diagram is very simple, connect each LED on a different PWM pin</p>



<figure class="is-style-stripes wp-block-table"><table><tbody><tr><td>Red LED</td><td>GPIO 12(PWM0)</td></tr><tr><td>Green LED</td><td>GPIO 18(PWM0)</td></tr><tr><td>Blue LED</td><td>GPIO 19(PWM1)</td></tr></tbody></table></figure>



<p class="has-regular-font-size wp-block-paragraph">The raspberry pi has two different schemes in numbering its GPIO pins. you can use either pin numbers<strong>(BOARD)</strong> or the Broadcom GPIO pin numbers<strong>(BCM)</strong>. <strong>You can only use one numbering scheme in each program</strong>.</p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="803" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/pi3_gpio_z4Rfmm2PRu.png?resize=770%2C803&#038;ssl=1" alt="RPi GPIO Pinout" class="wp-image-475" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/pi3_gpio_z4Rfmm2PRu.png?w=920&amp;ssl=1 920w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/pi3_gpio_z4Rfmm2PRu.png?resize=800%2C835&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/pi3_gpio_z4Rfmm2PRu.png?resize=288%2C300&amp;ssl=1 288w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/pi3_gpio_z4Rfmm2PRu.png?resize=768%2C801&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/pi3_gpio_z4Rfmm2PRu.png?resize=675%2C704&amp;ssl=1 675w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">RPi GPIO Pinout</figcaption></figure>
</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="5056799298"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



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



<p class="wp-block-paragraph">GPIO Board: Referring to the pin by its number of the plug, the pin number on the physical board which printed on it. Example: PIN#1, PIN#2, …..<br>GPIO BCM: Referring to the pin by its &#8220;Broadcom SOC Channel&#8221; number, these are the numbers after the GPIO word. Example: GPIO12, GPIO19, ….</p>



<p class="wp-block-paragraph">Neither way is wrong, both ways are good and work well without any differences. You have to pick the one which you feel comfortable more with.</p>



<p class="has-regular-font-size wp-block-paragraph">The <strong>Raspberry Pi 3 Model B</strong> has two PWM channels (PWM0, PWM1) each channel has two different GPIO PWM pins available for use. </p>



<figure class="wp-block-table"><table><tbody><tr><td><strong>GPIO BCM</strong></td><td><strong>GPIO BOARD</strong></td><td><strong>PWM channel</strong></td></tr><tr><td>GPIO12</td><td>Pin#32</td><td>PWM0</td></tr><tr><td>GPIO18</td><td>Pin#12</td><td>PWM0</td></tr><tr><td>GPIO19</td><td>Pin#35</td><td>PWM1</td></tr><tr><td>GPIO13</td><td>pin#33</td><td>PWM1</td></tr></tbody></table></figure>



<p class="has-regular-font-size wp-block-paragraph">These three PWM pins <strong>GPIO12, GPIO 13, GPIO19</strong> are used by the <strong>A/V output audio jack</strong>. So, if you don&#8217;t need to use the A/V audio jack in your project, these three GPIO PWM pins will be free and available to get used. But you can&#8217;t use the A/V output Audio jack and these PWM pins at the same time. In today&#8217;s project, we don&#8217;t need to use the A/V audio jack so all the PWM pins will be free and available for us to use.</p>



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



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



<pre class="EnlighterJSRAW" data-enlighter-language="python" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">import RPi.GPIO as GPIO             #import the raspberry pi GPIO library, to be able to use them.
from time import sleep              #import the sleep library, which responsible to do the timing stuff.


redLED = 18				#red LED connected on PWM pin GPIO18
blueLED = 12            #blue LED connected on PWM pin GPIO12
greenLED = 19           #green LED connected on PWM pin GPIO19

GPIO.setwarnings(False)			#disable warnings
GPIO.setmode(GPIO.BCM)	        #set pin numbering system to the (Broadcom chip channel numbering).

GPIO.setup(redLED,GPIO.OUT)     #set the red LED pin(GPIO18) to an output pin.
GPIO.setup(blueLED,GPIO.OUT)    #set the blue LED pin(GPIO12) to an output pin.
GPIO.setup(greenLED,GPIO.OUT)   #set the green LED pin(GPIO19) to an output pin.

red_pwm = GPIO.PWM(redLED,1000)	       	      #create PWM instance with 1000Hz frequency.
blue_pwm = GPIO.PWM(blueLED,1000)             #create PWM instance with 1000Hz frequency.
green_pwm = GPIO.PWM(greenLED,1000)           #create PWM instance with 1000Hz frequency.

red_pwm.start(0)				              #start red LED PWM pin with 0% initial Duty Cycle (OFF).
blue_pwm.start(0)                             #start blue LED PWM pin with 0% initial Duty Cycle (OFF).
green_pwm.start(0)                            #start green LED PWM pin with 0% initial Duty Cycle (OFF).

print("AH Shit! Here we go again! Press CTRL+C to exit")    #Take Care, Meme LORD.

try:
    while True:                                         #the start of the actual program.
        for duty in range(0,101,1):                     #imolement a "for loop" responsible for increasing the red LED light brightness.
            red_pwm.ChangeDutyCycle(duty)               #provide duty cycle in the range 0-100.
            sleep(0.01)                                 #wait 0.01 sec. between each iteration.
        sleep(0.5)                                      #wait 0.5 sec. after the "for loop" is done.

        for duty in range(100,-1,-1):                   #implement a "for loop" responsible for decreasing the red LED light brightness.
            red_pwm.ChangeDutyCycle(duty)               #provide duty cycle in the range 100-0.
            sleep(0.01)                                 #wait 0.01 sec. between each iteration.
        sleep(0.5)                                      #wait 0.5 sec. after the "for loop" is done.
		
        for duty in range (0, 101, 1):                  #repeat the previous logic but this time with the blue LED.
            blue_pwm.ChangeDutyCycle(duty)
            sleep(0.01)
        sleep(0.5)

        for duty in range (100, -1, -1):                #repeat the previous logic but this time with the blue LED.
            blue_pwm.ChangeDutyCycle(duty)
            sleep(0.01)
        sleep(0.5)

        for duty in range(0,101,1):                     #repeat the previous logic but this time with the green LED.
            green_pwm.ChangeDutyCycle(duty)
            sleep(0.01)
        sleep(0.5)

        for duty in range(100,-1,-1):                   #repeat the previous logic but this time with the green LED.
            green_pwm.ChangeDutyCycle(duty)
            sleep(0.01)
        sleep(0.5)

except KeyboardInterrupt: 		# If CTRL+C is pressed, exit cleanly:
    red_pwm.stop() 			    # stop red PWM
    blue_pwm.stop()             # stop blue PWM
    green_pwm.stop()            # stop green  PWM
    GPIO.cleanup() 	            # cleanup all GPIO</pre>



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



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



<p class="has-regular-font-size wp-block-paragraph">The code is pretty simple and straightforward, first, we need to import two important modules to allow us to use the raspberry pi GPIO pins. Also, import the <strong>time</strong> module that will make the timing work for us. without importing this module you will not be able to use the <code>sleep()</code> method.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="python" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">import RPi.GPIO as GPIO
from time import sleep</pre>



<p class="has-regular-font-size wp-block-paragraph">then we need to initialize three variables called <code>redLED</code>, <code>blueLED</code>, <code>greenLED</code> referring to the three PWM pins that we will use to control our LEDs. Yeah as you noticed we are using the <strong>GPIO BCM</strong> <strong>numbering scheme</strong>.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="python" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">redLED = 18
blueLED = 12
greenLED = 19</pre>



<p class="has-regular-font-size wp-block-paragraph">Then we need to set the numbering scheme of raspberry pi pins to &#8220;GPIO BCM&#8221;, then set all the three pins as output pins.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="python" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">GPIO.setmode(GPIO.BCM)

GPIO.setup(redLED,GPIO.OUT)
GPIO.setup(blueLED,GPIO.OUT)
GPIO.setup(greenLED,GPIO.OUT)</pre>



<p class="has-regular-font-size wp-block-paragraph">create three PWM instances(instance for each pin) <code>red_pwm</code>, <code>blue_pwm</code>, <code>green_pwm </code>with 1000Hz frequency that will help us to generate the PWM signal. After that, we need to set the initial state of these pins to 0% duty cycle which means that the three pins will be OFF at the beginning of the program.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="python" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">red_pwm = GPIO.PWM(redLED,1000)
blue_pwm = GPIO.PWM(blueLED,1000)
green_pwm = GPIO.PWM(greenLED,1000)

red_pwm.start(0)
blue_pwm.start(0)
green_pwm.start(0)</pre>



<p class="has-regular-font-size wp-block-paragraph">Here is the fun part! inside the <code>while loop</code> we write the set of commands(program) that we need to keep executing forever until we force-stop it.<br><br>inside the <code>while loop</code> implement a &#8220;for loop&#8221; it&#8217;s initial value 0, at every iteration it will increment by 1 until it reaches 100. This <code>for loop</code> responsible for increasing the red LED light brightness.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="python" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">while True:                                       
    for duty in range(0,101,1):
        red_pwm.ChangeDutyCycle(duty)
        sleep(0.01)
    sleep(0.5)</pre>



<p class="has-regular-font-size wp-block-paragraph">The second <code>for loop</code> it&#8217;s initial value 100, at every iteration will decrease by 1 until it reaches 0. this <code>for loop</code> is responsible for decreasing the red LED light brightness.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="python" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">    for duty in range(100,-1,-1):
        red_pwm.ChangeDutyCycle(duty)
        sleep(0.01)
    sleep(0.5)</pre>



<p class="has-regular-font-size wp-block-paragraph">then repeat the previous logic with the remaining two LEDs. After finishing your code, close and save it, run it by writing <code>python fileName.py</code> in the terminal. </p>



<p class="has-regular-font-size wp-block-paragraph">After running it, It&#8217;s expected to see this sentence got printed on the terminal <code>AH Shit! Here we go again! Press CTRL+C to exit</code> then the three LEDs light brightness will start to increase and decrease. </p>



<p class="has-regular-font-size wp-block-paragraph">I will assume that you did that and it&#8217;s working fine with you. VOILA! Officially you are now promoted to the next level. Let&#8217;s make it more interesting and control the beefy RGB LED Strip.</p>



<h2 class="wp-block-heading">Control RGB LED Strip Lighting  </h2>



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



<p class="has-regular-font-size wp-block-paragraph">Actually, controlling an RGB LED it&#8217;s not very different from controlling a normal LED. RGB LED means red, green and blue LED which combines all these three LEDs in one combo. with these three different colors, you can produce almost any color by mixing them with different intensities. To adjust LED intensity we use the PWM technique.</p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="192" height="192" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/RGB.png?resize=192%2C192&#038;ssl=1" alt="single RGB LED" class="wp-image-496" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/RGB.png?w=192&amp;ssl=1 192w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/RGB.png?resize=100%2C100&amp;ssl=1 100w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/RGB.png?resize=150%2C150&amp;ssl=1 150w" sizes="auto, (max-width: 192px) 100vw, 192px" /><figcaption class="wp-element-caption">single RGB LED</figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph">For example, to generate a pure red color, we need to set the red LED to the highest intensity and the green, blue to the lowest intensity. To generate a white color we have to set all the three LEDs to the highest intensity. And By adjusting the intensity of each LED you will generate a new color.</p>



<h4 class="wp-block-heading">RGB LED Strip pinout</h4>



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


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="500" height="203" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/led_strips_astripend_t.jpg?resize=500%2C203&#038;ssl=1" alt="RGB LED Strip pinout" class="wp-image-501" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/led_strips_astripend_t.jpg?w=500&amp;ssl=1 500w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/led_strips_astripend_t.jpg?resize=300%2C122&amp;ssl=1 300w" sizes="auto, (max-width: 500px) 100vw, 500px" /><figcaption class="wp-element-caption">RGB LED Strip pinout</figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph">There are two main types of RGB LED strips. The common anode, and the common cathode. In the common anode RGB LED strip, the three LEDs share the same positive lead <strong>(Anode)</strong>, and in the common cathode RGB LED strip, the three LEDs share the same negative lead <strong>(Cathode)</strong>. As a result of that, the RGB LED strip has four leads, one for each LED (red, green, blue) and one common anode or common cathode.</p>



<p class="has-regular-font-size wp-block-paragraph">The RGB LED strip that we will use today is Common Anode.</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/09/common-anode-and-common-cathode.png?resize=770%2C433&#038;ssl=1" alt="Difference between the common anode and common cathode" class="wp-image-503" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/common-anode-and-common-cathode.png?w=1920&amp;ssl=1 1920w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/common-anode-and-common-cathode.png?resize=800%2C450&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/common-anode-and-common-cathode.png?resize=300%2C169&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/common-anode-and-common-cathode.png?resize=768%2C432&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/common-anode-and-common-cathode.png?resize=1024%2C576&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/common-anode-and-common-cathode.png?resize=1026%2C577&amp;ssl=1 1026w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/common-anode-and-common-cathode.png?resize=675%2C380&amp;ssl=1 675w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/common-anode-and-common-cathode.png?w=1540&amp;ssl=1 1540w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">Difference between the common anode and common cathode</figcaption></figure>
</div>


<h4 class="wp-block-heading">Power Management</h4>



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



<p class="has-regular-font-size wp-block-paragraph">Before we connect the RGB LED strip with raspberry pi we need to ask ourselves, Does the raspberry pi board able to provide the beefy RGB LED strip with the needed power to operate properly? The short answer is, of course not. </p>



<p class="has-regular-font-size wp-block-paragraph">If you are a math nerd let&#8217;s do some calculations. we need to know how much current our RGB LED Strip is going to draw. each RGB cell contains three LEDs<strong>(red, green, blue)</strong> each LED in the cell draws <strong>20mA</strong> at full intensity. So, each RGB cell will draw a current of total <strong>60mA</strong> at full intensity, the RGB LED Strip that we are using today contains <strong>20 cells/one meter</strong>, and we have a <strong>4-meter long strip</strong>. So, Which means that the total drawn current at maximum intensity is equal to:<br><strong><em>4(Meter)*20(cell/meter)*60(mA) = 4800MA.</em></strong></p>



<p class="has-regular-font-size wp-block-paragraph">this amount of drawn current will vary depending on the intensity of the LED brightness that you are working with, but we made the calculations at the highest values to work freely and be on the safe side. Now we need a power source that can provide us with those <strong>4.8A</strong> at <strong>12V</strong>.</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="5056799298"></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">The best option I found for that job, is a power supply/converter that converts an AC power to DC, the power supply/converter that we will use today offers 5A at 12VDC which is exactly what we need.</p>



<h4 class="wp-block-heading">The Power Supply Connections</h4>



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



<p class="has-regular-font-size wp-block-paragraph">A power supply is an electrical device that converts one type of electrical type to another. In our case, we will convert a 220VAC to 12VDC.</p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="578" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/IMG_1686.jpg?resize=770%2C578&#038;ssl=1" alt="The power supply pinout" class="wp-image-511" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/IMG_1686.jpg?w=2048&amp;ssl=1 2048w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/IMG_1686.jpg?resize=600%2C450&amp;ssl=1 600w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/IMG_1686.jpg?resize=800%2C600&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/IMG_1686.jpg?resize=300%2C225&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/IMG_1686.jpg?resize=768%2C576&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/IMG_1686.jpg?resize=1024%2C768&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/IMG_1686.jpg?resize=1026%2C770&amp;ssl=1 1026w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/IMG_1686.jpg?resize=675%2C506&amp;ssl=1 675w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/IMG_1686.jpg?resize=480%2C360&amp;ssl=1 480w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/IMG_1686.jpg?w=1540&amp;ssl=1 1540w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">The power supply pinout</figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph">From the left side, the first three terminals are the input from the AC power source:</p>



<ul class="wp-block-list">
<li class=""><strong>L:</strong> life.</li>



<li class=""><strong>N:</strong> neutral.</li>



<li class=""><strong>GND:</strong> earth.</li>
</ul>



<p class="has-regular-font-size wp-block-paragraph">The last four terminals are the 12VDC output, the first two terminals are the <strong>GND</strong> and the second two terminals are <strong>positive</strong>.</p>



<ul class="wp-block-list">
<li class=""><strong>V-:</strong> GND.</li>



<li class=""><strong>V+:</strong> positive.</li>
</ul>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="578" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/IMG_1681.jpg?resize=770%2C578&#038;ssl=1" alt="Power Supply Connections" class="wp-image-508" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/IMG_1681.jpg?w=1170&amp;ssl=1 1170w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/IMG_1681.jpg?resize=600%2C450&amp;ssl=1 600w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/IMG_1681.jpg?resize=800%2C600&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/IMG_1681.jpg?resize=300%2C225&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/IMG_1681.jpg?resize=768%2C576&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/IMG_1681.jpg?resize=1024%2C768&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/IMG_1681.jpg?resize=1026%2C770&amp;ssl=1 1026w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/IMG_1681.jpg?resize=675%2C506&amp;ssl=1 675w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/IMG_1681.jpg?resize=480%2C360&amp;ssl=1 480w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">Power Supply Connections</figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph">And we connect them as follow:</p>



<ul class="wp-block-list">
<li class=""><strong>Brown wire (AC Power source):</strong> L (Power supply).</li>



<li class=""><strong>Blue wire (AC Power source):</strong> N (Power supply).</li>



<li class=""><strong>Green wire (AC Power source):</strong> Earth (Power supply).</li>
</ul>



<p class="has-regular-font-size wp-block-paragraph">And the red, and the black wire are the 12VDC output:</p>



<ul class="wp-block-list">
<li class=""><strong>Red Wire: </strong>12VDC Output (V+).</li>



<li class=""><strong>Black Wire:</strong> GND Output (V-).</li>
</ul>



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



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



<figure class="wp-block-image"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="568" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/LED-Strip.png?resize=770%2C568&#038;ssl=1" alt="RGB LED Strip wiring diagram" class="wp-image-505" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/LED-Strip.png?w=2048&amp;ssl=1 2048w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/LED-Strip.png?resize=800%2C590&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/LED-Strip.png?resize=300%2C221&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/LED-Strip.png?resize=768%2C566&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/LED-Strip.png?resize=1024%2C755&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/LED-Strip.png?resize=1026%2C756&amp;ssl=1 1026w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/LED-Strip.png?resize=675%2C498&amp;ssl=1 675w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/LED-Strip.png?w=1540&amp;ssl=1 1540w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">RGB LED Strip wiring diagram</figcaption></figure>



<p class="has-regular-font-size wp-block-paragraph">As we stated before, the RGB LED strip needs 4.8A at 12VDC to operate properly. But at the same time, the Raspberry pi board can&#8217;t provide all that power to the RGB LED strip. So, we need a component that can take orders from the Raspberry pi board but provide power from the external 12VDC power supply.</p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="770" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Tip_122-800x800.jpg?resize=770%2C770&#038;ssl=1" alt="TIP122 NPN Transistor" class="wp-image-517" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Tip_122-800x800.jpg?resize=800%2C800&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Tip_122-800x800.jpg?resize=100%2C100&amp;ssl=1 100w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Tip_122-800x800.jpg?resize=150%2C150&amp;ssl=1 150w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Tip_122-800x800.jpg?resize=300%2C300&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Tip_122-800x800.jpg?resize=768%2C768&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Tip_122-800x800.jpg?resize=675%2C675&amp;ssl=1 675w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">TIP122 NPN Transistor</figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph">Here comes the TIP122 Darlington transistor, this transistor can drive high power loads by using a small amount of current and voltage.</p>



<p class="has-regular-font-size wp-block-paragraph">The TIP122 transistor can handle current up to 5A<strong>(Continous)</strong> and 8A<strong>(Peak)</strong> which satisfies our needs.</p>



<h4 class="wp-block-heading">TIP122 Transistor Pinout</h4>



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


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="450" height="461" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/TIP122-Darlington-NPN-Transistor.jpg?resize=450%2C461&#038;ssl=1" alt="TIP122 pinout" class="wp-image-516" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/TIP122-Darlington-NPN-Transistor.jpg?w=450&amp;ssl=1 450w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/TIP122-Darlington-NPN-Transistor.jpg?resize=293%2C300&amp;ssl=1 293w" sizes="auto, (max-width: 450px) 100vw, 450px" /><figcaption class="wp-element-caption">TIP122 pinout</figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph">TIP122 Transistor acts like a switch that can drive loads with higher electrical requirements, so by a small amount of current and voltage can drive a high power load, at this example we gonna use the TIP122 which completes the LED strip circuit with the 12-volt power supply, the TIP122 has three legs(base, collector, emitter). The collector will get connected to the load(LED strip), and the emitter will get connected to the ground. And by a small amount of current on the base pin, will close the circuit between the collector and the emitter.</p>



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



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



<p class="has-regular-font-size wp-block-paragraph">What about transferring our breadboard circuit to a professional <strong>printed circuit board&nbsp;(PCB)</strong>&nbsp;to make our project more rigid and solid.</p>



<h4 class="wp-block-heading">Raspberry Pi HAT files (PCB)</h4>



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



<p class="wp-block-paragraph">I designed the project circuit using Autodesk Eagle software. all the PCB files are open-source you can access it from that 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="aligncenter wp-block-button"><a class="wp-block-button__link wp-element-button" href="https://www.pcbway.com/project/shareproject/IoT_Using_Raspberry_Pi_and_Firebase_and_Android.html">pcb files</a></div>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="337" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/two-layers.png?resize=770%2C337&#038;ssl=1" alt="PCB bottom and top layer" class="wp-image-645" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/two-layers.png?w=1170&amp;ssl=1 1170w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/two-layers.png?resize=800%2C350&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/two-layers.png?resize=300%2C131&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/two-layers.png?resize=768%2C336&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/two-layers.png?resize=1024%2C448&amp;ssl=1 1024w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">PCB bottom and the top layer</figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph"><strong>You can order your own PCB From&nbsp;<a href="https://www.pcbway.com/">PCBWay</a>&nbsp;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&nbsp;PCB files link&nbsp;and click “Add to cart”. That’s it!</strong></p>


<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/10/Screen-Shot-2019-10-03-at-3.52.38-AM.png?resize=770%2C357&#038;ssl=1" alt="PCB Files" class="wp-image-648" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-03-at-3.52.38-AM.png?w=1170&amp;ssl=1 1170w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-03-at-3.52.38-AM.png?resize=800%2C371&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-03-at-3.52.38-AM.png?resize=300%2C139&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-03-at-3.52.38-AM.png?resize=768%2C356&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-03-at-3.52.38-AM.png?resize=1024%2C475&amp;ssl=1 1024w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">PCB Files</figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph">This PCB can get mounted over the Raspberry pi board easily as a normal raspberry pi HAT, it will organize your wiring and will make your project easier to debug.</p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="578" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/IMG_5100.jpg?resize=770%2C578&#038;ssl=1" alt="Custom PCB Raspberry Pi HAT" class="wp-image-678" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/IMG_5100.jpg?w=1170&amp;ssl=1 1170w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/IMG_5100.jpg?resize=600%2C450&amp;ssl=1 600w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/IMG_5100.jpg?resize=800%2C600&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/IMG_5100.jpg?resize=300%2C225&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/IMG_5100.jpg?resize=768%2C576&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/IMG_5100.jpg?resize=1024%2C768&amp;ssl=1 1024w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">Custom PCB Raspberry Pi HAT</figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph">With that slide switch, you can turn on and off the RGB LED Strip power.</p>



<h4 class="wp-block-heading">Raspberry Pi Enclosure</h4>



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



<p class="wp-block-paragraph">I designed a laser cutting enclosure using Autodesk fusion 360, feel free to download the DXF files from that link.</p>



<div class="aligncenter wp-block-button"><a class="wp-block-button__link has-background wp-element-button" href="https://drive.google.com/open?id=1QmRRjlBHuWzjAIe_6h9ZnT-xhDQ9o_yR" style="border-radius:100px;background-color:#00a99d">enclosure files</a></div>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="578" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Raspberry-Pi-Enclosure.jpg?resize=770%2C578&#038;ssl=1" alt="Raspberry Pi Enclosure" class="wp-image-663" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Raspberry-Pi-Enclosure.jpg?w=1170&amp;ssl=1 1170w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Raspberry-Pi-Enclosure.jpg?resize=600%2C450&amp;ssl=1 600w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Raspberry-Pi-Enclosure.jpg?resize=800%2C600&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Raspberry-Pi-Enclosure.jpg?resize=300%2C225&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Raspberry-Pi-Enclosure.jpg?resize=768%2C576&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Raspberry-Pi-Enclosure.jpg?resize=1024%2C768&amp;ssl=1 1024w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">Raspberry Pi Enclosure</figcaption></figure>
</div>


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



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



<pre class="EnlighterJSRAW" data-enlighter-language="python" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">#We will use the same previous Code without any changes.</pre>



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



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



<p class="has-regular-font-size wp-block-paragraph">The same previous explanation since we are using the same code with the same logic.</p>



<p class="has-regular-font-size wp-block-paragraph">After finishing the wiring and your code, close and save it, Run your program by writing <code>python fileName.py</code> in your terminal. Like the last example, After running your program, It&#8217;s expected to see this sentence got printed on the terminal <code>AH Shit! Here we go again! Press CTRL+C to exit</code> then the three LEDs light brightness will start to increase and decrease.</p>



<p class="has-regular-font-size wp-block-paragraph">After getting sure that everything is working as expected, let&#8217;s level it up and build our firebase database.</p>



<h2 class="wp-block-heading">Building The Firebase Database</h2>



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



<p class="has-regular-font-size wp-block-paragraph">The Firebase Realtime Database is a cloud-hosted database. Data is stored as JSON and synchronized in realtime to every connected client. If you want to know more check out <a href="https://firebase.google.com/docs/database">this link</a>. </p>



<p class="has-regular-font-size wp-block-paragraph">As we stated before, the realtime database will receive some data from the mobile app based on the user interaction and will sync it with the raspberry pi in milliseconds. So, to be able to use firebase you need to sign in using your normal Gmail account. then go to your project console to create a new project.</p>



<p class="has-regular-font-size wp-block-paragraph">First things first, you need to create a new project in your console.</p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="393" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-26-at-6.30.39-PM.png?resize=770%2C393&#038;ssl=1" alt="your console" class="wp-image-523" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-26-at-6.30.39-PM.png?w=2048&amp;ssl=1 2048w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-26-at-6.30.39-PM.png?resize=800%2C409&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-26-at-6.30.39-PM.png?resize=300%2C153&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-26-at-6.30.39-PM.png?resize=768%2C392&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-26-at-6.30.39-PM.png?resize=1024%2C523&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-26-at-6.30.39-PM.png?resize=1026%2C524&amp;ssl=1 1026w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-26-at-6.30.39-PM.png?resize=675%2C345&amp;ssl=1 675w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-26-at-6.30.39-PM.png?w=1540&amp;ssl=1 1540w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">your console</figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph">Then, give a name to your project</p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="388" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/unnamed-file.png?resize=770%2C388&#038;ssl=1" alt="Name Your Project" class="wp-image-524" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/unnamed-file.png?w=2048&amp;ssl=1 2048w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/unnamed-file.png?resize=800%2C404&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/unnamed-file.png?resize=300%2C151&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/unnamed-file.png?resize=768%2C387&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/unnamed-file.png?resize=1024%2C516&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/unnamed-file.png?resize=1026%2C517&amp;ssl=1 1026w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/unnamed-file.png?resize=675%2C340&amp;ssl=1 675w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/unnamed-file.png?w=1540&amp;ssl=1 1540w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">Name Your Project</figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph">We don&#8217;t need to set up google analytics now</p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="427" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/firebase-analytics-setup.png?resize=770%2C427&#038;ssl=1" alt="Creating the project" class="wp-image-525" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/firebase-analytics-setup.png?w=2048&amp;ssl=1 2048w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/firebase-analytics-setup.png?resize=800%2C443&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/firebase-analytics-setup.png?resize=300%2C166&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/firebase-analytics-setup.png?resize=768%2C426&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/firebase-analytics-setup.png?resize=1024%2C567&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/firebase-analytics-setup.png?resize=1026%2C569&amp;ssl=1 1026w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/firebase-analytics-setup.png?resize=675%2C374&amp;ssl=1 675w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/firebase-analytics-setup.png?w=1540&amp;ssl=1 1540w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">Creating the project</figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph">After creating your project successfully, your project overview page should look something like this. From the left menu, We need to select &#8220;Database&#8221;</p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="387" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-14-at-7.05.15-AM.png?resize=770%2C387&#038;ssl=1" alt="Project overview page" class="wp-image-526" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-14-at-7.05.15-AM.png?w=2048&amp;ssl=1 2048w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-14-at-7.05.15-AM.png?resize=800%2C402&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-14-at-7.05.15-AM.png?resize=300%2C151&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-14-at-7.05.15-AM.png?resize=768%2C386&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-14-at-7.05.15-AM.png?resize=1024%2C515&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-14-at-7.05.15-AM.png?resize=1026%2C516&amp;ssl=1 1026w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-14-at-7.05.15-AM.png?resize=675%2C339&amp;ssl=1 675w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-14-at-7.05.15-AM.png?w=1540&amp;ssl=1 1540w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">Project overview page</figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph">We will choose &#8220;Realtime database&#8221; and click the &#8220;Create Database&#8221; button</p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="388" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-14-at-7.05.59-AM.png?resize=770%2C388&#038;ssl=1" alt="Create a Realtime Database" class="wp-image-529" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-14-at-7.05.59-AM.png?w=1170&amp;ssl=1 1170w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-14-at-7.05.59-AM.png?resize=800%2C403&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-14-at-7.05.59-AM.png?resize=300%2C151&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-14-at-7.05.59-AM.png?resize=768%2C387&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-14-at-7.05.59-AM.png?resize=1024%2C516&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-14-at-7.05.59-AM.png?resize=1026%2C517&amp;ssl=1 1026w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-14-at-7.05.59-AM.png?resize=675%2C340&amp;ssl=1 675w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">Create a Realtime Database</figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph">After that, select &#8220;Test Mode&#8221; and click &#8220;Enable&#8221;</p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="490" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-14-at-7.06.20-AM.png?resize=770%2C490&#038;ssl=1" alt="Test Mode" class="wp-image-527" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-14-at-7.06.20-AM.png?w=1170&amp;ssl=1 1170w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-14-at-7.06.20-AM.png?resize=800%2C509&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-14-at-7.06.20-AM.png?resize=300%2C191&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-14-at-7.06.20-AM.png?resize=768%2C489&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-14-at-7.06.20-AM.png?resize=1024%2C652&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-14-at-7.06.20-AM.png?resize=1026%2C653&amp;ssl=1 1026w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/Screen-Shot-2019-09-14-at-7.06.20-AM.png?resize=675%2C430&amp;ssl=1 675w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">Test Mode</figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph">Now, your Realtime database should look something like this.</p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="387" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-dfShot-2019-09-14-at-7.06.40-AM.png?resize=770%2C387&#038;ssl=1" alt="Your Database dashboard" class="wp-image-667" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-dfShot-2019-09-14-at-7.06.40-AM.png?w=1170&amp;ssl=1 1170w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-dfShot-2019-09-14-at-7.06.40-AM.png?resize=800%2C402&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-dfShot-2019-09-14-at-7.06.40-AM.png?resize=300%2C151&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-dfShot-2019-09-14-at-7.06.40-AM.png?resize=768%2C386&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-dfShot-2019-09-14-at-7.06.40-AM.png?resize=1024%2C515&amp;ssl=1 1024w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption"><em>Your Database dashboard</em></figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph">After building the Realtime Database, we need to build the mobile app that will send the data to the firebase database.</p>



<h2 class="wp-block-heading"> Building The Android Mobile APP</h2>



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



<p class="has-regular-font-size wp-block-paragraph">Now we need to build the mobile app that the user will use to control the RGB LED Strip from, we used the amazing tool the &#8220;MIT APP Inventor&#8221; to build it. It&#8217;s fast and very easy to use.</p>



<p class="has-regular-font-size wp-block-paragraph">App inventor lets you develop android mobile applications using a web browser and a physical mobile phone or just the emulator, the MIT app inventor saves your projects in their clouds to keep tracking your work</p>



<p class="has-regular-font-size wp-block-paragraph">First, you need to go to the MIT app inventor <a href="http://appinventor.mit.edu/explore/">official website</a> and login with your Gmail account, then press on the “create apps” button, then start building your mobile app. Easy HA!</p>



<p class="has-regular-font-size wp-block-paragraph">To build your mobile app using the app inventor tool, you should deal with two main parts</p>



<ul class="wp-block-list">
<li class="">The design of the app.</li>



<li class="">The programming of the app.</li>
</ul>



<h4 class="wp-block-heading">The App Design</h4>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="320" height="480" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/SC20190923-190644.png?resize=320%2C480&#038;ssl=1" alt="The app design" class="wp-image-593" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/SC20190923-190644.png?w=320&amp;ssl=1 320w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/09/SC20190923-190644.png?resize=200%2C300&amp;ssl=1 200w" sizes="auto, (max-width: 320px) 100vw, 320px" /><figcaption class="wp-element-caption">The app design</figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph">The mobile application consists of <strong>Six buttons</strong> to control the lighting mode(Mode One, Mode Two, &#8230;), <strong>three sliders</strong> to control each LED color lighting intensity, and a <strong>button</strong> named<strong> &#8220;power button&#8221; </strong>to control the state of the LEDs(turning it ON or OFF). The most important part here is to add the &#8220;firebaseDB&#8221; client components to the app to allow us sending data to our firebase database project that we created before.</p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="283" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-6.42.44-PM.png?resize=770%2C283&#038;ssl=1" alt="Adding the FirebaseDB component to the app" class="wp-image-598" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-6.42.44-PM.png?w=1066&amp;ssl=1 1066w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-6.42.44-PM.png?resize=800%2C294&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-6.42.44-PM.png?resize=300%2C110&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-6.42.44-PM.png?resize=768%2C282&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-6.42.44-PM.png?resize=1024%2C377&amp;ssl=1 1024w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">Adding the FirebaseDB component to the app</figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph">After adding the &#8220;FirebaseDB&#8221; component to the app, we need to put our created Firebase database URL to the mobile application &#8220;FirebaseDB&#8221; component to specify where does the data will get saved, the Firebase database URL can be found here.</p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="200" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-6.45.42-PM-1.png?resize=770%2C200&#038;ssl=1" alt="Firebase database URL" class="wp-image-601" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-6.45.42-PM-1.png?w=1170&amp;ssl=1 1170w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-6.45.42-PM-1.png?resize=800%2C208&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-6.45.42-PM-1.png?resize=300%2C78&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-6.45.42-PM-1.png?resize=768%2C200&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-6.45.42-PM-1.png?resize=1024%2C266&amp;ssl=1 1024w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">Firebase database URL</figcaption></figure>
</div>

<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="512" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-6.49.31-PM.png?resize=770%2C512&#038;ssl=1" alt="Connecting the app with the firebase" class="wp-image-600" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-6.49.31-PM.png?w=1038&amp;ssl=1 1038w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-6.49.31-PM.png?resize=800%2C532&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-6.49.31-PM.png?resize=300%2C199&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-6.49.31-PM.png?resize=768%2C511&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-6.49.31-PM.png?resize=1024%2C681&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-6.49.31-PM.png?resize=270%2C180&amp;ssl=1 270w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-6.49.31-PM.png?resize=370%2C245&amp;ssl=1 370w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">Connecting the app with the firebase</figcaption></figure>
</div>


<h4 class="wp-block-heading">The Programming Of The App</h4>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="746" height="1066" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-09-26-at-7.13.08-PM.png?resize=746%2C1066&#038;ssl=1" alt="The App Code" class="wp-image-596" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-09-26-at-7.13.08-PM.png?w=746&amp;ssl=1 746w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-09-26-at-7.13.08-PM.png?resize=210%2C300&amp;ssl=1 210w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-09-26-at-7.13.08-PM.png?resize=717%2C1024&amp;ssl=1 717w" sizes="auto, (max-width: 746px) 100vw, 746px" /><figcaption class="wp-element-caption">The App Code</figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph">After designing the interface of our app we need to give it life, adding some functionality to each button and slider.</p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="215" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-6.39.02-PM.png?resize=770%2C215&#038;ssl=1" alt="sending data to the database" class="wp-image-597" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-6.39.02-PM.png?w=1062&amp;ssl=1 1062w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-6.39.02-PM.png?resize=800%2C223&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-6.39.02-PM.png?resize=300%2C84&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-6.39.02-PM.png?resize=768%2C214&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-6.39.02-PM.png?resize=1024%2C285&amp;ssl=1 1024w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">sending data to the database</figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph">Let&#8217;s take the <strong>&#8220;Mode One&#8221;</strong> button as an example to see how the logic works. When the user clicks on the &#8220;Mode One&#8221; button it will send the value <strong>&#8220;mode1&#8221;</strong> with the tag <strong>&#8220;lightMode&#8221;</strong> to the firebase database project that we created before. and if we opened the firebase database dashboard page we will see that new entry got added to our database. <strong>Congrats!</strong></p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="142" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-7.01.37-PM-1.png?resize=770%2C142&#038;ssl=1" alt="" class="wp-image-606" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-7.01.37-PM-1.png?w=1170&amp;ssl=1 1170w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-7.01.37-PM-1.png?resize=800%2C148&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-7.01.37-PM-1.png?resize=300%2C55&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-7.01.37-PM-1.png?resize=768%2C142&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-7.01.37-PM-1.png?resize=1024%2C189&amp;ssl=1 1024w" sizes="auto, (max-width: 770px) 100vw, 770px" /></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph">But, when the user clicks the <strong>&#8220;Mode Two&#8221;</strong> button the &#8220;lightMode&#8221; tag value will get updated to the new value which in this case will be <strong>&#8220;mode2&#8221;</strong>.</p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="199" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-7.04.40-PM.png?resize=770%2C199&#038;ssl=1" alt="Mode Two button" class="wp-image-607" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-7.04.40-PM.png?w=1104&amp;ssl=1 1104w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-7.04.40-PM.png?resize=800%2C207&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-7.04.40-PM.png?resize=300%2C78&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-7.04.40-PM.png?resize=768%2C199&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-7.04.40-PM.png?resize=1024%2C265&amp;ssl=1 1024w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">Mode Two button</figcaption></figure>
</div>

<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="161" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-7.05.45-PM.png?resize=770%2C161&#038;ssl=1" alt="Updated data" class="wp-image-605" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-7.05.45-PM.png?w=1170&amp;ssl=1 1170w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-7.05.45-PM.png?resize=800%2C168&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-7.05.45-PM.png?resize=300%2C63&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-7.05.45-PM.png?resize=768%2C161&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-7.05.45-PM.png?resize=1024%2C214&amp;ssl=1 1024w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">Updated data</figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph">The same logic applies to the remaining buttons, when the user clicks on a button, a specific piece of data will get sent to the database depending on what button the user clicked.</p>



<h4 class="wp-block-heading">Building the app APK file</h4>



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



<p class="wp-block-paragraph">download the following <strong>.aia</strong> file and import it to your &#8220;MIT app inventor&#8221; account projects dashboard, it will open up the project source, <strong>don&#8217;t forget to update the &#8220;FirebaseURL&#8221; to your firebase project database URL.</strong></p>



<p class="wp-block-paragraph">You can download the .aia source file from that link.</p>



<div class="aligncenter wp-block-button"><a class="wp-block-button__link has-background wp-element-button" href="https://drive.google.com/open?id=1uGUct6ddtGVaS_aYOXB2k6JPw_WVf7_M" style="border-radius:100px;background-color:#00a99d">mobile app .aia file</a></div>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="512" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-6.49.31-PM.png?resize=770%2C512&#038;ssl=1" alt="updating the firebase URL" class="wp-image-600" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-6.49.31-PM.png?w=1038&amp;ssl=1 1038w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-6.49.31-PM.png?resize=800%2C532&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-6.49.31-PM.png?resize=300%2C199&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-6.49.31-PM.png?resize=768%2C511&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-6.49.31-PM.png?resize=1024%2C681&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-6.49.31-PM.png?resize=270%2C180&amp;ssl=1 270w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-6.49.31-PM.png?resize=370%2C245&amp;ssl=1 370w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">updating the firebase URL</figcaption></figure>
</div>


<p class="wp-block-paragraph">Then <strong>build the app APK file</strong> and download it to your computer, then send the APK file to your mobile and install it.</p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="118" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-03-at-4.13.20-AM.png?resize=770%2C118&#038;ssl=1" alt="save the APK file to your computer" class="wp-image-652" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-03-at-4.13.20-AM.png?w=1170&amp;ssl=1 1170w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-03-at-4.13.20-AM.png?resize=800%2C123&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-03-at-4.13.20-AM.png?resize=300%2C46&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-03-at-4.13.20-AM.png?resize=768%2C118&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-03-at-4.13.20-AM.png?resize=1024%2C157&amp;ssl=1 1024w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">save the APK file to your computer</figcaption></figure>
</div>


<h2 class="wp-block-heading">Programming The Raspberry Pi</h2>



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



<p class="has-regular-font-size wp-block-paragraph">After building the mobile app and sending data successfully from it to the database, the raspberry pi will read that data from the <strong>&#8220;firebase database&#8221;</strong> and according to the read data, it will take different actions like changing the lighting mode or increasing the brightness and so on.</p>



<h4 class="wp-block-heading">Installing The Pyrebase Module</h4>



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



<p class="has-regular-font-size wp-block-paragraph">Before we start writing any code, we need to install the <strong>&#8220;Pyrebase&#8221;</strong> python module on the raspberry pi board to allow us to communicate with the &#8220;Firebase Database&#8221; servers. Because by default the &#8220;Firebase&#8221; doesn&#8217;t support the &#8220;Python Programming Language&#8221; So, some cool guys wrote a python module to allow the python developers to use &#8220;Firebase&#8221; easily. If you are a Python NERD you can check out the module documentation on their <a href="https://github.com/thisbejim/Pyrebase#database"><strong>Github page</strong></a>.</p>



<p class="has-regular-font-size wp-block-paragraph">We will use &#8220;pip&#8221; to install the &#8220;Pyrebase&#8221; module. So, check to see if you currently have pip installed by running the command in the terminal.</p>



<pre class="wp-block-code"><code>pip --version</code></pre>



<p class="has-regular-font-size wp-block-paragraph">If it is not currently installed, you can install pip by running the following command</p>



<pre class="wp-block-code"><code>curl https://bootstrap.pypa.io/get-pip.py | python</code></pre>



<p class="has-regular-font-size wp-block-paragraph">After getting sure that we have &#8220;pip&#8221; on our raspberry pi board, we will start installing <strong>&#8220;Pyrebase&#8221;</strong> by running this command, and don&#8217;t worry if it takes some time.</p>



<pre class="wp-block-code"><code>sudo pip3 install Pyrebase</code></pre>



<p class="has-regular-font-size wp-block-paragraph">After finishing installing the &#8220;Pyrebase&#8221; module, we are now ready to write the final python script that will read data from the &#8220;Firebase database&#8221; to take some different actions according to that data.</p>



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



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



<pre class="EnlighterJSRAW" data-enlighter-language="python" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">#OK!
#Author: Ahmed Ibrahim
#Date: 2/10/2019
#Website: makesomestuff.org

import RPi.GPIO as GPIO                                                                         #import the RPi.GPIO module to allow us use the board GPIO pins.
import pyrebase                                                                                 #import the pyrebase module which allows us to communicate with the firebase servers.
from time import sleep                                                                          #import the time modulde to allow us do the delay stuff.

config = {                                                              #define a dictionary named config with several key-value pairs that configure the connection to the database.
  "apiKey": "ENTER YOUR API KEY",
  "authDomain": "ENTER YOUR AUTH DOMAIN URL",
  "databaseURL": "ENTER YOUR DATABASE URL",
  "storageBucket": "ENTER YOUR STORAGE BUGET URL"
}

firebase = pyrebase.initialize_app(config)                              #initialize the communication with the "firebase" servers using the previous config data.

redLED = 12                                                                                    #the "redLED" variable refers to the GPIO pin 12 which the red LED is connected on.
blueLED = 19                                                                                   #the "blueLED" variable refers to the GPIO pin 19 which the blue LED is connected on.
greenLED = 18                                                                                  #the "greenLED" variable refers to the GPIO pin 18 which the green LED is connected on.

GPIO.setmode(GPIO.BCM)                                                                         #Set the GPIO Scheme numbering system to the BCM mode.
GPIO.setwarnings(False)                                                                        #disable warnings

GPIO.setup(redLED,GPIO.OUT)                                                                    #set the "redLED" variable pin (12) as an output pin.
GPIO.setup(blueLED,GPIO.OUT)                                                                   #set the "blueLED" variable pin (19) as an output pin.
GPIO.setup(greenLED,GPIO.OUT)                                                                  #set the "greenLED" variable pin (18) as an output pin.

red_pwm = GPIO.PWM(redLED,1000)                                                                #create PWM instance named "red_pwm" with frequency 1000.
blue_pwm = GPIO.PWM(blueLED,1000)                                                              #create PWM instance named "blue_pwm" with frequency 1000.
green_pwm = GPIO.PWM(greenLED,1000)                                                            #create PWM instance named "green_pwm" with frequency 1000.

red_pwm.start(0)                                                                               #start the program with 0% duty cycle (red LED will be OFF).
blue_pwm.start(0)                                                                              #start the program with 0% duty cycle (blue LED will be OFF).
green_pwm.start(0)                                                                             #start the program with 0% duty cycle (green LED will be OFF).

print("AH Shit! Here we go again! Press CTRL+C to exit")                                       #print "AH Shit! Here we go again! Press CTRL+C to exit" at the beginning of the program.

# function name: mode6
# arguments:
#   redIntensity: the brightness intensity of the red LED.
#   greenIntensity: the brightness intensity of the green LED.
#   blueIntensity: the brightness intensity of the blue LED.
# return: this funtion return nothing.
# this function is responsible for the pattern of the lighting mode. Feel free to change the lighting pattern as you want.
def mode6 (redIntensity, greenIntensity, blueIntensity):
    for duty in range (0, redIntensity, 1):
        red_pwm.ChangeDutyCycle(duty)
        sleep(0.01)
    sleep(0.3)
    for duty in range (redIntensity - 1, -1, -1):
        red_pwm.ChangeDutyCycle(duty)
        sleep(0.01)
    sleep(0.3)
    for duty in range (0, blueIntensity, 1):
        blue_pwm.ChangeDutyCycle(duty)
        sleep(0.01)
    sleep(0.3)
    for duty in range (blueIntensity - 1, -1, -1):
        blue_pwm.ChangeDutyCycle(duty)
        sleep(0.01)
    sleep(0.3)
    for duty in range (0, greenIntensity, 1):
        green_pwm.ChangeDutyCycle(duty)              #provide duty cycle in the range 0-100.
        sleep(0.01)
    sleep(0.3)
    for duty in range (greenIntensity - 1, -1 ,-1):
       green_pwm.ChangeDutyCycle(duty)               #provide duty cycle in the range 0-100
       sleep(0.01)
    sleep(0.3)

# function name: mode5
# arguments:
#   redIntensity: the brightness intensity of the red LED.
#   greenIntensity: the brightness intensity of the green LED.
#   blueIntensity: the brightness intensity of the blue LED.
# return: this funtion return nothing.
# this function is responsible for the pattern of the lighting mode. Feel free to change the lighting pattern as you want.
def mode5(redIntensity, greenIntensity, blueIntensity):
    for duty in range (0, redIntensity, 1):
        red_pwm.ChangeDutyCycle(duty)
        sleep(0.001)
    sleep(0.3)
    for duty in range (redIntensity - 1, -1, -1):
        red_pwm.ChangeDutyCycle(duty)
        sleep(0.001)
    sleep(0.3)
    for duty in range (0, blueIntensity, 1):
        blue_pwm.ChangeDutyCycle(duty)
        sleep(0.001)
    sleep(0.3)
    for duty in range (blueIntensity - 1 , -1, -1):
        blue_pwm.ChangeDutyCycle(duty)
        sleep(0.001)
    sleep(0.3)
    for duty in range (0, greenIntensity, 1):
        green_pwm.ChangeDutyCycle(duty)              #provide duty cycle in the range 0-100.
        sleep(0.001)
    sleep(0.3)
    for duty in range (greenIntensity - 1 , -1, -1):
       green_pwm.ChangeDutyCycle(duty)               #provide duty cycle in the range 0-100
       sleep(0.001)
    sleep(0.3)

# function name: mode4
# arguments:
#   redIntensity: the brightness intensity of the red LED.
#   greenIntensity: the brightness intensity of the green LED.
#   blueIntensity: the brightness intensity of the blue LED.
# return: this funtion return nothing.
# this function is responsible for the pattern of the lighting mode. Feel free to change the lighting pattern as you want.
def mode4(redIntensity, greenIntensity, blueIntensity):
    for duty in range (0, redIntensity, 1):
        red_pwm.ChangeDutyCycle(duty)
        sleep(0.01)
    sleep(0.5)
    green_pwm.ChangeDutyCycle(0)
    sleep(0.2)
    green_pwm.ChangeDutyCycle(greenIntensity - 1)

    for duty in range (0, blueIntensity, 1):
        blue_pwm.ChangeDutyCycle(duty)
        sleep(0.01)
    sleep(0.5)
    blue_pwm.ChangeDutyCycle(0)
    sleep(0.2)
    blue_pwm.ChangeDutyCycle(blueIntensity - 1)

    for duty in range (0,greenIntensity,1):
        green_pwm.ChangeDutyCycle(duty)
        sleep(0.01)
    sleep(0.5)
    red_pwm.ChangeDutyCycle(0)
    sleep(0.2)
    red_pwm.ChangeDutyCycle(redIntensity - 1)

    red_pwm.ChangeDutyCycle(0)
    green_pwm.ChangeDutyCycle(0)
    blue_pwm.ChangeDutyCycle(0)

# function name: mode3
# arguments:
#   redIntensity: the brightness intensity of the red LED.
#   greenIntensity: the brightness intensity of the green LED.
#   blueIntensity: the brightness intensity of the blue LED.
# return: this funtion return nothing.
# this function is responsible for the pattern of the lighting mode. Feel free to change the lighting pattern as you want.
def mode3(redIntensity, greenIntensity, blueIntensity):
    red_pwm.ChangeDutyCycle(0)
    green_pwm.ChangeDutyCycle(0)
    blue_pwm.ChangeDutyCycle(0)

    red_pwm.ChangeDutyCycle(redIntensity - 1)
    blue_pwm.ChangeDutyCycle(blueIntensity - 1)
    green_pwm.ChangeDutyCycle(greenIntensity - 1)

# function name: mode2
# arguments:
#   redIntensity: the brightness intensity of the red LED.
#   greenIntensity: the brightness intensity of the green LED.
#   blueIntensity: the brightness intensity of the blue LED.
# return: this funtion return nothing.
# this function is responsible for the pattern of the lighting mode. Feel free to change the lighting pattern as you want.
def mode2(redIntensity, greenIntensity, blueIntensity):
    red_pwm.ChangeDutyCycle(0)
    green_pwm.ChangeDutyCycle(0)
    blue_pwm.ChangeDutyCycle(0)

    blue_pwm.ChangeDutyCycle(blueIntensity - 1)
    sleep(0.1)
    blue_pwm.ChangeDutyCycle(0)
    sleep(0.1)
    green_pwm.ChangeDutyCycle(greenIntensity - 1)
    sleep(0.1)
    green_pwm.ChangeDutyCycle(0)
    sleep(0.1)
    red_pwm.ChangeDutyCycle(redIntensity - 1)
    sleep(0.1)
    red_pwm.ChangeDutyCycle(0)
    sleep(0.1)

# function name: mode1
# arguments:
#   redIntensity: the brightness intensity of the red LED.
#   greenIntensity: the brightness intensity of the green LED.
#   blueIntensity: the brightness intensity of the blue LED.
# return: this funtion return nothing.
# this function is responsible for the pattern of the lighting mode. Feel free to change the lighting pattern as you want.
def mode1(redIntensity, greenIntensity, blueIntensity):
    red_pwm.ChangeDutyCycle(redIntensity - 1)
    sleep(0.02)
    red_pwm.ChangeDutyCycle(0)
    sleep(0.02)
    red_pwm.ChangeDutyCycle(redIntensity - 1)
    sleep(0.02)
    red_pwm.ChangeDutyCycle(0)
    sleep(0.02)

    green_pwm.ChangeDutyCycle(greenIntensity - 1)
    sleep(0.02)
    green_pwm.ChangeDutyCycle(0)
    sleep(0.02)
    green_pwm.ChangeDutyCycle(greenIntensity - 1)
    sleep(0.02)
    green_pwm.ChangeDutyCycle(0)
    sleep(0.02)

    blue_pwm.ChangeDutyCycle(blueIntensity - 1)
    sleep(0.02)
    blue_pwm.ChangeDutyCycle(0)
    sleep(0.02)
    blue_pwm.ChangeDutyCycle(blueIntensity - 1)
    sleep(0.02)
    blue_pwm.ChangeDutyCycle(0)
    sleep(0.02)

try:
    while True:                                                                              #the beginning of the main program.

        database = firebase.database()                                             #take an instance from the firebase database which is pointing to the root directory of your database.
        RGBControlBucket = database.child("RGBControl")                            #get the child "RGBControl" path in your database and store it inside the "RGBControlBucket" variable.
        powerState = RGBControlBucket.child("powerState").get().val()                        #read the power state value from the tag "powerState" which is a node inside the database.
#        print("power state is: " + str(powerState))

                                                                                             # if the "powerState" variable value is equal to "true"
        if "true" in powerState.lower():
            database = firebase.database()                                         #take an instance from the firebase database which is pointing to the root directory of your database.
            RGBControlBucket = database.child("RGBControl")                        #get the child "RGBControl" path in your database and store it inside the "RGBControlBucket" variable.
            redLightIntensity = RGBControlBucket.child("redLightIntensity").get().val()  #read the red LED intensity value from the tag "redLightIntensity" which is a node inside the database then store that value inside the "redLightIntensity" variable.
            
#            print("red Light Intensity is: " + str(redLightIntensity))

            database = firebase.database()                                         #take an instance from the firebase database which is pointing to the root directory of your database.
            RGBControlBucket = database.child("RGBControl")                        #get the child "RGBControl" path in your database and store it inside the "RGBControlBucket" variable.
            blueLightIntensity = RGBControlBucket.child("blueLightIntensity").get().val()  #read the blue LED intensity value from the tag "blueLightIntensity" which is a node inside the database then store that value inside the "blueLightIntensity" variable.
            
#            print("blue Light Intensity is: " + str(blueLightIntensity))

            database = firebase.database()                                         #take an instance from the firebase database which is pointing to the root directory of your database.
            RGBControlBucket = database.child("RGBControl")                        #get the child "RGBControl" path in your database and store it inside the "RGBControlBucket" variable.
            greenLightIntensity = RGBControlBucket.child("greenLightIntensity").get().val()  #read the green LED intensity value from the tag "greenLightIntensity" which is a node inside the database then store that value inside the "greenLightIntensity" variable.
            
#            print("green Light Intensity is: " + str(greenLightIntensity))

            database = firebase.database()                                         #take an instance from the firebase database which is pointing to the root directory of your database.
            RGBControlBucket = database.child("RGBControl")                        #get the child "RGBControl" path in your database and store it inside the "RGBControlBucket" variable.
            lightPresetMode = RGBControlBucket.child("lightMode").get().val()  #read the light preset mode value from the tag "lightMode" which is a node inside the database then store that value inside the "lightPresetMode" variable.
            
#            print("light preset mode is: " + str(lightPresetMode))
            #           if the variable "lightPresetMode" value is equal to "mode6", call the mode6 function.
            if "mode6" in lightPresetMode.lower():
                mode6(int(redLightIntensity), int(greenLightIntensity), int(blueLightIntensity))
            #           if the variable "lightPresetMode" value is equal to "mode5", call the mode5 function.
            elif "mode5" in lightPresetMode.lower():
                mode5(int(redLightIntensity), int(greenLightIntensity), int(blueLightIntensity))
            #           if the variable "lightPresetMode" value is equal to "mode4", call the mode4 function.
            elif "mode4" in lightPresetMode.lower():
                mode4(int(redLightIntensity), int(greenLightIntensity), int(blueLightIntensity))
            #           if the variable "lightPresetMode" value is equal to "mode3", call the mode3 function.
            elif "mode3" in lightPresetMode.lower():
                mode3(int(redLightIntensity), int(greenLightIntensity), int(blueLightIntensity))
            #           if the variable "lightPresetMode" value is equal to "mode2", call the mode2 function.
            elif "mode2" in lightPresetMode.lower():
                mode2(int(redLightIntensity), int(greenLightIntensity), int(blueLightIntensity))
            #           if the variable "lightPresetMode" value is equal to "mode1", call the mode1 function.
            elif "mode1" in lightPresetMode.lower():
                mode1(int(redLightIntensity), int(greenLightIntensity), int(blueLightIntensity))
    #                   if the variable "lightPresetMode" value is not equal to any of the above values, print "DAMN, the power state is: false" on the terminal for debugging purposes.
        else:
            print("DAMN, the power state is: " + powerState)


except KeyboardInterrupt: # If CTRL+C is pressed, exit cleanly:
    red_pwm.stop() # stop red PWM
    blue_pwm.stop() # stop blue PWM
    green_pwm.stop() # stop green PWM
    GPIO.cleanup() # cleanup all GPIO</pre>



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



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



<p class="has-regular-font-size wp-block-paragraph">the most important part here is to connect your python script to the &#8220;Firebase database&#8221; servers to be able to read the data from it. We define a dictionary named <code>config</code> with several key-value pairs that configure the connection to the database. The apiKey, authDomain, databaseUrl, and storageBucket values needed to connect to your database can be found in the Firebase console.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="python" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">config = {                                                              #define a dictionary named config with several key-value pairs that configure the connection to the database.
  "apiKey": "ENTER YOUR PROJECT API KEY",
  "authDomain": "ENTER YOUR AUTH DOMAIN URL",       # "projectId.firebaseapp.com"
  "databaseURL": "ENTER YOUR DATABASE URL",         # "https://databaseName.firebaseio.com"
  "storageBucket": "ENTER YOUR STORAGE BUGET URL"   # "projectId.appspot.com"
}</pre>



<p class="has-regular-font-size wp-block-paragraph">To find the <strong>&#8220;API Key&#8221;</strong>, <strong>&#8220;authDomain&#8221;</strong>, <strong>&#8220;databaseURL&#8221;</strong>, <strong>&#8220;storageBucket&#8221;</strong> values, go to your database dashboard click on the gear icon, then &#8220;Project settings&#8221;.</p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="129" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-9.39.15-PM.png?resize=770%2C129&#038;ssl=1" alt="Getting the API key" class="wp-image-616" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-9.39.15-PM.png?w=1170&amp;ssl=1 1170w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-9.39.15-PM.png?resize=800%2C134&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-9.39.15-PM.png?resize=300%2C50&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-9.39.15-PM.png?resize=768%2C129&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-9.39.15-PM.png?resize=1024%2C172&amp;ssl=1 1024w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">Getting the API key</figcaption></figure>
</div>


<figure class="wp-block-image"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="465" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-9.41.29-PM.png?resize=770%2C465&#038;ssl=1" alt="getting the project ID" class="wp-image-619" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-9.41.29-PM.png?resize=1024%2C618&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-9.41.29-PM.png?resize=800%2C483&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-9.41.29-PM.png?resize=300%2C181&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-9.41.29-PM.png?resize=768%2C463&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-9.41.29-PM.png?w=1170&amp;ssl=1 1170w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">getting the project ID</figcaption></figure>



<p class="has-regular-font-size wp-block-paragraph">Then you will find your project <strong>API key</strong>. Copy and paste it inside your python script. To find the <strong>&#8220;authDomain&#8221;</strong> you need to get the <strong>project ID</strong>, after getting your <strong>Project ID</strong> your <strong>&#8220;authDomain&#8221;</strong> will be like this <strong>&#8220;projectId.firebaseapp.com&#8221;</strong>.<br>your <strong>&#8220;storageBucket&#8221;</strong> will be like this <strong>&#8220;projectId.appspot.com&#8221;</strong>.</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="5056799298"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



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



<p class="wp-block-paragraph">and to get your <strong>&#8220;databaseURL&#8221;</strong> go to your project <strong>database dashboard</strong> and copy that URL. That&#8217;s It!</p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="200" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-6.45.42-PM-1.png?resize=770%2C200&#038;ssl=1" alt="Database URL" class="wp-image-601" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-6.45.42-PM-1.png?w=1170&amp;ssl=1 1170w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-6.45.42-PM-1.png?resize=800%2C208&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-6.45.42-PM-1.png?resize=300%2C78&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-6.45.42-PM-1.png?resize=768%2C200&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-02-at-6.45.42-PM-1.png?resize=1024%2C266&amp;ssl=1 1024w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">Database URL</figcaption></figure>
</div>


<p class="has-regular-font-size wp-block-paragraph">If you want more code explanation, please read the code comments it&#8217;s well documented.</p>



<h4 class="wp-block-heading">How does It Work?</h4>



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



<p class="has-regular-font-size wp-block-paragraph">After finishing the wiring and your code, close and save it, Run your program by writing <code>python3 fileName.py</code> in your terminal. <br>Like the last example, After running your program, It&#8217;s expected to see this sentence got printed on the terminal <code>AH Shit! Here we go again! Press CTRL+C to exit</code> then you will be able to control the LED Strip from your mobile app, Voila!</p>



<p class="wp-block-paragraph"><strong>Note: You must run your program using python3, because the &#8220;pyrebase&#8221; module only works with python3 any other python version will not work.</strong></p>



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



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



<p class="has-regular-font-size wp-block-paragraph">If you see that error message when you run your program</p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="512" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/erScreen-Shot-2019-09-14-at-8.24.03-AM.png?resize=770%2C512&#038;ssl=1" alt="program running error" class="wp-image-632" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/erScreen-Shot-2019-09-14-at-8.24.03-AM.png?w=1170&amp;ssl=1 1170w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/erScreen-Shot-2019-09-14-at-8.24.03-AM.png?resize=800%2C532&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/erScreen-Shot-2019-09-14-at-8.24.03-AM.png?resize=300%2C199&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/erScreen-Shot-2019-09-14-at-8.24.03-AM.png?resize=768%2C511&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/erScreen-Shot-2019-09-14-at-8.24.03-AM.png?resize=1024%2C681&amp;ssl=1 1024w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/erScreen-Shot-2019-09-14-at-8.24.03-AM.png?resize=270%2C180&amp;ssl=1 270w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/erScreen-Shot-2019-09-14-at-8.24.03-AM.png?resize=370%2C245&amp;ssl=1 370w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">program running error</figcaption></figure>
</div>


<p class="wp-block-paragraph">don&#8217;t worry open your terminal and execute that commands </p>



<pre class="wp-block-code"><code>pip install --upgrade pyasn1-modules
</code></pre>



<p class="wp-block-paragraph"> this command will install your missing modules.</p>



<h2 class="wp-block-heading">Running The Program Automatically On Startup</h2>



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



<p class="has-regular-font-size wp-block-paragraph">We don&#8217;t need to run the program manually by ourselves every time we boot up our raspberry pi board, it will be a good idea if we get our program to run automatically whenever the raspberry pi boots.</p>



<p class="has-regular-font-size wp-block-paragraph">After the desktop environment starts (LXDE-pi, in this case), it runs whatever commands it finds in the profile&#8217;s&nbsp;<em>autostart</em>&nbsp;script, which is located at&nbsp;<em>/home/pi/.config/lxsession/LXDE-pi/autostart</em>&nbsp;for our Raspberry Pi.</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="5056799298"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



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



<p class="wp-block-paragraph">First, we need to create a .desktop File, Open a terminal, and execute the following commands to create an&nbsp;<em>autostart</em>&nbsp;directory (if one does not already exist) and edit a .desktop file for our project code</p>



<pre class="wp-block-code"><code>mkdir /home/pi/.config/autostart
nano /home/pi/.config/autostart/IoTUsingRaspberryPi.desktop
</code></pre>



<p class="has-regular-font-size wp-block-paragraph">Copy in the following text into the&nbsp;&#8220;IoTUsingRaspberryPi.desktop&#8221;&nbsp;file. Feel free to change the&nbsp;<em>Name</em>&nbsp;and&nbsp;<em>Exec</em>&nbsp;variables to your particular application.</p>



<pre class="wp-block-code"><code>&#91;Desktop Entry]
Type=Application
Name=IoTUsingRaspberryPiAndFirebase
Exec=/usr/bin/python3 /your program absolute path/programName.py
</code></pre>



<p class="has-regular-font-size wp-block-paragraph">That&#8217;s it! Now, at every time you boot up your raspberry pi, the program will start running automatically.</p>



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



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



<p class="has-regular-font-size wp-block-paragraph"><strong>&nbsp;your script does not run as soon as you see the desktop?!  </strong></p>



<p class="wp-block-paragraph">there could be several issues. First, make sure that you have logged in (autostart does not start until you have logged in). You could also try enabling auto-login in&nbsp;<code>raspi-config</code>. Second, make sure you are using the absolute directory path (e.g.&nbsp;<code>/home/pi/IoTUsingRaspberryPi.py</code>). Third, make sure that you are using the python version 3 not anything else.</p>



<h2 class="wp-block-heading">My Setup</h2>



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


<div class="wp-block-image">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="770" height="578" src="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/IMG_5105.jpg?resize=770%2C578&#038;ssl=1" alt="Project Setup" class="wp-image-679" srcset="https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/IMG_5105.jpg?w=1170&amp;ssl=1 1170w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/IMG_5105.jpg?resize=600%2C450&amp;ssl=1 600w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/IMG_5105.jpg?resize=800%2C600&amp;ssl=1 800w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/IMG_5105.jpg?resize=300%2C225&amp;ssl=1 300w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/IMG_5105.jpg?resize=768%2C576&amp;ssl=1 768w, https://i0.wp.com/makesomestuff.org/wp-content/uploads/2019/10/IMG_5105.jpg?resize=1024%2C768&amp;ssl=1 1024w" sizes="auto, (max-width: 770px) 100vw, 770px" /><figcaption class="wp-element-caption">Project Setup</figcaption></figure>
</div>


<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’s tutorial, we learned how to build a simple mobile app using MIT App inventor. Also, we learned how to control RGD LED strips using the raspberry pi board, and how to communicate with the firebase database servers through a python script. Lastly, how to control an RGB LED strip wirelessly from anywhere in the world.</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</strong></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="5056799298"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>
<p>The post <a href="https://makesomestuff.org/iot-using-raspberry-pi-and-firebase-and-android/">IoT Using Raspberry Pi and Firebase and Android</a> appeared first on <a href="https://makesomestuff.org">Make Some Stuff</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://makesomestuff.org/iot-using-raspberry-pi-and-firebase-and-android/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">448</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-06-03 20:16:57 by W3 Total Cache
-->