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

<channel>
	<title>Arduino | Learn with Edwin Robotics</title>
	<atom:link href="https://learn.edwinrobotics.com/category/arduino/feed/" rel="self" type="application/rss+xml" />
	<link>https://learn.edwinrobotics.com</link>
	<description>Tutorials on basics of electronics, etc.</description>
	<lastBuildDate>Sun, 30 Dec 2018 11:17:58 +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>HC-06 Bluetooth Module Hookup Guide</title>
		<link>https://learn.edwinrobotics.com/hc-06-bluetooth-module-hookup-guide/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=hc-06-bluetooth-module-hookup-guide</link>
					<comments>https://learn.edwinrobotics.com/hc-06-bluetooth-module-hookup-guide/#respond</comments>
		
		<dc:creator><![CDATA[Abhishek Nair]]></dc:creator>
		<pubDate>Mon, 13 Feb 2017 15:31:43 +0000</pubDate>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Wireless]]></category>
		<guid isPermaLink="false">http://learn.edwinrobotics.com/?p=1523</guid>

					<description><![CDATA[<img width="6000" height="4000" src="https://learn.edwinrobotics.com/wp-content/uploads/DSC_0019-2-1.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_0019-2-1.jpg 6000w, https://learn.edwinrobotics.com/wp-content/uploads/DSC_0019-2-1-300x200.jpg 300w, https://learn.edwinrobotics.com/wp-content/uploads/DSC_0019-2-1-1024x683.jpg 1024w, https://learn.edwinrobotics.com/wp-content/uploads/DSC_0019-2-1-140x94.jpg 140w" sizes="auto, (max-width: 6000px) 100vw, 6000px" />Bluetooth is a wireless technology standard for exchanging data over short distances (using short-wavelength UHF radio waves in the ISM band from 2.4 to 2.485 GHz) from fixed and mobile devices, and building personal area networks (PANs). Range is approximately 10 Meters (30 feet). The Bluetooth Module Bluetooth HC-06s with Bluetooth V2.0 have proven themselves [&#8230;]]]></description>
										<content:encoded><![CDATA[<img width="6000" height="4000" src="https://learn.edwinrobotics.com/wp-content/uploads/DSC_0019-2-1.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_0019-2-1.jpg 6000w, https://learn.edwinrobotics.com/wp-content/uploads/DSC_0019-2-1-300x200.jpg 300w, https://learn.edwinrobotics.com/wp-content/uploads/DSC_0019-2-1-1024x683.jpg 1024w, https://learn.edwinrobotics.com/wp-content/uploads/DSC_0019-2-1-140x94.jpg 140w" sizes="auto, (max-width: 6000px) 100vw, 6000px" /><p>Bluetooth is a wireless technology standard for exchanging data over short distances (using short-wavelength UHF radio waves in the ISM band from 2.4 to 2.485 GHz) from fixed and mobile devices, and building personal area networks (PANs). Range is approximately 10 Meters (30 feet). The Bluetooth Module Bluetooth HC-06s with Bluetooth V2.0 have proven themselves to be very reliable and easy to use module, these module uses serial interface for communication , thus very easy to interface with any microcontroller/Computer over RX/TX Lines.</p>
<p>You can refer the list of items we are covering in this hookup guide here:</p>
<ol>
<li><a href="#step1">Hardware Needed</a></li>
<li><a href="#step2">Board Description</a></li>
<li><a href="#step3">Pin Description</a></li>
<li><a href="#step4">Jumper Description</a></li>
<li><a href="#step5">AT Commands and Arduino Interface Code</a></li>
<li><a href="#step6">Datasheets</a></li>
</ol>
<h3 id="step1">Hardware Needed:</h3>

<table id="tablepress-13" class="tablepress tablepress-id-13">
<tbody>
<tr class="row-1">
	<td class="column-1"><div style="width: 160px" class="wp-caption aligncenter"><a href="https://shop.edwinrobotics.com/wireless/602-edwin-robotics-bluetooth-module-hc-06.html"target="_blank"><img loading="lazy" decoding="async" src="http://learn.edwinrobotics.com/wp-content/uploads/DSC_0019-2.jpg" alt="" width="150" height="50" class="alignnone size-full wp-image-1555" /></a><p class="wp-caption-text"></p> <em>Edwin Robotics Bluetooth Module - HC06</em></p></div></td><td class="column-2"><div style="width: 160px" class="wp-caption aligncenter"><a href="https://shop.edwinrobotics.com/wires/19-male-female-jumper-wires.html"target="_blank"><img loading="lazy" decoding="async" src="http://learn.edwinrobotics.com/wp-content/uploads/179-2.jpg" alt="" width="150" height="50" class="alignnone size-full wp-image-1571" /></a><p class="wp-caption-text"></p><em>Male-Female Jumper Wires</em></p></div></td>
</tr>
</tbody>
</table>
<!-- #tablepress-13 from cache -->
<p>&nbsp;</p>
<h3 id="step2">Board Description:</h3>
<p>The HC-06 modules are based on the Cambridge Silicon Radio BC417 2.4 GHz Bluetooth Radio chip. This is a complex chip which uses an external 8 Mbit flash memory. These low-cost Bluetooth Sub-modules work well with Arduino and other Microcomputers. HC-06 is a Slave only device.The module has two modes of operation, Command Mode where we can send AT commands to it and Data Mode where it transmits and receives data to and from another Bluetooth module. By default the device was in Command mode and needs to pair with some device to get it into data mode.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="attachment_1555" style="width: 510px" class="wp-caption aligncenter"><a href="http://learn.edwinrobotics.com/wp-content/uploads/DSC_0019-2.jpg" target="_blank"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1555" class="wp-image-1555" src="http://learn.edwinrobotics.com/wp-content/uploads/DSC_0019-2.jpg" alt="Its a brand new HC-06 Bluetooth module with latest updated firmware (Firmware: hc01.comV2.0 (It does not use Linvor firmware)) and HC06 hardware" width="500" height="500" srcset="https://learn.edwinrobotics.com/wp-content/uploads/DSC_0019-2.jpg 2000w, https://learn.edwinrobotics.com/wp-content/uploads/DSC_0019-2-150x150.jpg 150w, https://learn.edwinrobotics.com/wp-content/uploads/DSC_0019-2-300x300.jpg 300w, https://learn.edwinrobotics.com/wp-content/uploads/DSC_0019-2-1024x1024.jpg 1024w, https://learn.edwinrobotics.com/wp-content/uploads/DSC_0019-2-184x184.jpg 184w" sizes="auto, (max-width: 500px) 100vw, 500px" /></a><p id="caption-attachment-1555" class="wp-caption-text"><em>Edwin Robotics Bluetooth Module &#8211; HC06</em></p></div>
<p>&nbsp;</p>

<table id="tablepress-10" class="tablepress tablepress-id-10">
<tbody class="row-striping row-hover">
<tr class="row-1">
	<td class="column-1"><b align="center">Bluetooth version</b></td><td class="column-2">v2.0 + EDR</td>
</tr>
<tr class="row-2">
	<td class="column-1"><b align="center">Firmware</b></td><td class="column-2">hc01.comV2.0 (It does not use Linvor firmware)</td>
</tr>
<tr class="row-3">
	<td class="column-1"><b align="center">Default baud rate</b></td><td class="column-2">9600</td>
</tr>
<tr class="row-4">
	<td class="column-1"><b align="center">Default PIN</b></td><td class="column-2">1234</td>
</tr>
<tr class="row-5">
	<td class="column-1"><b align="center">Default NAME</b></td><td class="column-2">HC-06</td>
</tr>
<tr class="row-6">
	<td class="column-1"><b align="center">Status LED</b></td><td class="column-2">Blue (Top Left)</td>
</tr>
<tr class="row-7">
	<td class="column-1"><b align="center">Power LED</b></td><td class="column-2">Red (Bottom Right)</td>
</tr>
</tbody>
</table>
<!-- #tablepress-10 from cache -->
<p>There are two LED&#8217;s on board for indication, refer the diagram below, for better idea:</p>
<div id="attachment_1557" style="width: 510px" class="wp-caption aligncenter"><a href="http://learn.edwinrobotics.com/wp-content/uploads/DSC_0030-2.jpg" target="_blank"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1557" class="wp-image-1557" src="http://learn.edwinrobotics.com/wp-content/uploads/DSC_0030-2.jpg" alt="Firmware: hc01.comV2.0 (It does not use Linvor firmware)" width="500" height="500" srcset="https://learn.edwinrobotics.com/wp-content/uploads/DSC_0030-2.jpg 2000w, https://learn.edwinrobotics.com/wp-content/uploads/DSC_0030-2-150x150.jpg 150w, https://learn.edwinrobotics.com/wp-content/uploads/DSC_0030-2-300x300.jpg 300w, https://learn.edwinrobotics.com/wp-content/uploads/DSC_0030-2-1024x1024.jpg 1024w, https://learn.edwinrobotics.com/wp-content/uploads/DSC_0030-2-184x184.jpg 184w" sizes="auto, (max-width: 500px) 100vw, 500px" /></a><p id="caption-attachment-1557" class="wp-caption-text"><em>LED Indication</em></p></div>
<p>&nbsp;</p>
<h3 id="step3">Pins/Headers:</h3>
<p>Board needs 4-lines to communicate most of the times, i.e <strong>Vcc</strong>, <strong>Gnd</strong>, <strong>RX</strong> and <strong>TX</strong> pin. There are two additional pin onboard, one is Key pin and the other is Reset pin, this Reset pin can be used to send reset signal from microcontroller to reset the bluetooth module. Refer the table and image below in detail:</p>
<p>&nbsp;</p>
<div id="attachment_1559" style="width: 510px" class="wp-caption aligncenter"><a href="http://learn.edwinrobotics.com/wp-content/uploads/DSC_0025-1-1.jpg" target="_blank"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1559" class="wp-image-1559" src="http://learn.edwinrobotics.com/wp-content/uploads/DSC_0025-1-1.jpg" alt="Bluetooth Module v2.0 HC06" width="500" height="500" srcset="https://learn.edwinrobotics.com/wp-content/uploads/DSC_0025-1-1.jpg 2000w, https://learn.edwinrobotics.com/wp-content/uploads/DSC_0025-1-1-150x150.jpg 150w, https://learn.edwinrobotics.com/wp-content/uploads/DSC_0025-1-1-300x300.jpg 300w, https://learn.edwinrobotics.com/wp-content/uploads/DSC_0025-1-1-1024x1024.jpg 1024w, https://learn.edwinrobotics.com/wp-content/uploads/DSC_0025-1-1-184x184.jpg 184w" sizes="auto, (max-width: 500px) 100vw, 500px" /></a><p id="caption-attachment-1559" class="wp-caption-text"><em>Silkscreen</em></p></div>

<table id="tablepress-11" class="tablepress tablepress-id-11">
<thead>
<tr class="row-1">
	<th class="column-1"><b align="center">Pin</b></th><th class="column-2"><b align="center">Description</b></th>
</tr>
</thead>
<tbody class="row-striping row-hover">
<tr class="row-2">
	<td class="column-1"><b align="center">RST</b></td><td class="column-2">Reset input (Logic Low resets the Module)</td>
</tr>
<tr class="row-3">
	<td class="column-1"><b align="center">VCC</b></td><td class="column-2">Supply input 3.3V to 5.5V Input</td>
</tr>
<tr class="row-4">
	<td class="column-1"><b align="center">GND</b></td><td class="column-2">Ground</td>
</tr>
<tr class="row-5">
	<td class="column-1"><b align="center">TXD</b></td><td class="column-2">Transmit Data (Connect RX line from other peripheral here)</td>
</tr>
<tr class="row-6">
	<td class="column-1"><b align="center">RXD</b></td><td class="column-2">Receive Data (Connect TX line from other peripheral here)</td>
</tr>
<tr class="row-7">
	<td class="column-1"><b align="center">KEY</b></td><td class="column-2">This function is intended to use with Master module to clear the memory and search for new slave device</td>
</tr>
</tbody>
</table>
<!-- #tablepress-11 from cache -->
<p>&nbsp;</p>
<h3 id="step4">Jumper&#8217;s:</h3>
<p>There are Jumpers provided on the bottom side of the module, refer the below image and table for better idea:</p>
<p>&nbsp;</p>
<div id="attachment_1556" style="width: 510px" class="wp-caption aligncenter"><a href="http://learn.edwinrobotics.com/wp-content/uploads/DSC_0025-.jpg" target="_blank"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1556" class="wp-image-1556" src="http://learn.edwinrobotics.com/wp-content/uploads/DSC_0025-.jpg" alt="HC-06 Bluetooth Module Firmware: hc01.comV2.0 (It does not use Linvor firmware)" width="500" height="500" srcset="https://learn.edwinrobotics.com/wp-content/uploads/DSC_0025-.jpg 1950w, https://learn.edwinrobotics.com/wp-content/uploads/DSC_0025--150x150.jpg 150w, https://learn.edwinrobotics.com/wp-content/uploads/DSC_0025--300x300.jpg 300w, https://learn.edwinrobotics.com/wp-content/uploads/DSC_0025--1024x1024.jpg 1024w, https://learn.edwinrobotics.com/wp-content/uploads/DSC_0025--184x184.jpg 184w" sizes="auto, (max-width: 500px) 100vw, 500px" /></a><p id="caption-attachment-1556" class="wp-caption-text"><em>Jumper Settings</em></p></div>
<p>&nbsp;</p>
<p>&nbsp;</p>

<table id="tablepress-12" class="tablepress tablepress-id-12">
<thead>
<tr class="row-1">
	<th class="column-1"><b align="center">Jumper</b></th><th class="column-2"><b align="center">Description</b></th>
</tr>
</thead>
<tbody class="row-striping row-hover">
<tr class="row-2">
	<td class="column-1"><b align="center">VCC/REG</b></td><td class="column-2">Its a two way jumper, to Use/ bypass regulator.<br />
<br />
<b>By default:</b> VCC connected to Regulator.<br />
<br />
Cut the trace and solder the center pad with VCC to supply 3.3V Supply to daughter board directly.</td>
</tr>
<tr class="row-3">
	<td class="column-1"><b align="center">PLED</b></td><td class="column-2">Cut the trace to disable Power LED</td>
</tr>
<tr class="row-4">
	<td class="column-1"><b align="center">SLED2</b></td><td class="column-2">Cut the trace to disbale status LED on Mother Board (Blue LED next to Power LED, not provided on some boards) </td>
</tr>
<tr class="row-5">
	<td class="column-1"><b align="center">SLED1</b></td><td class="column-2">Dedicated for future purpose/Other boards.</td>
</tr>
</tbody>
</table>
<!-- #tablepress-12 from cache -->
<p>&nbsp;</p>
<h3 id="step5">AT Commands:</h3>
<p>The bluetooth module supports some limited commands set, which you can refer from the datasheet, we had addded the code below, to get the AT command interface working on any Arduino board. All the Supported commands are well documented in the code below, make sure of following things:</p>
<ul>
<li>nl/cr line endings not required in the serial window.</li>
<li>AT commands are required to be in upper case</li>
<li>Default Serial Communication baud rate: 9600</li>
</ul>
<p>&nbsp;</p>
<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="atomic">/**********************************************************************************
AT_Command_Interface.ino

Description:
  Sample AT Command Interface code for Arduino and HC06 Bluetooth Module

Tutorial Link:  
  learn.edwinrobotics.com/hc-06-bluetooth-module-hookup-guide

Created by:
  Abhishek Nair @ Edwin Robotics
  Feb 9th 2017

Distributed as-is; no warranty is given.   
**********************************************************************************/
#include &lt;SoftwareSerial.h&gt;

SoftwareSerial mySerial(2, 3); // RX, TX

void setup() {

Serial.begin(9600);
Serial.println("------------------------------------------------------------------------------------------");
Serial.println("             Edwin Robotics HC06 Bluetooth Module Serial Interface ");
Serial.println("------------------------------------------------------------------------------------------");
Serial.println("                 Connect Bluetooth Module RX -&gt; Arduino pin 3 ");
Serial.println("                 Connect Bluetooth Module TX -&gt; Arduino pin 2 ");
Serial.println("------------------------------------------------------------------------------------------");
Serial.println("");
Serial.println("Entered AT command Mode, please Enter AT Commands from the list of supported commands:");
Serial.println("******************************************************************************************");
Serial.println("AT              &gt; connection test command. Returns OK");
Serial.println("");
Serial.println("AT+BAUDx        &gt; sets the baud rate to respective board rate for entered 'x' value(refer values below) and returns OKBaud_Rate");
Serial.println("                   1: 1200  2: 2400  3: 4800  4: 9600  5: 19200  6: 38400  7: 57600  8: 115200  9: 230400  A: 460800  B: 921600  C: 1382400");
Serial.println("");
Serial.println("AT+NAME(myName) &gt; sets the name to (myName), returns OKsetname");
Serial.println("");
Serial.println("AT+PIN9999      &gt; changes the PIN to 9999, returns OKsetPIN");
Serial.println("");
Serial.println("AT+VERSION      &gt; returns the firmware version : hc01.comV2.0");
Serial.println("");
Serial.println("AT+LED0         &gt; turn off the blue LED, returns LED OFF");
Serial.println("");
Serial.println("AT+LED1         &gt; turn on the blue LED, returns LED ON");
Serial.println("");
Serial.println("AT+PN           &gt; sets no parity");
Serial.println("");
Serial.println("AT+PE           &gt; sets even parity");
Serial.println("");
Serial.println("AT+PO           &gt; sets odd parity");
Serial.println("******************************************************************************************");
Serial.println("");

mySerial.begin(9600);
delay(300);
Serial.println();
Serial.println("Note: if 'Version: hc01.comV2.0' is not printed below, make sure that your connections are correct or your module is not connected to any other device,try restarting the device/Serial Window");
Serial.println("----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------");
Serial.print("Version: ");
mySerial.write("AT+VERSION");
}

void loop()
{
  if (mySerial.available())
    Serial.write(mySerial.read());

  if (Serial.available())
    mySerial.write(Serial.read());
}</pre>
<p>&nbsp;</p>
<h3 id="step6">Datasheets:</h3>
<p><a href="https://drive.google.com/uc?export=download&amp;id=0BzmrQ1bTvperek5Ca2JobU4xZjA" target="_blank">Download English Datasheet</a> : In this datasheet, the photo would appear to be of an older version but the commands, pins and functionalities are same.<br />
<a href="https://drive.google.com/uc?export=download&amp;id=0BzmrQ1bTvperSmRxc3ZNSGdSdjQ" target="_blank">Download Chinese Datasheet</a></p>
<p>&nbsp;</p>
<p>Other command which we did not added in the code but can be found in the data sheet is the ROLE command:<br />
AT+ROLE=S puts the module in to SLAVE mode, returns OK+ROLE:S<br />
AT+ROLE=M puts the module in to MASTER mode, returns OK+ROLE:M<br />
We did not seen any affect or usage of this command, we will update this section , if there is some information on this part from the manufacturer.</p>
<p>&nbsp;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://learn.edwinrobotics.com/hc-06-bluetooth-module-hookup-guide/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Getting Started with Ardublockly</title>
		<link>https://learn.edwinrobotics.com/getting-started-with-ardublockly/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=getting-started-with-ardublockly</link>
					<comments>https://learn.edwinrobotics.com/getting-started-with-ardublockly/#comments</comments>
		
		<dc:creator><![CDATA[emil]]></dc:creator>
		<pubDate>Mon, 30 Jan 2017 15:33:54 +0000</pubDate>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[General]]></category>
		<guid isPermaLink="false">http://learn.edwinrobotics.com/?p=1222</guid>

					<description><![CDATA[<img width="6000" height="4000" src="https://learn.edwinrobotics.com/wp-content/uploads/2016/05/DSC_0037.jpg" class="attachment- size- wp-post-image" alt="Arduino UNO" style="float:left; margin:0 15px 15px 0;" decoding="async" loading="lazy" srcset="https://learn.edwinrobotics.com/wp-content/uploads/2016/05/DSC_0037.jpg 6000w, https://learn.edwinrobotics.com/wp-content/uploads/2016/05/DSC_0037-300x200.jpg 300w, https://learn.edwinrobotics.com/wp-content/uploads/2016/05/DSC_0037-768x512.jpg 768w, https://learn.edwinrobotics.com/wp-content/uploads/2016/05/DSC_0037-1024x683.jpg 1024w, https://learn.edwinrobotics.com/wp-content/uploads/2016/05/DSC_0037-140x94.jpg 140w" sizes="auto, (max-width: 6000px) 100vw, 6000px" />Ardublockly Ardublockly is a visual programming language that is based on Google&#8217;s Blockly. Being a visual programming language you don&#8217;t need to worry about remembering syntaxes or missing semicolons. The Arduino code is generated when the blocks are connected to perform an action. Ardublockly also displays the actual C code that is being uploaded making [&#8230;]]]></description>
										<content:encoded><![CDATA[<img width="6000" height="4000" src="https://learn.edwinrobotics.com/wp-content/uploads/2016/05/DSC_0037.jpg" class="attachment- size- wp-post-image" alt="Arduino UNO" style="float:left; margin:0 15px 15px 0;" decoding="async" loading="lazy" srcset="https://learn.edwinrobotics.com/wp-content/uploads/2016/05/DSC_0037.jpg 6000w, https://learn.edwinrobotics.com/wp-content/uploads/2016/05/DSC_0037-300x200.jpg 300w, https://learn.edwinrobotics.com/wp-content/uploads/2016/05/DSC_0037-768x512.jpg 768w, https://learn.edwinrobotics.com/wp-content/uploads/2016/05/DSC_0037-1024x683.jpg 1024w, https://learn.edwinrobotics.com/wp-content/uploads/2016/05/DSC_0037-140x94.jpg 140w" sizes="auto, (max-width: 6000px) 100vw, 6000px" /><h2>Ardublockly</h2>
<p>Ardublockly is a visual programming language that is based on Google&#8217;s <a href="https://developers.google.com/blockly/" target="_blank">Blockly</a>. Being a visual programming language you don&#8217;t need to worry about remembering syntaxes or missing semicolons. The Arduino code is generated when the blocks are connected to perform an action. Ardublockly also displays the actual C code that is being uploaded making it easier to understand what goes on in the background.<br />
&nbsp;</p>
<h2>Installing &amp; Configuring Ardublockly</h2>
<p>Get the latest version of Ardublockly from its <a href="https://github.com/carlosperate/ardublockly/releases" target="_blank">github page</a>. Do ensure that you have the latest <a href="https://www.arduino.cc/en/Main/Software" target="_blank">Arduino IDE</a> installed as well, check the Arduino guide for more info on <a href="https://www.arduino.cc/en/Guide/HomePage" target="_blank">how to install Arduino.</a><br />
<span class="collapseomatic " id="id688dff594ec19"  tabindex="0" title="&lt;strong&gt;Installing on Windows&lt;/strong&gt;"    ><strong>Installing on Windows</strong></span><div id="target-id688dff594ec19" class="collapseomatic_content ">
<ol>
<li><strong>Extract Ardublockly &#8211;</strong> Once you have downloaded the latest version of Ardublockly, extract it to a location of your choosing.</li>
<li><strong>Run Ardublockly &#8211; </strong>In the Ardublockly folder <strong>run the ardublockly_run.bat.</strong> This will run Ardublockly and create the <strong>ServerCompilerSettings.ini </strong>file that we need to modify to get Ardublockly working. Once Ardublockly has successfully started you should see the Ardublockly homescreen.
<div id="attachment_1225" style="width: 510px" class="wp-caption aligncenter"><a href="http://learn.edwinrobotics.com/wp-content/uploads/Ardublockly-IDE.png" target="_blank"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1225" class="wp-image-1225" src="http://learn.edwinrobotics.com/wp-content/uploads/Ardublockly-IDE.png" alt="Ardublockly" width="500" height="318" srcset="https://learn.edwinrobotics.com/wp-content/uploads/Ardublockly-IDE.png 1185w, https://learn.edwinrobotics.com/wp-content/uploads/Ardublockly-IDE-300x191.png 300w, https://learn.edwinrobotics.com/wp-content/uploads/Ardublockly-IDE-1024x651.png 1024w" sizes="auto, (max-width: 500px) 100vw, 500px" /></a><p id="caption-attachment-1225" class="wp-caption-text">Ardublockly IDE</p></div></li>
<li><strong>Close Ardublockly &#8211;</strong> Now that the <strong>ServerCompilerSettings.ini</strong> has been created, we can <strong>close Ardublockly</strong></li>
<li><strong>Open ServerCompilerSettings.ini file using Wordpad &#8211;</strong> The <strong>ServerCompilerSettings.ini</strong> file needs to be edited to configure the location of <strong>arduino_debug.exe<br />
</strong><strong>Note: </strong>Open the file using pretty much any text editor other than notepad as notepad does not recognize the line breaks properly</li>
<li><strong>Add location of arduino_debug.exe &#8211;</strong>   The location of <strong>arduino_debug.exe </strong>if installed via the Arduino installer, will be located at <strong>C:\Program Files (x86)\Arduino\arduino_debug.exe</strong>
<div id="attachment_1252" style="width: 510px" class="wp-caption aligncenter"><a href="http://learn.edwinrobotics.com/wp-content/uploads/serverconfig.png" target="_blank"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1252" class="wp-image-1252" src="http://learn.edwinrobotics.com/wp-content/uploads/serverconfig.png" alt="Configuring Ardublockly" width="500" height="163" srcset="https://learn.edwinrobotics.com/wp-content/uploads/serverconfig.png 605w, https://learn.edwinrobotics.com/wp-content/uploads/serverconfig-300x98.png 300w" sizes="auto, (max-width: 500px) 100vw, 500px" /></a><p id="caption-attachment-1252" class="wp-caption-text">ServerCompilerSettings.ini configured using wordpad</p></div></li>
<li><strong>Run Ardublockly &#8211;</strong> To test whether it has been configured properly, <strong>r</strong><strong>un ardublockly_run.bat</strong> and open the preferences ( Edit → Preferences) it should show a window like this
<div id="attachment_1253" style="width: 510px" class="wp-caption aligncenter"><a href="http://learn.edwinrobotics.com/wp-content/uploads/Settings-1.png" target="_blank"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1253" class="wp-image-1253" src="http://learn.edwinrobotics.com/wp-content/uploads/Settings-1.png" alt="Ardublockly Preferences" width="500" height="388" srcset="https://learn.edwinrobotics.com/wp-content/uploads/Settings-1.png 691w, https://learn.edwinrobotics.com/wp-content/uploads/Settings-1-300x233.png 300w" sizes="auto, (max-width: 500px) 100vw, 500px" /></a><p id="caption-attachment-1253" class="wp-caption-text">Ardublockly Preferences</p></div></li>
<li><strong>Select Board &amp; Port &#8211;</strong> Next select the board that is being used, in our case it is the UNO. The available serial port will be shown only if the Arduino is connected.</li>
<li><strong>Test Configuration &#8211;</strong> To ensure everything is all set and done click on the verify button</li>
</ol>
<div id="attachment_1254" style="width: 93px" class="wp-caption aligncenter"><a href="http://learn.edwinrobotics.com/wp-content/uploads/Verify-1.png" target="_blank"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1254" class="wp-image-1254 size-full" src="http://learn.edwinrobotics.com/wp-content/uploads/Verify-1.png" alt="Ardublockly Verify" width="83" height="77" /></a><p id="caption-attachment-1254" class="wp-caption-text"><em>Ardublockly Verify</em></p></div>
<div id="attachment_1255" style="width: 332px" class="wp-caption aligncenter"><a href="http://learn.edwinrobotics.com/wp-content/uploads/Verify-Successfully.png" target="_blank"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1255" class="wp-image-1255 size-full" src="http://learn.edwinrobotics.com/wp-content/uploads/Verify-Successfully.png" alt="Verify Successfully" width="322" height="89" srcset="https://learn.edwinrobotics.com/wp-content/uploads/Verify-Successfully.png 322w, https://learn.edwinrobotics.com/wp-content/uploads/Verify-Successfully-300x83.png 300w" sizes="auto, (max-width: 322px) 100vw, 322px" /></a><p id="caption-attachment-1255" class="wp-caption-text"><em>Verify Successfully</em></p></div>
<ul>
<li>If all goes well the <strong>Successfully Verified Sketch</strong> will be displayed, this <strong>may take 20-30 seconds</strong> on some machines.</li>
</ul>
</div>
<span class="collapseomatic " id="id688dff594edaf"  tabindex="0" title="&lt;strong&gt;Installing on Linux&lt;/strong&gt;"    ><strong>Installing on Linux</strong></span><div id="target-id688dff594edaf" class="collapseomatic_content ">
<ol>
<li><strong>Extract Ardublockly &#8211;</strong> Once you have downloaded the latest version of Ardublockly, extract it to a location of your choosing.</li>
<li><strong>Run Ardublockly &#8211; </strong>In the Ardublockly folder <strong>run the ardublockly_run.sh as root </strong>file from terminal. This will run Ardublockly and create the <strong>ServerCompilerSettings.ini </strong>file that we need to modify to get Ardublockly working. Once Ardublockly has successfully started you should see the Ardublockly homescreen.
<div id="attachment_1315" style="width: 510px" class="wp-caption aligncenter"><a href="http://learn.edwinrobotics.com/wp-content/uploads/Ardublockly-Terminal.png" target="_blank"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1315" class="wp-image-1315" src="http://learn.edwinrobotics.com/wp-content/uploads/Ardublockly-Terminal.png" alt="Ardublockly Terminal" width="500" height="299" srcset="https://learn.edwinrobotics.com/wp-content/uploads/Ardublockly-Terminal.png 732w, https://learn.edwinrobotics.com/wp-content/uploads/Ardublockly-Terminal-300x180.png 300w" sizes="auto, (max-width: 500px) 100vw, 500px" /></a><p id="caption-attachment-1315" class="wp-caption-text"><em>Ardublockly Terminal</em></p></div>
<p>&nbsp;</p>
<div id="attachment_1283" style="width: 510px" class="wp-caption aligncenter"><a href="http://learn.edwinrobotics.com/wp-content/uploads/Ardublockly-Linux.png" target="_blank"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1283" class="wp-image-1283" src="http://learn.edwinrobotics.com/wp-content/uploads/Ardublockly-Linux.png" alt="Ardublockly Linux" width="500" height="330" srcset="https://learn.edwinrobotics.com/wp-content/uploads/Ardublockly-Linux.png 1200w, https://learn.edwinrobotics.com/wp-content/uploads/Ardublockly-Linux-300x198.png 300w, https://learn.edwinrobotics.com/wp-content/uploads/Ardublockly-Linux-1024x677.png 1024w, https://learn.edwinrobotics.com/wp-content/uploads/Ardublockly-Linux-207x136.png 207w, https://learn.edwinrobotics.com/wp-content/uploads/Ardublockly-Linux-430x283.png 430w" sizes="auto, (max-width: 500px) 100vw, 500px" /></a><p id="caption-attachment-1283" class="wp-caption-text"><em>Ardublockly Linux</em></p></div></li>
<li><strong>Close Ardublockly &#8211;</strong> Now that the <strong>ServerCompilerSettings.ini</strong> has been created, we can <strong>close Ardublockly</strong></li>
<li><strong>Open ServerCompilerSettings.ini file &#8211;</strong> The <strong>ServerCompilerSettings.ini</strong> file needs to be edited to configure the location of <strong>arduino</strong></li>
<li><strong>Add location of arduino &#8211;</strong>   <strong>arduino  </strong>is located at the root folder of Arduino, in this case it is <strong><strong>/home/emil/Apps/arduino-1.8.0/arduino<br />
</strong></strong></p>
<div id="attachment_1295" style="width: 510px" class="wp-caption aligncenter"><a href="http://learn.edwinrobotics.com/wp-content/uploads/Ardublockly-gedit.png" target="_blank"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1295" class="wp-image-1295" src="http://learn.edwinrobotics.com/wp-content/uploads/Ardublockly-gedit.png" alt="Editing ServerCompilerSettings.ini in gedit" width="500" height="404" srcset="https://learn.edwinrobotics.com/wp-content/uploads/Ardublockly-gedit.png 900w, https://learn.edwinrobotics.com/wp-content/uploads/Ardublockly-gedit-300x243.png 300w" sizes="auto, (max-width: 500px) 100vw, 500px" /></a><p id="caption-attachment-1295" class="wp-caption-text"><em>Editing ServerCompilerSettings.ini in gedit</em></p></div></li>
<li><strong>Run Ardublockly &#8211;</strong> To test whether it has been configured properly, <strong>Run ardublockly_run.sh as root </strong>from terminal and open the preferences ( Edit → Preferences) it should show a window like this
<div id="attachment_1304" style="width: 510px" class="wp-caption aligncenter"><a href="http://learn.edwinrobotics.com/wp-content/uploads/Ardublockly-Preferences-Linux-e1485846189635.png" target="_blank"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1304" class="wp-image-1304" src="http://learn.edwinrobotics.com/wp-content/uploads/Ardublockly-Preferences-Linux-e1485846189635.png" alt="Ardublockly Preferences on Linux" width="500" height="413" srcset="https://learn.edwinrobotics.com/wp-content/uploads/Ardublockly-Preferences-Linux-e1485846189635.png 690w, https://learn.edwinrobotics.com/wp-content/uploads/Ardublockly-Preferences-Linux-e1485846189635-300x248.png 300w" sizes="auto, (max-width: 500px) 100vw, 500px" /></a><p id="caption-attachment-1304" class="wp-caption-text"><em>Ardublockly Preferences on Linux</em></p></div></li>
<li><strong>Select Board &amp; Port &#8211;</strong> Next select the board that is being used, in our case it is the UNO. The available serial port will be shown only if the Arduino is connected.</li>
<li><strong>Test Configuration &#8211;</strong> To ensure everything is all set and done click on the verify button
<div id="attachment_1254" style="width: 93px" class="wp-caption aligncenter"><a href="http://learn.edwinrobotics.com/wp-content/uploads/Verify-1.png" target="_blank"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1254" class="wp-image-1254 size-full" src="http://learn.edwinrobotics.com/wp-content/uploads/Verify-1.png" alt="Ardublockly Verify" width="83" height="77" /></a><p id="caption-attachment-1254" class="wp-caption-text"><em>Ardublockly Verify</em></p></div>
<div id="attachment_1255" style="width: 332px" class="wp-caption aligncenter"><a href="http://learn.edwinrobotics.com/wp-content/uploads/Verify-Successfully.png" target="_blank"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1255" class="wp-image-1255 size-full" src="http://learn.edwinrobotics.com/wp-content/uploads/Verify-Successfully.png" alt="Verify Successfully" width="322" height="89" srcset="https://learn.edwinrobotics.com/wp-content/uploads/Verify-Successfully.png 322w, https://learn.edwinrobotics.com/wp-content/uploads/Verify-Successfully-300x83.png 300w" sizes="auto, (max-width: 322px) 100vw, 322px" /></a><p id="caption-attachment-1255" class="wp-caption-text"><em>Verify Successfully</em></p></div></li>
<li>If all goes well the <strong>Successfully Verified Sketch</strong> will be displayed</li>
</ol>
</div>
<p>&nbsp;</p>
<h2>Blinking An LED</h2>
<ul>
<li>The first step should be to add the <strong>Arduino Run First/Arduino Loop Forever block</strong> although this is not necessary it will help keep your code clean. It can be found under the <strong>functions category</strong></li>
<p>&nbsp;<br />
<a href="http://learn.edwinrobotics.com/wp-content/uploads/Ardublockly-1.png" target="_blank"><img loading="lazy" decoding="async" class="aligncenter wp-image-1257 size-full" src="http://learn.edwinrobotics.com/wp-content/uploads/Ardublockly-1.png" width="362" height="123" srcset="https://learn.edwinrobotics.com/wp-content/uploads/Ardublockly-1.png 362w, https://learn.edwinrobotics.com/wp-content/uploads/Ardublockly-1-300x102.png 300w" sizes="auto, (max-width: 362px) 100vw, 362px" /></a></p>
<li>This block lets define what instructions need to be run first and what needs to run forever. Most instructions will come under the latter.</li>
<li>Next involves setting the digital pin onto which the LED is connected as either HIGH (ON) or LOW (OFF), this block can be found under the <strong>Input/Output </strong>category</li>
<p>&nbsp;<br />
<a href="http://learn.edwinrobotics.com/wp-content/uploads/Ardublockly-2.png" target="_blank"><img loading="lazy" decoding="async" class="aligncenter wp-image-1258 size-full" src="http://learn.edwinrobotics.com/wp-content/uploads/Ardublockly-2.png" width="367" height="61" srcset="https://learn.edwinrobotics.com/wp-content/uploads/Ardublockly-2.png 367w, https://learn.edwinrobotics.com/wp-content/uploads/Ardublockly-2-300x50.png 300w" sizes="auto, (max-width: 367px) 100vw, 367px" /></a></p>
<li>The on board LED is connected to pin 13, set the pin# to 13 to be able to turn ON the LED. Next comes the delay this will ensure that the pin stays in the HIGH (ON) state for a set period of time. This can be found under the <strong>Time </strong>category. The time is set in milliseconds, 1 second = 1000 milliseconds.</li>
<p>&nbsp;<br />
<a href="http://learn.edwinrobotics.com/wp-content/uploads/Ardublockly-3.png" target="_blank"><img loading="lazy" decoding="async" class="aligncenter wp-image-1259 size-full" src="http://learn.edwinrobotics.com/wp-content/uploads/Ardublockly-3.png" width="238" height="70" /></a></p>
<li>These 2 steps needs to be repeated again but in the LOW state to turn off the LED. The final code will be as follows.</li>
</ul>
<div id="attachment_1265" style="width: 510px" class="wp-caption aligncenter"><a href="http://learn.edwinrobotics.com/wp-content/uploads/Ardublockly-Final-2.png" target="_blank"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1265" class="wp-image-1265" src="http://learn.edwinrobotics.com/wp-content/uploads/Ardublockly-Final-2.png" alt="Blink Code" width="500" height="165" srcset="https://learn.edwinrobotics.com/wp-content/uploads/Ardublockly-Final-2.png 1032w, https://learn.edwinrobotics.com/wp-content/uploads/Ardublockly-Final-2-300x99.png 300w, https://learn.edwinrobotics.com/wp-content/uploads/Ardublockly-Final-2-1024x337.png 1024w" sizes="auto, (max-width: 500px) 100vw, 500px" /></a><p id="caption-attachment-1265" class="wp-caption-text"><em>Blink Code</em></p></div>
<ul>
<li>Click the upload button to push the code to the Arduino.</li>
</ul>
<div id="attachment_1272" style="width: 282px" class="wp-caption aligncenter"><a href="http://learn.edwinrobotics.com/wp-content/uploads/Upload.png" target="_blank"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1272" class="wp-image-1272 size-full" src="http://learn.edwinrobotics.com/wp-content/uploads/Upload.png" alt="Upload Ardublockly" width="272" height="95" /></a><p id="caption-attachment-1272" class="wp-caption-text"><em>Upload Button (Center Button)</em></p></div>
<ul>
<li>If all goes well, the LED should start blinking now.</li>
</ul>
<div id="attachment_1275" style="width: 510px" class="wp-caption aligncenter"><a href="http://learn.edwinrobotics.com/wp-content/uploads/Upload-Successfully.png" target="_blank"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1275" class="wp-image-1275" src="http://learn.edwinrobotics.com/wp-content/uploads/Upload-Successfully.png" alt="Successful Upload - Ardublockly" width="500" height="320" srcset="https://learn.edwinrobotics.com/wp-content/uploads/Upload-Successfully.png 1184w, https://learn.edwinrobotics.com/wp-content/uploads/Upload-Successfully-300x192.png 300w, https://learn.edwinrobotics.com/wp-content/uploads/Upload-Successfully-1024x656.png 1024w" sizes="auto, (max-width: 500px) 100vw, 500px" /></a><p id="caption-attachment-1275" class="wp-caption-text"><em>Successful Upload</em></p></div>
]]></content:encoded>
					
					<wfw:commentRss>https://learn.edwinrobotics.com/getting-started-with-ardublockly/feed/</wfw:commentRss>
			<slash:comments>1</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>Tutorial: Switch, transistor and Buzzer on Breadboard</title>
		<link>https://learn.edwinrobotics.com/tutorial-switch-transistor-and-buzzer-on-breadboard/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=tutorial-switch-transistor-and-buzzer-on-breadboard</link>
					<comments>https://learn.edwinrobotics.com/tutorial-switch-transistor-and-buzzer-on-breadboard/#respond</comments>
		
		<dc:creator><![CDATA[Abhishek Nair]]></dc:creator>
		<pubDate>Wed, 29 Jun 2016 15:41:56 +0000</pubDate>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Breadboard]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Raspberry Pi]]></category>
		<guid isPermaLink="false">http://learn.edwinrobotics.com/?p=608</guid>

					<description><![CDATA[Let start with building something interesting, in the previous tutorial you seen the functionality of  LED and we taught you the basics of breadboard, in this section we are going to show something more interesting, this tutorial is mainly focused on transistors which is basic common part in all of today&#8217;s electronics, they are just simple [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Let start with building something interesting, in the <a href="http://learn.edwinrobotics.com/tutorial-how-to-breadboard-led/" target="_blank">previous tutorial</a> you seen the functionality of  LED and we taught you the basics of breadboard, in this section we are going to show something more interesting, this tutorial is mainly focused on transistors which is basic common part in all of today&#8217;s electronics, they are just simple switches that we can use to turn things on and off. Even though they are simple, they are the most important electrical component. These are basic building block of any Integrated Circuits(IC), For example, transistors are almost the only components used to build a Pentium processor. A single Pentium chip has about 3.5 million transistors. The ones in the Pentium are smaller than the ones we will use but they work the same way.</p>
<p>&nbsp;</p>
<p>To understand transistor better we will start with one of the basic component we seen in electronic circuit, its nothing but switch, refer the image below:</p>
<p>&nbsp;</p>
<p><a href="http://learn.edwinrobotics.com/wp-content/uploads/Switch-Description.jpg" target="_blank"><img loading="lazy" decoding="async" class="alignnone wp-image-592 size-full" src="http://learn.edwinrobotics.com/wp-content/uploads/Switch-Description.jpg" alt="Switch Description" width="3552" height="2200" srcset="https://learn.edwinrobotics.com/wp-content/uploads/Switch-Description.jpg 3552w, https://learn.edwinrobotics.com/wp-content/uploads/Switch-Description-300x186.jpg 300w, https://learn.edwinrobotics.com/wp-content/uploads/Switch-Description-1024x634.jpg 1024w" sizes="auto, (max-width: 3552px) 100vw, 3552px" /></a></p>
<p>&nbsp;</p>
<p>These switches are nothing but momentary push buttons, means when you press them then only it will be functional(i.e ON) otherwise it will remain OFF. Lets build a simple circuit on breadboard using a switch, refer the image below to build your circuit:</p>
<p>&nbsp;</p>
<p><a href="http://learn.edwinrobotics.com/wp-content/uploads/LED-SWITCH.jpg" target="_blank"><img loading="lazy" decoding="async" class="alignnone wp-image-575 size-full" src="http://learn.edwinrobotics.com/wp-content/uploads/LED-SWITCH.jpg" alt="LED-SWITCH" width="2572" height="2123" srcset="https://learn.edwinrobotics.com/wp-content/uploads/LED-SWITCH.jpg 2572w, https://learn.edwinrobotics.com/wp-content/uploads/LED-SWITCH-300x248.jpg 300w, https://learn.edwinrobotics.com/wp-content/uploads/LED-SWITCH-1024x845.jpg 1024w" sizes="auto, (max-width: 2572px) 100vw, 2572px" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><strong>Note: We had Connected 5v supply and GND from Arduino board in the above image, you can use Raspberry Pi or any other boards you having with you to supply 5v and GND from the board.</strong> <strong>If you having our <a href="https://shop.edwinrobotics.com/kits/547-raspberry-pi-electronics-starter-kit.html" target="_blank">Raspberry Pi Electronics Starter kit</a> with you, then you can use the <a href="https://shop.edwinrobotics.com/raspberry-pi/394-raspio-portsplus.html" target="_blank">RasPiO Portplus</a> we provided with the kit, to find the 5v and GND pins on Raspberry Pi and use the <a href="https://shop.edwinrobotics.com/wires/19-male-female-jumper-wires.html" target="_blank">Male-Female Jumper wire</a> we provided in the Kit to Supply power to the LED-Switch Circuit on breadboard.</strong></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Now if you see, you can understand that this circuit is nothing but modification of the previous LED breadboard tutorial, here we have added one switch to the LED circuit. Care must be taken when you connect the switch. Out of four legs you will get two shorted legs, as described in the image, you refer the cut mark on the bottom of the switch to understand which sides of the switch are shorted. Make sure that the mark on the switch and the breadboard columns should match otherwise your switch will not functional properly.</p>
<p>&nbsp;</p>
<p style="padding-left: 120px;"><a href="http://learn.edwinrobotics.com/wp-content/uploads/LED-Switch.jpg" target="_blank"><img loading="lazy" decoding="async" class="alignnone wp-image-611 size-full" src="http://learn.edwinrobotics.com/wp-content/uploads/LED-Switch.jpg" alt="LED+ Switch" width="351" height="921" srcset="https://learn.edwinrobotics.com/wp-content/uploads/LED-Switch.jpg 351w, https://learn.edwinrobotics.com/wp-content/uploads/LED-Switch-114x300.jpg 114w" sizes="auto, (max-width: 351px) 100vw, 351px" /></a></p>
<p>&nbsp;</p>
<p>When you power the above circuit, the LED won&#8217;t glow, its because the circuit is controlled by Switch now, so if you press the Switch now, you will see that the LED will remain On till the moment you press the Switch, otherwise it will remain off. The transistors works in similar fashion, its works as Switch, except that, with switch you need to use your hands to push it and made the LED glow, here with transistors you need to apply logics to turn the LED ON and OFF. Thus applying logic&#8217;s will simulate the key press in the transistor.</p>
<p>&nbsp;</p>
<p>All the Electronic Components runs on two logic&#8217;s only <strong>1(HIGH)</strong> and <strong>0(LOW), </strong>When you apply Logic High to transistor the transistor will either turn ON or turn OFF depending on the transistor type. Before we see the types, we will clear you what this Logic High and Low Means. Any Electronic Machine understands only two voltages/ Logic&#8217;s and they are  <strong>Vcc/ Logic 1(High)</strong> and <strong>Gnd/ Logic 0(LOW)</strong></p>
<p>&nbsp;</p>
<p>Now, we will see what are types of transistor:</p>
<ol>
<li>NPN</li>
<li>PNP</li>
</ol>
<p>&nbsp;</p>
<p>The NPN is nothing but N-Type transistor, which will activates when you supply a Logic High to it. Similarly, The PNP is nothing but P-Type transistor, which will activates when you supply a Logic Low to it.</p>
<p>&nbsp;</p>
<p style="padding-left: 90px;"><a href="http://learn.edwinrobotics.com/wp-content/uploads/Transistor-P.jpg"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-613" src="http://learn.edwinrobotics.com/wp-content/uploads/Transistor-P.jpg" alt="Transistor-P" width="387" height="888" srcset="https://learn.edwinrobotics.com/wp-content/uploads/Transistor-P.jpg 387w, https://learn.edwinrobotics.com/wp-content/uploads/Transistor-P-131x300.jpg 131w" sizes="auto, (max-width: 387px) 100vw, 387px" /></a></p>
<p style="padding-left: 90px;"><a href="http://learn.edwinrobotics.com/wp-content/uploads/Transistor-N.jpg"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-612" src="http://learn.edwinrobotics.com/wp-content/uploads/Transistor-N.jpg" alt="Transistor-N" width="394" height="894" srcset="https://learn.edwinrobotics.com/wp-content/uploads/Transistor-N.jpg 394w, https://learn.edwinrobotics.com/wp-content/uploads/Transistor-N-132x300.jpg 132w" sizes="auto, (max-width: 394px) 100vw, 394px" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Refer the two different types of circuit shown above, you will clearly understand the difference between the two types of transistors working. The P type will turn on the LED when you applied Logic low to the transistor and the N type will turn on the LED, when you apply Logic High to the transistor.</p>
<p>&nbsp;</p>
<p>Note: The logic&#8217;s will be applied to <strong>base/gate</strong> Pin of transistors, the other two pins are <strong>emitter/drain</strong> and <strong>Collector/source</strong>.Collector/Source pin used to connect the transistor from power source and emitter/drain pin used to connect with loads.The Pin descriptions are mentioned in the datasheet of each transistor, so there is no need to worry about it as of now.</p>
<p>&nbsp;</p>
<p>Now we will move one step further and add some sound to the project, till now when we press the switch or apply the logic&#8217;s to transistor the LED will lit up. let us add one piezo buzzer to the breadboard and see what happens when we press the switch.</p>
<p>&nbsp;</p>
<p><a href="http://learn.edwinrobotics.com/wp-content/uploads/Buzzer-DEscription.jpg" target="_blank"><img loading="lazy" decoding="async" class="alignnone wp-image-588 size-full" src="http://learn.edwinrobotics.com/wp-content/uploads/Buzzer-DEscription.jpg" alt="Buzzer DEscription" width="3481" height="2466" srcset="https://learn.edwinrobotics.com/wp-content/uploads/Buzzer-DEscription.jpg 3481w, https://learn.edwinrobotics.com/wp-content/uploads/Buzzer-DEscription-300x213.jpg 300w, https://learn.edwinrobotics.com/wp-content/uploads/Buzzer-DEscription-1024x725.jpg 1024w" sizes="auto, (max-width: 3481px) 100vw, 3481px" /></a></p>
<p>&nbsp;</p>
<p>Refer the schematic below to build your own circuit in a breadboard.</p>
<p>&nbsp;</p>
<p style="padding-left: 60px;"> <a href="http://learn.edwinrobotics.com/wp-content/uploads/TRANSISTOR-BUZZER-_LED.jpg" target="_blank"><img loading="lazy" decoding="async" class="alignnone wp-image-617 size-full" src="http://learn.edwinrobotics.com/wp-content/uploads/TRANSISTOR-BUZZER-_LED.jpg" alt="TRANSISTOR + BUZZER _LED" width="607" height="956" srcset="https://learn.edwinrobotics.com/wp-content/uploads/TRANSISTOR-BUZZER-_LED.jpg 607w, https://learn.edwinrobotics.com/wp-content/uploads/TRANSISTOR-BUZZER-_LED-190x300.jpg 190w" sizes="auto, (max-width: 607px) 100vw, 607px" /></a></p>
<p>&nbsp;</p>
<p>In the above shown example we had used Arduino as 5v power source to power the breadboard, you can use any other power source as per you convenience. Now if look at the circuit we had Used N-type(NPN) transistor, now if you google for <strong>BC547 </strong>Datasheet, you will see lots of options, open any one datasheet .pdf document, once you scan through all the pages you will notice lots of details about transistor is mentioned in it, right now we are focusing on the type, voltage and current of the transistor. If check you will see all these data  withing the first 5 pages. There its mentioned:</p>
<blockquote><p><strong>BC547</strong></p>
<ul>
<li>NPN Epitaxial Silicon Transistor</li>
<li>Vceo: 45v</li>
<li>100mA</li>
</ul>
</blockquote>
<p>&nbsp;</p>
<p>we seen that its N-Type(NPN) and its maximum voltage is 45v which is more than enough, since we are running only on 5v. Regarding current, if we calculate the current required for the loads, the LED needs 15mA and the buzzer needs 40mA max, thus combining two, its comes under 60mA, thus we are good to go with same transistor. If your loads exceeds the rated current go for higher current transistor. Refer the image below for the Pin description of the BC547 Transistor we are using.</p>
<p>&nbsp;</p>
<p><a href="http://learn.edwinrobotics.com/wp-content/uploads/Transistor.jpg" target="_blank"><img loading="lazy" decoding="async" class="alignnone wp-image-593 size-full" src="http://learn.edwinrobotics.com/wp-content/uploads/Transistor.jpg" alt="Transistor#" width="3756" height="2201" srcset="https://learn.edwinrobotics.com/wp-content/uploads/Transistor.jpg 3756w, https://learn.edwinrobotics.com/wp-content/uploads/Transistor-300x176.jpg 300w, https://learn.edwinrobotics.com/wp-content/uploads/Transistor-1024x600.jpg 1024w" sizes="auto, (max-width: 3756px) 100vw, 3756px" /></a></p>
<p>&nbsp;</p>
<p>You can see that we are supplying High Logic from switch to transistor, so when you press the switch the Vcc(5v) will be applied to gate pin of transistor and this will activate the transistor, allowing the current to flow through LED and Buzzer and in return we can see and hear the light and sound respectively.</p>
<p>Note: Don&#8217;t forget to add current limiting resistor for buzzer and resistor and polarity of the buzzer must be taken care of similar to that of LED.</p>
<p>&nbsp;</p>
<p>So, this is all about the welcome little step you made into hands on with electronics, in the next tutorial, we will show you how to use microcontrollers/Arduino to control these kind of circuits.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://learn.edwinrobotics.com/tutorial-switch-transistor-and-buzzer-on-breadboard/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Tutorial: How to Breadboard LED</title>
		<link>https://learn.edwinrobotics.com/tutorial-how-to-breadboard-led/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=tutorial-how-to-breadboard-led</link>
					<comments>https://learn.edwinrobotics.com/tutorial-how-to-breadboard-led/#comments</comments>
		
		<dc:creator><![CDATA[Abhishek Nair]]></dc:creator>
		<pubDate>Tue, 28 Jun 2016 16:10:25 +0000</pubDate>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Breadboard]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Raspberry Pi]]></category>
		<guid isPermaLink="false">http://learn.edwinrobotics.com/?p=553</guid>

					<description><![CDATA[Heard of breadboard? Sure you do, but some of you don&#8217;t have much idea that, what this little piece can do, we will start with some of the basics of breadboards before we start with projects. Breadboards are one of the basic element when you start learning how to build circuits. Breadboards are preferred platform [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Heard of breadboard? Sure you do, but some of you don&#8217;t have much idea that, what this little piece can do, we will start with some of the basics of breadboards before we start with projects. Breadboards are one of the basic element when you start learning how to build circuits. Breadboards are preferred platform to start building circuits because it don&#8217;t need any soldering, thus giving you the flexibility to try, test and modify your circuit at any point of time. They allow you to make quick circuits, test out ideas and allow prototyping before making a permanent Printed Circuit Board. They are inexpensive and reusable and they are easily available in any electronics store.</p>
<p>Breadboard is nothing but a plastic base with lots of holes in it, where you can fit in your components and wires to build your circuit. You can&#8217;t see what&#8217;s going inside the breadboard, but inside its nothing but many strips of metal that connect the rows and columns together. These metal strips are springy so that when you poke a wire or component into the hole, the clips grab onto it.</p>
<p>Breadboards are used for both the simplest circuit as well as very complex circuits. In case one breadboard can&#8217;t accommodate your circuit, you can snap in multiple breadboards together to make a big breadboard base. You can use breadboard to test and figure out the working of Integrated circuits (ICs).</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><a href="http://learn.edwinrobotics.com/wp-content/uploads/DSC_0072.jpg" target="_blank"><img loading="lazy" decoding="async" class="alignnone wp-image-558 size-full" src="http://learn.edwinrobotics.com/wp-content/uploads/DSC_0072.jpg" alt="DSC_0072" width="3768" height="2656" srcset="https://learn.edwinrobotics.com/wp-content/uploads/DSC_0072.jpg 3768w, https://learn.edwinrobotics.com/wp-content/uploads/DSC_0072-300x211.jpg 300w, https://learn.edwinrobotics.com/wp-content/uploads/DSC_0072-1024x722.jpg 1024w" sizes="auto, (max-width: 3768px) 100vw, 3768px" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><a href="http://learn.edwinrobotics.com/wp-content/uploads/Breadboard_Description.jpg" target="_blank"><img loading="lazy" decoding="async" class="alignnone wp-image-586 size-full" src="http://learn.edwinrobotics.com/wp-content/uploads/Breadboard_Description.jpg" alt="Breadboard_Description" width="3768" height="2656" srcset="https://learn.edwinrobotics.com/wp-content/uploads/Breadboard_Description.jpg 3768w, https://learn.edwinrobotics.com/wp-content/uploads/Breadboard_Description-300x211.jpg 300w, https://learn.edwinrobotics.com/wp-content/uploads/Breadboard_Description-1024x722.jpg 1024w" sizes="auto, (max-width: 3768px) 100vw, 3768px" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>If you refer the description in the image above you can see that the how tracks are connected inside the breadboard. Refer the Vcc and Gnd Lines in the image above, you can see these two lines are running round the borders, thus allowing us to use these lines for power supply distribution, but there is a discontinuity in Vcc and Gnd tracks as shown above(mentioned &#8220;Not Connected&#8221;), which you need to connect with jumpers to distribute the power. The center holes are column connected as shown in the picture and there is a gap in between the same columns, allowing us to fit in IC to the gap. To make things further clear, we have added the tear down image of the breadboard, refer the next diagram to get better idea of inside connections.</p>
<p>&nbsp;</p>
<p><a href="http://learn.edwinrobotics.com/wp-content/uploads/Breadboard-Teardown.jpg" target="_blank"><img loading="lazy" decoding="async" class="alignnone wp-image-572 size-full" src="http://learn.edwinrobotics.com/wp-content/uploads/Breadboard-Teardown.jpg" alt="Breadboard Teardown" width="1772" height="1606" srcset="https://learn.edwinrobotics.com/wp-content/uploads/Breadboard-Teardown.jpg 1772w, https://learn.edwinrobotics.com/wp-content/uploads/Breadboard-Teardown-300x272.jpg 300w, https://learn.edwinrobotics.com/wp-content/uploads/Breadboard-Teardown-1024x928.jpg 1024w" sizes="auto, (max-width: 1772px) 100vw, 1772px" /></a></p>
<p>&nbsp;</p>
<p>The image shown above is of Half sized breadboard, thus don&#8217;t be confused comparing it with previous images. Hope things are clear to this point and you understood the breadboard well, now we will move further and see how to start building basic circuits on this breadboard. We are going to start with LED circuit, which is common to all the devices, we are going to build a circuit for Power LED Indication, i.e whenever there is power in the circuit, this led will let us know about it.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><a href="http://learn.edwinrobotics.com/wp-content/uploads/LED-Description-.jpg" target="_blank"><img loading="lazy" decoding="async" class="alignnone wp-image-603 size-full" src="http://learn.edwinrobotics.com/wp-content/uploads/LED-Description-.jpg" alt="LED Description-" width="3029" height="2252" srcset="https://learn.edwinrobotics.com/wp-content/uploads/LED-Description-.jpg 3029w, https://learn.edwinrobotics.com/wp-content/uploads/LED-Description--300x223.jpg 300w, https://learn.edwinrobotics.com/wp-content/uploads/LED-Description--1024x761.jpg 1024w" sizes="auto, (max-width: 3029px) 100vw, 3029px" /></a></p>
<p>&nbsp;</p>
<p>If you notice the above image you will see the legs of LED mentioned with Anode and cathode and to understand how to distinguish between anode and cathode pins, we provided hints in the image, its nothing but one cut mark(Means the LED is not completely round from the bottom side) which indicates that the leg underneath it is cathode(-ve) pin and if we seen the size of the legs, the anode(+ve) pin is little longer. But most of the times you have to trim the legs of LED when you use these LED in any circuit thus making the anode pins and cathode pins indistinguishable in terms of Leg size.</p>
<p>&nbsp;</p>
<p>The importance of anode and cathode pins in LED is that, LED will glow only is you provide <strong>+ve power supply to Anode pin</strong> and &#8211;<strong>ve power supply to Cathode Pin. </strong>But wait, you cannot straight away supply the LED with power supply because there are chances that more current will pass through LED and this will lead to damage the LED, to avoid this situation, it is strongly recommended to use the resistor along with LED.</p>
<p><a href="http://learn.edwinrobotics.com/wp-content/uploads/LEDREsistor.jpg" target="_blank"><img loading="lazy" decoding="async" class="alignnone wp-image-578 size-full" src="http://learn.edwinrobotics.com/wp-content/uploads/LEDREsistor.jpg" alt="LED+REsistor" width="457" height="834" srcset="https://learn.edwinrobotics.com/wp-content/uploads/LEDREsistor.jpg 457w, https://learn.edwinrobotics.com/wp-content/uploads/LEDREsistor-164x300.jpg 164w" sizes="auto, (max-width: 457px) 100vw, 457px" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>The circuit will be something like shown above. But it is really important to use the correct resistor value in the circuit to limit the current. We will show you how to select the correct resistor value for each circuit. For this, you need to understand two necessary parameters of LED, i.e <strong>LED Current</strong> and <strong>LED Forward voltage</strong>, refer the section below, for detailed description:</p>
<p>&nbsp;</p>
<h3>LED Current:</h3>
<p>As an example we will <a href="https://drive.google.com/uc?export=download&amp;id=0BzmrQ1bTvperZXpseVRrYk55N1E" target="_blank">refer the datasheet</a> for Basic Red 5mm LED.Starting at the top and making our way down, the first thing we encounter is this Absolute maximum ratings table:</p>
<p><a href="https://cdn.sparkfun.com/assets/8/a/5/0/2/51f20420ce395fe058000000.JPG"><img decoding="async" src="https://cdn.sparkfun.com/assets/8/a/5/0/2/51f20420ce395fe058000000.JPG" alt="alt text" /></a></p>
<p>Confused?  Questions coming that what does it all mean? right ?</p>
<p>So, the first row in the table indicates how much current your LED will be able to handle continuously. In this case, <strong>you can give it 20mA or less, and it will shine its brightest at 20mA</strong>. The second row tells us what the maximum peak current should be for short bursts. This LED can handle short bumps to 30mA, but you don’t want to sustain that current for too long. This datasheet is even helpful enough to suggest a stable current range (in the third row from the top) of 16-18mA. That’s a good target number to help you make the resistor calculations we talked about.</p>
<p>The following few rows are of less importance for the purposes of this tutorial. The reverse voltage is a diode property that you shouldn’t have to worry about in most cases. The power dissipation is the amount of power in milliWatts that the LED can use before taking damage. This should work itself out as long as you keep the LED within its suggested voltage and current ratings.</p>
<h3></h3>
<h3>LED Forward Voltage</h3>
<p>Now, when you check the datasheet further, you will come across the next table shown as follows:</p>
<p><a href="https://cdn.sparkfun.com/assets/4/4/9/0/9/51f6d886ce395f8c67000006.jpg"><img decoding="async" src="https://cdn.sparkfun.com/assets/4/4/9/0/9/51f6d886ce395f8c67000006.jpg" alt="alt text" /></a></p>
<p>Now,this is a useful little table! The first row tells us what the <strong>forward voltage</strong> drop across the LED will be. Forward voltage is a term that will come up a lot when working with LEDs. This number will help you decide how much voltage your circuit will need to supply to the LED.You need to follow the following formula every time you build circuits something with LED, refer the section below:</p>
<p style="text-align: left;">The basic ohm&#8217;s law states that:</p>
<blockquote>
<h2 style="text-align: left;"><strong>V = I x R    or   R = V/I</strong></h2>
<p>where,</p>
<p>V = Supply Voltage</p>
<p>I = Current through LED</p>
<p>R = Circuit Resistor</p></blockquote>
<p>Thus, applying this law for LED circuit, we will get following formula:</p>
<blockquote><p><a href="https://cdn.sparkfun.com/assets/8/3/4/4/e/515f354dce395fc424000000.png" target="_blank"><img loading="lazy" decoding="async" class="alignnone" src="https://cdn.sparkfun.com/assets/8/3/4/4/e/515f354dce395fc424000000.png" alt="Current limiting resistor = (Vs-Vf)/If" width="215" height="86" /></a></p>
<p>Where,</p>
<p>V<sub>S</sub> = Source voltage (usually a battery or power supply voltage)</p>
<p>V<sub>F</sub> = LED’s forward voltage</p>
<p>I<sub>F</sub> = Desired current that runs through it.</p></blockquote>
<p>For example, assume in this example you have a 9V battery to power an LED. If your LED is red, it might have a forward voltage around 1.8V. If you want to limit the current to 10mA (or 0.010A) rather than limiting it to 20mA , use a series resistor of about 720Ω.</p>
<p><a href="https://cdn.sparkfun.com/assets/3/2/b/a/2/515f369cce395f5425000000.png" target="_blank"><img loading="lazy" decoding="async" class="alignnone" src="https://cdn.sparkfun.com/assets/3/2/b/a/2/515f369cce395f5425000000.png" alt="Current limiting example equation R=(9-1.8)/.010" width="500" height="86" /></a></p>
<p>Now, if we are going to build power supply Indicator circuit for 5v system, thus our resistor calculation will come somewhat like this:</p>
<blockquote><p>R = (5-1.8)V ÷ 0.010A</p>
<p>R = 3.2V ÷ 0.010 A</p>
<p>R =  320 V/A</p>
<p>R = 320 Ω</p>
<p>R = 330Ω Approx (Nearest standard resistor value)</p></blockquote>
<p>&nbsp;</p>
<h3></h3>
<p>Thus if you notice in the circuit shown above, you will see that we had used 330Ω resistor in the circuit, but wait you may be confused with how the resistor shown above is 330Ω, its again you need to follow the ring colors on the resistor surface. Refer the image below for better idea:</p>
<p>&nbsp;</p>
<p><a href="http://learn.edwinrobotics.com/wp-content/uploads/Resistor-Color-Guide-.jpg" target="_blank"><img loading="lazy" decoding="async" class="alignnone wp-image-602 size-full" src="http://learn.edwinrobotics.com/wp-content/uploads/Resistor-Color-Guide-.jpg" alt="Resistor Color Guide-" width="3781" height="2532" srcset="https://learn.edwinrobotics.com/wp-content/uploads/Resistor-Color-Guide-.jpg 3781w, https://learn.edwinrobotics.com/wp-content/uploads/Resistor-Color-Guide--300x201.jpg 300w, https://learn.edwinrobotics.com/wp-content/uploads/Resistor-Color-Guide--1024x686.jpg 1024w, https://learn.edwinrobotics.com/wp-content/uploads/Resistor-Color-Guide--140x94.jpg 140w" sizes="auto, (max-width: 3781px) 100vw, 3781px" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>If you notice in the image, it is well documented how the 330Ω value is calculated. Refer the formula shown on the image, which will help you to find out the resistance value of the resistor, you just need to substitute the A,B,C and D value in the formula based on the colored ring.</p>
<p>In our case the resistor colors are orange, orange, brown, gold in sequence, thus if we substitute the corresponding values of the colors in the formula, yow will get: 33 x 10, which is nothing but 330 with 5% tolerance, tolerance will let you know how good the resistor is?</p>
<p>In this case its 5% means: The resistance value is limited within the vast range [<strong>270 &#8211; (5% of 270)</strong>]<strong>  </strong>and  [<strong>270 +</strong> <strong>(5% of 270)</strong>], which is not good, the lesser the range, the more close the resistance to the desired resistance value.</p>
<p>&nbsp;</p>
<p>Let start assembling the circuit in the breadboard, refer the image below for better idea:</p>
<p>&nbsp;</p>
<p><a href="http://learn.edwinrobotics.com/wp-content/uploads/LED-1.jpg" target="_blank"><img loading="lazy" decoding="async" class="alignnone wp-image-574 size-full" src="http://learn.edwinrobotics.com/wp-content/uploads/LED-1.jpg" alt="LED-1" width="4248" height="2764" srcset="https://learn.edwinrobotics.com/wp-content/uploads/LED-1.jpg 4248w, https://learn.edwinrobotics.com/wp-content/uploads/LED-1-300x195.jpg 300w, https://learn.edwinrobotics.com/wp-content/uploads/LED-1-1024x666.jpg 1024w, https://learn.edwinrobotics.com/wp-content/uploads/LED-1-207x136.jpg 207w, https://learn.edwinrobotics.com/wp-content/uploads/LED-1-260x170.jpg 260w" sizes="auto, (max-width: 4248px) 100vw, 4248px" /></a></p>
<p>&nbsp;</p>
<p>Now, you can see how we utilized the breadboard columns which are internally shorted to connect the LED anode pin with resistor, similarly we used the jumper wires to connect the LED cathode pin and resistor other end. Now if you power the above shown circuit, i.e Red wire with 5v and Black with Ground supply, you will see that your LED will glow safely.</p>
<p>&nbsp;</p>
<p><strong>Note: We had Connected 5v supply and GND from Arduino board in the following image, you can use Raspberry Pi or any other boards you having with you to supply 5v and GND from the board. If you having our <a href="https://shop.edwinrobotics.com/kits/547-raspberry-pi-electronics-starter-kit.html" target="_blank">Raspberry Pi Electronics Starter kit</a> with you, then you can use the <a href="https://shop.edwinrobotics.com/raspberry-pi/394-raspio-portsplus.html" target="_blank">RasPiO Portplus</a> we provided with the kit, to find the 5v and GND pins on Raspberry Pi and use the <a href="https://shop.edwinrobotics.com/wires/19-male-female-jumper-wires.html" target="_blank">Male-Female Jumper wire</a> we provided in the Kit to Supply power to the LED on breadboard.</strong></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><a href="http://learn.edwinrobotics.com/wp-content/uploads/LED.jpg" target="_blank"><img loading="lazy" decoding="async" class="alignnone wp-image-573 size-full" src="http://learn.edwinrobotics.com/wp-content/uploads/LED.jpg" alt="LED" width="3960" height="2213" srcset="https://learn.edwinrobotics.com/wp-content/uploads/LED.jpg 3960w, https://learn.edwinrobotics.com/wp-content/uploads/LED-300x168.jpg 300w, https://learn.edwinrobotics.com/wp-content/uploads/LED-1024x572.jpg 1024w" sizes="auto, (max-width: 3960px) 100vw, 3960px" /></a></p>
<p>&nbsp;</p>
<p>Now, we want you to build one circuit on your own with multiple LED&#8217;s in series, but before doing that, we want to clear some basics related to building such circuits. When you went through<strong> LED forward voltage</strong> section above, you seen the table with LED forward voltage, you must use that value to find out how much LED you can use in your circuit. When using multiple LED&#8217;s in series, always remember that the Forward Voltage of all of your LEDs added together can’t exceed your system voltage. This is because every component in your circuit has to <em>share</em> the voltage, and the amount of voltage that every part uses together will always equal the amount that’s available. This is called <a href="https://en.wikipedia.org/wiki/Kirchhoff%27s_circuit_laws" target="_blank">Kirchhoff’s Voltage Law</a>. So if you have a 9V power supply and each of your LEDs have a forward voltage drop of 2.4V then you can’t power more than three at a time.</p>
<p>Kirchhoff’s Laws also come in handy when you want to approximate the voltage across a given part based on the Forward Voltage of other parts. For instance, in the example we just mentioned there’s a 9V supply and 3 LEDs with a 2.4V Forward Voltage Drop each. Of course we would want to include a current limiting resistor, right? How would you find out the voltage across that resistor? It’s easy:</p>
<blockquote><p>9 (System Voltage) = 2.4 (LED 1) + 2.4 (LED 2) + 2.4 (LED 3) + Resistor</p>
<p>9 = 7.2 + Resistor</p>
<p>Resistor = 9 &#8211; 7.2</p>
<p>Resistor = 1.8</p></blockquote>
<p>So there is 1.8V across the resistor! This is a simplified example and it isn’t always this easy, but hopefully this gives you an idea of why <strong>Forward Voltage Drop</strong> is important. Using the voltage number you derive from Kirchhoff’s Laws you can also do things like determine the current across a component using Ohm’s Law. In short, you want your system voltage equal to the expected forward voltage of your combined circuit components.</p>
<p>Hope the things are more clear to you now and this is the end of your first basic steps towards hands on with electronics. Refer the next tutorial for more advanced Projects.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://learn.edwinrobotics.com/tutorial-how-to-breadboard-led/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>Ethernet Hookup Guide</title>
		<link>https://learn.edwinrobotics.com/ethernet-hookup-guide/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ethernet-hookup-guide</link>
					<comments>https://learn.edwinrobotics.com/ethernet-hookup-guide/#respond</comments>
		
		<dc:creator><![CDATA[Abhishek Nair]]></dc:creator>
		<pubDate>Wed, 08 Jun 2016 12:30:01 +0000</pubDate>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Ethernet]]></category>
		<guid isPermaLink="false">http://learn.edwinrobotics.com/?p=485</guid>

					<description><![CDATA[<img width="6000" height="4000" src="https://learn.edwinrobotics.com/wp-content/uploads/Ethernet-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/Ethernet-cover.jpg 6000w, https://learn.edwinrobotics.com/wp-content/uploads/Ethernet-cover-300x200.jpg 300w, https://learn.edwinrobotics.com/wp-content/uploads/Ethernet-cover-1024x683.jpg 1024w, https://learn.edwinrobotics.com/wp-content/uploads/Ethernet-cover-140x94.jpg 140w" sizes="auto, (max-width: 6000px) 100vw, 6000px" />&#160; There are cases where we cannot totally rely on WiFi network for internet connectivity with device, thus we will prefer to use wired connection in such cases, network critical applications must be provided with wireless and wired connectivity options in order to achieve greater result and to get more flexibility and reliability and this [&#8230;]]]></description>
										<content:encoded><![CDATA[<img width="6000" height="4000" src="https://learn.edwinrobotics.com/wp-content/uploads/Ethernet-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/Ethernet-cover.jpg 6000w, https://learn.edwinrobotics.com/wp-content/uploads/Ethernet-cover-300x200.jpg 300w, https://learn.edwinrobotics.com/wp-content/uploads/Ethernet-cover-1024x683.jpg 1024w, https://learn.edwinrobotics.com/wp-content/uploads/Ethernet-cover-140x94.jpg 140w" sizes="auto, (max-width: 6000px) 100vw, 6000px" /><p>&nbsp;</p>
<p>There are cases where we cannot totally rely on WiFi network for internet connectivity with device, thus we will prefer to use wired connection in such cases, network critical applications must be provided with wireless and wired connectivity options in order to achieve greater result and to get more flexibility and reliability and this can be accomplished by integrating the Ethernet protocol, which is the basic of the communication protocol used in the internet into the embedded system. There are lots of options available in the market to get the Ethernet connectivity and one of the option to get Ethernet connectivity to your own micro controllers is by adding WIZ811MJ Ethernet module to your microcontrollers.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<ul>
<li>
<h1 style="text-align: left;"><strong><a href="#Step1">Introduction to WIZ811MJ Ethernet module</a></strong></h1>
</li>
<li>
<h1 style="text-align: left;"><strong><a href="#Step3">Connection reference</a></strong></h1>
</li>
<li>
<h1 style="text-align: left;"><strong><a href="#Step4">Sample Code</a></strong></h1>
</li>
</ul>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h1 id="Step1" class="step-title" style="text-align: left;"><strong>Introduction to WIZ811MJ Ethernet module</strong></h1>
<p>&nbsp;</p>
<p>The module we are going to use in this hookup is WIZnet W5100 Network Module with Mag Jack &#8211; WIZ811MJ. The WIZ811MJ is an ideal option for users who want a simple solution to adding TCP/IP and rapidly enabling Internet capability to their project. The WIZ811MJ network module comes with the Wiznet W5100 chip, MAG-JACK (RJ45) together with the glued logic needed to communicate with the microcontroller through the SPI or bus interface.</p>
<p>WIZ811MJ consists of W5100 and MAG-JACK.</p>
<ul>
<li>TCP/IP, MAC protocol layer: W5100</li>
<li>Physical layer: Included in W5100</li>
<li>Connector: MAG-JACK(RJ45 with Transformer)</li>
</ul>
<p>&nbsp;</p>
<p>We are using the version 1.1 of the WIZ811MJ module, its comes with following features:</p>
<ul>
<li>Supports 10/100 Base TX</li>
<li>Supports half/full duplex operation</li>
<li>Supports auto-negotiation and auto cross-over detection</li>
<li>IEEE 802.3/802.3u Compliance</li>
<li>Operates 3.3V with 5V I/O signal tolerance</li>
<li>Supports network status indicator LEDs</li>
<li>Includes Hardware Internet protocols: TCP, IP Ver.4, UDP, ICMP, ARP, PPPoE, IGMP</li>
<li>Includes Hardware Ethernet protocols: DLC, MAC</li>
<li>Supports 4 independent connections simultaneously</li>
<li>Supports MCU bus Interface and SPI Interface</li>
<li>Supports Direct/Indirect mode bus access</li>
<li>Supports Socket API for easy application programming</li>
<li>Interfaces with two 2.54mm pitch 2 x 10 header pin</li>
<li>Temperature : 0 ~ 70℃ (Operation), -40 ~ 85℃ (Storage)</li>
</ul>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><a href="http://learn.edwinrobotics.com/wp-content/uploads/s-1.jpg" target="_blank"><img loading="lazy" decoding="async" class="alignnone wp-image-509 size-full" src="http://learn.edwinrobotics.com/wp-content/uploads/s-1.jpg" alt="WIZ811MJ" width="600" height="600" srcset="https://learn.edwinrobotics.com/wp-content/uploads/s-1.jpg 600w, https://learn.edwinrobotics.com/wp-content/uploads/s-1-150x150.jpg 150w, https://learn.edwinrobotics.com/wp-content/uploads/s-1-300x300.jpg 300w, https://learn.edwinrobotics.com/wp-content/uploads/s-1-184x184.jpg 184w" sizes="auto, (max-width: 600px) 100vw, 600px" /></a></p>
<p style="text-align: left; padding-left: 210px;">     Image Credit: Sparkfun</p>
<p>&nbsp;</p>
<p><a href="http://learn.edwinrobotics.com/wp-content/uploads/s-2.jpg" target="_blank"><img loading="lazy" decoding="async" class="alignnone wp-image-511 size-full" src="http://learn.edwinrobotics.com/wp-content/uploads/s-2.jpg" alt="WIZ811MJ" width="567" height="340" srcset="https://learn.edwinrobotics.com/wp-content/uploads/s-2.jpg 567w, https://learn.edwinrobotics.com/wp-content/uploads/s-2-300x180.jpg 300w" sizes="auto, (max-width: 567px) 100vw, 567px" /></a></p>
<p style="padding-left: 180px;">Image Credit: Sparkfun</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>The Wiznet 5100 based chip has the TCP/IP hardwired on it; therefore it will help developing the TCP/IP protocol stack based application much easier and could be implemented on the small RAM size microcontroller class compared to the firmware TCP/IP protocols stack based implementation approach.</p>
<p><a href="http://learn.edwinrobotics.com/wp-content/uploads/s-3.jpg" target="_blank"><img loading="lazy" decoding="async" class="alignnone wp-image-513 size-full" src="http://learn.edwinrobotics.com/wp-content/uploads/s-3.jpg" alt="WIZ811MJ-pinouts" width="1276" height="1332" srcset="https://learn.edwinrobotics.com/wp-content/uploads/s-3.jpg 1276w, https://learn.edwinrobotics.com/wp-content/uploads/s-3-287x300.jpg 287w, https://learn.edwinrobotics.com/wp-content/uploads/s-3-981x1024.jpg 981w" sizes="auto, (max-width: 1276px) 100vw, 1276px" /></a></p>
<p style="padding-left: 150px;">Image Source: Wiznet WIZ811MJ Datasheet</p>
<p>&nbsp;</p>
<h1></h1>
<h1 id="Step2"></h1>
<p>We are going to use this module together with arduino to get started with it. The Arduino UNO does not have any options onboard to connect with internet, adding this module to Arduino UNO will give the Ethernet connectivity to the UNO board, thus it will provide a great option to create internet dependent applications using Arduino UNO board. You are free to use Arduino ethernet shield also (Since the ethernet sheild comes with same W5100 Chip onboard).</p>
<p>&nbsp;</p>
<p>The Arduino can produce web pages from within the Arduino sketch or host web pages that are stored on the SD card (there is a micro SD card socket on the Arduino Ethernet shield). These web pages can be configured to control and monitor hardware from a web browser on any Ethernet network that the Arduino is connected to. The WIZ811MJ module uses SPI Protocol to communicate with other devices, thus we are going to connect the Ethernet module to the arduino using SPI lines. Use the table below to check your SPI lines (Incase you are using any other Arduino Boards)</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h3></h3>
<table border="1" width="90%" cellpadding="5">
<tbody>
<tr>
<td align="center"><strong>Arduino / Genuino Board</strong></td>
<td align="center"><strong>MOSI</strong></td>
<td align="center"><strong>MISO</strong></td>
<td align="center"><strong>SCK</strong></td>
<td align="center"><strong>SS (slave)</strong></td>
<td align="center"><strong>SS (master)</strong></td>
<td align="right"><strong>Level</strong></td>
</tr>
<tr>
<td align="left">Uno or Duemilanove</td>
<td align="center">11 or ICSP-4</td>
<td align="center">12 or ICSP-1</td>
<td align="center">13 or ICSP-3</td>
<td align="center">10</td>
<td align="center">&#8211;</td>
<td>5V</td>
</tr>
<tr>
<td align="left">Mega1280 or Mega2560</td>
<td align="center">51 or ICSP-4</td>
<td align="center">50 or ICSP-1</td>
<td align="center">52 or ICSP-3</td>
<td align="center">53</td>
<td align="center">&#8211;</td>
<td>5V</td>
</tr>
<tr>
<td align="left">Leonardo</td>
<td align="center">ICSP-4</td>
<td align="center">ICSP-1</td>
<td align="center">ICSP-3</td>
<td align="center">&#8211;</td>
<td align="center">&#8211;</td>
<td>5V</td>
</tr>
<tr>
<td align="left">Due</td>
<td align="center">ICSP-4</td>
<td align="center">ICSP-1</td>
<td align="left">ICSP-3</td>
<td align="center">&#8211;</td>
<td align="center">4, 10, 52</td>
<td>3,3V</td>
</tr>
<tr>
<td align="left">Zero</td>
<td align="center">ICSP-4</td>
<td align="center">ICSP-1</td>
<td align="left">ICSP-3</td>
<td align="center">&#8211;</td>
<td align="center">&#8211;</td>
<td>3,3V</td>
</tr>
<tr>
<td align="left">101</td>
<td align="center">11 or ICSP-4</td>
<td align="left">12 or ICSP-1</td>
<td align="center">13 or ICSP-3</td>
<td align="center">10</td>
<td align="center">10</td>
<td>3,3V</td>
</tr>
<tr>
<td><span class="wikiword">MKR1000</span></td>
<td align="center">8</td>
<td align="center">10</td>
<td align="center">9</td>
<td align="center">&#8211;</td>
<td align="center">&#8211;</td>
<td>3,3V</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Note that MISO, MOSI, and SCK are available in a consistent physical location on the ICSP header; this is useful, for example, in designing a shield that works on every board.</p>
<div><img decoding="async" title="" src="https://www.arduino.cc/en/uploads/Reference/ICSPHeader.jpg" alt="" data-pin-nopin="true" /></div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h1 id="Step3" style="text-align: left;"><strong>Connections</strong></h1>
<p>&nbsp;</p>
<p>The connections between the Ethernet module and Arduino is really simple, you just need six lines to be connected to get it going. Refer the Images below to connect your circuit.</p>
<p>&nbsp;</p>
<p><a href="http://learn.edwinrobotics.com/wp-content/uploads/Ethernet-Connections.jpg" target="_blank"><img loading="lazy" decoding="async" class="alignnone wp-image-536 size-full" src="http://learn.edwinrobotics.com/wp-content/uploads/Ethernet-Connections.jpg" alt="Ethernet Connections" width="600" height="600" srcset="https://learn.edwinrobotics.com/wp-content/uploads/Ethernet-Connections.jpg 600w, https://learn.edwinrobotics.com/wp-content/uploads/Ethernet-Connections-150x150.jpg 150w, https://learn.edwinrobotics.com/wp-content/uploads/Ethernet-Connections-300x300.jpg 300w, https://learn.edwinrobotics.com/wp-content/uploads/Ethernet-Connections-184x184.jpg 184w" sizes="auto, (max-width: 600px) 100vw, 600px" /></a></p>
<p style="padding-left: 210px;">Image Credit: Sparkfun</p>
<p><a href="http://learn.edwinrobotics.com/wp-content/uploads/Arduino-SPI.jpg" target="_blank"><img loading="lazy" decoding="async" class="alignnone wp-image-540 size-full" src="http://learn.edwinrobotics.com/wp-content/uploads/Arduino-SPI.jpg" alt="Arduino-SPI" width="1843" height="1984" srcset="https://learn.edwinrobotics.com/wp-content/uploads/Arduino-SPI.jpg 1843w, https://learn.edwinrobotics.com/wp-content/uploads/Arduino-SPI-279x300.jpg 279w, https://learn.edwinrobotics.com/wp-content/uploads/Arduino-SPI-951x1024.jpg 951w" sizes="auto, (max-width: 1843px) 100vw, 1843px" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><a href="http://learn.edwinrobotics.com/wp-content/uploads/EthernetArduino.jpg" target="_blank"><img loading="lazy" decoding="async" class="alignnone wp-image-542 size-full" src="http://learn.edwinrobotics.com/wp-content/uploads/EthernetArduino.jpg" alt="Ethernet+Arduino" width="770" height="953" srcset="https://learn.edwinrobotics.com/wp-content/uploads/EthernetArduino.jpg 770w, https://learn.edwinrobotics.com/wp-content/uploads/EthernetArduino-242x300.jpg 242w" sizes="auto, (max-width: 770px) 100vw, 770px" /></a></p>
<p style="padding-left: 210px;">Circuit generated Using Fritzing Software</p>
<p>Connect the Jumper wires as mentioned above, once done power up your arduino and connect the Ethernet cable from the router to the WIZ811MJ Module. Refer the next section to see the code used for this module.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h1 id="Step4" style="text-align: left;"><strong>Sample Code</strong></h1>
<p>&nbsp;</p>
<p>We have reached the last step of this hookup guide, only thing left in this hookup guide is to upload the code to the arduino and see the output. In order to get it running we are going to use the Arduino Ethernet Library which comes by default when you install the software.</p>
<p>Open the example code from this mentioned path:</p>
<p>Arduino Examples  -&gt;  Ethernet  -&gt;   WebServer</p>
<p>&nbsp;</p>
<p>or copy paste the follwing into your arduino and upload the code</p>
<blockquote><p>/*<br />
Web Server</p>
<p>A simple web server that shows the value of the analog input pins.<br />
using an Arduino Wiznet Ethernet shield.</p>
<p>Circuit:<br />
* Ethernet shield attached to pins 10, 11, 12, 13<br />
* Analog inputs attached to pins A0 through A5 (optional)</p>
<p>created 18 Dec 2009<br />
by David A. Mellis<br />
modified 9 Apr 2012<br />
by Tom Igoe</p>
<p>*/</p>
<p>#include &lt;SPI.h&gt;<br />
#include &lt;Ethernet.h&gt;</p>
<p>// Enter a MAC address and IP address for your controller below.<br />
// The IP address will be dependent on your local network:<br />
byte mac[] = {<br />
0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED<br />
};<br />
IPAddress ip(192, 168, 1, 177);</p>
<p>// Initialize the Ethernet server library<br />
// with the IP address and port you want to use<br />
// (port 80 is default for HTTP):<br />
EthernetServer server(80);</p>
<p>void setup() {<br />
// Open serial communications and wait for port to open:<br />
Serial.begin(9600);<br />
while (!Serial) {<br />
; // wait for serial port to connect. Needed for Leonardo only<br />
}<br />
// start the Ethernet connection and the server:<br />
Ethernet.begin(mac, ip);<br />
server.begin();<br />
Serial.print(&#8220;server is at &#8220;);<br />
Serial.println(Ethernet.localIP());<br />
}<br />
void loop() {<br />
// listen for incoming clients<br />
EthernetClient client = server.available();<br />
if (client) {<br />
Serial.println(&#8220;new client&#8221;);<br />
// an http request ends with a blank line<br />
boolean currentLineIsBlank = true;<br />
while (client.connected()) {<br />
if (client.available()) {<br />
char c = client.read();<br />
Serial.write(c);<br />
// if you&#8217;ve gotten to the end of the line (received a newline<br />
// character) and the line is blank, the http request has ended,<br />
// so you can send a reply<br />
if (c == &#8216;\n&#8217; &amp;&amp; currentLineIsBlank) {<br />
// send a standard http response header<br />
client.println(&#8220;HTTP/1.1 200 OK&#8221;);<br />
client.println(&#8220;Content-Type: text/html&#8221;);<br />
client.println(&#8220;Connection: close&#8221;); // the connection will be closed after completion of the response<br />
client.println(&#8220;Refresh: 5&#8221;); // refresh the page automatically every 5 sec<br />
client.println();<br />
client.println(&#8220;&lt;!DOCTYPE HTML&gt;&#8221;);<br />
client.println(&#8220;&lt;html&gt;&#8221;);<br />
// output the value of each analog input pin<br />
for (int analogChannel = 0; analogChannel &lt; 6; analogChannel++) {<br />
int sensorReading = analogRead(analogChannel);<br />
client.print(&#8220;analog input &#8220;);<br />
client.print(analogChannel);<br />
client.print(&#8221; is &#8220;);<br />
client.print(sensorReading);<br />
client.println(&#8220;&lt;br /&gt;&#8221;);<br />
}<br />
client.println(&#8220;&lt;/html&gt;&#8221;);<br />
break;<br />
}<br />
if (c == &#8216;\n&#8217;) {<br />
// you&#8217;re starting a new line<br />
currentLineIsBlank = true;<br />
}<br />
else if (c != &#8216;\r&#8217;) {<br />
// you&#8217;ve gotten a character on the current line<br />
currentLineIsBlank = false;<br />
}<br />
}<br />
}<br />
// give the web browser time to receive the data<br />
delay(1);<br />
// close the connection:<br />
client.stop();<br />
Serial.println(&#8220;client disconnected&#8221;);<br />
}<br />
}</p></blockquote>
<p>&nbsp;</p>
<p>Once done with uploading the code, you must open the serial terminal. Now open web browser in your Computer and copy paste this IP address 192.168.1.177 to your address bar and hit enter. If some page loads up showing up values from the arduino it means your connection is established successfully. In order to  see the sensor readings on the web page, connect some sensors or potentiometer to Analog pins A0, A1, A2, A3, A4 and A5. You are able to read these values on the web page. Now try with other examples provided with Ethernet library.</p>
<p>&nbsp;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://learn.edwinrobotics.com/ethernet-hookup-guide/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Vehicle ADS</title>
		<link>https://learn.edwinrobotics.com/vehicle-ads/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=vehicle-ads</link>
					<comments>https://learn.edwinrobotics.com/vehicle-ads/#respond</comments>
		
		<dc:creator><![CDATA[Abhishek Nair]]></dc:creator>
		<pubDate>Thu, 12 May 2016 17:28:49 +0000</pubDate>
				<category><![CDATA[6 DOF IMU]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[GPS]]></category>
		<category><![CDATA[GSM]]></category>
		<category><![CDATA[Sensors]]></category>
		<guid isPermaLink="false">http://learn.edwinrobotics.com/?p=196</guid>

					<description><![CDATA[<img width="6000" height="4000" src="https://learn.edwinrobotics.com/wp-content/uploads/2016/05/DSC_0037.jpg" class="attachment- size- wp-post-image" alt="Arduino UNO" style="float:left; margin:0 15px 15px 0;" decoding="async" loading="lazy" srcset="https://learn.edwinrobotics.com/wp-content/uploads/2016/05/DSC_0037.jpg 6000w, https://learn.edwinrobotics.com/wp-content/uploads/2016/05/DSC_0037-300x200.jpg 300w, https://learn.edwinrobotics.com/wp-content/uploads/2016/05/DSC_0037-768x512.jpg 768w, https://learn.edwinrobotics.com/wp-content/uploads/2016/05/DSC_0037-1024x683.jpg 1024w, https://learn.edwinrobotics.com/wp-content/uploads/2016/05/DSC_0037-140x94.jpg 140w" sizes="auto, (max-width: 6000px) 100vw, 6000px" /> Vehicle Accident Detection System &#160; Before we go into details of this project, I would like to give you some idea about what this project is all about. This is a DIY project suited for anyone who are interested to build a prototype using any old RC cars, but do not limit yourself just to [&#8230;]]]></description>
										<content:encoded><![CDATA[<img width="6000" height="4000" src="https://learn.edwinrobotics.com/wp-content/uploads/2016/05/DSC_0037.jpg" class="attachment- size- wp-post-image" alt="Arduino UNO" style="float:left; margin:0 15px 15px 0;" decoding="async" loading="lazy" srcset="https://learn.edwinrobotics.com/wp-content/uploads/2016/05/DSC_0037.jpg 6000w, https://learn.edwinrobotics.com/wp-content/uploads/2016/05/DSC_0037-300x200.jpg 300w, https://learn.edwinrobotics.com/wp-content/uploads/2016/05/DSC_0037-768x512.jpg 768w, https://learn.edwinrobotics.com/wp-content/uploads/2016/05/DSC_0037-1024x683.jpg 1024w, https://learn.edwinrobotics.com/wp-content/uploads/2016/05/DSC_0037-140x94.jpg 140w" sizes="auto, (max-width: 6000px) 100vw, 6000px" /><h1> <strong>Vehicle Accident Detection System</strong></h1>
<p>&nbsp;</p>
<p>Before we go into details of this project, I would like to give you some idea about what this project is all about. This is a DIY project suited for anyone who are interested to build a prototype using any old RC cars, but do not limit yourself just to RC cars or toys itself, You are all free to modify it as per your ideas and imagination. Beginners can give it a try for sure but there is some level of skill needed to finish this project. You are going to learn some electronics hardware interfacing in addition to programming during this project.</p>
<p>The objective of this project is to build a vehicle which is capable enough to inform the Emergency Service and the pre-programmed contact number about the accident. Accident detection systems help reduce fatalities stemming from car accidents by decreasing the response time of emergency responders.</p>
<p>Smartphones and their onboard sensors (such as GPS receivers and accelerometers) are promising platforms for constructing such systems. Thus we will try to replicate the functions of smartphones and some sensors to build this project.</p>
<p>I used the following components to build this project:</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h2><strong>Components List</strong></h2>
<ul>
<li><a href="http://shop.edwinrobotics.com/arduino/75-arduino-uno-r3.html">Arduino UNO</a></li>
<li>GSM Shield</li>
<li>Sparkfun GPS Shield</li>
<li>Sparkfun 6DOF IMU</li>
<li><a href="http://shop.edwinrobotics.com/switches/134-sparkfun-redbot-sensor-mechanical-bumper.html">Sparkfun RedBot Sensor- Mechanical Bumper</a></li>
<li><a href="http://shop.edwinrobotics.com/displays/32-16x2-lcd.html">LCD 16X2</a></li>
<li>Antenna</li>
<li><a href="http://shop.edwinrobotics.com/potentiometers/11-10k-potentiometer.html">Potentiometer</a></li>
<li>DC Jack Battery Connector</li>
<li><a href="http://shop.edwinrobotics.com/home/56-9v-dc-battery-snapper.html">9v Battery Snapper</a></li>
</ul>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Follow the Steps below to finish it without having any issues.</p>
<h3><a href="#Step1">Collision Detection Using Mechanical Bump Sensor</a></h3>
<p>&nbsp;</p>
<h3><a href="#Step2">Detect roll using 6DOF IMU</a></h3>
<p>&nbsp;</p>
<h3><a href="#Step3">Display Information using 16 x 2 LCD</a></h3>
<p>&nbsp;</p>
<h3><a href="#Step4">Tracking location using GPS</a></h3>
<p>&nbsp;</p>
<h3><a href="#Step5">Sending Messages using GSM Module</a></h3>
<p>&nbsp;</p>
<h3><a href="#Step6">Complete Setup</a></h3>
<p>&nbsp;</p>
<h3 style="text-align: justify;"></h3>
<p>&nbsp;</p>
<h3 id="Step1" style="text-align: justify;">Collision Detection Using Mechanical Bump sensor</h3>
<p>I used the Sparkfun RedBot Sensor- Mechanical Bumper to start the collision detection.</p>
<p><a href="https://cdn.sparkfun.com//assets/parts/8/4/9/3/11999-01a.jpg" target="_blank"><img loading="lazy" decoding="async" class="alignnone" src="https://cdn.sparkfun.com//assets/parts/8/4/9/3/11999-01a.jpg" width="600" height="600" /></a></p>
<p>Connections to this module is very simple. You need to use jumper wires to connect GND and OUT pins (not the 5v pin). Now take out your ARDUINO UNO and connect as mentioned:</p>
<p><strong>Sensor OUT                Arduino A3</strong><br />
<strong> Sensor GND               Arduino GND</strong></p>
<p>Run the following code in your Arduino</p>
<blockquote><p>void setup() {<br />
Serial.begin(57600);<br />
pinMode(A3, INPUT_PULLUP);<br />
}</p>
<p>void loop() {<br />
if(digitalRead(A3)==0){<br />
Serial.println(&#8220;detected&#8221;);<br />
delay(200);<br />
}<br />
}</p></blockquote>
<p>Once code is uploaded, you need to open the Serial monitor at 57600 baud rate, you are able to see that whenever you press the bumper from hand, it will show the message detected.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h3 id="Step2" style="text-align: justify;">Detect roll using 6DOF IMU</h3>
<p>In case of accident the car will either roll or it will create a sudden jerk movement, Our job is to detect this roll and jerk from the car, for this we will use the Sparkfun 6DOF IMU</p>
<p><a href="https://cdn.sparkfun.com//assets/parts/4/3/8/2/10121-01d.jpg" target="_blank"><img loading="lazy" decoding="async" class="alignnone" src="https://cdn.sparkfun.com//assets/parts/4/3/8/2/10121-01d.jpg" width="600" height="600" /></a></p>
<p>It’s a Small tiny board with Accelerometer and Gyroscope Together on the same board with six degree of freedom. The board uses I2C communication and requires 3.3v power supply.</p>
<p>Connect the board as shown in the figure below:</p>
<p style="padding-left: 30px;"><a href="http://learn.edwinrobotics.com/wp-content/uploads/2016/05/upload1.png" target="_blank"><img loading="lazy" decoding="async" class="alignnone wp-image-213 size-full" src="http://learn.edwinrobotics.com/wp-content/uploads/2016/05/upload1.png" alt="upload1" width="561" height="951" srcset="https://learn.edwinrobotics.com/wp-content/uploads/2016/05/upload1.png 561w, https://learn.edwinrobotics.com/wp-content/uploads/2016/05/upload1-177x300.png 177w" sizes="auto, (max-width: 561px) 100vw, 561px" /></a></p>
<p>You need to run the following code in the Arduino, but before that make sure you added all the necessary library for the same.</p>
<p>Refer this link to download the latest version of library:<br />
<a href="http://code.bildr.org/project/6dof/Arduino">http://code.bildr.org/project/6dof/Arduino</a></p>
<p>or<br />
Visit the Following link to download the Zip File:<br />
<a href="http://code.bildr.org/download/985.zip">http://code.bildr.org/download/985.zip</a></p>
<p>Once you download the library, make sure you unzip it and copy it to Arduino libraries.<br />
You need to restart the Arduino after this step.</p>
<p>Use the following code to detect the yaw, pitch and roll from the Sensor.</p>
<blockquote><p>#include &lt;FreeSixIMU.h&gt;<br />
#include &lt;FIMU_ADXL345.h&gt;<br />
#include &lt;FIMU_ITG3200.h&gt;<br />
#include &lt;Wire.h&gt;<br />
#define limit1 165<br />
#define limit2 165<br />
#define limit3 165</p>
<p>float y_p_r[3];<br />
boolean yaw=false, pitch=false, roll=false;</p>
<p>FreeSixIMU sixDOF = FreeSixIMU();</p>
<p>void setup() {<br />
Wire.begin();<br />
delay(5);<br />
sixDOF.init(); //begin the IMU<br />
delay(20);<br />
}</p>
<p>void loop() {<br />
sixDOF.getYawPitchRoll(y_p_r);</p>
<p>if( (abs(y_p_r[0]) &gt; limit1))<br />
yaw = true;<br />
else<br />
yaw = false;</p>
<p>if( (abs(y_p_r[1]) &gt; limit2))<br />
pitch = true;<br />
else<br />
pitch = false;</p>
<p>if( (abs(y_p_r[2]) &gt; limit3))<br />
roll = true;<br />
else<br />
roll = false;</p>
<p>if(yaw==true){<br />
Serial.println(yaw);<br />
yaw=false;<br />
}</p>
<p>if(pitch==true){<br />
Serial.println(pitch);<br />
pitch=false;<br />
}</p>
<p>if(roll==true){</p>
<p>Serial.println(roll);<br />
roll=false;<br />
}</p>
<p>}</p></blockquote>
<p>Modify the parameter limit1,limit2 and limit3 in the code as per your requirement and make sure you are able to get the output with different orientation and tilt of the board.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h3 id="Step3" style="text-align: justify;">Display Information using 16 x 2 LCD</h3>
<p>Most of the Vehicle ADS have onboard display to show the various Information, In this project we will use the 16 x 2 LCD to display our information, you can use any display as per your convenience but I opt this one because it’s cheaper and you are able to get it easily from the local shop.</p>
<p>Refer the Diagram below to connect the LCD</p>
<p style="padding-left: 30px;"><a href="http://learn.edwinrobotics.com/wp-content/uploads/2016/05/upload1-1.png" target="_blank"><img loading="lazy" decoding="async" class="alignnone wp-image-221 size-full" src="http://learn.edwinrobotics.com/wp-content/uploads/2016/05/upload1-1.png" alt="LCD" width="570" height="952" srcset="https://learn.edwinrobotics.com/wp-content/uploads/2016/05/upload1-1.png 570w, https://learn.edwinrobotics.com/wp-content/uploads/2016/05/upload1-1-180x300.png 180w" sizes="auto, (max-width: 570px) 100vw, 570px" /></a></p>
<p>To test the LCD, you just need to follow the Arduino Examples Section, there you will find LiquidCrystal, just run any of the examples sketch and check whether you are able to get any output or not. Make Sure you modify the LCD pin connections in the example Code, otherwise you will not see the desired output.</p>
<p>Below I have added the LCD initialization for the connections shown in the image, if you had followed the same pin structure then you just need to copy paste it in the example sketch.</p>
<p><strong>LiquidCrystal lcd(6, 12, 8, 9, 10, 11);</strong></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h3 id="Step4" style="text-align: justify;">Tracking location using GPS</h3>
<p>Location tracking is something we have seen in several devices like mobile phones, metro trains, buses and your own vehicles and most of them uses GPS to find out the position. We will use this GPS Receiver &#8211; LS20031 to find out the current location of device.</p>
<p>Sparkfun has provided great tutorial on their website to get started with this device, follow the instructions here:<br />
<a href="https://www.sparkfun.com/tutorials/176">https://www.sparkfun.com/tutorials/176</a></p>
<p>Perform the Quick test to see the output from the GPS.</p>
<p>Once you done with Setting up the GPS Receiver, it is really easy to get the desired reading, all thanks to TinyGPS library, which will give you the locations in formatted manner, all you need to do is to access the position from the library function itself.</p>
<p>Visit this link to download the latest version of the TinyGPS library:<br />
<a href="https://github.com/mikalhart/TinyGPS/releases/tag/v13">https://github.com/mikalhart/TinyGPS/releases/tag/v13</a></p>
<p>Or</p>
<p>you can download the zip file directly from this link:</p>
<p><a href="https://github.com/mikalhart/TinyGPS/archive/v13.zip">https://github.com/mikalhart/TinyGPS/archive/v13.zip</a></p>
<p>Once you are done setting up the library for the Arduino, restart the Arduino software, refer the diagram below to display the GPS Location in LCD.</p>
<p><a href="http://learn.edwinrobotics.com/wp-content/uploads/2016/05/upload1-2.png" target="_blank"><img loading="lazy" decoding="async" class="alignnone wp-image-223 size-full" src="http://learn.edwinrobotics.com/wp-content/uploads/2016/05/upload1-2.png" alt="lcd_gps" width="685" height="983" srcset="https://learn.edwinrobotics.com/wp-content/uploads/2016/05/upload1-2.png 685w, https://learn.edwinrobotics.com/wp-content/uploads/2016/05/upload1-2-209x300.png 209w" sizes="auto, (max-width: 685px) 100vw, 685px" /></a></p>
<p><strong>Note**</strong> Care must be taken while connection GPS, since its runs on 3.3v and you are interfacing it with 5v System, thus any voltage level greater than 3.3v will damage the GPS module, this is why we did not used the Rx pin on the GPS, if you need to use RX pin on 5v system, you must add logic level shifter like: <a href="https://www.sparkfun.com/products/12009">https://www.sparkfun.com/products/12009</a>  <span style="font-size: 10.5pt; font-family: 'Open Sans',sans-serif; color: #464646;">between Arduino and GPS.</span></p>
<p>Use the following code to test the GPS and LCD:</p>
<blockquote><p>#include &lt;TinyGPS.h&gt;<br />
#include &lt;LiquidCrystal.h&gt;</p>
<p>TinyGPS gps;<br />
LiquidCrystal lcd(6, 12, 8, 9, 10, 11);</p>
<p>static void smartdelay(unsigned long ms);</p>
<p>void setup()<br />
{<br />
Serial.begin(57600);<br />
lcd.begin(16, 2);<br />
}</p>
<p>void loop()<br />
{<br />
float flat, flon;<br />
unsigned long age;</p>
<p>gps.f_get_position(&amp;flat, &amp;flon, &amp;age);</p>
<p>lcd.setCursor(0, 0);<br />
lcd.print(&#8220;LAT:&#8221;);<br />
delay(5);<br />
lcd.print(flat,3);<br />
delay(5);</p>
<p>lcd.setCursor(0, 1);<br />
lcd.print(&#8220;LON:&#8221;);<br />
delay(5);<br />
lcd.print(flon,3);</p>
<p>smartdelay(1000);<br />
}</p>
<p>static void smartdelay(unsigned long ms)<br />
{<br />
unsigned long start = millis();<br />
do<br />
{<br />
while (Serial.available())<br />
gps.encode(Serial.read());<br />
} while (millis() &#8211; start &lt; ms);<br />
}</p></blockquote>
<p>Advanced users can modify the code and connections to use any of the Arduino GPIO pin to be used as RX Pin using Software Serial Library, this is useful because while GPS Connected to RX Pin of Arduino you are not able to upload the code to the Arduino, it will give error while uploading, in case you face this issue, make sure to remove the jumper from Arduino RX pin.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h3 id="Step5" style="text-align: justify;">Sending Messages using GSM Module</h3>
<p>Now the most important function of this system is to deliver the alert messages to others in case of an accident, for this we will use the Arduino GSM Shield, GSM Shield has built in SIM slot, all you need to do is to insert a working SIM having some balance to send the messages.</p>
<p>For more advanced details refer this Link: <a href="https://www.arduino.cc/en/Guide/ArduinoGSMShield">https://www.arduino.cc/en/Guide/ArduinoGSMShield</a></p>
<p>We will try to integrate GPS and GSM together in this section, please refer the diagram below for required connections.</p>
<p><a href="http://learn.edwinrobotics.com/wp-content/uploads/2016/05/upload1-3.png" target="_blank"><img loading="lazy" decoding="async" class="alignnone wp-image-225 size-full" src="http://learn.edwinrobotics.com/wp-content/uploads/2016/05/upload1-3.png" alt="GPS_GSM" width="763" height="909" srcset="https://learn.edwinrobotics.com/wp-content/uploads/2016/05/upload1-3.png 763w, https://learn.edwinrobotics.com/wp-content/uploads/2016/05/upload1-3-252x300.png 252w" sizes="auto, (max-width: 763px) 100vw, 763px" /></a></p>
<p>Now all you need to do is use the following code to see the working of the device.</p>
<blockquote><p>#include &lt;GSM.h&gt;<br />
#include &lt;TinyGPS.h&gt;</p>
<p>#define PINNUMBER &#8220;&#8221; // If your SIM has PIN, pass it as a parameter of begin() in quotes</p>
<p>TinyGPS gps;</p>
<p>boolean MessageSent = false;</p>
<p>// initialize the library instance<br />
GSM gsmAccess;<br />
GSM_SMS sms;</p>
<p>float flat, flon;<br />
String txtMsg =&#8221;Owner:Abhishek\nLicense: KLNA2\nAccident Alert!!!!!!!\n&#8221;;</p>
<p>static void smartdelay(unsigned long ms);</p>
<p>void setup(){<br />
boolean notConnected = true;<br />
Serial.begin(57600);</p>
<p>while (notConnected)<br />
{<br />
if (gsmAccess.begin(PINNUMBER) == GSM_READY)<br />
notConnected = false;<br />
delay(1000);<br />
}<br />
}</p>
<p>void loop(){<br />
char remoteNum[]=&#8221;0562xxxxx0&#8243;; // telephone number to send sms</p>
<p>unsigned long age;<br />
gps.f_get_position(&amp;flat, &amp;flon, &amp;age);</p>
<p>Serial.println(txtMsg+&#8221;LON: &#8221; + String(flon)+ &#8221; LAT: &#8221; + String(flat));</p>
<p>if(!MessageSent){<br />
sms.beginSMS(remoteNum);<br />
sms.print(txtMsg+&#8221;LON: &#8221; + String(flon)+ &#8221; LAT: &#8221; + String(flat));<br />
sms.endSMS();<br />
MessageSent = true;<br />
}<br />
}<br />
static void smartdelay(unsigned long ms)<br />
{<br />
unsigned long start = millis();<br />
do<br />
{<br />
while (Serial.available())<br />
gps.encode(Serial.read());<br />
} while (millis() &#8211; start &lt; ms);<br />
}</p></blockquote>
<p>The above code will continuously print the GPS location in the Serial Terminal also it will send the formatted message to designated number once.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h3 id="Step6" style="text-align: justify;">Complete Setup</h3>
<p>This step is the most important part, here we will put things together, following all the steps one by one make sure that all the things in the project are working upto the mark, I am expecting you are able to get the desired output till step4.</p>
<p>We will first start with hardware Integration part, I had made things easier for you. Just refer the diagram I attached below as reference.</p>
<p><a href="http://learn.edwinrobotics.com/wp-content/uploads/2016/05/Schematics.png" target="_blank"><img loading="lazy" decoding="async" class="alignnone wp-image-227 size-large" src="http://learn.edwinrobotics.com/wp-content/uploads/2016/05/Schematics-1024x824.png" alt="Schematics" width="1024" height="824" srcset="https://learn.edwinrobotics.com/wp-content/uploads/2016/05/Schematics-1024x824.png 1024w, https://learn.edwinrobotics.com/wp-content/uploads/2016/05/Schematics-300x241.png 300w, https://learn.edwinrobotics.com/wp-content/uploads/2016/05/Schematics-768x618.png 768w, https://learn.edwinrobotics.com/wp-content/uploads/2016/05/Schematics.png 1219w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p><a href="http://learn.edwinrobotics.com/wp-content/uploads/2016/05/Connections.png" target="_blank"><img loading="lazy" decoding="async" class="alignnone wp-image-228 size-full" src="http://learn.edwinrobotics.com/wp-content/uploads/2016/05/Connections.png" alt="Connections" width="1045" height="969" srcset="https://learn.edwinrobotics.com/wp-content/uploads/2016/05/Connections.png 1045w, https://learn.edwinrobotics.com/wp-content/uploads/2016/05/Connections-300x278.png 300w, https://learn.edwinrobotics.com/wp-content/uploads/2016/05/Connections-768x712.png 768w, https://learn.edwinrobotics.com/wp-content/uploads/2016/05/Connections-1024x950.png 1024w" sizes="auto, (max-width: 1045px) 100vw, 1045px" /></a></p>
<p>In the above image I had used SPST Switch in place of mechanical bump sensor since I was unable to found the part in the fritzing software, so no need to be confused with that part. Most of the sections we already tested individually. Just make sure you follow the connections exact same way, crosscheck twice or thrice before we move to software part.</p>
<p>I had used the Fritzing software to make my work easier, it’s really helpful tool to make connections faster in breadboard and get the schematics ready.</p>
<p>I had used the following program to get the final prototype ready and in working condition.</p>
<blockquote><p>#include &lt;FreeSixIMU.h&gt;<br />
#include &lt;FIMU_ADXL345.h&gt;<br />
#include &lt;FIMU_ITG3200.h&gt;<br />
#include &lt;LiquidCrystal.h&gt;<br />
#include &lt;Wire.h&gt;<br />
#include &lt;TinyGPS.h&gt;<br />
#include &lt;GSM.h&gt;</p>
<p>#define limit3 165 //roll // Increasing the value can decrease the sense range of the IMU, Decreasing the value can sense the minute vibrations, tilt or accelaration, update this incase you need it</p>
<p>#define debounce 100<br />
#define bumper1 A2<br />
#define bumper2 A3</p>
<p>LiquidCrystal lcd(6, 12, 8, 9, 10, 11);</p>
<p>TinyGPS gps;</p>
<p>GSM gsmAccess;<br />
GSM_SMS sms;</p>
<p>char remoteNum[]=&#8221;05xxxxxx74&#8243;; // telephone number to send sms &#8220;Update this part only&#8221;</p>
<p>float y_p_r[3];<br />
boolean roll=false;<br />
boolean hit=false;</p>
<p>FreeSixIMU sixDOF = FreeSixIMU();</p>
<p>void setup() {<br />
boolean notConnected = true;</p>
<p>lcd.begin(16, 2);<br />
lcd.setCursor(0,0);<br />
lcd.print(&#8220;Please wait&#8221;);</p>
<p>while (notConnected)<br />
{<br />
if (gsmAccess.begin() == GSM_READY)<br />
notConnected = false;<br />
delay(1000);<br />
}</p>
<p>lcd.begin(16, 2);<br />
lcd.clear();</p>
<p>Serial.begin(57600);<br />
pinMode(bumper1, INPUT);<br />
pinMode(bumper2, INPUT);<br />
digitalWrite(bumper1, 1);<br />
digitalWrite(bumper2, 1);<br />
Wire.begin();</p>
<p>delay(5);<br />
sixDOF.init(); //begin the IMU<br />
delay(1000);</p>
<p>lcd.clear();<br />
lcd.print(&#8220;Setup complete &#8220;);<br />
delay(2000);<br />
lcd.clear();</p>
<p>}</p>
<p>void loop() {<br />
float flat, flon;<br />
unsigned long age;</p>
<p>for(int i=0; i&lt;5; i++){<br />
while (Serial.available())<br />
{gps.encode(Serial.read());}<br />
delay(100);<br />
}</p>
<p>gps.f_get_position(&amp;flat, &amp;flon, &amp;age);</p>
<p>if((digitalRead(bumper1)==0) || (digitalRead(bumper2)==0))<br />
{<br />
delay(debounce);<br />
hit=true;<br />
}</p>
<p>sixDOF.getYawPitchRoll(y_p_r);</p>
<p>if( (abs(y_p_r[0]) &gt; limit3) ||(abs(y_p_r[1]) &gt; limit3) ||(abs(y_p_r[2]) &gt; limit3))<br />
roll = true;<br />
else<br />
roll = false;</p>
<p>if(hit==true || roll ==true)<br />
{<br />
if((flon == 1000.000) &amp;&amp; (flat==1000.000)){<br />
flon=54.39;<br />
flat=24.45;<br />
}</p>
<p>lcd.setCursor(0,0);<br />
lcd.print(&#8220;Abhi N3AB4&#8243;);<br />
delay(2000);<br />
lcd.clear();</p>
<p>String txtMsg =&#8221;Owner:Abhi \nLicense: N3BA4\nAccident Alert!!!!!!!\n&#8221;;</p>
<p>sms.beginSMS(remoteNum);<br />
sms.print(txtMsg+&#8221;LON: &#8221; + String(flon)+ &#8221; LAT: &#8221; + String(flat));<br />
sms.endSMS();</p>
<p>hit=false;<br />
}<br />
}</p></blockquote>
<p>While compiling this code you might get the message that Sketch too big, it really took some time for me to get this thing sorted out. I did modified the library files to make its size within the limit, the next part you can do is to remove or modify the string in the code and it will save you more space. I will share you the library which I modified so as to get it in working condition.</p>
<p style="line-height: 18.0pt; background: white; vertical-align: baseline;">Sometimes GPS might not work inside the house and it will give you location as 1000,1000<br />
so don’t worry with this, it’s not code issue, it’s the GPS, when you take it out under open sky, you will see the coordinates are updated and the red led on the module started blinking. Hope you enjoyed this project, expecting your valuable feedback. Will join you soon with more interesting project.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://learn.edwinrobotics.com/vehicle-ads/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/

Object Caching 141/497 objects using APC
Page Caching using Disk: Enhanced 
Lazy Loading (feed)
Database Caching 69/186 queries in 0.111 seconds using APC

Served from: learn.edwinrobotics.com @ 2025-08-02 16:06:49 by W3 Total Cache
-->