<?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>Particle Photon | Learn with Edwin Robotics</title>
	<atom:link href="https://learn.edwinrobotics.com/category/particle-photon/feed/" rel="self" type="application/rss+xml" />
	<link>https://learn.edwinrobotics.com</link>
	<description>Tutorials on basics of electronics, etc.</description>
	<lastBuildDate>Thu, 28 Mar 2019 05:08:48 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.2</generator>
	<item>
		<title>DRV8833 DC/Stepper motor driver hookup guide</title>
		<link>https://learn.edwinrobotics.com/drv8833-dcstepper-motor-driver-hookup-guide/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=drv8833-dcstepper-motor-driver-hookup-guide</link>
					<comments>https://learn.edwinrobotics.com/drv8833-dcstepper-motor-driver-hookup-guide/#respond</comments>
		
		<dc:creator><![CDATA[Abhishek Nair]]></dc:creator>
		<pubDate>Wed, 28 Jun 2017 06:44:55 +0000</pubDate>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[ESP8266]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Particle Photon]]></category>
		<category><![CDATA[Raspberry Pi]]></category>
		<guid isPermaLink="false">http://learn.edwinrobotics.com/?p=1914</guid>

					<description><![CDATA[<img width="6000" height="4000" src="https://learn.edwinrobotics.com/wp-content/uploads/DRV8833_Cover.jpg" class="attachment- size- wp-post-image" alt="" style="float:left; margin:0 15px 15px 0;" decoding="async" fetchpriority="high" srcset="https://learn.edwinrobotics.com/wp-content/uploads/DRV8833_Cover.jpg 6000w, https://learn.edwinrobotics.com/wp-content/uploads/DRV8833_Cover-300x200.jpg 300w, https://learn.edwinrobotics.com/wp-content/uploads/DRV8833_Cover-1024x683.jpg 1024w, https://learn.edwinrobotics.com/wp-content/uploads/DRV8833_Cover-1080x720.jpg 1080w, https://learn.edwinrobotics.com/wp-content/uploads/DRV8833_Cover-140x94.jpg 140w" sizes="(max-width: 6000px) 100vw, 6000px" />The Edwin Robotics DRV8833 breakout board is capable of controlling up to 2 DC motors or one bi/uni-polar stepper motor a max current of 1.2A. The DRV8833 comes with 2 full H-bridges which give bi-directional control of your DC motors. It is similar to the L9110S in its voltage range ( 2.7V &#8211; 10.8V), but [&#8230;]]]></description>
										<content:encoded><![CDATA[<img width="6000" height="4000" src="https://learn.edwinrobotics.com/wp-content/uploads/DRV8833_Cover.jpg" class="attachment- size- wp-post-image" alt="" style="float:left; margin:0 15px 15px 0;" decoding="async" loading="lazy" srcset="https://learn.edwinrobotics.com/wp-content/uploads/DRV8833_Cover.jpg 6000w, https://learn.edwinrobotics.com/wp-content/uploads/DRV8833_Cover-300x200.jpg 300w, https://learn.edwinrobotics.com/wp-content/uploads/DRV8833_Cover-1024x683.jpg 1024w, https://learn.edwinrobotics.com/wp-content/uploads/DRV8833_Cover-1080x720.jpg 1080w, https://learn.edwinrobotics.com/wp-content/uploads/DRV8833_Cover-140x94.jpg 140w" sizes="auto, (max-width: 6000px) 100vw, 6000px" /><p>The Edwin Robotics DRV8833 breakout board is capable of controlling up to 2 DC motors or one bi/uni-polar stepper motor a max current of 1.2A. The DRV8833 comes with 2 full H-bridges which give bi-directional control of your DC motors. It is similar to the L9110S in its voltage range ( 2.7V &#8211; 10.8V), but carrying 50% more oomph. This makes it ideal for projects where the motors will be run from a 9V battery.</p>
<p>The board can be powered using the provided screw terminals or through micro-USB, checkout out <a href="https://shop.edwinrobotics.com/connectors/106-microusb-dc-jack-female.html" target="_blank" rel="noopener">micro-USB to DC Jack adapter</a> if you would like to use a standard power adapter with the board</p>
<h2> Hardware Required</h2>

<table id="tablepress-23" class="tablepress tablepress-id-23">
<tbody>
<tr class="row-1">
	<td class="column-1"><div id="attachment_1928" style="width: 160px" class="wp-caption aligncenter"><a href="https://shop.edwinrobotics.com/drivers/924-drv8833-dcstepper-motor-driver-breakout-board.html"target="_blank"><img decoding="async" aria-describedby="caption-attachment-1928" src="http://learn.edwinrobotics.com/wp-content/uploads/Feature-1-150x150.jpg" alt="DC Motor Driver" width="150" height="150" class="size-thumbnail wp-image-1928" srcset="https://learn.edwinrobotics.com/wp-content/uploads/Feature-1-150x150.jpg 150w, https://learn.edwinrobotics.com/wp-content/uploads/Feature-1-300x300.jpg 300w, https://learn.edwinrobotics.com/wp-content/uploads/Feature-1-184x184.jpg 184w, https://learn.edwinrobotics.com/wp-content/uploads/Feature-1.jpg 800w" sizes="(max-width: 150px) 100vw, 150px" /></a><p id="caption-attachment-1928" class="wp-caption-text">Edwin Robotics DRV8833 Motor Driver</p></div></td><td class="column-2"><div id="attachment_241" style="width: 160px" class="wp-caption aligncenter"><a href="https://shop.edwinrobotics.com/boards/75-arduino-uno-r3.html"target="_blank"><img decoding="async" aria-describedby="caption-attachment-241" src="http://learn.edwinrobotics.com/wp-content/uploads/2016/05/UNO-150x150.jpg" alt="Arduino UNO Microcontroller board" width="150" height="150" class="size-thumbnail wp-image-241" srcset="https://learn.edwinrobotics.com/wp-content/uploads/2016/05/UNO-150x150.jpg 150w, https://learn.edwinrobotics.com/wp-content/uploads/2016/05/UNO-184x184.jpg 184w" sizes="(max-width: 150px) 100vw, 150px" /></a><p id="caption-attachment-241" class="wp-caption-text">Arduino UNO</p></div></td><td class="column-3"><div id="attachment_1571" style="width: 160px" class="wp-caption aligncenter"><a href="https://shop.edwinrobotics.com/prototyping/19-male-female-jumper-wires-pack-of-10.html"target="_blank"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1571" src="http://learn.edwinrobotics.com/wp-content/uploads/179-2-150x150.jpg" alt="Arduino Jumper wires" width="150" height="150" class="size-thumbnail wp-image-1571" srcset="https://learn.edwinrobotics.com/wp-content/uploads/179-2-150x150.jpg 150w, https://learn.edwinrobotics.com/wp-content/uploads/179-2-300x300.jpg 300w, https://learn.edwinrobotics.com/wp-content/uploads/179-2-184x184.jpg 184w, https://learn.edwinrobotics.com/wp-content/uploads/179-2.jpg 600w" sizes="auto, (max-width: 150px) 100vw, 150px" /></a><p id="caption-attachment-1571" class="wp-caption-text">Male-Female Jumper wires</p></div></td>
</tr>
<tr class="row-2">
	<td class="column-1"><div id="attachment_1999" style="width: 160px" class="wp-caption aligncenter"><a href="https://shop.edwinrobotics.com/robotics/31-300-rpm-dc-geared-motor.html"target="_blank"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1999" src="http://learn.edwinrobotics.com/wp-content/uploads/300-RPM-w-yellow-Wheel-150x150.jpg" alt="" width="150" height="150" class="size-thumbnail wp-image-1999" srcset="https://learn.edwinrobotics.com/wp-content/uploads/300-RPM-w-yellow-Wheel-150x150.jpg 150w, https://learn.edwinrobotics.com/wp-content/uploads/300-RPM-w-yellow-Wheel-300x300.jpg 300w, https://learn.edwinrobotics.com/wp-content/uploads/300-RPM-w-yellow-Wheel-1024x1024.jpg 1024w, https://learn.edwinrobotics.com/wp-content/uploads/300-RPM-w-yellow-Wheel-1080x1080.jpg 1080w, https://learn.edwinrobotics.com/wp-content/uploads/300-RPM-w-yellow-Wheel-184x184.jpg 184w, https://learn.edwinrobotics.com/wp-content/uploads/300-RPM-w-yellow-Wheel.jpg 1500w" sizes="auto, (max-width: 150px) 100vw, 150px" /></a><p id="caption-attachment-1999" class="wp-caption-text">DC Geared Motor with Wheel</p></div></td><td class="column-2"><div id="attachment_2000" style="width: 160px" class="wp-caption aligncenter"><a href="https://shop.edwinrobotics.com/connectors/56-9v-dc-battery-snapper.html"target="_blank"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2000" src="http://learn.edwinrobotics.com/wp-content/uploads/9v-battery-snapper-1-150x150.jpg" alt="9v battery snap in cable" width="150" height="150" class="size-thumbnail wp-image-2000" srcset="https://learn.edwinrobotics.com/wp-content/uploads/9v-battery-snapper-1-150x150.jpg 150w, https://learn.edwinrobotics.com/wp-content/uploads/9v-battery-snapper-1-300x300.jpg 300w, https://learn.edwinrobotics.com/wp-content/uploads/9v-battery-snapper-1-184x184.jpg 184w, https://learn.edwinrobotics.com/wp-content/uploads/9v-battery-snapper-1.jpg 800w" sizes="auto, (max-width: 150px) 100vw, 150px" /></a><p id="caption-attachment-2000" class="wp-caption-text">9V DC Battery Snapper</p></div></td><td class="column-3"><div id="attachment_2002" style="width: 160px" class="wp-caption aligncenter"><a href="https://shop.edwinrobotics.com/connectors/106-microusb-dc-jack-female.html"target="_blank"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2002" src="http://learn.edwinrobotics.com/wp-content/uploads/microUSB-to-DC-Jack-Female-Front-150x150.jpg" alt="" width="150" height="150" class="size-thumbnail wp-image-2002" srcset="https://learn.edwinrobotics.com/wp-content/uploads/microUSB-to-DC-Jack-Female-Front-150x150.jpg 150w, https://learn.edwinrobotics.com/wp-content/uploads/microUSB-to-DC-Jack-Female-Front-184x184.jpg 184w" sizes="auto, (max-width: 150px) 100vw, 150px" /></a><p id="caption-attachment-2002" class="wp-caption-text">microUSB to DC Jack Female Connector</p></div></td>
</tr>
</tbody>
</table>
<!-- #tablepress-23 from cache -->
<h2>Features</h2>
<ul>
<li>Dual-H-bridge motor driver: can drive two DC motors or one uni/bi-polar stepper motor</li>
<li>Operating voltage: 2.7‌‌ V to 10.8 V</li>
<li>Output current: 1.2 A continuous (2 A peak) per motor</li>
<li>Motor outputs can be paralleled to deliver 2.4 A continuous (4 A peak) to a single motor</li>
<li>Inputs are 3V- and 5V-compatible</li>
<li>Under-voltage lockout and protection against over-current and over-temperature</li>
<li>Reverse-voltage protection circuit</li>
<li>Current limiting can be enabled by adding sense resistors (not included)</li>
</ul>
<h2>Pinouts:</h2>
<div class="row-fluid build-text">
<div id="attachment_1993" style="width: 510px" class="wp-caption aligncenter"><a href="http://learn.edwinrobotics.com/wp-content/uploads/Pin-DEscription-new.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1993" class="wp-image-1993" src="http://learn.edwinrobotics.com/wp-content/uploads/Pin-DEscription-new.png" alt="DRV8833 motor driver pin description" width="500" height="500" srcset="https://learn.edwinrobotics.com/wp-content/uploads/Pin-DEscription-new.png 2750w, https://learn.edwinrobotics.com/wp-content/uploads/Pin-DEscription-new-150x150.png 150w, https://learn.edwinrobotics.com/wp-content/uploads/Pin-DEscription-new-300x300.png 300w, https://learn.edwinrobotics.com/wp-content/uploads/Pin-DEscription-new-1024x1024.png 1024w, https://learn.edwinrobotics.com/wp-content/uploads/Pin-DEscription-new-1080x1080.png 1080w, https://learn.edwinrobotics.com/wp-content/uploads/Pin-DEscription-new-184x184.png 184w" sizes="auto, (max-width: 500px) 100vw, 500px" /></a><p id="caption-attachment-1993" class="wp-caption-text"><em>DRV8833 Motor driver pin description</em></p></div>
<p>&nbsp;</p>
<h3>Power</h3>
<ul>
<li><strong>Vm</strong> &#8211; This is the voltage supply for the motors. Keep this voltage between 2.7V and 10.8V. This Supply Pin is not Reverse polarity protected, so care must be taken while connecting jumper wires to it.</li>
<li><strong>Power Screw Terminal: </strong>The Power Screw terminal is labelled with + and -, connect your power supply according to label, this terminal is reverse polarity protected.</li>
<li><strong>USB Power In</strong>: You can power the board with micro USB connector provided; this is reverse polarity protected as well.</li>
<li><strong>GND</strong> &#8211; This is the shared logic and motor ground. All grounds are connected</li>
</ul>
</div>
<div class="row-fluid build-text">
<h3><span id="signal-in-pins" class="anchor-link-target"></span>Signals</h3>
<p>These are all &#8216;2.7V or higher logic level&#8217; inputs</p>
<ul>
<li><strong>AIN1, AIN2</strong> &#8211; Two inputs to the Motor A H-bridges. Speed control supported using PWM.</li>
<li><strong>BIN1, BIN2</strong> &#8211; Two inputs to the Motor B H-bridges. Speed control supported using PWM.</li>
<li><strong>FLT</strong> -This is the <strong>Fault</strong> output, which will drive low if there&#8217;s a thermal shutdown or overcurrent.</li>
<li><strong>SLP</strong> &#8211; sleep pin for quickly disabling the driver. On Board 10K pullup resistor provided to keep the driver enabled.</li>
</ul>
<p>The control inputs are pulled low internally, effectively disabling the motor driver outputs by default. See the truth tables in the DRV8833 datasheet for more information on how the inputs affect the driver outputs.</p>
<p><strong>The FAULT pin is an open-drain output that is driven low by the chip whenever an over-current, over-temperature-or under-voltage condition occurs. Otherwise, it remains in a floating state, so you will need to connect an external pull-up resistor (or use a micro-controller input with its built-in pull-up enabled) if you want to monitor fault conditions on the driver.</strong></p>
<p><strong><span style="color: #ff0000;">Note: There is a misprint on Silkscreen, BIN1 is printed in place of AIN1, refer the above image for correct pinouts description.</span></strong></p>
<p><strong>Note: we had Provided on board power LED, which will stay on whenever board is powered. You can disable the power LED with the jumper provided on the back, refer the image below for power LED (P-LED) Jumper</strong></p>
</div>
<div class="row-fluid build-text">
<h3>Current Limiting Pins</h3>
<p><strong>As/ Bs:</strong> The DRV8833 can perform current limiting for each motor H-bridge by connecting a resistor between As/Bs and ground to set the Motor A/ Motor B Limit.</p>
<p><strong>By default , the current limiting feature is disabled and can be enabled by modifying the jumper, refer the image below:</strong></p>
<div id="attachment_1930" style="width: 510px" class="wp-caption aligncenter"><a href="http://learn.edwinrobotics.com/wp-content/uploads/Jumper-Description.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1930" class="wp-image-1930" src="http://learn.edwinrobotics.com/wp-content/uploads/Jumper-Description.png" alt="DRV8833 Current limiting feature" width="500" height="200" srcset="https://learn.edwinrobotics.com/wp-content/uploads/Jumper-Description.png 1856w, https://learn.edwinrobotics.com/wp-content/uploads/Jumper-Description-300x120.png 300w, https://learn.edwinrobotics.com/wp-content/uploads/Jumper-Description-1024x410.png 1024w, https://learn.edwinrobotics.com/wp-content/uploads/Jumper-Description-1080x433.png 1080w" sizes="auto, (max-width: 500px) 100vw, 500px" /></a><p id="caption-attachment-1930" class="wp-caption-text"><em>Current Limiting and Status LED&#8217;s Jumper Pads.</em></p></div>
<p>The Current limiting can be enabled by cutting out the solder joint between the jumper Pads for Asen and Bsen. Once the jumper pads are modified you can either solder SMD resistor (1206 Size) on board or you can use the AS/BS headers pin to make connection with through hole resistors. You can also totally disable current limiting whenever needed by soldering the two jumpers on the back.</p>
<p><strong>The current limiting rule is: LimitCurrent (amps) = 0.2 V / RSENSE</strong></p>
<div id="attachment_1994" style="width: 510px" class="wp-caption aligncenter"><a href="http://learn.edwinrobotics.com/wp-content/uploads/Current-sense-resistors_mod.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1994" class="wp-image-1994" src="http://learn.edwinrobotics.com/wp-content/uploads/Current-sense-resistors_mod.png" alt="Current limiting resistors" width="500" height="500" srcset="https://learn.edwinrobotics.com/wp-content/uploads/Current-sense-resistors_mod.png 550w, https://learn.edwinrobotics.com/wp-content/uploads/Current-sense-resistors_mod-150x150.png 150w, https://learn.edwinrobotics.com/wp-content/uploads/Current-sense-resistors_mod-300x300.png 300w, https://learn.edwinrobotics.com/wp-content/uploads/Current-sense-resistors_mod-184x184.png 184w" sizes="auto, (max-width: 500px) 100vw, 500px" /></a><p id="caption-attachment-1994" class="wp-caption-text"><em>Add 1206 resistors here to modify the current supplied to the respective motors</em></p></div>
<p>&nbsp;</p>
<h2>Connection&#8217;s</h2>
<p>You can use any stepper motor or dc motor rated upto 10.8v with this board. We have used the following kit to get it tested:</p>
<div id="attachment_1929" style="width: 510px" class="wp-caption aligncenter"><a href="http://learn.edwinrobotics.com/wp-content/uploads/FUnky-DRIVER-SET.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1929" class="wp-image-1929" src="http://learn.edwinrobotics.com/wp-content/uploads/FUnky-DRIVER-SET.png" alt="DRV8833 Motor driver kit" width="500" height="500" srcset="https://learn.edwinrobotics.com/wp-content/uploads/FUnky-DRIVER-SET.png 4300w, https://learn.edwinrobotics.com/wp-content/uploads/FUnky-DRIVER-SET-150x150.png 150w, https://learn.edwinrobotics.com/wp-content/uploads/FUnky-DRIVER-SET-300x300.png 300w, https://learn.edwinrobotics.com/wp-content/uploads/FUnky-DRIVER-SET-1024x1024.png 1024w, https://learn.edwinrobotics.com/wp-content/uploads/FUnky-DRIVER-SET-1080x1080.png 1080w, https://learn.edwinrobotics.com/wp-content/uploads/FUnky-DRIVER-SET-184x184.png 184w" sizes="auto, (max-width: 500px) 100vw, 500px" /></a><p id="caption-attachment-1929" class="wp-caption-text"><em>Robotics Kit</em></p></div>
<p>&nbsp;</p>
<div class="page-title-wrapper"> Refer the image below for the motor connections</div>
</div>
<div></div>
<div></div>
<div class="row-fluid build-text">
<div></div>
<div>
<div id="attachment_1927" style="width: 510px" class="wp-caption aligncenter"><a href="http://learn.edwinrobotics.com/wp-content/uploads/DRV8833_Cover.jpg" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1927" class="wp-image-1927" src="http://learn.edwinrobotics.com/wp-content/uploads/DRV8833_Cover.jpg" alt="DRV8833 gear motor robotics kit" width="500" height="333" srcset="https://learn.edwinrobotics.com/wp-content/uploads/DRV8833_Cover.jpg 6000w, https://learn.edwinrobotics.com/wp-content/uploads/DRV8833_Cover-300x200.jpg 300w, https://learn.edwinrobotics.com/wp-content/uploads/DRV8833_Cover-1024x683.jpg 1024w, https://learn.edwinrobotics.com/wp-content/uploads/DRV8833_Cover-1080x720.jpg 1080w, https://learn.edwinrobotics.com/wp-content/uploads/DRV8833_Cover-140x94.jpg 140w" sizes="auto, (max-width: 500px) 100vw, 500px" /></a><p id="caption-attachment-1927" class="wp-caption-text"><em>Motor Connections</em></p></div>
</div>
</div>
<div class="page-content"></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div>You can power the board using phone charger (1.25~ 2.5Ampere rated) using micro usb or use the 9v battery snapper with micro usb connector as shown below:</div>
<div></div>
<div>
<div id="attachment_2013" style="width: 510px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2013" class="wp-image-2013" src="http://learn.edwinrobotics.com/wp-content/uploads/Power-Supply-1.jpg" alt="Motor Driver Power Supply" width="500" height="500" srcset="https://learn.edwinrobotics.com/wp-content/uploads/Power-Supply-1.jpg 2800w, https://learn.edwinrobotics.com/wp-content/uploads/Power-Supply-1-150x150.jpg 150w, https://learn.edwinrobotics.com/wp-content/uploads/Power-Supply-1-300x300.jpg 300w, https://learn.edwinrobotics.com/wp-content/uploads/Power-Supply-1-1024x1024.jpg 1024w, https://learn.edwinrobotics.com/wp-content/uploads/Power-Supply-1-1080x1080.jpg 1080w, https://learn.edwinrobotics.com/wp-content/uploads/Power-Supply-1-184x184.jpg 184w" sizes="auto, (max-width: 500px) 100vw, 500px" /><p id="caption-attachment-2013" class="wp-caption-text"><em>Power Supply Connections</em></p></div>
</div>
<div></div>
<div>Now connect the following pins to your Arduino board:</div>
<div></div>
<div>

<table id="tablepress-21" class="tablepress tablepress-id-21">
<thead>
<tr class="row-1">
	<th class="column-1">DRV8833 Motor Driver Breakout Pins</th><th class="column-2">Arduino Pins</th>
</tr>
</thead>
<tbody class="row-hover">
<tr class="row-2">
	<td class="column-1">AIN1</td><td class="column-2">2</td>
</tr>
<tr class="row-3">
	<td class="column-1">AIN2</td><td class="column-2">3</td>
</tr>
<tr class="row-4">
	<td class="column-1">BIN1</td><td class="column-2">4</td>
</tr>
<tr class="row-5">
	<td class="column-1">BIN2</td><td class="column-2">5</td>
</tr>
</tbody>
</table>
<!-- #tablepress-21 from cache -->
</div>
<div></div>
<div>
<div id="attachment_2008" style="width: 510px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2008" class="wp-image-2008" src="http://learn.edwinrobotics.com/wp-content/uploads/Arduino-Connections.jpg" alt="Stepper Motor driver connections" width="500" height="550" srcset="https://learn.edwinrobotics.com/wp-content/uploads/Arduino-Connections.jpg 816w, https://learn.edwinrobotics.com/wp-content/uploads/Arduino-Connections-273x300.jpg 273w" sizes="auto, (max-width: 500px) 100vw, 500px" /><p id="caption-attachment-2008" class="wp-caption-text"><em>Arduino DRV8833 Connections</em></p></div>
</div>
<div></div>
<h2>Test Codes</h2>
<div></div>
<div></div>
<div> Once the connections are done, upload the following code:</div>
<div></div>
<div></div>
<div></div>
<div>
<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="atomic">#define Ain1 5
#define Ain2 6
#define Bin1 9
#define Bin2 10

int speed = 0;

void setup() {
pinMode(Ain1, OUTPUT);  //Ain1
pinMode(Ain2, OUTPUT);  //Ain2
pinMode(Bin1, OUTPUT);  //Bin1
pinMode(Bin2, OUTPUT);  //Bin2

}

void loop() {

    digitalWrite(Ain1,HIGH);
    digitalWrite(Ain2,LOW);
    digitalWrite(Bin1,HIGH);
    digitalWrite(Bin2,LOW);
    delay(700);
    digitalWrite(Ain1,LOW);
    digitalWrite(Ain2,LOW);
    digitalWrite(Bin1,LOW);
    digitalWrite(Bin2,LOW);

    digitalWrite(Ain1,LOW);
    digitalWrite(Ain2,HIGH);
    digitalWrite(Bin1,LOW);
    digitalWrite(Bin2,HIGH);
    delay(700);
    digitalWrite(Ain1,LOW);
    digitalWrite(Ain2,LOW);
    digitalWrite(Bin1,LOW);
    digitalWrite(Bin2,LOW);
  
}</pre>
<p>&nbsp;</p>
</div>
<div></div>
<div></div>
<div></div>
<h2><a href="http://www.ti.com/lit/ds/symlink/drv8833.pdf" target="_blank" rel="noopener">Download DRV8833 Datasheet</a></h2>
<p>&nbsp;</p>
<p>References:</p>
<p><a href="https://learn.adafruit.com/adafruit-drv8833-dc-stepper-motor-driver-breakout-board/stepper-motor-usage" target="_blank" rel="noopener">Adafruit Hookup Guide</a></p>
<p><a href="https://www.pololu.com/product/2130/blog" target="_blank" rel="noopener">Polulu Blog</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://learn.edwinrobotics.com/drv8833-dcstepper-motor-driver-hookup-guide/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Getting started with the Particle Photon</title>
		<link>https://learn.edwinrobotics.com/getting-started-with-the-particle-photon/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=getting-started-with-the-particle-photon</link>
					<comments>https://learn.edwinrobotics.com/getting-started-with-the-particle-photon/#respond</comments>
		
		<dc:creator><![CDATA[emil]]></dc:creator>
		<pubDate>Fri, 20 Jan 2017 20:13:26 +0000</pubDate>
				<category><![CDATA[General]]></category>
		<category><![CDATA[IOT]]></category>
		<category><![CDATA[Particle Photon]]></category>
		<category><![CDATA[Wireless]]></category>
		<guid isPermaLink="false">http://learn.edwinrobotics.com/?p=1121</guid>

					<description><![CDATA[<img width="1000" height="750" src="https://learn.edwinrobotics.com/wp-content/uploads/DSC_0013.jpg" class="attachment- size- wp-post-image" alt="" style="float:left; margin:0 15px 15px 0;" decoding="async" loading="lazy" srcset="https://learn.edwinrobotics.com/wp-content/uploads/DSC_0013.jpg 1000w, https://learn.edwinrobotics.com/wp-content/uploads/DSC_0013-300x225.jpg 300w, https://learn.edwinrobotics.com/wp-content/uploads/DSC_0013-640x480.jpg 640w" sizes="auto, (max-width: 1000px) 100vw, 1000px" />The particle photon provides one of the best IoT experience in the market, its out of the box experience is unparalleled. Here we will be talking about the steps required to get started with the Particle Photon. Hardware Required:   &#160; Particle Photon w/ Headers   &#160; microUSB Cable Manually upgrading to the latest firmware: [&#8230;]]]></description>
										<content:encoded><![CDATA[<img width="1000" height="750" src="https://learn.edwinrobotics.com/wp-content/uploads/DSC_0013.jpg" class="attachment- size- wp-post-image" alt="" style="float:left; margin:0 15px 15px 0;" decoding="async" loading="lazy" srcset="https://learn.edwinrobotics.com/wp-content/uploads/DSC_0013.jpg 1000w, https://learn.edwinrobotics.com/wp-content/uploads/DSC_0013-300x225.jpg 300w, https://learn.edwinrobotics.com/wp-content/uploads/DSC_0013-640x480.jpg 640w" sizes="auto, (max-width: 1000px) 100vw, 1000px" /><p align="left"><span style="font-family: Calibri,sans-serif;">The particle photon provides one of the best IoT experience in the market, its out of the box experience is unparalleled. Here we will be talking about the steps required to get started with the Particle Photon.</span></p>
<p align="left"><span style="font-family: Calibri,sans-serif;"><b>Hardware Required:</b></span></p>
<table style="height: 177px;" width="451" cellspacing="0" cellpadding="4">
<tbody>
<tr valign="top">
<td width="50%"> <a href="https://shop.edwinrobotics.com/particle/506-particle-photon-wh.html" target="_blank"><img loading="lazy" decoding="async" class="aligncenter wp-image-1122 size-thumbnail" src="http://learn.edwinrobotics.com/wp-content/uploads/particle-photon-sq-150x150.jpg" width="150" height="150" srcset="https://learn.edwinrobotics.com/wp-content/uploads/particle-photon-sq-150x150.jpg 150w, https://learn.edwinrobotics.com/wp-content/uploads/particle-photon-sq-300x300.jpg 300w, https://learn.edwinrobotics.com/wp-content/uploads/particle-photon-sq-184x184.jpg 184w, https://learn.edwinrobotics.com/wp-content/uploads/particle-photon-sq.jpg 477w" sizes="auto, (max-width: 150px) 100vw, 150px" /></a></td>
<td width="50%">&nbsp;</p>
<p><a href="https://shop.edwinrobotics.com/particle/506-particle-photon-wh.html" target="_blank">Particle Photon w/ Headers</a></td>
</tr>
<tr valign="top">
<td width="50%"> <a href="https://shop.edwinrobotics.com/cables-and-adapters/213-usb-20-a-male-to-micro-5pin-male.html" target="_blank"><img loading="lazy" decoding="async" class="aligncenter wp-image-1124 size-thumbnail" src="http://learn.edwinrobotics.com/wp-content/uploads/usb-20-a-male-to-micro-5pin-male-150x150.jpg" width="150" height="150" srcset="https://learn.edwinrobotics.com/wp-content/uploads/usb-20-a-male-to-micro-5pin-male-150x150.jpg 150w, https://learn.edwinrobotics.com/wp-content/uploads/usb-20-a-male-to-micro-5pin-male-300x300.jpg 300w, https://learn.edwinrobotics.com/wp-content/uploads/usb-20-a-male-to-micro-5pin-male-184x184.jpg 184w, https://learn.edwinrobotics.com/wp-content/uploads/usb-20-a-male-to-micro-5pin-male.jpg 477w" sizes="auto, (max-width: 150px) 100vw, 150px" /></a></td>
<td style="text-align: center;" width="50%">&nbsp;</p>
<p><a href="https://shop.edwinrobotics.com/cables-and-adapters/213-usb-20-a-male-to-micro-5pin-male.html" target="_blank">microUSB Cable</a></td>
</tr>
</tbody>
</table>
<p align="left"><span style="font-family: Calibri,sans-serif;"><b>Manually upgrading to the latest firmware:</b></span></p>
<p align="left"><span style="font-family: Calibri,sans-serif;">The Particle Photon may not come with the latest firmware, <b>the firmware is automatically upgraded to the latest version when a program is uploaded</b>. Alternatively, the firmware can also be upgraded to the latest version using the Particle Firmware Manager app. You can get the latest version from <a href="https://github.com/spark/firmware/releases">Firmware Releases page</a></span></p>
<p align="left"><span style="font-family: Calibri,sans-serif;">Once downloaded, run the application as administrator this will automatically install the drivers first and will later ask to connect the board.</span></p>
<p align="left"><span style="font-family: Calibri,sans-serif;">Once the drivers are installed, <b>connect the Particle Photon</b> and <b>click on Update to X.X.X</b> where X.X.X is the firmware version. </span></p>
<p align="left"><span style="font-family: Calibri,sans-serif;"><b>Connecting the Particle Photon to the WiFi using the Particle App</b></span></p>
<ol>
<li><span style="font-family: Calibri,sans-serif;">The easiest way to configure the Particle Photon is using the Particle App, there are <a href="https://play.google.com/store/apps/details?id=io.particle.android.app">Android</a> and <a href="https://itunes.apple.com/us/app/particle-build-iot-projects/id991459054?mt=8">iOS</a> versions available.</span></li>
<li><span style="font-family: Calibri,sans-serif;">Once the board is booted up and in setup mode the on board RGB Led will start <b>blinking blue.</b></span></li>
<li><span style="font-family: Calibri,sans-serif;">Click on <b>setup a photon </b>and choose the WiFi AP corresponding to <b>Photon-XXXX </b>where XXXX varies from board to board. Once connected select your WiFi and enter the password.</span></li>
<li><span style="font-family: Calibri,sans-serif;">The tinker code helps you configure the various GPIO pins on the Photon through the mobile app. If the board is flashed with a non-Tinker code, it can be re-flashed though the app itself. The <b>on-board LED</b> is connected to D7</span></li>
</ol>
<p align="left"><span style="font-family: Calibri,sans-serif;"><b>Programming the Particle Photon</b></span></p>
<p align="left"><span style="font-family: Calibri,sans-serif;">Particle offers 3 options to program the Particle Photon.</span></p>
<ul>
<li><span style="font-family: Calibri,sans-serif;">Online</span></li>
<li><span style="font-family: Calibri,sans-serif;">Semi-offline</span></li>
<li><span style="font-family: Calibri,sans-serif;">Offline</span></li>
</ul>
<p align="left"><span style="font-family: Calibri,sans-serif;">In this tutorial we will be covering the Online and the Semi-offline method</span></p>
<p align="left"><span style="font-family: Calibri,sans-serif;"><b>Programming the Particle Photon Online</b></span></p>
<p align="left"><img loading="lazy" decoding="async" class="aligncenter wp-image-1117" src="http://learn.edwinrobotics.com/wp-content/uploads/Particle-IDE-1024x695.png" width="649" height="441" srcset="https://learn.edwinrobotics.com/wp-content/uploads/Particle-IDE-1024x695.png 1024w, https://learn.edwinrobotics.com/wp-content/uploads/Particle-IDE-300x204.png 300w, https://learn.edwinrobotics.com/wp-content/uploads/Particle-IDE-140x94.png 140w, https://learn.edwinrobotics.com/wp-content/uploads/Particle-IDE.png 1599w" sizes="auto, (max-width: 649px) 100vw, 649px" /></p>
<p align="left"><span style="font-family: Calibri,sans-serif;">Particle has a great <a href="https://build.particle.io/">online IDE</a> that can be used for pushing code onto the Particle Photon. </span></p>
<table style="height: 281px;" width="560" cellspacing="0" cellpadding="4">
<colgroup>
<col width="128*" />
<col width="128*" /> </colgroup>
<tbody>
<tr>
<td width="50%"> <img loading="lazy" decoding="async" class="aligncenter size-full wp-image-1114" src="http://learn.edwinrobotics.com/wp-content/uploads/Flash.png" alt="" width="44" height="44" /></td>
<td width="50%">
<p align="left"><span style="font-family: Calibri,sans-serif;">Flash the code on to the Particle Photon</span></p>
</td>
</tr>
<tr>
<td width="50%"> <img loading="lazy" decoding="async" class="aligncenter size-full wp-image-1119" src="http://learn.edwinrobotics.com/wp-content/uploads/Verify.png" alt="" width="45" height="45" /></td>
<td width="50%">
<p align="left"><span style="font-family: Calibri,sans-serif;">Verify the code of errors</span></p>
</td>
</tr>
<tr>
<td width="50%"> <img loading="lazy" decoding="async" class="aligncenter size-full wp-image-1116" src="http://learn.edwinrobotics.com/wp-content/uploads/Open.png" alt="" width="45" height="45" /></td>
<td width="50%">
<p align="left"><span style="font-family: Calibri,sans-serif;">Save current code</span></p>
</td>
</tr>
<tr>
<td width="50%"> <img loading="lazy" decoding="async" class="aligncenter size-full wp-image-1111" src="http://learn.edwinrobotics.com/wp-content/uploads/Code.png" alt="" width="45" height="45" /></td>
<td width="50%">
<p align="left"><span style="font-family: Calibri,sans-serif;">Show/Hide the side bar</span></p>
</td>
</tr>
<tr>
<td width="50%"> <img loading="lazy" decoding="async" class="aligncenter size-full wp-image-1115" src="http://learn.edwinrobotics.com/wp-content/uploads/Library.png" alt="" width="45" height="45" /></td>
<td width="50%">
<p align="left"><span style="font-family: Calibri,sans-serif;">List of libraries</span></p>
</td>
</tr>
<tr>
<td width="50%"> <img loading="lazy" decoding="async" class="aligncenter size-full wp-image-1113" src="http://learn.edwinrobotics.com/wp-content/uploads/Docs.png" alt="" width="45" height="45" /></td>
<td width="50%">
<p align="left"><span style="font-family: Calibri,sans-serif;">View the docs</span></p>
</td>
</tr>
<tr>
<td width="50%"> <img loading="lazy" decoding="async" class="aligncenter size-full wp-image-1120" src="http://learn.edwinrobotics.com/wp-content/uploads/Devices.png" alt="" width="45" height="45" /></td>
<td width="50%">
<p align="left"><span style="font-family: Calibri,sans-serif;">List of devices</span></p>
</td>
</tr>
<tr>
<td width="50%"> <img loading="lazy" decoding="async" class="aligncenter size-full wp-image-1112" src="http://learn.edwinrobotics.com/wp-content/uploads/Console.png" alt="" width="45" height="45" /></td>
<td width="50%">
<p align="left"><span style="font-family: Calibri,sans-serif;">Open the Particle Dashboard that will list all your devices and products</span></p>
</td>
</tr>
<tr>
<td width="50%"> <img loading="lazy" decoding="async" class="aligncenter size-full wp-image-1118" src="http://learn.edwinrobotics.com/wp-content/uploads/Settings.png" alt="" width="45" height="45" /></td>
<td width="50%">
<p align="left"><span style="font-family: Calibri,sans-serif;">Basics settings for Particle Account </span></p>
</td>
</tr>
</tbody>
</table>
<p align="left"><strong><span style="font-family: Calibri,sans-serif;">Step 1: Get the Code ready</span></strong></p>
<p align="left"><span style="font-family: Calibri,sans-serif;">The first step would be to create an app, for the tutorial we will be using the blink an LED app. Once the code is typed out and ready to be flashed, the board that needs to be flashed needs to be selected. </span></p>
<p align="left"><strong><span style="font-family: Calibri,sans-serif;">Step 2: Select the device</span></strong></p>
<p align="left"><span style="font-family: Calibri,sans-serif;">The device to be flashed can be selected from the list of devices tab. Here you can also select the firmware that is to be used.<br />
</span></p>
<p align="left"><span style="font-family: Calibri,sans-serif;"><strong> Step 3: Flashing the code</strong></span></p>
<p align="left"><span style="font-family: Calibri,sans-serif;">Flashing the code is as simple as clicking on the flash button. The first time uploading the code might take longer as the firmware will need be upgraded, this process is denoted by the magenta color on the RGB Led</span></p>
<p align="left"><span style="font-family: Calibri,sans-serif;"><b>Programming the Particle Photon using the IDE</b></span></p>
<p align="left"><img loading="lazy" decoding="async" class="aligncenter wp-image-1126" src="http://learn.edwinrobotics.com/wp-content/uploads/Particle-Dev.png" width="650" height="647" srcset="https://learn.edwinrobotics.com/wp-content/uploads/Particle-Dev.png 1006w, https://learn.edwinrobotics.com/wp-content/uploads/Particle-Dev-150x150.png 150w, https://learn.edwinrobotics.com/wp-content/uploads/Particle-Dev-300x300.png 300w, https://learn.edwinrobotics.com/wp-content/uploads/Particle-Dev-184x184.png 184w" sizes="auto, (max-width: 650px) 100vw, 650px" /></p>
<p align="left"><span style="font-family: Calibri,sans-serif;">The Particle IDE offers a local solution to coding on the Particle Photon, the IDE allows you to code locally but still requires an internet connection to be able to compile the code and to push it to the board. </span></p>
<p align="left"><span style="font-family: Calibri,sans-serif;">In order to be able to select the board that needs to be programmed, the IDE needs access to your particle account. This can be done through the Particle menu, <b>Particle</b> → <b>Login to Particle Cloud</b><br />
The device can be selected from <b>Parti</b><b>cl</b><b>e </b>→<b> Select Device </b></span></p>
<p align="left"><span style="font-family: Calibri,sans-serif;">In order to get started, we need to create a project folder which will hold the code. Once done add the project folder to the Particle IDE. This will show in the side bar</span></p>
<p align="left"><img loading="lazy" decoding="async" class="aligncenter wp-image-1125" src="http://learn.edwinrobotics.com/wp-content/uploads/Project-Folder.png" alt="" width="460" height="112" srcset="https://learn.edwinrobotics.com/wp-content/uploads/Project-Folder.png 1199w, https://learn.edwinrobotics.com/wp-content/uploads/Project-Folder-300x73.png 300w, https://learn.edwinrobotics.com/wp-content/uploads/Project-Folder-1024x249.png 1024w" sizes="auto, (max-width: 460px) 100vw, 460px" /></p>
<p><span style="font-family: Calibri,sans-serif;">All of the files for the project will be shown in the sidebar. <b>Any library that is to be included in the code must be added to this folder </b>, all added libraries will show up under this.</span></p>
<p><span style="font-family: Calibri,sans-serif;">Once the code is ready to be uploaded, click on flash. The status will display success once uploaded.</span></p>
<p align="left"><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-1129" src="http://learn.edwinrobotics.com/wp-content/uploads/success.png" alt="" width="1700" height="52" srcset="https://learn.edwinrobotics.com/wp-content/uploads/success.png 1700w, https://learn.edwinrobotics.com/wp-content/uploads/success-300x9.png 300w, https://learn.edwinrobotics.com/wp-content/uploads/success-1024x31.png 1024w" sizes="auto, (max-width: 1700px) 100vw, 1700px" /></p>
]]></content:encoded>
					
					<wfw:commentRss>https://learn.edwinrobotics.com/getting-started-with-the-particle-photon/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>230v/110v AC Mains Detection Module Hookup Guide</title>
		<link>https://learn.edwinrobotics.com/230v110v-ac-mains-detection-using-arduino-raspberry-pi-and-esp8266-thing/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=230v110v-ac-mains-detection-using-arduino-raspberry-pi-and-esp8266-thing</link>
					<comments>https://learn.edwinrobotics.com/230v110v-ac-mains-detection-using-arduino-raspberry-pi-and-esp8266-thing/#comments</comments>
		
		<dc:creator><![CDATA[Abhishek Nair]]></dc:creator>
		<pubDate>Mon, 29 Aug 2016 14:43:22 +0000</pubDate>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[ESP8266]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Home Appliance]]></category>
		<category><![CDATA[IOT]]></category>
		<category><![CDATA[Particle Photon]]></category>
		<category><![CDATA[Raspberry Pi]]></category>
		<category><![CDATA[Wireless]]></category>
		<guid isPermaLink="false">http://learn.edwinrobotics.com/?p=692</guid>

					<description><![CDATA[<img width="6000" height="4000" src="https://learn.edwinrobotics.com/wp-content/uploads/Isometric-2.jpg" class="attachment- size- wp-post-image" alt="AC Line detector using optocoupler" style="float:left; margin:0 15px 15px 0;" decoding="async" loading="lazy" srcset="https://learn.edwinrobotics.com/wp-content/uploads/Isometric-2.jpg 6000w, https://learn.edwinrobotics.com/wp-content/uploads/Isometric-2-300x200.jpg 300w, https://learn.edwinrobotics.com/wp-content/uploads/Isometric-2-1024x683.jpg 1024w, https://learn.edwinrobotics.com/wp-content/uploads/Isometric-2-1080x720.jpg 1080w, https://learn.edwinrobotics.com/wp-content/uploads/Isometric-2-140x94.jpg 140w" sizes="auto, (max-width: 6000px) 100vw, 6000px" />Want to check if you left your lights ON remotely, need to detect the zero crossing point for your dimming circuit or do you just need to interface a 230V signal to your Arduino? The AC Mains Detector board simplifies interfacing high voltage signals by giving a digital output when an AC voltage is detected. [&#8230;]]]></description>
										<content:encoded><![CDATA[<img width="6000" height="4000" src="https://learn.edwinrobotics.com/wp-content/uploads/Isometric-2.jpg" class="attachment- size- wp-post-image" alt="AC Line detector using optocoupler" style="float:left; margin:0 15px 15px 0;" decoding="async" loading="lazy" srcset="https://learn.edwinrobotics.com/wp-content/uploads/Isometric-2.jpg 6000w, https://learn.edwinrobotics.com/wp-content/uploads/Isometric-2-300x200.jpg 300w, https://learn.edwinrobotics.com/wp-content/uploads/Isometric-2-1024x683.jpg 1024w, https://learn.edwinrobotics.com/wp-content/uploads/Isometric-2-1080x720.jpg 1080w, https://learn.edwinrobotics.com/wp-content/uploads/Isometric-2-140x94.jpg 140w" sizes="auto, (max-width: 6000px) 100vw, 6000px" /><p>Want to check if you left your lights ON remotely, need to detect the zero crossing point for your dimming circuit or do you just need to interface a 230V signal to your Arduino? The AC Mains Detector board simplifies interfacing high voltage signals by giving a digital output when an AC voltage is detected. By disabling the on board capacitor, zero crossing detection is possible as well.</p>
<div id="attachment_2054" style="width: 510px" class="wp-caption aligncenter"><a href="https://shop.edwinrobotics.com/sensors/960-ac-line-detection-module.html" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2054" class="wp-image-2054" src="http://learn.edwinrobotics.com/wp-content/uploads/Iso.jpg" alt="AC line detection using optocoupler, diode and rectifer" width="500" height="500" srcset="https://learn.edwinrobotics.com/wp-content/uploads/Iso.jpg 1500w, https://learn.edwinrobotics.com/wp-content/uploads/Iso-150x150.jpg 150w, https://learn.edwinrobotics.com/wp-content/uploads/Iso-300x300.jpg 300w, https://learn.edwinrobotics.com/wp-content/uploads/Iso-1024x1024.jpg 1024w, https://learn.edwinrobotics.com/wp-content/uploads/Iso-1080x1080.jpg 1080w, https://learn.edwinrobotics.com/wp-content/uploads/Iso-184x184.jpg 184w" sizes="auto, (max-width: 500px) 100vw, 500px" /></a><p id="caption-attachment-2054" class="wp-caption-text"><em>AC Line detection Module</em></p></div>
<p>You can buy this item from the following links:</p>
<p><strong>Within GCC</strong>: <a href="https://shop.edwinrobotics.com/sensors/960-ac-mains-zero-crossing-detection-module.html" target="_blank" rel="noopener">Edwin Robotics</a></p>
<p><strong>International Order</strong>: <a href="https://www.tindie.com/products/edwinrobotics/ac-mains-zero-crossing-detector/" target="_blank" rel="noopener">Tindie</a></p>
<p><a href="https://www.tindie.com/stores/edwinrobotics/?ref=offsite_badges&amp;utm_source=sellers_edwinrobotics&amp;utm_medium=badges&amp;utm_campaign=badge_medium"><img loading="lazy" decoding="async" src="https://d2ss6ovg47m0r5.cloudfront.net/badges/tindie-mediums.png" alt="I sell on Tindie" width="150" height="78" /></a></p>
<p>Let us have a look at the guide contents, refer to the list below:</p>
<ul>
<li>
<h4><a href="#Step1">Components</a></h4>
</li>
<li>
<h4><a href="#Step8">Board Pinouts</a></h4>
</li>
<li>
<h4><a href="#Step2">Circuit Schematics </a></h4>
</li>
<li>
<h4><a href="#Step4">Interfacing with Arduino</a></h4>
</li>
<li>
<h4><a href="#Step7">Zero Crossing detection using Arduino</a></h4>
</li>
</ul>
<p>&nbsp;</p>
<h1 id="Step1"><strong>Components</strong></h1>

<table id="tablepress-24" class="tablepress tablepress-id-24">
<tbody>
<tr class="row-1">
	<td class="column-1"><div id="attachment_2055" style="width: 160px" class="wp-caption aligncenter"><a href="https://shop.edwinrobotics.com/sensors/960-ac-line-detection-module.html"target="_blank"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2055" src="http://learn.edwinrobotics.com/wp-content/uploads/AC-Line-Detector_Side-150x150.jpg" alt="AC LINE MONITOR LOGIC-OUT MODULE" width="150" height="150" class="size-thumbnail wp-image-2055" srcset="https://learn.edwinrobotics.com/wp-content/uploads/AC-Line-Detector_Side-150x150.jpg 150w, https://learn.edwinrobotics.com/wp-content/uploads/AC-Line-Detector_Side-300x300.jpg 300w, https://learn.edwinrobotics.com/wp-content/uploads/AC-Line-Detector_Side-1024x1024.jpg 1024w, https://learn.edwinrobotics.com/wp-content/uploads/AC-Line-Detector_Side-1080x1080.jpg 1080w, https://learn.edwinrobotics.com/wp-content/uploads/AC-Line-Detector_Side-184x184.jpg 184w, https://learn.edwinrobotics.com/wp-content/uploads/AC-Line-Detector_Side.jpg 1300w" sizes="auto, (max-width: 150px) 100vw, 150px" /></a><p id="caption-attachment-2055" class="wp-caption-text">AC Line detection Module</p></div></td><td class="column-2"><div id="attachment_241" style="width: 160px" class="wp-caption aligncenter"><a href="https://shop.edwinrobotics.com/boards/75-arduino-uno-r3.html"target="_blank"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-241" src="http://learn.edwinrobotics.com/wp-content/uploads/2016/05/UNO-150x150.jpg" alt="Arduino UNO Microcontroller board" width="150" height="150" class="size-thumbnail wp-image-241" srcset="https://learn.edwinrobotics.com/wp-content/uploads/2016/05/UNO-150x150.jpg 150w, https://learn.edwinrobotics.com/wp-content/uploads/2016/05/UNO-184x184.jpg 184w" sizes="auto, (max-width: 150px) 100vw, 150px" /></a><p id="caption-attachment-241" class="wp-caption-text">Arduino UNO</p></div></td><td class="column-3"><div id="attachment_1571" style="width: 160px" class="wp-caption aligncenter"><a href="https://shop.edwinrobotics.com/prototyping/19-male-female-jumper-wires-pack-of-10.html"target="_blank"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1571" src="http://learn.edwinrobotics.com/wp-content/uploads/179-2-150x150.jpg" alt="Arduino Jumper wires" width="150" height="150" class="size-thumbnail wp-image-1571" srcset="https://learn.edwinrobotics.com/wp-content/uploads/179-2-150x150.jpg 150w, https://learn.edwinrobotics.com/wp-content/uploads/179-2-300x300.jpg 300w, https://learn.edwinrobotics.com/wp-content/uploads/179-2-184x184.jpg 184w, https://learn.edwinrobotics.com/wp-content/uploads/179-2.jpg 600w" sizes="auto, (max-width: 150px) 100vw, 150px" /></a><p id="caption-attachment-1571" class="wp-caption-text">Male-Female Jumper wires</p></div></td>
</tr>
</tbody>
</table>
<!-- #tablepress-24 from cache -->
<p>&nbsp;</p>
<h1 id="Step8"><strong>Board Pinouts</strong></h1>

<table id="tablepress-25" class="tablepress tablepress-id-25">
<tbody>
<tr class="row-1">
	<td class="column-1"><div id="attachment_2066" style="width: 310px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2066" src="http://learn.edwinrobotics.com/wp-content/uploads/PCB-TOP-Pins-300x300.jpg" alt="AC Detection Board for industrial application" width="300" height="300" class="size-medium wp-image-2066" srcset="https://learn.edwinrobotics.com/wp-content/uploads/PCB-TOP-Pins-300x300.jpg 300w, https://learn.edwinrobotics.com/wp-content/uploads/PCB-TOP-Pins-150x150.jpg 150w, https://learn.edwinrobotics.com/wp-content/uploads/PCB-TOP-Pins-184x184.jpg 184w, https://learn.edwinrobotics.com/wp-content/uploads/PCB-TOP-Pins.jpg 1000w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p id="caption-attachment-2066" class="wp-caption-text">Top Side</p></div></td><td class="column-2"><div id="attachment_2092" style="width: 310px" class="wp-caption aligncenter"><a href="http://learn.edwinrobotics.com/wp-content/uploads/Bottom-jumper.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2092" src="http://learn.edwinrobotics.com/wp-content/uploads/Bottom-jumper-300x300.jpg" alt="AC mains zero crossing detection" width="300" height="300" class="size-medium wp-image-2092" srcset="https://learn.edwinrobotics.com/wp-content/uploads/Bottom-jumper-300x300.jpg 300w, https://learn.edwinrobotics.com/wp-content/uploads/Bottom-jumper-150x150.jpg 150w, https://learn.edwinrobotics.com/wp-content/uploads/Bottom-jumper-184x184.jpg 184w, https://learn.edwinrobotics.com/wp-content/uploads/Bottom-jumper.jpg 1000w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a><p id="caption-attachment-2092" class="wp-caption-text">Bottom Side</p></div></td>
</tr>
</tbody>
</table>
<!-- #tablepress-25 from cache -->
<ul>
<li><strong>AC-IN &#8211; </strong>Connect the AC line that needs to be detected here.</li>
<li><strong>&#8211;</strong> (negative sign) &#8211; Connect to ground of microcontroller</li>
<li><strong>+</strong> (positive sign) &#8211; Connect to VCC of microcontroller <strong>in case external pull-up is required</strong></li>
<li><strong>S</strong> &#8211; Connect to a digital/interrupt pin of microcontroller</li>
</ul>
<p><strong>Note: Working with AC voltages is DANGEROUS, care must be taken to prevent any short circuits or mistakes in connection. And as always, you are doing this project at your own risk and Edwin Robotics or the Author cannot be held liable for any damages.</strong></p>
<p>&nbsp;</p>
<h1 id="Step2"><strong>Circuit Schematics</strong></h1>
<p>The circuit consists of two main parts, first is the Bridge Rectifier (DB107) which converts the AC signal to DC and the second is the Optocoupler (LTV816), which provides isolation between High voltage(HV) side and Low Voltage (LV) Side.<a href="http://learn.edwinrobotics.com/wp-content/uploads/Schematics_LTV816_updated.png"><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-2115" src="http://learn.edwinrobotics.com/wp-content/uploads/Schematics_LTV816_updated.png" alt="AC line Detection Schematics and Circuit" width="1121" height="275" srcset="https://learn.edwinrobotics.com/wp-content/uploads/Schematics_LTV816_updated.png 1121w, https://learn.edwinrobotics.com/wp-content/uploads/Schematics_LTV816_updated-300x74.png 300w, https://learn.edwinrobotics.com/wp-content/uploads/Schematics_LTV816_updated-1024x251.png 1024w, https://learn.edwinrobotics.com/wp-content/uploads/Schematics_LTV816_updated-1080x265.png 1080w" sizes="auto, (max-width: 1121px) 100vw, 1121px" /></a></p>
<p>&nbsp;</p>
<p>A pull-up resistor is provided for use with microcontrollers (e.g. ESP8266) that do not have an internal pullup resistor.</p>
<p>&nbsp;</p>
<h1 id="Step4"><strong>Interfacing with Arduino</strong></h1>
<p>The hardware connections are pretty straightforward. On the low voltage side the + (positive symbol) goes to VCC of microcontroller, &#8211; (negative symbol) goes to GND and S goes any digital/interrupt pin. On the high voltage side, the AC lines are connected.</p>
<div id="attachment_2078" style="width: 510px" class="wp-caption aligncenter"><a href="http://learn.edwinrobotics.com/wp-content/uploads/PCB_Arduino.jpg" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2078" class="wp-image-2078" src="http://learn.edwinrobotics.com/wp-content/uploads/PCB_Arduino.jpg" alt="AC Line detection using arduino" width="500" height="500" srcset="https://learn.edwinrobotics.com/wp-content/uploads/PCB_Arduino.jpg 1300w, https://learn.edwinrobotics.com/wp-content/uploads/PCB_Arduino-150x150.jpg 150w, https://learn.edwinrobotics.com/wp-content/uploads/PCB_Arduino-300x300.jpg 300w, https://learn.edwinrobotics.com/wp-content/uploads/PCB_Arduino-1024x1024.jpg 1024w, https://learn.edwinrobotics.com/wp-content/uploads/PCB_Arduino-1080x1080.jpg 1080w, https://learn.edwinrobotics.com/wp-content/uploads/PCB_Arduino-184x184.jpg 184w" sizes="auto, (max-width: 500px) 100vw, 500px" /></a><p id="caption-attachment-2078" class="wp-caption-text"><em>Arduino Connections</em></p></div>
<p>In this example, Pin 2 on the arduino is used in this example as it can be used as an interrupt pin as well.</p>
<p>Sample Code:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="c" data-enlighter-theme="atomic">#define Signal_Pin 2  // Modify this pin as per your connection

void setup() {
  pinMode(Signal_Pin , INPUT_PULLUP);
  Serial.begin(9600);
}

void loop() {
  if ( digitalRead(Signal_Pin) == 0 )
    Serial.println (" AC Mains 230v Detected ");
}
</pre>
<p>&nbsp;</p>
<p><strong>Note: Do not touch the PCB once powered, you can get electrocuted. Keep it away from reach of humans/Animals. Make sure that there are no shorted wires, when connecting the 230v AC mains supply.</strong></p>
<p>&nbsp;</p>
<h1 id="Step7"><strong>Zero Crossing Detection using Arduino</strong></h1>
<p>By default zero crossing detection is disabled by the use of a 2.2uF capacitor, in order to use the board for zero crossing detection the capacitor needs to be bypassed by cutting the trace shown below. It can be resoldered at any time later to disable zero crossing:</p>
<div id="attachment_2072" style="width: 510px" class="wp-caption aligncenter"><a href="http://learn.edwinrobotics.com/wp-content/uploads/zero-Crossing-PCB.jpg" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2072" class="wp-image-2072" src="http://learn.edwinrobotics.com/wp-content/uploads/zero-Crossing-PCB.jpg" alt="Zero crossing detection using AC line detector module" width="500" height="500" srcset="https://learn.edwinrobotics.com/wp-content/uploads/zero-Crossing-PCB.jpg 1000w, https://learn.edwinrobotics.com/wp-content/uploads/zero-Crossing-PCB-150x150.jpg 150w, https://learn.edwinrobotics.com/wp-content/uploads/zero-Crossing-PCB-300x300.jpg 300w, https://learn.edwinrobotics.com/wp-content/uploads/zero-Crossing-PCB-184x184.jpg 184w" sizes="auto, (max-width: 500px) 100vw, 500px" /></a><p id="caption-attachment-2072" class="wp-caption-text"><em>Modify the jumper</em></p></div>
<p>The Arduino connection will be same as before, upload the following code and view the output on Serial Monitor at 9600 baud rate:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="atomic">#define Signal_Pin 2 //Use Arduino Pin 2 or pin 3, both supports hardware interrupt
int counter=0;

void setup()
{
  pinMode(Signal_Pin , INPUT_PULLUP);
  Serial.begin(9600);
  attachInterrupt(0, zero_crosss_int, RISING);  // Choose the zero cross interrupt # from the table above
}

void zero_crosss_int()  // function to be fired at the zero crossing to dim the light
{
  counter++;
}

void loop()
{
  Serial.println(counter);
}
</pre>
<p>&nbsp;</p>
<p>You can see that the counter value increases with every cycle of AC line and the moment you turn off the AC line, the counter Stops as well.</p>
<p>&nbsp;</p>
<h1><strong>References:</strong></h1>
<ul>
<li><a href="http://www.rectron.com/data_sheets/db101-107.pdf" target="_blank" rel="noopener">DB107 Rectifier Datasheet</a></li>
<li><a href="http://datasheet.octopart.com/LTV-816S-Lite-On-datasheet-26684805.pdf" target="_blank" rel="noopener">LTV-816 Datasheet</a></li>
</ul>
]]></content:encoded>
					
					<wfw:commentRss>https://learn.edwinrobotics.com/230v110v-ac-mains-detection-using-arduino-raspberry-pi-and-esp8266-thing/feed/</wfw:commentRss>
			<slash:comments>54</slash:comments>
		
		
			</item>
		<item>
		<title>Micro OLED Hookup guide for ESP8266 and Particle Photon</title>
		<link>https://learn.edwinrobotics.com/micro-oled-hookup-guide-for-esp8266-and-particle-photon/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=micro-oled-hookup-guide-for-esp8266-and-particle-photon</link>
					<comments>https://learn.edwinrobotics.com/micro-oled-hookup-guide-for-esp8266-and-particle-photon/#comments</comments>
		
		<dc:creator><![CDATA[Abhishek Nair]]></dc:creator>
		<pubDate>Sun, 22 May 2016 14:18:12 +0000</pubDate>
				<category><![CDATA[Display]]></category>
		<category><![CDATA[ESP8266]]></category>
		<category><![CDATA[OLED]]></category>
		<category><![CDATA[Particle Photon]]></category>
		<guid isPermaLink="false">http://learn.edwinrobotics.com/?p=284</guid>

					<description><![CDATA[<img width="6000" height="4000" src="https://learn.edwinrobotics.com/wp-content/uploads/OLED_cover.jpg" class="attachment- size- wp-post-image" alt="" style="float:left; margin:0 15px 15px 0;" decoding="async" loading="lazy" srcset="https://learn.edwinrobotics.com/wp-content/uploads/OLED_cover.jpg 6000w, https://learn.edwinrobotics.com/wp-content/uploads/OLED_cover-300x200.jpg 300w, https://learn.edwinrobotics.com/wp-content/uploads/OLED_cover-1024x683.jpg 1024w, https://learn.edwinrobotics.com/wp-content/uploads/OLED_cover-140x94.jpg 140w" sizes="auto, (max-width: 6000px) 100vw, 6000px" />&#160; &#160; Introduction to Micro OLED Display &#160; An organic light-emitting diode (OLED) is a light-emitting diode (LED) in which the emissive electroluminescent layer is a film of organic compound that emits light in response to an electric current. This layer of organic semiconductor is situated between two electrodes typically and at least one of [&#8230;]]]></description>
										<content:encoded><![CDATA[<img width="6000" height="4000" src="https://learn.edwinrobotics.com/wp-content/uploads/OLED_cover.jpg" class="attachment- size- wp-post-image" alt="" style="float:left; margin:0 15px 15px 0;" decoding="async" loading="lazy" srcset="https://learn.edwinrobotics.com/wp-content/uploads/OLED_cover.jpg 6000w, https://learn.edwinrobotics.com/wp-content/uploads/OLED_cover-300x200.jpg 300w, https://learn.edwinrobotics.com/wp-content/uploads/OLED_cover-1024x683.jpg 1024w, https://learn.edwinrobotics.com/wp-content/uploads/OLED_cover-140x94.jpg 140w" sizes="auto, (max-width: 6000px) 100vw, 6000px" /><h1 style="text-align: left; padding-left: 210px;"><a href="http://learn.edwinrobotics.com/wp-content/uploads/OLED.png" target="_blank" rel="noopener noreferrer"><img loading="lazy" decoding="async" class="alignnone wp-image-321 size-medium" src="http://learn.edwinrobotics.com/wp-content/uploads/OLED-184x300.png" alt="OLED" width="184" height="300" srcset="https://learn.edwinrobotics.com/wp-content/uploads/OLED-184x300.png 184w, https://learn.edwinrobotics.com/wp-content/uploads/OLED-627x1024.png 627w, https://learn.edwinrobotics.com/wp-content/uploads/OLED.png 911w" sizes="auto, (max-width: 184px) 100vw, 184px" /></a></h1>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h1 style="text-align: left;"><strong>Introduction to Micro OLED Display</strong></h1>
<p>&nbsp;</p>
<p>An organic light-emitting diode (OLED) is a light-emitting diode (LED) in which the emissive electroluminescent layer is a film of organic compound that emits light in response to an electric current. This layer of organic semiconductor is situated between two electrodes typically and at least one of these electrodes is transparent.</p>
<p>The Micro OLED Display used in this tutorial is a small monochrome, blue-on-black OLED. It’s 64 pixels wide and 48 pixels tall, measuring 0.66&#8243; across. It’s micro sized and sufficient enough to fit a deceivingly large amount of graphics on there. this Micro OLED is easy to control over either an SPI or I<sup>2</sup>C interface.</p>
<p>Sparkfun have the breakout board for this display, its easy and time saving to use the same breakout for any projects.This Micro OLED Breakout provides access to 16 of the OLED’s pins. This breakout board operates at 3.3V with a current of 10mA (20mA max).The Micro OLED present in this breakout is same as  Display used in the <a href="http://shop.edwinrobotics.com/displays/118-sparkfun-microview-oled-arduino-module.html" target="_blank" rel="noopener noreferrer">SparkFun MicroView &#8211; OLED Arduino Module</a>.</p>
<p>The breakout board is an open source design and you can get the design files <a href="https://github.com/sparkfun/Micro_OLED_Breakout/tree/V_1.0">here</a></p>
<p>&nbsp;</p>
<p><strong>Display board Features:</strong></p>
<ul>
<li>Operating Voltage: 3.3V</li>
<li>Screen Size: 64&#215;48 pixels (0.66&#8243; Across)</li>
<li>Monochrome Blue-on-Black</li>
<li>SPI or I<sup>2</sup>C Interface</li>
</ul>
<p>&nbsp;</p>
<p><strong>OLED Pin Reference:</strong></p>
<blockquote>
<h5 style="text-align: left;"></h5>
<table class="pin_table" style="height: 447px;" width="538">
<tbody>
<tr>
<th>Pin Label</th>
<th>SPI Function</th>
<th>I<sup>2</sup>C Function</th>
<th>Notes</th>
</tr>
<tr>
<td style="text-align: center;">GND</td>
<td style="text-align: center;">Ground</td>
<td style="text-align: center;">Ground</td>
<td style="text-align: center;">0V</td>
</tr>
<tr>
<td style="text-align: center;">3V3 (VDD)</td>
<td style="text-align: center;">Power</td>
<td style="text-align: center;">Power</td>
<td style="text-align: center;">Should be a regulated 3.3V supply.</td>
</tr>
<tr>
<td style="text-align: center;">D1 (SDI)</td>
<td style="text-align: center;">MOSI</td>
<td style="text-align: center;">SDA</td>
<td style="text-align: center;">Serial data in</td>
</tr>
<tr>
<td style="text-align: center;">D0 (SCK)</td>
<td style="text-align: center;">SCK</td>
<td style="text-align: center;">SCL</td>
<td style="text-align: center;">SPI and I<sup>2</sup>C clock</td>
</tr>
<tr>
<td style="text-align: center;">D2 (SDO)</td>
<td style="text-align: center;">MISO</td>
<td style="text-align: center;">—</td>
<td style="text-align: center;">Can be unused in SPI mode. No function for I<sup>2</sup>C.</td>
</tr>
<tr>
<td style="text-align: center;">D/C</td>
<td style="text-align: center;">Data/Command</td>
<td style="text-align: center;">I<sup>2</sup>C address selection</td>
<td style="text-align: center;">Digital pin to signal if incoming byte is a command or screen data.</td>
</tr>
<tr>
<td style="text-align: center;">RST</td>
<td style="text-align: center;">Reset</td>
<td style="text-align: center;">Reset</td>
<td style="text-align: center;">Active-low screen reset.</td>
</tr>
<tr>
<td style="text-align: center;">CS</td>
<td style="text-align: center;">CS</td>
<td style="text-align: center;">—</td>
<td style="text-align: center;">SPI chip select (active-low)</td>
</tr>
</tbody>
</table>
</blockquote>
<p><span style="line-height: 1.5;">Sparkfun has provided detailed hookup guide on their blog to setup the OLED breakout board.Follow the links below to see the detailed Instructions.</span></p>
<ul>
<li><a href="https://learn.sparkfun.com/tutorials/micro-oled-breakout-hookup-guide#breakout-board-overview" target="_blank" rel="noopener noreferrer">Breakout Board Overview</a></li>
<li><a href="https://learn.sparkfun.com/tutorials/micro-oled-breakout-hookup-guide#hardware-assembly" target="_blank" rel="noopener noreferrer">Hardware Assembly</a></li>
<li><a href="https://learn.sparkfun.com/tutorials/micro-oled-breakout-hookup-guide#hardware-hookup" target="_blank" rel="noopener noreferrer">Hardware Hookup</a></li>
<li><a href="https://learn.sparkfun.com/tutorials/micro-oled-breakout-hookup-guide#arduino-library-download-install-and-test" target="_blank" rel="noopener noreferrer">Arduino Library Download, Install, and Test</a></li>
<li><a href="https://learn.sparkfun.com/tutorials/micro-oled-breakout-hookup-guide#using-the-arduino-library" target="_blank" rel="noopener noreferrer">Using the Arduino Library</a></li>
</ul>
<p>When we tested the board with Sparkfun library we faced some issue with displaying text, thus we made changes to library and sorted out the issue. The library is available to download from GitHub, <a href="https://github.com/EdwinRobotics/ER_Micro_OLED_Arduino_Library/archive/GSlibrary.zip" target="_blank" rel="noopener noreferrer">Click here</a> to download the library.</p>
<p>When you use this Library, make sure you either replace the Sparkfun library or remove and make a backup of the Sparkfun library from the Arduino.</p>
<p>The hookup guide to setup the Micro OLED display with different boards can be found below:</p>
<ul>
<li><a href="#Step1">Micro OLED Breakout Hookup with ESP8266 </a></li>
<li><span style="color: #333333;"><a href="#Step2">Micro OLED Breakout Hookup with Particle Photon</a></span></li>
</ul>
<h1 style="text-align: justify;"></h1>
<h1 id="Step1" style="text-align: justify;"><strong>Micro OLED Breakout Hookup with ESP8266</strong></h1>
<p>&nbsp;</p>
<p>The ESP8266 is a low-cost Wi-Fi chip with full TCP/IP stack and Microcontroller capability produced by Shanghai-based Chinese manufacturer, Espressif. There are many third party modules With ESP8266 available in the market and you can decide which one suits best for your application, we are using the Sprakfun ESP8266 Thing in this tutorial.</p>
<p><a href="https://cdn.sparkfun.com//assets/parts/1/0/4/0/0/13231-04.jpg" target="_blank" rel="noopener noreferrer"><img loading="lazy" decoding="async" class="alignnone" src="https://cdn.sparkfun.com//assets/parts/1/0/4/0/0/13231-04.jpg" width="600" height="600" /></a></p>
<p>The SparkFun ESP8266 Thing is a breakout and development board for the ESP8266 WiFi SoC – a leading platform for Internet of Things (IoT) or WiFi-related projects. These are some features of the board:</p>
<p>&nbsp;</p>
<h2>ESP8266 Thing Features:</h2>
<h2></h2>
<ul>
<li>All module pins broken out</li>
<li>On-board LiPo charger/power supply</li>
<li>802.11 b/g/n</li>
<li>Wi-Fi Direct (P2P), soft-AP</li>
<li>Integrated TCP/IP protocol stack</li>
<li>Integrated TR switch, balun, LNA, power amplifier and matching network</li>
<li>Integrated PLLs, regulators, DCXO and power management units</li>
<li>Integrated low power 32-bit CPU could be used as application processor</li>
<li>+19.5dBm output power in 802.11b mode</li>
<li>Arduino IDE integration</li>
<li>Breadboard Compatible Breakout Headers position</li>
<li>Power On-Off Switch</li>
<li>Status LED</li>
<li>Operating Voltage: 3.3v</li>
</ul>
<p>Refer the Graphical Datasheet for hardware description</p>
<p><a href="http://learn.edwinrobotics.com/wp-content/uploads/ESP8266ThingV1-page-001.jpg" target="_blank" rel="noopener noreferrer"><img loading="lazy" decoding="async" class="alignnone wp-image-313 size-full" src="http://learn.edwinrobotics.com/wp-content/uploads/ESP8266ThingV1-page-001.jpg" alt="ESP8266ThingV1-page-001" width="3300" height="2550" srcset="https://learn.edwinrobotics.com/wp-content/uploads/ESP8266ThingV1-page-001.jpg 3300w, https://learn.edwinrobotics.com/wp-content/uploads/ESP8266ThingV1-page-001-300x232.jpg 300w, https://learn.edwinrobotics.com/wp-content/uploads/ESP8266ThingV1-page-001-1024x791.jpg 1024w" sizes="auto, (max-width: 3300px) 100vw, 3300px" /></a></p>
<p>&nbsp;</p>
<h2>Programming the Thing:</h2>
<p>The ESP8266 has a built-in serial bootloader, which allows for easy programming and re-programming. You don’t need a specialized, expensive programmer – just a simple, USB-to-Serial converter.</p>
<p>We use a 3.3V FTDI Basic to program the Thing, but other serial converters with 3.3V I/O levels should work. The converter does need a DTR line in addition to the RX and TX pins.The FTDI Basic’s 6-pin header matches up exactly to the Thing’s 6-pin serial port header. To set up for programming, simply connect the FTDI directly to this port – take care to match up the DTR and GND pins!</p>
<p style="padding-left: 150px;"><a href="http://learn.edwinrobotics.com/wp-content/uploads/s.jpg" target="_blank" rel="noopener noreferrer"><img loading="lazy" decoding="async" class="alignnone wp-image-318 size-medium" src="http://learn.edwinrobotics.com/wp-content/uploads/s-300x300.jpg" alt="s" width="300" height="300" srcset="https://learn.edwinrobotics.com/wp-content/uploads/s-300x300.jpg 300w, https://learn.edwinrobotics.com/wp-content/uploads/s-150x150.jpg 150w, https://learn.edwinrobotics.com/wp-content/uploads/s-184x184.jpg 184w, https://learn.edwinrobotics.com/wp-content/uploads/s.jpg 600w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p><b>Note:</b> While programming the Thing, it&#8217;s best to power it off USB. We&#8217;ve noticed programming is more likely to fail if the Thing is only powered via the battery.</p>
<p>Now we will see how to connect the ESP8266 Thing with Micro OLED Breakout in I<sup>2</sup>C Mode:</p>
<ul>
<li>Setup the jumpers in the Hardware</li>
</ul>
<blockquote><p><strong>Setting Jumpers for I<span style="font-size: 13.3333px; line-height: 20px;">2</span>C Mode:</strong></p>
<ul>
<li><strong>Short D1/D2</strong> – This will combine the data output line and data input line into one.</li>
<li><strong>Set BS1 to 1</strong> – The BS1 jumpers comes defaulted to 0, which does half the job of setting it to SPI. To set the display to I<span style="font-size: 13.3333px; line-height: 20px;">2</span>C, you’ll need to flip that jumper to 1. Also make sure the BS2 jumper remains set to 0.</li>
<li><strong>Set D/C</strong> – In I<span style="font-size: 13.3333px; line-height: 20px;">2</span>C mode, the D/C pin configures the display’s 7-bit address. You can set it to either 0 or 1, just keep that value in mind when you get to the code part of this tutorial.</li>
</ul>
</blockquote>
<p>Once you’re done setting jumpers, the back of the board should look a little something like this:</p>
<p><a href="https://cdn.sparkfun.com/assets/learn_tutorials/3/0/8/Micro_LED_Tutorial-06.jpg" target="_blank" rel="noopener noreferrer"><img loading="lazy" decoding="async" class="alignnone" src="https://cdn.sparkfun.com/assets/learn_tutorials/3/0/8/Micro_LED_Tutorial-06.jpg" width="1000" height="1000" /></a></p>
<p><a href="http://learn.edwinrobotics.com/wp-content/uploads/ESp-OLED.png" target="_blank" rel="noopener noreferrer"><img loading="lazy" decoding="async" class="alignnone wp-image-328 size-full" src="http://learn.edwinrobotics.com/wp-content/uploads/ESp-OLED.png" alt="ESp-OLED" width="1134" height="1134" srcset="https://learn.edwinrobotics.com/wp-content/uploads/ESp-OLED.png 1134w, https://learn.edwinrobotics.com/wp-content/uploads/ESp-OLED-150x150.png 150w, https://learn.edwinrobotics.com/wp-content/uploads/ESp-OLED-300x300.png 300w, https://learn.edwinrobotics.com/wp-content/uploads/ESp-OLED-1024x1024.png 1024w, https://learn.edwinrobotics.com/wp-content/uploads/ESp-OLED-184x184.png 184w" sizes="auto, (max-width: 1134px) 100vw, 1134px" /></a></p>
<p>Follow the above shown connections for I2C interface between OLED and ESP8266 Thing. Any Digital pin can be connected to RST(Reset) Pin of OLED, we used Pin number 5 from the ESP8266 Thing.</p>
<p>&nbsp;</p>
<p><strong>Note: </strong>Pin 5 on the ESP8266 Thing is connected to onboard LED, we tampered the tracks to LED to disable it.</p>
<p>Try out the following code on the ESP8266 Things and check whether your board is working fine or not, We used the modified library (The <a href="https://github.com/EdwinRobotics/ER_Micro_OLED_Arduino_Library/archive/GSlibrary.zip" target="_blank" rel="noopener noreferrer">link</a> to download the library is mentioned above), make sure you must use the same to made it work.</p>
<blockquote><p>#include &lt;Wire.h&gt; <span style="color: #00ccff;">//Include Wire if you&#8217;re using I2C</span><br />
<span style="color: #00ccff;">//#include &lt;SPI.h&gt; // Include SPI if you&#8217;re using SPI</span><br />
#include &lt;ER_MicroOLED.h&gt; <span style="color: #00ccff;">// Include the ER_MicroOLED library</span><br />
#define PIN_RESET 5 <span style="color: #00ccff;">// Connect RST to pin 9 (req. for SPI and I2C)</span><br />
<span style="color: #00ccff;">//#define PIN_DC 8 // Connect DC to pin 8 (required for SPI)</span><br />
<span style="color: #00ccff;">//#define PIN_CS 10 // Connect CS to pin 10 (required for SPI)</span><br />
#define DC_JUMPER 1<br />
<span style="color: #00ccff;">// Also connect pin 13 to SCK and pin 11 to MOSI</span><br />
<span style="color: #00ccff;"> // Declare a MicroOLED object. The parameters include:</span><br />
<span style="color: #00ccff;"> // 1 &#8211; Reset pin: Any digital pin</span><br />
<span style="color: #00ccff;"> // 2 &#8211; D/C pin: Any digital pin (SPI mode only)</span><br />
<span style="color: #00ccff;"> // 3 &#8211; CS pin: Any digital pin (SPI mode only, 10 recommended)</span><br />
<span style="color: #00ccff;"> //MicroOLED oled(PIN_RESET, PIN_DC, PIN_CS);</span><br />
MicroOLED oled(PIN_RESET, DC_JUMPER); <span style="color: #00ccff;">// Example I2C declaration</span></p>
<p>void setup()<br />
{<br />
oled.begin();</p>
<p><span style="color: #00ccff;">// clear(ALL) will clear out the OLED&#8217;s graphic memory.</span><br />
<span style="color: #00ccff;"> // clear(PAGE) will clear the Arduino&#8217;s display buffer.</span><br />
oled.clear(ALL); <span style="color: #00ccff;">// Clear the display&#8217;s memory (gets rid of artifacts)</span><br />
<span style="color: #00ccff;">// To actually draw anything on the display, you must call the</span><br />
<span style="color: #00ccff;"> // display() function.</span><br />
oled.display();<br />
delay(2000);</p>
<p>oled.clear(PAGE);<br />
oled.clear(ALL);<br />
oled.setCursor(0,0);<br />
oled.setTextColor(WHITE);<br />
oled.setTextSize(0);</p>
<p>oled.println(&#8220;hello !!!!&#8221;);<br />
oled.display();<br />
}</p>
<p>void loop()<br />
{<br />
<span style="color: #00ccff;">//oled.line(x0, y0, x1, y1); // Draw a line from (x0,y0) to (x1,y1);</span><br />
oled.line(5, 15, 57, 15); <span style="color: #00ccff;">// Draw a line from (x0,y0) to (x1,y1);</span></p>
<p><span style="color: #00ccff;">//oled.rect(x0, y0, width, height); // Draw a rectange from (7,5) to (31,18)</span><br />
oled.rect(5, 20, 52, 20); <span style="color: #00ccff;">// Draw a rectange from (7,5) to (31,18)</span></p>
<p>oled.line(5, 45, 57, 45); <span style="color: #00ccff;">// Draw a line from (x0,y0) to (x1,y1);</span></p>
<p><span style="color: #00ccff;">//oled.rectFill(7, 5, 35, 5); // Fill a rectangle from (7, 5) to (42, 10)</span><br />
oled.rectFill(10, 25, 42, 10); <span style="color: #00ccff;">// Fill a rectangle from (7, 5) to (42, 10)</span></p>
<p><span style="color: #00ccff;">//oled.circleFill(42, 20, 7); // Fill a circle, 7 radius, centered at (42, 20)</span></p>
<p>oled.display(); // Draw to the screen<br />
}</p></blockquote>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h1 id="Step2" style="text-align: justify;"><strong>Micro OLED Hookup with Particle Photon</strong></h1>
<p>&nbsp;</p>
<p>The <a href="http://shop.edwinrobotics.com/particle/77-particle-photon.html" target="_blank" rel="noopener noreferrer">Photon</a> is a development kit for creating Wi-Fi connected products. It&#8217;s based on Broadcom&#8217;s WICED architecture, and combines a powerful STM32 ARM Cortex M3 microcontroller and a Broadcom Wi-Fi chip (the same one that&#8217;s in Nest Protect, LIFX, and Amazon Dash).</p>
<p style="padding-left: 150px;"><a href="http://learn.edwinrobotics.com/wp-content/uploads/temp.png" target="_blank" rel="noopener noreferrer"><img loading="lazy" decoding="async" class="alignnone wp-image-340 size-full" src="http://learn.edwinrobotics.com/wp-content/uploads/temp.png" alt="photon" width="293" height="521" srcset="https://learn.edwinrobotics.com/wp-content/uploads/temp.png 293w, https://learn.edwinrobotics.com/wp-content/uploads/temp-169x300.png 169w" sizes="auto, (max-width: 293px) 100vw, 293px" /></a></p>
<h2>Photon Features:</h2>
<ul class="fancy-list">
<li>Fits in a standard breadboard (with headers)</li>
<li>Surface mountable for machine assembly (without headers)</li>
<li>Backwards compatible with the Spark Core</li>
<li>Broadcom BCM43362 Wi-Fi chip</li>
<li>STM32F205 120Mhz ARM Cortex M3</li>
<li>1MB flash, 128KB RAM</li>
<li>802.11b/g/n</li>
<li>FCC/CE/IC certified</li>
<li>Open source hardware</li>
<li>On-board RGB status LED (ext. drive provided)</li>
<li>18 Mixed-signal GPIO and advanced peripherals</li>
<li>Real-time operating system (FreeRTOS)</li>
<li>Soft AP setup</li>
</ul>
<p>&nbsp;</p>
<table style="height: 281px;" width="586">
<thead>
<tr>
<th style="text-align: center;">Peripheral Type</th>
<th style="text-align: center;">Qty</th>
<th style="text-align: center;">Input(I) / Output(O)</th>
<th style="text-align: center;">FT<sup>[1]</sup> / 3V3<sup>[2]</sup></th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: center;">Digital</td>
<td style="text-align: center;">18</td>
<td style="text-align: center;">I/O</td>
<td style="text-align: center;">FT/3V3</td>
</tr>
<tr>
<td style="text-align: center;">Analog (ADC)</td>
<td style="text-align: center;">8</td>
<td style="text-align: center;">I</td>
<td style="text-align: center;">3V3</td>
</tr>
<tr>
<td style="text-align: center;">Analog (DAC)</td>
<td style="text-align: center;">2</td>
<td style="text-align: center;">O</td>
<td style="text-align: center;">3V3</td>
</tr>
<tr>
<td style="text-align: center;">SPI</td>
<td style="text-align: center;">2</td>
<td style="text-align: center;">I/O</td>
<td style="text-align: center;">3V3</td>
</tr>
<tr>
<td style="text-align: center;">I2S</td>
<td style="text-align: center;">1</td>
<td style="text-align: center;">I/O</td>
<td style="text-align: center;">3V3</td>
</tr>
<tr>
<td style="text-align: center;">I2C</td>
<td style="text-align: center;">1</td>
<td style="text-align: center;">I/O</td>
<td style="text-align: center;">FT</td>
</tr>
<tr>
<td style="text-align: center;">CAN</td>
<td style="text-align: center;">1</td>
<td style="text-align: center;">I/O</td>
<td style="text-align: center;">FT</td>
</tr>
<tr>
<td style="text-align: center;">USB</td>
<td style="text-align: center;">1</td>
<td style="text-align: center;">I/O</td>
<td style="text-align: center;">3V3</td>
</tr>
<tr>
<td style="text-align: center;">PWM</td>
<td style="text-align: center;">9<sup>[3]</sup></td>
<td style="text-align: center;">O</td>
<td style="text-align: center;">3V3</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p><strong>Notes:</strong></p>
<p><sup>[1]</sup> FT = 5.0V tolerant pins. All pins except A3 and DAC are 5V tolerant (when not in analog mode). If used as a 5V input the pull-up/pull-down resistor must be disabled.</p>
<p><sup>[2]</sup> 3V3 = 3.3V max pins.</p>
<p><sup>[3]</sup> PWM is available on D0, D1, D2, D3, A4, A5, WKP, RX, TX with a caveat: PWM timer peripheral is duplicated on two pins (A5/D2) and (A4/D3) for 7 total independent PWM outputs. For example: PWM may be used on A5 while D2 is used as a GPIO, or D2 as a PWM while A5 is used as an analog input. However A5 and D2 cannot be used as independently controlled PWM outputs at the same time.</p>
<p>&nbsp;</p>
<h2>Photon Graphical Pin Description:</h2>
<p>&nbsp;</p>
<p><a href="https://docs.particle.io/assets/images/photon_pin_markings_1400.png" target="_blank" rel="noopener noreferrer"><img loading="lazy" decoding="async" class="alignnone" src="https://docs.particle.io/assets/images/photon_pin_markings_1400.png" width="1400" height="1513" /></a></p>
<p><a href="https://docs.particle.io/datasheets/photon-datasheet/" target="_blank" rel="noopener noreferrer">Click here</a> to see the Complete Datasheet for <a href="http://shop.edwinrobotics.com/particle/77-particle-photon.html" target="_blank" rel="noopener noreferrer">Particle Photon</a>.</p>
<p>To hookup the OLED with Photon in I2C mode is pretty much same as what we seen with ESP8266 Thing except this point that both the SDA and SCL lines must be pulled high always. Refer the connection diagram for better idea.</p>
<p><a href="http://learn.edwinrobotics.com/wp-content/uploads/photon-oled.png" target="_blank" rel="noopener noreferrer"><img loading="lazy" decoding="async" class="alignnone wp-image-349 size-full" src="http://learn.edwinrobotics.com/wp-content/uploads/photon-oled.png" alt="photon-oled" width="861" height="629" srcset="https://learn.edwinrobotics.com/wp-content/uploads/photon-oled.png 861w, https://learn.edwinrobotics.com/wp-content/uploads/photon-oled-300x219.png 300w" sizes="auto, (max-width: 861px) 100vw, 861px" /></a></p>
<p>Pullup is the thing you need to take care of, we used 10kΩ Resistor for pullup and connected it to 3v3 supply line as shown in the figure.</p>
<p>&nbsp;</p>
<h2><strong>Programme the Particle Photon:</strong></h2>
<p>Photon can be programmed in three ways:</p>
<ul>
<li>Particle Build(Online)</li>
<li>Particle Dev(Half Online, Half Offline)</li>
<li>ARM GCC and the DFU Bootloader (Offline)</li>
</ul>
<p>We recommend you to start with Particle Build(Online), the Particle Build IDE is an always-online, browser-based portal where your Photon code can be edited, saved, and shared. This cloud-based IDE handles code compilation and flashes the built binaries to your Photon over-the-air. You don’t even need your Photon next to you to update its program!</p>
<p>To load the Build IDE head over to <a href="https://build.particle.io/" target="_blank" rel="noopener noreferrer">build.particle.io</a>.</p>
<p>Sparkfun has provided more detailed Instructions for the beginners to understand the IDE better, <a href="https://learn.sparkfun.com/tutorials/photon-development-guide/particle-build-online" target="_blank" rel="noopener noreferrer">Click here</a> to see the Particle Build(Online) guide.</p>
<p>Similarly they provided instruction to understand <a href="https://learn.sparkfun.com/tutorials/photon-development-guide/particle-dev-half-online-half-offline" target="_blank" rel="noopener noreferrer">Particle Dev(Half Online, Half Offline) guide</a> and <a href="https://learn.sparkfun.com/tutorials/photon-development-guide/arm-gcc-and-the-dfu-bootloader-offline" target="_blank" rel="noopener noreferrer">ARM GCC and the DFU Bootloader (Offline) guide</a>.</p>
<p>&nbsp;</p>
<p>To run the OLED program in the Particle Build(online), follow these steps:</p>
<ul>
<li>Add your device to the Particle Build.
<ul>
<li>Download Particle Mobile App to your Handset- <a href="https://itunes.apple.com/us/app/particle-build-photon-electron/id991459054?ls=1&amp;mt=8" target="_blank" rel="noopener noreferrer">iPhone</a> | <a href="https://play.google.com/store/apps/details?id=io.particle.android.app" target="_blank" rel="noopener noreferrer">Android</a></li>
<li>Open the app on your phone. Log in or sign up for an account with Particle if you don&#8217;t have one.</li>
<li>Use this <a href="https://docs.particle.io/guide/getting-started/start/photon/#step-2-connect-with-your-smartphone" target="_blank" rel="noopener noreferrer">Particle First time setup guide</a></li>
</ul>
</li>
<li>Open the online terminal <a href="https://build.particle.io/" target="_blank" rel="noopener noreferrer">build.particle.io</a> and login in to your account</li>
<li>Check under devices tab that whether your devices is listed or not, if not try to add it using mobile app.</li>
<li>Goto &#8221; <strong>code tab</strong>  -&gt; <strong>Create New App </strong>&#8220;</li>
<li>Add micro OLED library to current App.</li>
<li>To add Librbary, goto: &#8221; <strong>Libraries Tab</strong> -&gt; <strong>Community Library Search Box</strong> -&gt; type <strong>OLED </strong>&#8220;</li>
<li>There you will see <strong>SPARKFUNMICROOLED </strong>Library, Click &#8221; <strong>Include in App </strong>&#8221; option.</li>
<li>Save the App using save option.</li>
<li>Use the following code to begin with</li>
</ul>
<blockquote><p><span style="color: #33cccc;">/******************************************************************************</span><br />
<span style="color: #33cccc;"> Micro-OLED-Shield-Example.ino</span><br />
<span style="color: #33cccc;"> SparkFun Micro OLED Library Hello World Example</span><br />
<span style="color: #33cccc;"> Jim Lindblom @ SparkFun Electronics</span><br />
<span style="color: #33cccc;"> Original Creation Date: June 22, 2015</span></p>
<p><span style="color: #33cccc;">This sketch prints a friendly, recognizable logo on the OLED Shield, then</span><br />
<span style="color: #33cccc;"> goes on to demo the Micro OLED library&#8217;s functionality drawing pixels,</span><br />
<span style="color: #33cccc;"> lines, shapes, and text.</span></p>
<p><span style="color: #33cccc;">Hardware Connections:</span><br />
<span style="color: #33cccc;"> This sketch was written specifically for the Photon Micro OLED Shield,</span><br />
<span style="color: #33cccc;"> which does all the wiring for you. If you have a Micro OLED breakout,</span><br />
<span style="color: #33cccc;"> use the following hardware setup:</span></p>
<p><span style="color: #33cccc;">MicroOLED &#8212;&#8212;&#8212;&#8212;- Photon</span><br />
<span style="color: #33cccc;"> GND &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- GND</span><br />
<span style="color: #33cccc;"> VDD &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- 3.3V (VCC)</span><br />
<span style="color: #33cccc;"> D1/MOSI &#8212;&#8212;&#8212;&#8212;&#8212;&#8211; A5 (don&#8217;t change)</span><br />
<span style="color: #33cccc;"> D0/SCK &#8212;&#8212;&#8212;&#8212;&#8212;&#8212; A3 (don&#8217;t change)</span><br />
<span style="color: #33cccc;"> D2</span><br />
<span style="color: #33cccc;"> D/C &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- D6 (can be any digital pin)</span><br />
<span style="color: #33cccc;"> RST &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- D7 (can be any digital pin)</span><br />
<span style="color: #33cccc;"> CS &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- A2 (can be any digital pin)</span></p>
<p><span style="color: #33cccc;">Development environment specifics:</span><br />
<span style="color: #33cccc;"> IDE: Particle Build</span><br />
<span style="color: #33cccc;"> Hardware Platform: Particle Photon</span><br />
<span style="color: #33cccc;"> SparkFun Photon Micro OLED Shield</span></p>
<p><span style="color: #33cccc;">This code is beerware; if you see me (or any other SparkFun</span><br />
<span style="color: #33cccc;"> employee) at the local, and you&#8217;ve found our code helpful,</span><br />
<span style="color: #33cccc;"> please buy us a round!</span></p>
<p><span style="color: #33cccc;">Distributed as-is; no warranty is given.</span><br />
<span style="color: #33cccc;"> *******************************************************************************/</span><br />
#include &#8220;SparkFunMicroOLED/SparkFunMicroOLED.h&#8221; <span style="color: #33cccc;">// Include MicroOLED library</span><br />
#include &#8220;math.h&#8221;</p>
<p><span style="color: #33cccc;">//////////////////////////////////</span><br />
<span style="color: #33cccc;"> // MicroOLED Object Declaration //</span><br />
<span style="color: #33cccc;"> //////////////////////////////////</span><br />
<span style="color: #33cccc;"> // Declare a MicroOLED object. If no parameters are supplied, default pins are</span><br />
<span style="color: #33cccc;"> // used, which will work for the Photon Micro OLED Shield (RST=D7, DC=D6, CS=A2)</span><br />
<span style="color: #33cccc;"> //MicroOLED oled;</span><br />
MicroOLED oled(MODE_I2C, D6); <span style="color: #33cccc;">// Example I2C declaration RST=D7, DC=LOW (0)</span></p>
<p><span style="color: #33cccc;">//SYSTEM_MODE(MANUAL);</span></p>
<p>void setup()<br />
{<br />
Serial.begin(9600);<br />
oled.begin(); <span style="color: #33cccc;">// Initialize the OLED</span><br />
oled.clear(ALL); <span style="color: #33cccc;">// Clear the display&#8217;s internal memory</span><br />
oled.display(); <span style="color: #33cccc;">// Display what&#8217;s in the buffer (splashscreen)</span><br />
delay(1000);<span style="color: #33cccc;"> // Delay 1000 ms</span><br />
randomSeed(analogRead(A0) + analogRead(A1));<br />
}</p>
<p>void loop()<br />
{<br />
pixelExample();<span style="color: #33cccc;"> // Run the pixel example function</span><br />
lineExample(); <span style="color: #33cccc;">// Then the line example function</span><br />
shapeExample(); <span style="color: #33cccc;">// Then the shape example</span><br />
textExamples(); <span style="color: #33cccc;">// Finally the text example</span><br />
<span style="color: #33cccc;"> }</span></p>
<p>void pixelExample()<br />
{<br />
printTitle(&#8220;Pixels&#8221;, 1);</p>
<p>for (int i=0; i&lt;512; i++)<br />
{<br />
oled.pixel(random(oled.getLCDWidth()), random(oled.getLCDHeight()));<br />
oled.display();<br />
}<br />
}</p>
<p>void lineExample()<br />
{<br />
int middleX = oled.getLCDWidth() / 2;<br />
int middleY = oled.getLCDHeight() / 2;<br />
int xEnd, yEnd;<br />
int lineWidth = min(middleX, middleY);</p>
<p>printTitle(&#8220;Lines!&#8221;, 1);</p>
<p>for (int i=0; i&lt;3; i++)<br />
{<br />
for (int deg=0; deg&lt;360; deg+=15)<br />
{<br />
xEnd = lineWidth * cos(deg * M_PI / 180.0);<br />
yEnd = lineWidth * sin(deg * M_PI / 180.0);</p>
<p>oled.line(middleX, middleY, middleX + xEnd, middleY + yEnd);<br />
oled.display();<br />
delay(10);<br />
}<br />
for (int deg=0; deg&lt;360; deg+=15)<br />
{<br />
xEnd = lineWidth * cos(deg * M_PI / 180.0);<br />
yEnd = lineWidth * sin(deg * M_PI / 180.0);</p>
<p>oled.line(middleX, middleY, middleX + xEnd, middleY + yEnd, BLACK, NORM);<br />
oled.display();<br />
delay(10);<br />
}<br />
}<br />
}</p>
<p>void shapeExample()<br />
{<br />
printTitle(&#8220;Shapes!&#8221;, 0);</p>
<p><span style="color: #33cccc;">// Silly pong demo. It takes a lot of work to fake pong&#8230;</span><br />
int paddleW = 3; <span style="color: #33cccc;">// Paddle width</span><br />
int paddleH = 15; <span style="color: #33cccc;">// Paddle height</span><br />
<span style="color: #33cccc;">// Paddle 0 (left) position coordinates</span><br />
int paddle0_Y = (oled.getLCDHeight() / 2) &#8211; (paddleH / 2);<br />
int paddle0_X = 2;<br />
<span style="color: #33cccc;">// Paddle 1 (right) position coordinates</span><br />
int paddle1_Y = (oled.getLCDHeight() / 2) &#8211; (paddleH / 2);<br />
int paddle1_X = oled.getLCDWidth() &#8211; 3 &#8211; paddleW;<br />
int ball_rad = 2; <span style="color: #33cccc;">// Ball radius</span><br />
<span style="color: #33cccc;">// Ball position coordinates</span><br />
int ball_X = paddle0_X + paddleW + ball_rad;<br />
int ball_Y = random(1 + ball_rad, oled.getLCDHeight() &#8211; ball_rad);<span style="color: #33cccc;">//paddle0_Y + ball_rad;</span><br />
int ballVelocityX = 1; <span style="color: #33cccc;">// Ball left/right velocity</span><br />
int ballVelocityY = 1; <span style="color: #33cccc;">// Ball up/down velocity</span><br />
int paddle0Velocity = -1; <span style="color: #33cccc;">// Paddle 0 velocity</span><br />
int paddle1Velocity = 1; <span style="color: #33cccc;">// Paddle 1 velocity</span></p>
<p>//while(ball_X &gt;= paddle0_X + paddleW &#8211; 1)<br />
while ((ball_X &#8211; ball_rad &gt; 1) &amp;&amp;<br />
(ball_X + ball_rad &lt; oled.getLCDWidth() &#8211; 2))<br />
{<br />
<span style="color: #33cccc;">// Increment ball&#8217;s position</span><br />
ball_X+=ballVelocityX;<br />
ball_Y+=ballVelocityY;<br />
<span style="color: #33cccc;">// Check if the ball is colliding with the left paddle</span><br />
if (ball_X &#8211; ball_rad &lt; paddle0_X + paddleW)<br />
{<br />
<span style="color: #33cccc;">// Check if ball is within paddle&#8217;s height</span><br />
if ((ball_Y &gt; paddle0_Y) &amp;&amp; (ball_Y &lt; paddle0_Y + paddleH))<br />
{<br />
ball_X++; <span style="color: #33cccc;">// Move ball over one to the right</span><br />
ballVelocityX = -ballVelocityX; <span style="color: #33cccc;">// Change velocity</span><br />
}<br />
}<br />
<span style="color: #33cccc;">// Check if the ball hit the right paddle</span><br />
if (ball_X + ball_rad &gt; paddle1_X)<br />
{<br />
<span style="color: #33cccc;">// Check if ball is within paddle&#8217;s height</span><br />
if ((ball_Y &gt; paddle1_Y) &amp;&amp; (ball_Y &lt; paddle1_Y + paddleH))<br />
{<br />
ball_X&#8211;; <span style="color: #33cccc;">// Move ball over one to the left</span><br />
ballVelocityX = -ballVelocityX; <span style="color: #33cccc;">// change velocity</span><br />
}<br />
}<br />
<span style="color: #33cccc;">// Check if the ball hit the top or bottom</span><br />
if ((ball_Y &lt;= ball_rad) || (ball_Y &gt;= (oled.getLCDHeight() &#8211; ball_rad &#8211; 1)))<br />
{<br />
<span style="color: #33cccc;">// Change up/down velocity direction</span><br />
ballVelocityY = -ballVelocityY;<br />
}<br />
<span style="color: #33cccc;">// Move the paddles up and down</span><br />
paddle0_Y += paddle0Velocity;<br />
paddle1_Y += paddle1Velocity;<br />
<span style="color: #33cccc;">// Change paddle 0&#8217;s direction if it hit top/bottom</span><br />
if ((paddle0_Y &lt;= 1) || (paddle0_Y &gt; oled.getLCDHeight() &#8211; 2 &#8211; paddleH))<br />
{<br />
paddle0Velocity = -paddle0Velocity;<br />
}<br />
<span style="color: #33cccc;">// Change paddle 1&#8217;s direction if it hit top/bottom</span><br />
if ((paddle1_Y &lt;= 1) || (paddle1_Y &gt; oled.getLCDHeight() &#8211; 2 &#8211; paddleH))<br />
{<br />
paddle1Velocity = -paddle1Velocity;<br />
}</p>
<p>/<span style="color: #33cccc;">/ Draw the Pong Field</span><br />
<span style="color: #33cccc;"> oled.clear(PAGE); // Clear the page</span><br />
<span style="color: #33cccc;"> // Draw an outline of the screen:</span><br />
oled.rect(0, 0, oled.getLCDWidth() &#8211; 1, oled.getLCDHeight());<br />
<span style="color: #33cccc;">// Draw the center line</span><br />
oled.rectFill(oled.getLCDWidth()/2 &#8211; 1, 0, 2, oled.getLCDHeight());<br />
<span style="color: #33cccc;">// Draw the Paddles:</span><br />
oled.rectFill(paddle0_X, paddle0_Y, paddleW, paddleH);<br />
oled.rectFill(paddle1_X, paddle1_Y, paddleW, paddleH);<br />
<span style="color: #33cccc;">// Draw the ball:</span><br />
oled.circle(ball_X, ball_Y, ball_rad);<br />
<span style="color: #33cccc;">// Actually draw everything on the screen:</span><br />
oled.display();<br />
delay(25); <span style="color: #33cccc;">// Delay for visibility</span><br />
<span style="color: #33cccc;"> }</span><br />
delay(1000);<br />
}</p>
<p>void textExamples()<br />
{<br />
printTitle(&#8220;Text!&#8221;, 1);</p>
<p><span style="color: #33cccc;">// Demonstrate font 0. 5&#215;8 font</span><br />
oled.clear(PAGE);<span style="color: #33cccc;"> // Clear the screen</span><br />
oled.setFontType(0); <span style="color: #33cccc;">// Set font to type 0</span><br />
oled.setCursor(0, 0); <span style="color: #33cccc;">// Set cursor to top-left</span><br />
<span style="color: #33cccc;">// There are 255 possible characters in the font 0 type.</span><br />
<span style="color: #33cccc;"> // Lets run through all of them and print them out!</span><br />
for (int i=0; i&lt;=255; i++)<br />
{<br />
<span style="color: #33cccc;">// You can write byte values and they&#8217;ll be mapped to</span><br />
<span style="color: #33cccc;"> // their ASCII equivalent character.</span><br />
oled.write(i); <span style="color: #33cccc;">// Write a byte out as a character</span><br />
oled.display(); <span style="color: #33cccc;">// Draw on the screen</span><br />
delay(10); <span style="color: #33cccc;">// Wait 10ms</span><br />
<span style="color: #33cccc;">// We can only display 60 font 0 characters at a time.</span><br />
<span style="color: #33cccc;"> // Every 60 characters, pause for a moment. Then clear</span><br />
<span style="color: #33cccc;"> // the page and start over.</span><br />
if ((i%60 == 0) &amp;&amp; (i != 0))<br />
{<br />
delay(500); <span style="color: #33cccc;">// Delay 500 ms</span><br />
oled.clear(PAGE); <span style="color: #33cccc;">// Clear the page</span><br />
oled.setCursor(0, 0); <span style="color: #33cccc;">// Set cursor to top-left</span><br />
}<br />
}<br />
delay(500); <span style="color: #33cccc;">// Wait 500ms before next example</span></p>
<p><span style="color: #33cccc;">// Demonstrate font 1. 8&#215;16. Let&#8217;s use the print function</span><br />
<span style="color: #33cccc;"> // to display every character defined in this font.</span><br />
oled.setFontType(1); // Set font to type 1<br />
oled.clear(PAGE); <span style="color: #33cccc;">// Clear the page</span><br />
oled.setCursor(0, 0); <span style="color: #33cccc;">// Set cursor to top-left</span><br />
<span style="color: #33cccc;">// Print can be used to print a string to the screen:</span><br />
oled.print(&#8221; !\&#8221;#$%&amp;'()*+,-./01234&#8243;);<br />
oled.display(); <span style="color: #33cccc;">// Refresh the display</span><br />
delay(1000); <span style="color: #33cccc;">// Delay a second and repeat</span><br />
oled.clear(PAGE);<br />
oled.setCursor(0, 0);<br />
oled.print(&#8220;56789:;&lt;=&gt;?@ABCDEFGHI&#8221;);<br />
oled.display();<br />
delay(1000);<br />
oled.clear(PAGE);<br />
oled.setCursor(0, 0);<br />
oled.print(&#8220;JKLMNOPQRSTUVWXYZ[\\]^&#8221;);<br />
oled.display();<br />
delay(1000);<br />
oled.clear(PAGE);<br />
oled.setCursor(0, 0);<br />
oled.print(&#8220;_`abcdefghijklmnopqrs&#8221;);<br />
oled.display();<br />
delay(1000);<br />
oled.clear(PAGE);<br />
oled.setCursor(0, 0);<br />
oled.print(&#8220;tuvwxyz{|}~&#8221;);<br />
oled.display();<br />
delay(1000);</p>
<p><span style="color: #33cccc;">// Demonstrate font 2. 10&#215;16. Only numbers and &#8216;.&#8217; are defined.</span><br />
<span style="color: #33cccc;"> // This font looks like 7-segment displays.</span><br />
<span style="color: #33cccc;"> // Lets use this big-ish font to display readings from the</span><br />
<span style="color: #33cccc;"> // analog pins.</span><br />
for (int i=0; i&lt;25; i++)<br />
{<br />
oled.clear(PAGE); <span style="color: #33cccc;">// Clear the display</span><br />
oled.setCursor(0, 0); <span style="color: #33cccc;">// Set cursor to top-left</span><br />
oled.setFontType(0); <span style="color: #33cccc;">// Smallest font</span><br />
oled.print(&#8220;A0:&#8221;); <span style="color: #33cccc;">// Print &#8220;A0&#8221;</span><br />
oled.setFontType(2);<span style="color: #33cccc;"> // 7-segment font</span><br />
oled.print(analogRead(A0)); <span style="color: #33cccc;">// Print a0 reading</span><br />
oled.setCursor(0, 16); <span style="color: #33cccc;">// Set cursor to top-middle-left</span><br />
oled.setFontType(0); <span style="color: #33cccc;">// Repeat</span><br />
oled.print(&#8220;A1:&#8221;);<br />
oled.setFontType(2);<br />
oled.print(analogRead(A1));<br />
oled.setCursor(0, 32);<br />
oled.setFontType(0);<br />
oled.print(&#8220;A7:&#8221;);<br />
oled.setFontType(2);<br />
oled.print(analogRead(A7));<br />
oled.display();<br />
delay(100);<br />
}</p>
<p><span style="color: #33cccc;">// Demonstrate font 3. 12&#215;48. Stopwatch demo.</span><br />
oled.setFontType(3); <span style="color: #33cccc;">// Use the biggest font</span><br />
int ms = 0;<br />
int s = 0;<br />
while (s &lt;= 50)<br />
{<br />
oled.clear(PAGE); <span style="color: #33cccc;">// Clear the display</span><br />
oled.setCursor(0, 0); <span style="color: #33cccc;">// Set cursor to top-left</span><br />
if (s &lt; 10)<br />
oled.print(&#8220;00&#8221;);<span style="color: #33cccc;"> // Print &#8220;00&#8221; if s is 1 digit</span><br />
else if (s &lt; 100)<br />
oled.print(&#8220;0&#8221;); <span style="color: #33cccc;">// Print &#8220;0&#8221; if s is 2 digits</span><br />
oled.print(s); <span style="color: #33cccc;">// Print s&#8217;s value</span><br />
<span style="color: #33cccc;"> oled.print(&#8220;:&#8221;); // Print &#8220;:&#8221;</span><br />
oled.print(ms);<span style="color: #33cccc;"> // Print ms value</span><br />
oled.display(); <span style="color: #33cccc;">// Draw on the screen</span><br />
ms++; // Increment ms<br />
if (ms &gt;= 10) <span style="color: #33cccc;">// If ms is &gt;= 10</span><br />
{<br />
ms = 0; <span style="color: #33cccc;">// Set ms back to 0</span><br />
s++; <span style="color: #33cccc;">// and increment s</span><br />
}<br />
delay(1);<br />
}<br />
}</p>
<p><span style="color: #33cccc;">// Center and print a small title</span><br />
<span style="color: #33cccc;"> // This function is quick and dirty. Only works for titles one</span><br />
<span style="color: #33cccc;"> // line long.</span><br />
void printTitle(String title, int font)<br />
{<br />
int middleX = oled.getLCDWidth() / 2;<br />
int middleY = oled.getLCDHeight() / 2;</p>
<p>oled.clear(PAGE);<br />
oled.setFontType(font);<br />
<span style="color: #33cccc;">// Try to set the cursor in the middle of the screen</span><br />
oled.setCursor(middleX &#8211; (oled.getFontWidth() * (title.length()/2)),<br />
middleY &#8211; (oled.getFontWidth() / 2));<br />
<span style="color: #33cccc;">// Print the title:</span><br />
oled.print(title);<br />
oled.display();<br />
delay(1500);<br />
oled.clear(PAGE);<br />
}</p></blockquote>
<p>&nbsp;</p>
<p>Care must be taken to initialize object in the code for I2C communication, use the following parameter for declartion based on your application.<br />
<span style="color: #33cccc;">//MicroOLED oled(MODE_SPI, PIN_RESET, PIN_DC, PIN_CS); // Example SPI declaration</span><br />
<span style="color: #33cccc;"> //MicroOLED oled(MODE_I2C, PIN_RESET); // Example I2C declaration</span></p>
<p>&nbsp;</p>
<p>Note: The Hookup shown here for I2C communication is tested and in working condition, to do the SPI interface of the OLED Module, you need to do the following things:</p>
<ul>
<li>Modify the Jumpers on the back of the OLED breakout for SPI Communication</li>
<li><a href="https://learn.sparkfun.com/tutorials/micro-oled-breakout-hookup-guide#breakout-board-overview" target="_blank" rel="noopener noreferrer">Visit here</a> for jumper settings</li>
<li>Refer the shown connection chart below for SPI connection.</li>
<li>Make sure to initialize these connected pins in the object declaration.</li>
</ul>
<blockquote><p>&nbsp;</p>
<table>
<tbody>
<tr>
<td width="227">
<p style="text-align: center;"><strong>OLED</strong></p>
</td>
<td style="text-align: center;" width="227"><strong>Photon</strong></td>
<td style="text-align: center;" width="147"><strong>ESP8266</strong></td>
</tr>
<tr>
<td width="227">
<p style="text-align: center;">GND</p>
</td>
<td style="text-align: center;" width="227">GND</td>
<td style="text-align: center;" width="147">GND</td>
</tr>
<tr>
<td width="227">
<p style="text-align: center;">3v3</p>
</td>
<td style="text-align: center;" width="227">3v3</td>
<td style="text-align: center;" width="147">3v3</td>
</tr>
<tr>
<td width="227">
<p style="text-align: center;">D1-MOSI</p>
</td>
<td style="text-align: center;" width="227">
<table style="height: 62px;" width="256">
<tbody>
<tr>
<td width="118">A5</td>
<td width="67">D2</td>
</tr>
</tbody>
</table>
</td>
<td style="text-align: center;" width="147">13</td>
</tr>
<tr>
<td style="text-align: center;" width="227">D0-SCK</td>
<td style="text-align: center;" width="227">
<table style="height: 57px;" width="257">
<tbody>
<tr>
<td width="118">A3</td>
<td width="67">D4</td>
</tr>
</tbody>
</table>
</td>
<td width="147">
<p style="text-align: center;">14</p>
</td>
</tr>
<tr>
<td style="text-align: center;" width="227">D2-MISO</td>
<td style="text-align: center;" width="227">
<table style="height: 58px;" width="257">
<tbody>
<tr>
<td width="118">A4</td>
<td width="67">D3</td>
</tr>
</tbody>
</table>
</td>
<td width="147">
<p style="text-align: center;">12</p>
</td>
</tr>
<tr>
<td style="text-align: center;" width="227">DC</td>
<td style="text-align: center;" width="227">
<table style="height: 64px;" width="256">
<tbody>
<tr>
<td width="118">&#8211;</td>
<td width="67">&#8211;</td>
</tr>
</tbody>
</table>
</td>
<td width="147">
<p style="text-align: center;">&#8211;</p>
</td>
</tr>
<tr>
<td style="text-align: center;" width="227">RST</td>
<td style="text-align: center;" width="227">
<table style="height: 80px;" width="313">
<tbody>
<tr>
<td width="118">Any Digital pin</td>
<td width="111">Any Digital pin</td>
</tr>
</tbody>
</table>
</td>
<td width="147">
<p style="text-align: center;">D5</p>
</td>
</tr>
<tr>
<td style="text-align: center;" width="227">CS</td>
<td style="text-align: center;" width="227">
<table style="height: 62px;" width="312">
<tbody>
<tr>
<td width="125">Any Digital Pin</td>
<td width="113">Any Digital Pin</td>
</tr>
</tbody>
</table>
</td>
<td width="147">
<p style="text-align: center;">D4/D2</p>
</td>
</tr>
</tbody>
</table>
</blockquote>
<p><strong> Note: </strong>Use any one of the SPI peripheral of the photon. MISO pins can be unused.</p>
<h2><strong>Buy: </strong></h2>
<ul>
<li><strong><a href="http://shop.edwinrobotics.com/displays/118-sparkfun-microview-oled-arduino-module.html" target="_blank" rel="noopener noreferrer">SparkFun MicroView – OLED Arduino Module</a></strong></li>
<li><strong><a href="http://shop.edwinrobotics.com/particle/77-particle-photon.html" target="_blank" rel="noopener noreferrer">Particle Photon</a></strong></li>
</ul>
<h2>Source:</h2>
<ul>
<li><a href="https://en.wikipedia.org/wiki/ESP8266" target="_blank" rel="noopener noreferrer">ESp8266 Wiki</a></li>
<li><a href="https://www.particle.io/prototype" target="_blank" rel="noopener noreferrer">Particle Photon</a></li>
<li><a href="https://learn.sparkfun.com/tutorials/micro-oled-breakout-hookup-guide" target="_blank" rel="noopener noreferrer">Sparkfun Micro OLED Hookup</a></li>
<li><a href="https://docs.particle.io/guide/getting-started/start/photon/" target="_blank" rel="noopener noreferrer">Particle Photon Docs</a></li>
<li><a href="https://learn.sparkfun.com/tutorials/esp8266-thing-hookup-guide">ESP8266 Thing Hookup Guide</a></li>
<li><a href="https://learn.sparkfun.com/tutorials/photon-development-guide/introduction" target="_blank" rel="noopener noreferrer">Sparkfun Photon Development Guide</a></li>
<li><a href="https://en.wikipedia.org/wiki/OLED" target="_blank" rel="noopener noreferrer">OLED Wiki</a></li>
</ul>
]]></content:encoded>
					
					<wfw:commentRss>https://learn.edwinrobotics.com/micro-oled-hookup-guide-for-esp8266-and-particle-photon/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/

Object Caching 112/294 objects using APC
Page Caching using Disk: Enhanced 
Lazy Loading (feed)
Database Caching 36/100 queries in 0.064 seconds using APC

Served from: learn.edwinrobotics.com @ 2025-07-21 23:32:53 by W3 Total Cache
-->