<?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>PlastiBots</title>
	<atom:link href="http://www.plastibots.com/index.php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.plastibots.com</link>
	<description>LEGO Mindstorms Robotics, DIY Hacks and other stuff</description>
	<lastBuildDate>Tue, 18 Jun 2013 12:23:12 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Easy and Cheap DIY LED RGB Garden Glowies</title>
		<link>http://www.plastibots.com/index.php/2013/06/16/rgb-garden-glowies/</link>
		<comments>http://www.plastibots.com/index.php/2013/06/16/rgb-garden-glowies/#comments</comments>
		<pubDate>Mon, 17 Jun 2013 02:11:14 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[MyDYI Hacks & Other Stuff]]></category>

		<guid isPermaLink="false">http://www.plastibots.com/?p=2720</guid>
		<description><![CDATA[In a few weeks, we&#8217;ll have a new patio.  Like any new project I get into, I have to introduce a flavour of something DIY and electronic into the mix.  Like most guys, I&#8217;m planning for sound.  However, I&#8217;m also &#8230; <a href="http://www.plastibots.com/index.php/2013/06/16/rgb-garden-glowies/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>In a few weeks, we&#8217;ll have a new patio.  Like any new project I get into, I have to introduce a flavour of something DIY and electronic into the mix.  Like most guys, I&#8217;m planning for sound.  However, I&#8217;m also adding custom LED lighting to light up the armour stones, deck and pergola areas.  As part of the patio job, we are also planning on having a variety of plants and shrubs around the patio.  I figured it would be neat, for when we are entertaining, to have LED RGB glowies that I could place in each of the shrubs/plants and have a RGB glowing garden as an entertainment piece.<span id="more-2720"></span></p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-0955337107322324";
/* 728x90ImgOnly */
google_ad_slot = "4816127144";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p>I wanted something cheap and quick that I could pull out on short notice, turn on and drop into the plants to have a light show for the evening.  I also wanted something that I could whip together quickly.  Can&#8217;t really claim this as my idea as its been done many a time&#8230; Since I also wanted the components to be water resistant, and I wanted an easy way to power the units on/off, the concept of a Reed switch and magnet came immediately to mind.  The idea being to have a magnet attached to a stick that is stuck into the ground.  Then, when it comes time to put the glowies out, I would just stick them to the magnets.  They would serve 2 purposes; 1) to hold the glowie in the middle of the shrub, and 2) trip the Reed switch to turn the glowie on.  With that plan, I went hunting.   I managed to fleebay some RGB LEDs, reed switches, 2032 batteries (DX) and some coin cell holders.  Total price &lt; $10.  Not bad.  I managed to scrounge the tiny plastic ball casings from some of my kids toys (shhh).   They are perfect casings that just fit the battery holder and bits all inside and are &lt; 1&#8243; in diameter..  The RGB LEDs also have an embedded microchip that automatically slowly cycles them between all level of RGB combination of colours (not just red&gt;green&gt;blue, but everything in between).  This saved lots of time, money and space as the alternative was to cobble together some ATTiny85/25&#8242;s and have each PWM the LED&#8217;s..  That would have pushed this project into the &#8220;not worth the effort territory&#8221;.</p>
<p>Anyway, I&#8217;m happy with the result.  The glowies are just visible inside the plants, but no too bright that the are a big distraction.  This is an easy project that most anyone with basic soldering skills can do &#8211; and for &lt; $10.  Check out the night effect in the front garden below.</p>
<p style="text-align: center;"><a href="http://www.plastibots.com/wordpress/wp-content/uploads/2013/06/LEDGlowiesAllComponents.jpg"><img class="aligncenter  wp-image-2721" alt="LEDGlowiesAllComponents" src="http://www.plastibots.com/wordpress/wp-content/uploads/2013/06/LEDGlowiesAllComponents.jpg" width="560" height="326" /></a></p>
<p style="text-align: center;">Result: Not the best pic, but the glowies have been placed inside each shrub/bush and are noticeable from a distance as shown</p>
<p style="text-align: center;"><img class="aligncenter  wp-image-2729" alt="glowyResult" src="http://www.plastibots.com/wordpress/wp-content/uploads/2013/06/glowyResult.jpg" width="800" height="340" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.plastibots.com/index.php/2013/06/16/rgb-garden-glowies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>BT Bot Control &amp; IPCam Bot</title>
		<link>http://www.plastibots.com/index.php/2013/03/07/btbotcontrol/</link>
		<comments>http://www.plastibots.com/index.php/2013/03/07/btbotcontrol/#comments</comments>
		<pubDate>Thu, 07 Mar 2013 10:32:00 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Electronics]]></category>
		<category><![CDATA[LEGO Robots]]></category>
		<category><![CDATA[MyDYI Hacks & Other Stuff]]></category>
		<category><![CDATA[Remote Controlled]]></category>
		<category><![CDATA[AI-CAM]]></category>
		<category><![CDATA[Bluetooth]]></category>
		<category><![CDATA[IPCAM]]></category>
		<category><![CDATA[LEGO]]></category>

		<guid isPermaLink="false">http://www.plastibots.com/?p=2596</guid>
		<description><![CDATA[BTBotControl is an Android application that allows you to remotely control a micro controller-based robot using Bluetooth (i.e. Arduino).  It also allows you to (optionally) view a video stream from an IPCamera mounted to your robot.  This could be any &#8230; <a href="http://www.plastibots.com/index.php/2013/03/07/btbotcontrol/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://www.plastibots.com/index.php/2013/03/07/btbotcontrol/"><img class="aligncenter size-full wp-image-2605" alt="MasterFeatureGraphic800w" src="http://www.plastibots.com/wordpress/wp-content/uploads/2013/03/MasterFeatureGraphic800w.jpg" width="800" height="391" /></a></p>
<p style="text-align: left;"><a title="Get BTBotControl in the Google Play" href="https://play.google.com/store/search?q=pixelmason" target="_blank">BTBotControl</a> is an Android application that allows you to remotely control a micro controller-based robot using Bluetooth (i.e. Arduino).  It also allows you to (optionally) view a video stream from an IPCamera mounted to your robot.  This could be any type wireless IP camera or phone that has the ability to broadcast a video stream/images to the web.  Example Foscam, Ai-Cam etc.</p>
<p style="text-align: left;"><span id="more-2596"></span></p>
<p style="text-align: left;"><span style="background-color: #ffff00;">** Looking to see if there is interest for adding LEGO Mindstorms NXT control to BT Bot Control.  <a title="Contact Developer" href="http://www.plastibots.com/index.php/contact-us/"><span style="background-color: #ffff00;">Let me know</span></a> if you are interested or have suggestions. **</span></p>
<p style="text-align: left;">Some of the features of BTBotControl:</p>
<ul>
<li>Can use Joystick via finger movement, or the orientation sensor on your device.  (default is Joystick mode).</li>
<li>Supports 8 individual commands via Command Buttons.   4 on by default. 4 more can be turned on in the Settings section.</li>
<li>Sends the x/y coordinates as positive and negative integers based on 4 quadrants of the joystick.   Data is sent via Bluetooth and can be parsed to set both direction and velocity.  (sample code below)</li>
<li>Coordinates are generated as X+/- and Y +/-. These are packaged and sent in the following format <em>sX=val,Y=vale</em>  i.e. <em>sX=75,Y=-55e</em>  where &#8216;s&#8217; indicates the start and &#8216;e&#8217; indicates the end.</li>
<li>Command button values are packaged and sent in the following format: sC=[<em>val]e</em>  i.e. sC=<em>2e</em>  where &#8216;s&#8217; is the start,  &#8216;c&#8217; indicates the a command button as pressed, &#8217;2&#8242; is the value and &#8216;e&#8217; indicates the end.</li>
<li>Configurable Bluetooth packet send interval &#8211; used to set the speed (quantity) of packets sent.  Default of 200ms works well.</li>
<li>Shows video stream of IP Camera mounted to robot. (see FAQ)</li>
<li>Configurable camera URLs. Remembers last camera connection for easy re-connect.</li>
<li>Configurable Bluetooth connections.  Remember last Bluetooth connection for easy re-connect.</li>
<li>Sample Arduino Sketch provided (below).</li>
<li>Screen auto re-sizes for smaller phones.</li>
<li>Supports any micro controller that can parse Bluetooth data (<a href="http://dx.com/p/jy-mcu-arduino-bluetooth-wireless-serial-port-module-104299" target="_blank">bluetooth module</a> required) (sample sketch below).</li>
</ul>
<p><em>Note on Lite version:  The Lite version is a fully functional version.  However, Bluetooth data will be sent as &#8217;9&#8242;s.  i.e. s9,9e and c9e which will provide you with enough to determine if this app is right for you.  If you like BT Bot Control, the Pro version has full functionality enabled with proper data, and can be yours for less than the price of a coffee.  Also, you won&#8217;t be pestered by that start-up message either!  We hope you agree that the features and functionality provided are well worth the pocket change. <img src='http://www.plastibots.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </em></p>
<p><em>Note on Bluetooth: The control distance is dependent on a number of factors including; your Bluetooth device range, battery power, obstacles etc.</em></p>
<p><strong>Download BTBotControl here:</strong></p>
<p><a href="https://play.google.com/store/search?q=pub:PixelMason" target="_new"><br />
<img alt="Get it on Google Play" src="https://developer.android.com/images/brand/en_generic_rgb_wo_45.png" /><br />
</a></p>
<p>If you have an feature requests, or suggestions,  <a href="http://www.plastibots.com/index.php/contact-us/">please let me know</a>.</p>
<p><strong>Default Mode Joystick Sample Sketch:  <a href="http://www.plastibots.com/wordpress/wp-content/uploads/2013/03/BTBotControl12DefaultModeJoystick1.zip">BTBotControl12DefaultModeJoystick</a><a href="http://www.plastibots.com/wordpress/wp-content/uploads/2013/03/BTBotControl12DefaultModeJoystick.zip"><br />
</a></strong></p>
<p><strong>Simple Mode Joystick Sample Sketch:   <a href="http://www.plastibots.com/wordpress/wp-content/uploads/2013/03/BTBotControl12SimpleJoystickSample.zip">BTBotControl12SimpleJoystickSample</a></strong></p>
<p><em>Note:  For this project, I used a <a title="Digispark Homepage" href="http://digistump.com/" target="_blank">Digispark</a> (Arduino-based micro controller).  This sample sketch is targeted for a Digispark (ATTiny85), but was also tested on an Uno, so it should work for most Arduino&#8217;s.   If using an ATTiny, remove any Serial.Print statements. Also watch the size of the sketch as there are limitations on the ATTiny85.  </em></p>
<div class="qa-faqs qa-category cf animation-fade accordion collapsible">
		<div class="qa-category">
			<h2 class="faq-catname">BTBotControl - FAQ</h2>
			<div id="qa-faq0" class="qa-faq">
			<h3 class="qa-faq-title"><a class="qa-faq-anchor" href="http://www.plastibots.com/index.php/faqs/connecting-to-bluetooth/">Connecting to Bluetooth</a></h3>
			<div class="qa-faq-answer"><p><a href="http://www.plastibots.com/wordpress/wp-content/uploads/2013/03/FAQBTConfig.png"><img class="aligncenter size-full wp-image-2644" alt="FAQBTConfig" src="http://www.plastibots.com/wordpress/wp-content/uploads/2013/03/FAQBTConfig.png" width="315" height="54" /></a>Setting up Bluetooth is easy:</p>
<p><a href="http://www.plastibots.com/wordpress/wp-content/uploads/2013/03/FAQBTSettings.png"> </a></p>
<ul>
<li>Before starting BTBotControl, make sure Bluetooth is turned on.</li>
<li>Make sure the Bluetooth device you are connecting to is powered on and you have previously paired the Bluetooth unit to your Android device.</li>
<li>Open BTBotControl and click the Bluetooth Settings icon (A).   You will see a screen similar to below.  Select your Bluetooth device.</li>
</ul>
<p><img class="aligncenter size-full wp-image-2645" alt="FAQBTSettings" src="http://www.plastibots.com/wordpress/wp-content/uploads/2013/03/FAQBTSettings.png" width="400" height="102" /></p>
<ul>
<li>After a few seconds, your Bluetooth device should be connected, and you should see a message indicating this.</li>
<li>The main window will update by showing the MAC address of the connected Bluetooth device (below the camera viewing window).  The icon for Bluetooth Connect (B above) will also change (arrows facing out).</li>
<li>To disconnect the Bluetooth device, click the Bluetooth Connect/Disconnect icon (B above).  After it is clicked, the Bluetooth status will be updated to show &#8220;disconnected&#8221; (below the camera viewing window) and the Bluetooth Connect/Disconnect icon (B) will change to an icon with arrows pointing in.</li>
<li>To quickly reconnect, click the Bluetooth Connect/Disconnect icon (B above).</li>
</ul>
</div><!--.qa-faq-answer-->
				</div><!--.qa-faq-->
			<div id="qa-faq1" class="qa-faq">
			<h3 class="qa-faq-title"><a class="qa-faq-anchor" href="http://www.plastibots.com/index.php/faqs/how-do-i-tell-if-data-is-being-sent-over-bluetooth/">How do I tell if data is being sent over Bluetooth?</a></h3>
			<div class="qa-faq-answer"><p>You can verify that BTBotControl is sending data over Bluetooth by using an application such as <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/" target="_blank">Putty</a>. You can do this by connecting your Android device to your computer/laptop over Bluetooth. Before using Putty, make sure you have <a href="https://www.google.ca/search?q=bluetooth+pairing" target="_blank">paired </a>the two devices and they are connected. To configure putty, setup a serial connection pointing to the Com Port (Serial Line) that your Bluetooth device/dongle is connected to. Typical speed settings are 9600 (Baud). Once configured, open the connection and then connect BTBotControl to your computer. Once it is connected, you should see coordinate / command data stream through when using the controls on BTBotControl.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-2674" alt="putty" src="http://www.plastibots.com/wordpress/wp-content/uploads/2013/03/putty.jpg" width="456" height="438" /></p>
</div><!--.qa-faq-answer-->
				</div><!--.qa-faq-->
			<div id="qa-faq2" class="qa-faq">
			<h3 class="qa-faq-title"><a class="qa-faq-anchor" href="http://www.plastibots.com/index.php/faqs/bluetooth-does-not-enable/">Bluetooth does not enable when allowing BTBotControl try to enable it</a></h3>
			<div class="qa-faq-answer"><p>If Bluetooth is disabled, BTBotControl will ask you if you want to enable it. If you click yes, it will try to enable Bluetooth.  Your Android phone will ask you if you want to proceed.  Click Yes.  If, Bluetooth still does not enable after this, check your Airplane Mode settings.  if Airplane Mode is enabled, it will restrict the ability to turn Bluetooth on.  You must disable Airplane Mode to turn Bluetooth on.</p>
</div><!--.qa-faq-answer-->
				</div><!--.qa-faq-->
			<div id="qa-faq3" class="qa-faq">
			<h3 class="qa-faq-title"><a class="qa-faq-anchor" href="http://www.plastibots.com/index.php/faqs/connect-to-an-ipcam/">Connecting to an IP Camera</a></h3>
			<div class="qa-faq-answer"><p style="text-align: center;"><a href="http://www.plastibots.com/wordpress/wp-content/uploads/2013/03/FAQIPCamConfig.png"><img class="aligncenter size-full wp-image-2648" alt="FAQIPCamConfig" src="http://www.plastibots.com/wordpress/wp-content/uploads/2013/03/FAQIPCamConfig.png" width="315" height="54" /></a></p>
<p style="text-align: left;">Connecting to an IP Cam:</p>
<p>Assumptions:</p>
<ul>
<li>You have an IPCamera that is configured and can be viewed in your web browser.</li>
<li>You have the URL, username and password (if necessary) to access the IP camera.</li>
<li>If you are viewing your IP camera outside your network, you will have to setup a dynamic DNS service to remotely access it.</li>
</ul>
<ul>
<li>Click the Camera settings icon in the menu (item A above).</li>
<li>You will be taken the the camera config page shown here:</li>
</ul>
<p><img class="aligncenter size-full wp-image-2649" alt="FAQIPCamConfig2" src="http://www.plastibots.com/wordpress/wp-content/uploads/2013/03/FAQIPCamConfig2.png" width="800" height="279" /></p>
<ul>
<li>Enter the camera URL, and click Add Camera.  The camera URL will show in the list below.  The list shows what cameras you have stored.</li>
<li>Now, click Select Camera to select from the list of camera&#8217;s to choose a camera to view in Master Control.</li>
<li>To edit a camera, click Edit Camera, select one from the list, modify the URL, and click Add Camera.  The camera URL will be updated in the list.</li>
<li>To delete a camera, click Delete Camera, select one from the list, and confirm it&#8217;s deletion.</li>
</ul>
</div><!--.qa-faq-answer-->
				</div><!--.qa-faq-->
			<div id="qa-faq4" class="qa-faq">
			<h3 class="qa-faq-title"><a class="qa-faq-anchor" href="http://www.plastibots.com/index.php/faqs/issues-with-viewing-your-ip-camera/">Issues with viewing your IP Camera?</a></h3>
			<div class="qa-faq-answer"><p>If you are having issues viewing a direct video stream from your IP camera in BTBotControl (i.e. http://mycamera.com/videostream.cgi is not working), you may need to view the camera in snapshot mode.  Most IPCam&#8217;s have this mode (Google is your friend).  Below is a sample on how this can be done:</p>
<pre class="brush: xml; collapse: true; light: false; title: ; toolbar: true; notranslate">
&lt;HTML&gt;
&lt;HEAD&gt;
  &lt;meta name=&quot;keywords&quot; content=&quot;&quot;&gt;
  &lt;meta name=&quot;description&quot; content=&quot;&quot;&gt;
  &lt;meta name=&quot;robots&quot; content=&quot;NOFOLLOW,NOINDEX&quot;&gt;
  &lt;link rel=&quot;stylesheet&quot; href=&quot;/style.css&quot; type=&quot;text/css&quot;&gt;
&lt;/HEAD&gt;
&lt;BODY&gt;
		  &lt;table align=&quot;center&quot; border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;
		    &lt;tr&gt; 
			  &lt;td&gt;
			    &lt;img src=&quot;http://[YOURCAMERAIPHERE]/snapshot.cgi?user=[USERNAME]&amp;pwd=[PASSWORD]&amp;t=&quot; name=&quot;refresh&quot; id=&quot;refresh&quot; onload='reload(this)' onerror='reload(this)'&gt; 
  			  &lt;/td&gt;
			&lt;/tr&gt;
		  &lt;/table&gt;
&lt;/BODY&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~									
//Reload Video Interval
function reload()
{
	setTimeout('reloadImg(&quot;refresh&quot;)',100)   //this triggers an image reload every 100ms.  You can try to make this faster by lowering the number.
};
function reloadImg(id) 
{ 
	var obj = document.getElementById(id); 
    var date = new Date(); 
    obj.src = &quot;http://[YOURCAMERAIPHERE]/snapshot.cgi?user=[USERNAME]&amp;pwd=[PASSWORD]&amp;t=&quot; + Math.floor(date.getTime()/1000); 
} 
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
&lt;/script&gt;
&lt;/HTML&gt;
</pre>
</div><!--.qa-faq-answer-->
				</div><!--.qa-faq-->
			<div id="qa-faq5" class="qa-faq">
			<h3 class="qa-faq-title"><a class="qa-faq-anchor" href="http://www.plastibots.com/index.php/faqs/how-do-i-use-the-values-being-sent-in-my-program/">Joystick Modes and Sending Data Over Bluetooth (was &#8211; How do I use the values being sent in my program)?</a></h3>
			<div class="qa-faq-answer"><p>There are two joystick modes.  Default and Simple Joystick:</p>
<p><span style="text-decoration: underline;"><strong>*** Remember &#8211; the Free version will send the number 9 for all joystick (Default/Simple) and Command Buttons.  The <a href="https://play.google.com/store/search?q=pixelmason" target="_blank">Pro </a>version will send actual values.</strong></span></p>
<p>&nbsp;</p>
<p><strong>Default Joystick Mode:</strong><br />
When you move the ball around, coordinates are generated as X+/- and Y +/- and can be used to interpret both velocity and direction. These are packaged and sent in the following format: sX=val,Y=vale i.e. <strong>sX=75,Y=55e</strong> where &#8216;s&#8217; indicates the start and &#8216;e&#8217; indicates the end. In this mode, when you press a Command Button, values are sent in the following format: sC=[val]e (i.e. For Command #2 <strong>sC=2e</strong> is sent) where &#8216;s&#8217; indicates the start, &#8216;C&#8217; indicates it is a command button, &#8217;2&#8242; is the value that you want to parse and &#8216;e&#8217; indicates the end. These values can be parsed to have your robot move and perform additional tasks. (sample Arduino code provided at link below)</p>
<p><strong>Simple Joystick Mode:</strong><br />
In Simple mode, you tap the arrows which generate single character values depending on the arrow you tapped (i.e. the top arrow sends U). Values generated are: U (up), D (down), L (left), R (right). Tapping the center of the joystick sends an S value (stop). Tapping any of the command value sends the respective command number. i.e. tapping Command Button 3, sends 3. In this mode, your micro-controller code can be simplified as need only parse single character values.In this mode, when you press a Command Button, values are sent as single characters in the value of the Command Button. i.e. If you press Command Button 3, the value 3 is sent. (sample Arduino code provided at link below)</p>
<p>You can change between Default and Simple modes in the Settings section.</p>
<p>There are two example Arduino programs &#8211; one for Default mode, and one for Simple mode.   They have routines built into them to parse the values being sent over Bluetooth and performing motor actions.</p>
</div><!--.qa-faq-answer-->
				</div><!--.qa-faq-->
			<div id="qa-faq6" class="qa-faq">
			<h3 class="qa-faq-title"><a class="qa-faq-anchor" href="http://www.plastibots.com/index.php/faqs/btbotcontrol-version-history/">Version History</a></h3>
			<div class="qa-faq-answer"><p><span style="text-decoration: underline;"><strong>V5.0.7 – April 16 2013:</strong></span></p>
<p>::  Pro Version:  Fixed issue with Default Joystick and data being returned from joystick movement. Only affects small screen devices.</p>
<p><span style="text-decoration: underline;"><strong>V5.0.6  - April 12 2013:</strong></span></p>
<p>Settings:</p>
<p>:: New:  Added Simple Joystick Mode.   Allows for simple joystick control using arrows.  Sends single char data via Bluetooth as (U,D,L,R).  Command Buttons send data as (1 to 8).</p>
<p>Help:</p>
<p>:: Cleaned up the Help page content.</p>
<p>About:</p>
<p>:: Added Simple Joystick Mode info.</p>
<p><span style="text-decoration: underline;"><strong>v5.0.5 &#8211; April 6 2013 :</strong></span></p>
<p>Settings:</p>
<p>:: NEW! Added option to turn on additional command buttons (5-8). Will send values as numbered. i.e. Command button 5 sends sC=5e. The enable them, go to the Settings section.</p>
<p>::  Discovered that an &#8220;emergency stop&#8221; on the joystick is necessary when in Orientation Sensor mode.  When in this mode and controlling your robot, you may need to change a setting, add a camera etc.  Tapping the joystick will temporarily disable the Orientation Sensor control and bring the Joystick to 0,0 so your robot does not move.  Tapping the joystick again will turn the Orientation Sensor back on.  Note &#8211; this only works when the Orientation Sensor is enabled in Settings.</p>
<p><span style="text-decoration: underline;"><strong>v5.0.4 &#8211; April 3 2013:</strong></span><br />
Settings:<br />
:: Updated Bluetooth Packet Delay component. New slider. Better notifications.<br />
:: Updated notifications for Joystick Touch Down Action.<br />
:: Added ability to switch between joystick or orientation sensor to control the joystick.  You can now tilt/roll the phone to control your robot.    Note – Joystick Touch Down Action is disabled when this is on.<br />
Other<br />
:: Cleaned up notifications.<br />
:: Improved joystick response.</p>
<p><span style="text-decoration: underline;"><strong>Earlier Versions:</strong></span></p>
<p>Coming soon.</p>
</div><!--.qa-faq-answer-->
				</div><!--.qa-faq-->
			</div><!--.qa-category-->
		</div><!--.qa-faqs -->
<p><iframe width="1016" height="572" src="http://www.youtube.com/embed/mogQt5MjWzs?feature=oembed" frameborder="0" allowfullscreen></iframe></p>
<p><iframe width="1016" height="762" src="http://www.youtube.com/embed/JyRcQh6R4DU?feature=oembed" frameborder="0" allowfullscreen></iframe></p>
<p>Here are some pictures of the bot (click to enlarge):</p>

<a href='http://www.plastibots.com/index.php/2013/03/07/btbotcontrol/cambotmaster1/' title='CamBotMaster1'><img width="150" height="150" src="http://www.plastibots.com/wordpress/wp-content/uploads/2013/03/CamBotMaster1-150x150.jpg" class="attachment-thumbnail" alt="IPCamBot" /></a>
<a href='http://www.plastibots.com/index.php/2013/03/07/btbotcontrol/cambotmaster2/' title='CamBotMaster2'><img width="150" height="150" src="http://www.plastibots.com/wordpress/wp-content/uploads/2013/03/CamBotMaster2-150x150.jpg" class="attachment-thumbnail" alt="IPCamBot" /></a>
<a href='http://www.plastibots.com/index.php/2013/03/07/btbotcontrol/cambotmaster3/' title='CamBotMaster3'><img width="150" height="150" src="http://www.plastibots.com/wordpress/wp-content/uploads/2013/03/CamBotMaster3-150x150.jpg" class="attachment-thumbnail" alt="IPCamBot" /></a>
<a href='http://www.plastibots.com/index.php/2013/03/07/btbotcontrol/cambotmaster4/' title='CamBotMaster4'><img width="150" height="150" src="http://www.plastibots.com/wordpress/wp-content/uploads/2013/03/CamBotMaster4-150x150.jpg" class="attachment-thumbnail" alt="IPCamBot" /></a>
<a href='http://www.plastibots.com/index.php/2013/03/07/btbotcontrol/cambotmaster5/' title='CamBotMaster5'><img width="150" height="150" src="http://www.plastibots.com/wordpress/wp-content/uploads/2013/03/CamBotMaster5-150x150.jpg" class="attachment-thumbnail" alt="IPCamBot" /></a>
<a href='http://www.plastibots.com/index.php/2013/03/07/btbotcontrol/ipcambotmaster1-2/' title='IPCamBotMaster1'><img width="150" height="150" src="http://www.plastibots.com/wordpress/wp-content/uploads/2013/03/IPCamBotMaster1-150x150.jpg" class="attachment-thumbnail" alt="IPCamBotMaster1" /></a>

<p><a href="http://www.plastibots.com/wordpress/wp-content/uploads/2013/03/BTBotControlScreenArtweb.png"><img class="aligncenter size-medium wp-image-2687" alt="BTBotControlScreenArtweb" src="http://www.plastibots.com/wordpress/wp-content/uploads/2013/03/BTBotControlScreenArtweb-300x174.png" width="300" height="174" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.plastibots.com/index.php/2013/03/07/btbotcontrol/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Remote Shutdown using a Foscam FI8918W</title>
		<link>http://www.plastibots.com/index.php/2013/01/01/remote-cnc-shutdown-using-tablet-foscam-fi8918w-ipcam-arduino/</link>
		<comments>http://www.plastibots.com/index.php/2013/01/01/remote-cnc-shutdown-using-tablet-foscam-fi8918w-ipcam-arduino/#comments</comments>
		<pubDate>Tue, 01 Jan 2013 14:56:11 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Microcontrollers]]></category>
		<category><![CDATA[MyDYI Hacks & Other Stuff]]></category>
		<category><![CDATA[ATTiny85]]></category>
		<category><![CDATA[FI8918W]]></category>

		<guid isPermaLink="false">http://www.plastibots.com/?p=2549</guid>
		<description><![CDATA[As a parent of 2 children and an obsession with cramming my hobbies in whenever I can, I decided to devise a means to remotely monitor my CNC (a ShapeOko) and also provide the ability for me to remotely shut &#8230; <a href="http://www.plastibots.com/index.php/2013/01/01/remote-cnc-shutdown-using-tablet-foscam-fi8918w-ipcam-arduino/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p style="text-align: left;">As a parent of 2 children and an obsession with cramming my hobbies in whenever I can, I decided to devise a means to remotely monitor my CNC (a ShapeOko) and also <a href="http://www.plastibots.com/wordpress/wp-content/uploads/2013/01/CNCControl1.jpg"><img class="wp-image-2557 alignright" alt="CNCControl1" src="http://www.plastibots.com/wordpress/wp-content/uploads/2013/01/CNCControl1-300x210.jpg" width="300" height="210" /></a>provide the ability for me to remotely shut it down if things go arwy during a milling session.   I picked up a <a href="http://foscam.us/" target="_blank">Foscam</a> FI8918W IPCam at a &#8216;car boot&#8217; sale (I love that name) when I was visting in England this past summer.  For 5 quid nonetheless!  I don&#8217;t think the folks selling it had any idea what it was worth.  When asking the woman the standard &#8220;does it work&#8221; question, I knew I was going to get it regardless of my knowing that there was a good chance it would not work.  Well, my luck prevailed, as the unit worked flawlessly with the exception that the smell of smoke was embedded in the plastic (would hate to see the previous owners lungs!). Yuk.   Oh, and I also had to pickup a North American plug adapter &#8211; for all about$2 from DX.</p>
<p style="text-align: left;">My original plan was to pickup up an Arduino Network shield and use the camera to watch the CNC via custom webpage using streaming video and then, with some buttons, call the Arduino to trigger a servo to hit the Esc key on the CNC keyboard (which in turn would trigger Mach3 to shut down the CNC).  There were a few problems with this. 1) I have to wait for the Network shield to come from China (about a month or so), and I did not want to run a lengthy network cable from my router in the basement into the garage.  An Arduino WiFi shield was also out of the question as they are costly.</p>
<p style="text-align: left;">Then it hit me..  The Foscam has the ability to remotely trigger the IR LEDs to go on or off.    I managed to trace the signal wire to a wire on the mainboard that goes HI (1.5V) when the IR LEDs are on, and LOW (0v) when off.  Voila!  Tapping this signal then bringing it out to an ATTiny85 with a bit of simple code, I could control a servo connected to the keyboard..  So, onto the Arduino IDE, and out came the soldering iron.  A few hours later, here we are.</p>
<p><span id="more-2549"></span></p>
<p>Foscam publishes an <a title="Foscam IPCam API" href="http://www.foscam.es/descarga/ipcam_cgi_sdk.pdf" target="_blank">API </a>to it&#8217;s camera interface which allows <a href="http://www.plastibots.com/wordpress/wp-content/uploads/2013/01/CNCControl0.jpg"><img class="alignright size-medium wp-image-2556" alt="CNCControl0" src="http://www.plastibots.com/wordpress/wp-content/uploads/2013/01/CNCControl0-300x185.jpg" width="300" height="185" /></a>you to create your own pages and embed the camera stream and other functions in it. I just needed something simple &#8211; a video stream and a big STOP button. There area number of other buttons there to allow me to view various status outputs as well as change some settings. However, the only thing I need to do is stop the CNC (button triggers the call to turn the IR LEDs off) and turn the IR LED&#8217;s back on (small button below the Stop button). As part of the whole process, the IR LEDs need to be triggered back on in order to reset the control unit as this puts the voltage HIGH again. I had Javascript behind the Stop button doing this at first (triggering IR OFF, then IR ON), however, it caused reliability issues on my Andriod tablet (using Opera) and sometimes did not work (something that I could not have for this to work properly since the trigger HAS to work).</p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-0955337107322324";
/* 728x90ImgOnly */
google_ad_slot = "4816127144";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p>Showing the ATTiny85 circuit and the servo. The circuit is simple, the Tiny watches the output trigger from the camera, when it goes HIGH, it triggers the servo to &#8216;tap&#8217; the Esc key. I also added an LED in there to provide visual feedback. Since the Tiny does not allow you to monitor via Serial, I was also using the LED as a debug tool. During testing, I wanted to make sure there were no phantom taps triggered (as I had this happen earlier). I used the LED to count the number of taps and blink that count.<br />
<a href="http://www.plastibots.com/wordpress/wp-content/uploads/2013/01/CNCControl2.jpg"><img class="size-medium wp-image-2558 aligncenter" alt="CNCControl2" src="http://www.plastibots.com/wordpress/wp-content/uploads/2013/01/CNCControl2-300x169.jpg" width="300" height="169" /></a></p>
<p>Showing the modifications to the Foscam IPCam. This is an earlier picture before I was taking power from the camera. Since then, I have power coming directly off the power adapter inputs (bottom right shown with the black wire and red (drawn-in) wire). The IR LED trigger signal is the gray wire connected to pin #3 from the right.<br />
<a href="http://www.plastibots.com/wordpress/wp-content/uploads/2013/01/CNCControl4.jpg"><img class="size-medium wp-image-2553 aligncenter" alt="CNCControl4" src="http://www.plastibots.com/wordpress/wp-content/uploads/2013/01/CNCControl4-300x169.jpg" width="300" height="169" /></a></p>
<p>This is the servo mounted to the keyboard. &#8230; and of course, the ideal way to build custom mounting solutions &#8211; LEGO Technic. Check the rest of this site out if you are wondering why I use LEGO.<br />
<a href="http://www.plastibots.com/wordpress/wp-content/uploads/2013/01/CNCControl5.jpg"><img class="size-medium wp-image-2554 aligncenter" alt="CNCControl5" src="http://www.plastibots.com/wordpress/wp-content/uploads/2013/01/CNCControl5-300x169.jpg" width="300" height="169" /></a></p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-0955337107322324";
/* 728x90ImgOnly */
google_ad_slot = "4816127144";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p>I wanted the ability to easily remove and install the servo to the keyboard. I used a set of Technic friction pins and glued them in. The servo is mounted to a Technic 15 hole beam so it slides on and off easily, but is also secure enough to stay in place when the servo is triggered.<br />
<a href="http://www.plastibots.com/wordpress/wp-content/uploads/2013/01/CNCControl6.jpg"><img class="size-medium wp-image-2555 aligncenter" alt="CNCControl6" src="http://www.plastibots.com/wordpress/wp-content/uploads/2013/01/CNCControl6-300x275.jpg" width="300" height="275" /></a></p>
<p>Here&#8217;s the ShapeOko &amp; IPCam.</p>
<p><a href="http://www.plastibots.com/wordpress/wp-content/uploads/2013/01/CNCControl8.jpg"><img class="aligncenter size-medium wp-image-2582" alt="CNCControl8" src="http://www.plastibots.com/wordpress/wp-content/uploads/2013/01/CNCControl8-300x175.jpg" width="300" height="175" /></a></p>
<p>Here&#8217;s a video below of the system in action during testing. Now, I can roam around the house, be cooking dinner, etc.. while checking on the CNC and trigger a shutdown if needed. The Foscam also has a microphone, so I can also listen for those crazy noises you hear when your CNC skips a step and things go wrong &#8211; you know them, I&#8217;m sure you&#8217;ve heard it too!<br />
(<a href="http://www.youtube.com/embed/PZgWuric3Ok" target="_blank">Link</a>)<br />
<a href="http://youtu.be/PZgWuric3Ok"><iframe src="http://www.youtube.com/embed/PZgWuric3Ok" height="350" width="425" frameborder="0"></iframe><br />
</a></p>
<p>Improvements that could be done:</p>
<ul>
<li>The IR LEDs have to be triggered back on. Streamline the web interface component to ensure it automatically turns the IR LEDs back on after each Stop call. This could just be a Javascript timing issue. The code works by calling a new window, waiting a short period of time, then closing it. It does this for both the Stop call, and the call to turn the IR LEDs back on. During testing, I had both together in one call and it worked fine on my PC (networked), but did not work on my wireless tablet (it would miss either or both calls). By taking out the call to turn the IR LEDs back on, it reliably turns them off when called.</li>
<li>The camera itself uses a photo resistor to turn the IR LEDs during daytime. This is not good considering that my CNC work area is well lit. Covering it with black tape does the trick. To solve the problem, I could modify the Foscam to not dim the IR LEDs (apparently this setting already exists for other Foscam cameras).</li>
</ul>
<p>Other Thoughts:</p>
<ul>
<li><span style="line-height: 13px;">This could be used for other projects if you have a similar Foscam camera and want to remotely trigger actions using an Arduino or other microcontroller.</span></li>
</ul>
<p>Files / Code:</p>
<p><a href="http://www.plastibots.com/wordpress/wp-content/uploads/2013/01/CNCControl_WebInterfaceHTML.txt">CNCControl_WebInterfaceHTML</a></p>
<p>Arduino 1.0.3 Code:  <a href="http://www.plastibots.com/wordpress/wp-content/uploads/2013/01/CNCControlFoscamFI8918W_1_2.zip">CNCControlFoscamFI8918W_1_2</a>  (must have Servo8Bit library).</p>
<pre class="brush: csharp; collapse: true; light: false; title: ; toolbar: true; notranslate">&lt;/pre&gt;
//This is written to go onto an ATTiny85. If using an Arduino, change pin references. Also must change back to using the Servo library
//as Servo8Bit wont work.

//ATTiny85 Pinouts:
// ________
// Reset |1 8| VCC
// Pin 3(analog in 3) |2 7| Pin 2 (analog in 1)
// Pin 4(analog in 2) |3 6| Pin 1 (PWM)
// GND |4 5| Pin 0 (PWM)
// --------
//
//

#include &quot;Servo8Bit.h&quot;
Servo8Bit myservo; //create a servo object.
 //a maximum of five servo objects can be created
int statusLED = 0; //shows as Pin 0 on ATTiny (pin 5 on board)
int pos = 0; // variable to store the servo position
//int foscamIRpin = A0; //when IR is on, pin is high 1.5v. Else LOW 0v
int foscamIRpin = 3; // shows as Pin 3(analog in 3) - labelled pin #3 on ATTiny85 board layout - when IR is on, pin is high 1.5v. Else LOW 0v
int state = 1;
int doneOnce = 0;
int CNCoff = 0;
int blinkCount = 0;
void setup()
{

myservo.attach(1,544,2200); //shows as Pin 1 on ATTiny (pin 6 on board)

//Serial.begin (9600);
 //Serial.print(&quot;Started... running...&quot;); Serial.println();
 pinMode(foscamIRpin, INPUT);
 pinMode(statusLED, OUTPUT);
 //get the starting state of the IR LEDs
 //if (analogRead(foscamIRpin) &lt; 1) { startState = 0;} else {startState = 1;};
 //Serial.print(&quot;StartState: &quot;); Serial.print(startState);
 //Serial.println();

 //send servo to start position
 myservo.write(0);

}

void loop()
{

 //Stop button clicked - IR goes off - trigger CNC Stop - but only if it hasn't alread been triggered
 //startState of 0 means IRs where already off - dont want to trigger keyboard stop
 //startState of 1 means IRs are on at start - good this is what we want.
 if (analogRead(foscamIRpin) &lt; 1 &amp;&amp; CNCoff == 0)
 {
 //IR LEDs are off

hitKey(2);
 digitalWrite(statusLED, HIGH); // turn the LED on (HIGH is the voltage level)
 blinkCount ++;
 CNCoff = 1;
 doneOnce = 0;
 //Serial.print(&quot;Stop clicked - IR LEDs off &quot;); Serial.println();
 delay(500);
 digitalWrite(statusLED, LOW); // turn the LED of

}
 //this is to catch when the IR LED have been reset (switched back on). It will reset the system for the next round of cutting.
 //will look for a way in the web form to have it automatically reset the IR LEDs after a triggered shutdown.
 else if (analogRead(foscamIRpin) &gt; 50 &amp;&amp; doneOnce == 0)
 {
 //IR LEDs are on
 //Serial.print(&quot;Start clicked - IR LEDs on &quot;); Serial.println();
 CNCoff = 0;
 doneOnce = 1;
 }
 //Serial.print(&quot;IRVoltage: &quot;); Serial.print(analogRead(foscamIRpin));
 //Serial.print(&quot; CNCoff: &quot;); Serial.print(CNCoff);
 //Serial.print(&quot; DoneOnce: &quot;); Serial.print(doneOnce);
 //Serial.println();
 delay(100);
 //blink(blinkCount);
}
void hitKey(int spd)
{
 //CNCoff = 1;
 //Serial.print(&quot;CNC Triggered to shut off. &quot;);
 //Serial.println();

 for(pos = 0; pos &lt; 60; pos += 1) // goes from 0 degrees to 180 degrees
 { // in steps of 1 degree
 myservo.write(pos); // tell servo to go to position in variable 'pos'

 //Serial.println (myservo.read());
 delay(spd); // waits 15ms for the servo to reach the position
 }
 for(pos = 60; pos&gt;=1; pos-=1) // goes from 180 degrees to 0 degrees
 {
 myservo.write(pos); // tell servo to go to position in variable 'pos'
 //Serial.println (myservo.read());
 delay(spd); // waits 15ms for the servo to reach the position

 }

 delay(100);

}

/*
void blink(int cnt)
{
 int i;
 if (cnt &gt; 0)
 {
 for (i = 0; i&lt;=cnt; i++)
 {
 digitalWrite(statusLED, HIGH);
 delay(10);
 digitalWrite(statusLED, LOW);
 delay(100);
 }
 }
}
*/
&lt;pre&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.plastibots.com/index.php/2013/01/01/remote-cnc-shutdown-using-tablet-foscam-fi8918w-ipcam-arduino/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Juke &#8211; Custom Paddle Shifters &#8211; Phase 1</title>
		<link>http://www.plastibots.com/index.php/2012/07/18/juke-custom-paddle-shifters-phase-1/</link>
		<comments>http://www.plastibots.com/index.php/2012/07/18/juke-custom-paddle-shifters-phase-1/#comments</comments>
		<pubDate>Wed, 18 Jul 2012 13:44:04 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.plastibots.com/?p=2437</guid>
		<description><![CDATA[Not satisfied leaving well enough alone, I decided to add custom paddle shifters to my 2012 Nissan Juke.  For those that aren&#8217;t in the know, the Juke has a sport shift mode where you can &#8216;bump&#8217; the auto shift unit &#8230; <a href="http://www.plastibots.com/index.php/2012/07/18/juke-custom-paddle-shifters-phase-1/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.plastibots.com/wordpress/wp-content/uploads/2012/07/PaddleShifter_wirelessRemote1.png"><img class="size-medium wp-image-2448 alignright" title="PaddleShifter_wirelessRemote" src="http://www.plastibots.com/wordpress/wp-content/uploads/2012/07/PaddleShifter_wirelessRemote1-300x154.png" alt="" width="300" height="154" /></a>Not satisfied leaving well enough alone, I decided to add custom paddle shifters to my 2012 Nissan Juke.  For those that aren&#8217;t in the know, the Juke has a sport shift mode where you can &#8216;bump&#8217; the auto shift unit up or down to up/down shift.  ..but that&#8217;s no fun&#8230;   I wanted paddle shifters, and since there is no stock option, I decided to go the custom route.  Before jumping into the project, the main hurdle to overcome was to figure out how to add the paddles to the steering wheel.  In this case, the custom milled paddles I&#8217;m making would be mounted to the backside of the steering wheel and had to be wireless (for obvious reasons).  I am aware that this is not conventional and that many paddles are mounted to the steering column, but I wanted them on the steering wheel.  A <a href="http://www.jukeforums.com/forum/nissan-juke-diy/122943-diy-paddle-like-shifting-3.html#post1697379" target="_blank">suggestion</a> led me to a RF wireless remote (pic) that fit the ticket.  The plan is to embed the remote into the backside of the steering wheel, mod the buttons for &#8216;A&#8217; and &#8216;B&#8217; by adding wires out to the individual custom made paddle units.</p>
<p>Phase 1 &#8211; enable functionality for controlling manual mode shifting using an RF remote.  This will be discussed here.</p>
<p>Phase 2 &#8211; Custom CNC milled aluminum paddle shifter units mounted to the steering wheel. Stay tuned</p>
<p><span id="more-2437"></span></p>
<h1></h1>
<h1><span style="text-decoration: underline;"><strong>Phase 1:</strong></span></h1>
<p><strong>Preface:  If you want to try this yourself, you take responsibility for anything that may result from it.  If you mess up, you risk frying one of the BCM which could cost you some serious coin.  There is no guarantee that this will work for you, or of the long term affects.  I know enough about electronics / car electrical systems to have confidence that this will work.   If you don&#8217;t have this same confidence, then this may not be for you.</strong></p>
<p><img class="size-medium wp-image-2447 alignright" title="PaddleShifterSWModel" src="http://www.plastibots.com/wordpress/wp-content/uploads/2012/07/PaddleShifterSWModel-300x188.jpg" alt="" width="300" height="188" /><img class="alignright size-thumbnail wp-image-2454" title="paddle_shifter_switch" src="http://www.plastibots.com/wordpress/wp-content/uploads/2012/07/paddle_shifter_switch-150x150.png" alt="" width="150" height="150" /></p>
<p>Since I don&#8217;t have many hobbies (not), I&#8217;ve jumped into desktop CNC milling and recently picked up a <a href="http://www.mydiycnc.com/" target="_blank">MyDIYCNC</a>.  My first project will be the paddles.  I&#8217;ve modeled the unit  as shown here.  This will come in Phase II, but I wanted to show the end goal.  The view here is of the backside of the paddle.  The recessed area to the right is where the finger would rest when triggering the paddle.  The blank area to the right is going to hold a small switch (see image).  The switch will be mounted upside-down inside the paddle and will rest against the steering wheel.  The switch itself will serve to both trigger a shift as well as provide the &#8216;spring&#8217; to allow the paddle to triggered as the switch compresses against the back of the steering wheel.  The far left side will be used to mount a tab to to attach the paddle to the steering wheel itself.</p>
<p>The Juke manual mode shifter has some built-in checks to ensure that it is in the manual mode state and that the &#8216;up&#8217; and &#8216;down&#8217; shifts are not phantom shifts.  It does this with a few pins and an internal slide switch. Namely pins 7, 8, 9 and 10 (shown below).   These pins can be seen circled red in the connector that mounts to the backside of the shifter pod.  The manual mode shifting is monitored by the car computer to ensure than a shift took place and also determines which way.  Reading the switching diagram to the right, the following can be interpreted:</p>
<ol>
<li>Manual Mode engaged:  Pin 8 &amp; 9 &#8211; no continuity between pin 10.  Pin 7 &#8211; continuity to 10.</li>
<li>Shift Up &#8211; Pin 9 continuity to 10, pin 8 &amp;7  no continuity</li>
<li>Shift Dn &#8211; Pin 8 continuity to 10, pin 9 &amp; 7 no continuity</li>
<li>Shift unit connector wire colours: pin 7=brown, 8=green, 9=grey, 10=yellow</li>
</ol>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-2440" title="paddleshifter_modes diagrams" src="http://www.plastibots.com/wordpress/wp-content/uploads/2012/07/paddleshifter_modes-diagrams.png" alt="" width="945" height="503" /></p>
<p style="text-align: left;">
<p style="text-align: left;">I wanted to do the mod as well as ensure the stock unit would still work as designed.  To do this, I had to tap into these wires to mimic the action of the shifter lever, but not disable the shifter itself.  The RF remote receiver has 2 relays &#8211; one for each button &#8216;A&#8217; and &#8216;B&#8217;.  This was perfect as it allowed me to run parallel lines off pins 8 &amp; 9 and connect them to pins A of each relay.  Pin 10 was connected to GND on both relays.  The default state of the relay had no continuity between Pin 8 &amp; 10 and pin 9 &amp; 10 (as per spec). When the RF remote buttons are pressed, continuity to pin 10 is triggered from (8 or 9).  The challenge was pin 7.   Since pin 7 continuity needs to be broken when either 8 or 9 is triggered, it could not be connected to the relay as one of the relays would always keep continuity between 7 &amp; 10 while the other relay would try to open it &#8211; not gonna work!</p>
<p style="text-align: left;">Jumping ahead, here is a demo of first part.  The RF remote controlling the switching.  Choppy video warning in 3&#8230;2&#8230;1&#8230;.</p>
<h2 style="text-align: left;"><iframe src="http://www.youtube.com/embed/WRi77tmnNe0" width="320" height="240"></iframe></h2>
<p><a href="http://youtu.be/WRi77tmnNe0" target="_blank">Link</a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><span style="text-decoration: underline; font-size: medium;"><strong>The build:</strong></span></p>
<p>To handle the pin 7 issue, I used an ATTiny85 Arduino micro controller to work as a NOT gate.  It monitors pins 8 &amp; 9 and, when either of them go LOW (no continuity), it would trigger pin 7 to go High (and vise-versa).  The following image shows the circuit.  The bottom shows the leads coming form pins 8 &amp; 9 and the connection to the relays of the RF remote receiver.  Recall that when in manual mode neutral state (still driving), pins 8 &amp; 9 are Low and 7 is high.  This is fed to a voltage divider for each of 8 &amp; 9 to drop the voltage to a range between 0 &#8211; 5V.  The ATTiny reads this, and triggers the output on pin 6 (top right in blue), which in turn triggers the 2222 transistor.  On the car, the wire for pin 7 leading into the shifter was cut and leads were taken into the circuit (shown below top right for pin 7).    One lead goes to the Collector and the other to the Emitter of the 2222.  The idea is that the ATTiny serves as a trigger to set pin 7 High or Low.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-2443" title="PaddleShifter_Circuit" src="http://www.plastibots.com/wordpress/wp-content/uploads/2012/07/PaddleShifter_Circuit.png" alt="" width="932" height="715" /></p>
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">Showing the wireless remote receiver and emitter.  Pin 8 &amp; 9 went to connector C on each relay while pin 10 when to both &#8216;B&#8217; connectors.  The &#8216;A&#8217; connectors are not needed.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-2448" title="PaddleShifter_wirelessRemote" src="http://www.plastibots.com/wordpress/wp-content/uploads/2012/07/PaddleShifter_wirelessRemote1.png" alt="" width="581" height="300" /></p>
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">The below pic shows the ATTiny85 circuit connected to the RF receiver while testing.   I had originally intended to build just use a quad NAND gate to make this work, but ran into difficulties with leaky voltage not triggering pin 7 to go Low.  I also realized that there would be a timing issue.  Consider that, when manually shifting by hand, it takes time (in hundreds of milliseconds) to go from the shifter neutral state to either an up or down shift. During that time, there is a mechanical switch that changes states for pins 7,8 and 9.  However, when using the method here, everything is instantaneous. Once you touch a button on the RF remote and the relay is triggered, the switching is much faster than you can do with your hand.  Once the relay is triggered, the output states of the pins switch from one state to the other and back very fast &#8211; too fast for the car to see them sometimes.  I realized this when the RF remote was not working at first, but then when I held the button for a little longer, it worked.   I introduced a delay into the Arduino sketch to allow for approx 600 ms time to hold the pins in their switched state (High or Low).</p>
<p style="text-align: center;"><a href="http://www.plastibots.com/wordpress/wp-content/uploads/2012/07/PaddleShifter_circuit_final.jpg"><img class="aligncenter size-medium wp-image-2445" title="PaddleShifter_circuit_final" src="http://www.plastibots.com/wordpress/wp-content/uploads/2012/07/PaddleShifter_circuit_final-300x169.jpg" alt="" width="300" height="169" /></a></p>
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">Showing some of the wiring.  This is for pins 8, 9 and 10.  Pin 7 missing as this is an early picture of the project.  For pin 7, the wire is cut and a line is taken from each side.  In the case of the other pins, I tapped into the line but left the wire intact.  This is necessary to ensure that the shifter pod will still work.  The pin 7 wire had to be cut or it would not be able to be triggered from the RF and Arduino units.  BTW &#8211; pin 7 is the brown wire.</p>
<p style="text-align: left;"><a href="http://www.plastibots.com/wordpress/wp-content/uploads/2012/07/PaddleShifter_Wiring.jpg"><img class="aligncenter size-medium wp-image-2489" title="PaddleShifter_Wiring" src="http://www.plastibots.com/wordpress/wp-content/uploads/2012/07/PaddleShifter_Wiring-300x169.jpg" alt="" width="300" height="169" /></a></p>
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">Phase I is complete &#8211; the circuit and RF remote allow the manual mode shifting to be controlled.  I have yet to mill the paddles and hack the remote to get switching into the paddles &#8211; this is Phase II and will be coming in a bit.  Check back again!</p>
<p>Source Code:</p>
<pre class="brush: csharp; collapse: true; light: false; title: ; toolbar: true; notranslate">
/*
Juke paddle shifter code - NOT gate. ATTiny85
Purpose: monitor inputs on A2, A3. When either go High, output on digital pin 0 to go Low.  NOT gate
July 2012
D. Astolfo
*/

                  // On ATTiny85
int pin7Juke = 0; //pin #5
int led = 1;      //pin #6
int shiftUp = 3;  //pin #2 (note that pins are defined based on the ‘analog input text 3’ on the image at the below URL)
int shiftDn = 2;  //pin #3  (note that pins are defined based on the ‘analog input text 2’ on the image at the below URL)
                  //http://hlt.media.mit.edu/?p=1695

void setup() {
  //Serial.begin(115200);
  // initialize the digital pin as an output.
  pinMode(pin7Juke, OUTPUT);
  pinMode(led, OUTPUT);
  pinMode(shiftUp, INPUT);
  pinMode(shiftDn, INPUT);

  digitalWrite(pin7Juke, HIGH);  //onstartup, pin7 needs to be supplying 12V.
}

// the loop routine runs over and over again forever:
void loop() {

  //Serial.print(&quot;Val1=&quot;);
  //Serial.print(analogRead(shiftUp), DEC);
  //Serial.print(&quot;  Val2=&quot;);
  //Serial.println(analogRead(shiftDn), DEC);

  if (analogRead(shiftUp) &lt; 900 || analogRead(shiftDn) &lt; 900)
  {
    //will set pin 7 to LOW to tell the car that a shift up or dn has ocurred.
    digitalWrite(pin7Juke, LOW);
    blink();
    //keep the pin low for a bit as the relays and electrics trigger much faster than doing this by hand through the shifter
    delay(500);
  }
  else
  {
    //sets the pin back high again.
    digitalWrite(pin7Juke, HIGH);
  }

  delay(100);

}

void blink()
{
  digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(100);               // wait for a second
  digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
  delay(100);               // wait for a second

}

</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.plastibots.com/index.php/2012/07/18/juke-custom-paddle-shifters-phase-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Red Light Camera Alerter</title>
		<link>http://www.plastibots.com/index.php/2012/04/10/red-light-camera-alerter/</link>
		<comments>http://www.plastibots.com/index.php/2012/04/10/red-light-camera-alerter/#comments</comments>
		<pubDate>Wed, 11 Apr 2012 01:08:58 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Microcontrollers]]></category>
		<category><![CDATA[GPS]]></category>
		<category><![CDATA[OLED]]></category>

		<guid isPermaLink="false">http://www.plastibots.com/?p=2392</guid>
		<description><![CDATA[I had the chance to play with some new components &#8211; namely the Adafruit Monochrome 128&#215;32 OLED display and the Adafruit UP501 66 channel GPS receiver. As I was pondering ideas of what to build, I thought that it would &#8230; <a href="http://www.plastibots.com/index.php/2012/04/10/red-light-camera-alerter/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-2393" title="RedLightCamFinder1b" alt="" src="http://www.plastibots.com/wordpress/wp-content/uploads/2012/04/RedLightCamFinder1b.jpg" width="500" height="255" />I had the chance to play with some new components &#8211; namely the <a href="https://www.adafruit.com/products/661" target="_blank">Adafruit Monochrome 128&#215;32 OLED display</a> and the <a href="https://www.adafruit.com/products/660" target="_blank">Adafruit UP501 66 channel GPS receiver.</a> As I was pondering ideas of what to build, I thought that it would be neat to be alerted when approaching a red light camera.  In my local area (Southern Ontario), there are currently about a hundred or so of these cameras around the GTA.  However, it appears that new legislation may see this number grow much larger.   This is more of a proof of concept project to me than it is useful as, a) I don&#8217;t intend on trying to run any red lights, and b) there are only about 1 or 2 of them within the area.   However, it was fun to build and tweak to make it useful.  Read on&#8230;</p>
<p><span id="more-2392"></span></p>
<p>The general idea is that the GPS tracks the coordinates while driving,  the Arduino sketch has an array of red light camera location coordinates that it compares against the current reading.    On a regular basis, it checks the current position of the car against the array of red light camera locations.   With each check, it finds the closest red light camera location.  If that location is less than a pre-determined buffer distance (e.g. 3 km away), it will begin reporting on it via the OLED as well as the Status LED.</p>
<p>The Status LED flashes with 4 modes:</p>
<ul>
<li>green &#8211; indicates that the system is functional and GPS is returning results.</li>
<li>blue &#8211; early warning of approaching red light camera location less than 600 metres away.</li>
<li>yellow -warning of red light camera less than 200 metres away.</li>
<li>red &#8211; red light camera intersection less than 50 metres away.</li>
</ul>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-0955337107322324";
/* 728x90ImgOnly */
google_ad_slot = "4816127144";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p><strong><span style="text-decoration: underline;">The Parts:</span></strong></p>
<ul>
<li><a href="https://www.adafruit.com/products/661" target="_blank">Adafruit Monochrome 128&#215;32 OLED display</a></li>
<li><a href="https://www.adafruit.com/products/660" target="_blank">Adafruit UP501 66 channel GPS receiver</a></li>
<li><a href="https://www.adafruit.com/products/589" target="_blank">Adafruit Perma-Proto Quarter Sized Breadboard</a></li>
<li>Atmega 328P with UNO Bootloader</li>
<li>10mm Diffused RGB LED</li>
<li>Other bits (5v/3.3v regulator, female headers, resistors etc)</li>
</ul>
<p>The OLED will display the distance to the Red Light Camera in Km, Direction that the vehicle is travelling, Speed, # of Satellites, Latitude and Longitude of the vehicle.</p>
<p><a href="http://www.plastibots.com/wordpress/wp-content/uploads/2012/04/SSD1306AdafruitOLED_2.jpg"><img class="aligncenter size-medium wp-image-2390" title="SSD1306AdafruitOLED_2" alt="" src="http://www.plastibots.com/wordpress/wp-content/uploads/2012/04/SSD1306AdafruitOLED_2-300x201.jpg" width="300" height="201" /></a></p>
<p><strong><span style="text-decoration: underline;">The Build:</span></strong></p>
<p>The main unit consists of an Atmega 328P mounted to an <a href="https://www.adafruit.com/products/589" target="_blank">Adafruit Perma-Proto Quarter sized breadboard</a>.   The board has both 5v and 3.3v rails running down either side to provide power for various components.  The rest is a spaghetti mess of wires for all the components.   I also decided to make this unit (somewhat) modular.   The main board has been fitted with female header pins to allow all components to be plugged/unplugged.  So, if I want to re-use the controller for another project, I can just unplug all the bits and I have a dual power supply-ready Arduino.     Given that I would likely want to re-use the GPS on other projects, I hacked in USB ports on the main unit as well as a mini-USB connector on the GPS module.</p>
<p style="text-align: center;"><a href="http://www.plastibots.com/wordpress/wp-content/uploads/2012/04/RedLightCamFinder3.jpg"><img class="aligncenter size-medium wp-image-2386" title="RedLightCamFinder3" alt="" src="http://www.plastibots.com/wordpress/wp-content/uploads/2012/04/RedLightCamFinder3-300x285.jpg" width="300" height="285" /></a></p>
<p style="text-align: left;">As noted above, the GPS module is modular.  With the mini-USB connector, I can move it over to other projects in a breeze.   There are only 4 connectors that need to be brought to the Arduino to use this unit, so USB cables do the trick.  Although there are more pins needed, the wiring can be done at the GPS module end itself (e.g resistor between two pins).  I also wanted a minimal USB cable, so I picked up one of those self-retracting flat cable USB dongle thingamabobs and just took out the self-retracting bit.  The cable is very flexible as well.</p>
<p><a href="http://www.plastibots.com/wordpress/wp-content/uploads/2012/04/RedLightCamFinder4.jpg"><img class="aligncenter size-medium wp-image-2387" title="RedLightCamFinder4" alt="" src="http://www.plastibots.com/wordpress/wp-content/uploads/2012/04/RedLightCamFinder4-300x169.jpg" width="300" height="169" /></a></p>
<p><strong><span style="text-decoration: underline;">The Verdict:</span></strong></p>
<p>Adafruit UP501 GPS Module: The UP501 is small, which makes it great for fitting into small packages.  Another nice feature is that you only require 4 wires between the controller and the GPS, which makes it a perfect candidate for using readily available USB cables.   I managed to get this one before the newer <a href="https://www.adafruit.com/products/746" target="_blank">Adafruit Ultimate GPS</a> that comes with a backup battery.  As a result, my unit takes up to 45 seconds to as it would cold start every time it is powered up.  This is negligible considering I don&#8217;t need the GPS functioning the moment I start my car.  However, for other projects, this could be an issue.  Once the unit acquires its first fix, it provides fast accurate updates.  It is also great at acquiring signals indoors..  When testing, I would put it on my window sill to get a fix, then once fixed, I could move the unit to my desk to continue testing.</p>
<p>Adafruit 128&#215;32 OLED Module: I won&#8217;t go into detail here as I have already done a review on this unit <a href="http://www.plastibots.com/?p=2296" target="_blank">here</a>.  However, I will say that this is a nice, crisp, small display that works very well with small projects.</p>
<p>&nbsp;</p>
<p>Looking for an Android remote control for your robot? Check out <a title="BTBotControl" href="http://www.plastibots.com/index.php/2013/03/07/btbotcontrol/">BTBotControl </a>- I built this to remotely control <a href="http://www.plastibots.com/index.php/2013/03/07/btbotcontrol/">IPCamBot</a> and view a live feed of a mounted IP Camera.</p>
<p>&nbsp;</p>
<p><strong><span style="text-decoration: underline;">The Code:</span></strong></p>
<pre>(<strong><a href="http://www.plastibots.com/wordpress/wp-content/uploads/2012/04/GPSRedLightTracker1_5.zip">download</a></strong>)
<pre class="brush: csharp; collapse: true; light: false; title: ; toolbar: true; notranslate">

// Select which PWM-capable pins are to be used.
int redPin = 9;
int greenPin = 3;
int bluePin = 10;

#include &lt;SoftwareSerial.h&gt;
//SoftwareSerial mySerial(rxPin, txPin)
//SoftwareSerial nss(2, 3);  //yellow wire = RX  Blue wire = TX
SoftwareSerial nss(0, 2);   //yellow wire = RX  Blue wire = TX

#include &lt;avr/pgmspace.h&gt;
#include &lt;SSD1306.h&gt;                  //for OLED
#include &lt;SPI.h&gt;                      //for OLED
#include &lt;string.h&gt;
#include &lt;TinyGPS.h&gt;

#define OLED_RESET 7
#define OLED_DC 8
#define OLED_CS 6     // SPI slave-select
#define OLED_MOSI 11   // hardware SPI MOSI
#define OLED_CLK 13    // hardware SPI clock

// Connect the GPS Power pin to 3.3V
// Connect the GPS Ground pin to ground
// Connect the GPS VBAT pin to 3.3V if no battery is used
// Connect the GPS TX (transmit) pin to Digital 2
// Connect the GPS RX (receive) pin to Digital 3
// For 3.3V only modules such as the UP501, connect a 10K
// resistor between digital 3 and GPS RX and a 10K resistor
// from GPS RX to ground.
TinyGPS gps;
//NewSoftSerial mySerial(rxPin, txPin);

//OLED
SSD1306 oled(OLED_MOSI, OLED_CLK, OLED_DC, OLED_RESET, OLED_CS);

const int GPSActive = 4;               // Indicates GPS is getting data
const int statusLED = 5;               //System hearbeat LED

int updateFreq = 1000;                 //frequency to update GPS polls.  Good not to go below 1000 ms.

float flat, flon;                      //lat and long variables used in calculations
unsigned long age;                     //GPS reading age variable
float spd;                             // GPS Speed
float minDist = 100000;                //preset the minDist to some very high value (in meters)

//
//int md[] = {600, 180, 35};
//int j = 0;
//

const float ToRad = PI / 180.0;        // for HaverSine function
const float R = 6371;                  // radius earth in Km - for HaverSine function
int mappedDist = 0;                    // mapped variable converted for placement of icons on OLED
int spdProRate = 0;                    // pro rated speed value movement of road graphic on OLED - to mimic speed changes
int i = 128;                           // used for the looping through animations of the OLED
int state = LOW;                       // The input state of the status LED
int gpsStatCounter = 0;
// setup variables for Tiny GPS
void gpsdump(TinyGPS &amp;gps);
bool feedgps();

char cVal[32];
int sats;
int hdop;
String cardinal;

//********************************************************************************************************
// use for testing
boolean debug = true;            //print debugging statements to the serial port.
//********************************************************************************************************

// different commands to set the update rate from once a second (1 Hz) to 10 times a second (10Hz)
#define PMTK_SET_NMEA_UPDATE_1HZ  &quot;$PMTK220,1000*1F&quot;
#define PMTK_SET_NMEA_UPDATE_5HZ  &quot;$PMTK220,200*2C&quot;
#define PMTK_SET_NMEA_UPDATE_10HZ &quot;$PMTK220,100*2F&quot;
// turn on only the second sentence (GPRMC)
#define PMTK_SET_NMEA_OUTPUT_RMCONLY &quot;$PMTK314,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*29&quot;
// turn on ALL THE DATA
//#define PMTK_SET_NMEA_OUTPUT_ALLDATA &quot;$PMTK314,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0*28&quot;
// to generate your own sentences, check out the MTK command datasheet and use a checksum calculator
// such as the awesome http://www.hhhh.org/wiml/proj/nmeaxor.html

//Define list of waypoints to search
//format WayPt[Lat][Long]
//multidimensional array [howmany dn] [howmany across]
const float wayPt[175][2] PROGMEM =
{
{43.25981,-79.88897},
PUT YOUR RED LIGHT CAMERA COORDINATES HERE
};

void setup()
{

  Serial.begin(115200);
  pinMode(statusLED, OUTPUT);

  //setup the RGB LED
  pinMode(redPin, OUTPUT);
  pinMode(greenPin, OUTPUT);
  pinMode(bluePin, OUTPUT);

  //set the RGB status LED to off which is HIGH (255) reason: Common-Annode.
  analogWrite(redPin, 255);
  analogWrite(greenPin, 255);
  analogWrite(bluePin, 255);

  //Serial.println(&quot;Adafruit MTK3329 NMEA test!&quot;);
  nss.begin(9600);  //needed to change this to 9600 baud for the UP501 GPS module

  //*********  OLED SETUP STUFF ******************************************************************/
  SPI.begin ();  //for OLED
  // OLED: By default, we'll generate the high voltage from the 3.3v line internally! (neat!)
  oled.ssd1306_init(SSD1306_SWITCHCAPVCC);

  //*********  GPS SETUP STUFF ******************************************************************/
  // 9600 NMEA is the default baud rate
  // uncomment this line to turn on only the &quot;minimum recommended&quot; data for high update rates!
  nss.println(PMTK_SET_NMEA_OUTPUT_RMCONLY);
  // uncomment this line to turn on all the available data - for 9600 baud you'll want 1 Hz rate
  //mySerial.println(PMTK_SET_NMEA_OUTPUT_ALLDATA);
  // Set the update rate
  // 1 Hz update rate
  nss.println(PMTK_SET_NMEA_UPDATE_1HZ);
  // 5 Hz update rate- for 9600 baud you'll have to set the output to RMC only (see above)
  //nss.println(PMTK_SET_NMEA_UPDATE_5HZ);
  // 10 Hz update rate - for 9600 baud you'll have to set the output to RMC only (see above)
  //nss.println(PMTK_SET_NMEA_UPDATE_10HZ);
  //*********  END GPS SETUP STUFF ******************************************************************/

  //setupDisplay();

}

void loop()
{
  bool newdata = false;
  unsigned long start = millis();

  blinkLED();   // heartbeat to ensure system is working
  flat=0;
  flon=0;
  spd=0;
  sats=0;
  hdop=0;
  cardinal= &quot;&quot;;

  // Every xxxx milliseconds we print an update
  while (millis() - start &lt; updateFreq)
  {
    if (feedgps())
      newdata = true;
  }

  heartbeat(newdata);  //shows external heartbeat signal through GPS status LED

      if (newdata)
      {
                  feedgps(); // If we don't feed the gps during this long routine, we may drop characters and get checksum errors
                  gps.f_get_position(&amp;flat, &amp;flon, &amp;age);
                  if (debug) {
                    Serial.print(&quot;Lat/Long(float): &quot;); Serial.print(flat, 5); Serial.print(&quot;, &quot;); Serial.print(flon, 5);
                    Serial.print(&quot; Fix age: &quot;); Serial.print(age); Serial.print(&quot;ms.&quot;);
                    Serial.print(&quot; (kmph): &quot;); Serial.print(gps.f_speed_kmph(),4); Serial.println();
                    //Serial.print(&quot; Sats: &quot;); Serial.print(gps.satellites()); Serial.println();
                    feedgps(); // If we don't feed the gps during this long routine, we may drop characters and get checksum errors
                    Serial.print(&quot; Sats: &quot;); print_int(gps.satellites(), TinyGPS::GPS_INVALID_SATELLITES, 5);
                    Serial.print(&quot; HDOP: &quot;); print_int(gps.hdop(), TinyGPS::GPS_INVALID_HDOP, 5);
                    Serial.print(&quot; Course: &quot;); print_float(gps.f_course(), TinyGPS::GPS_INVALID_F_ANGLE, 7, 2);
                    Serial.print(&quot; Cardinal: &quot;); print_str(gps.f_course() == TinyGPS::GPS_INVALID_F_ANGLE ? &quot;*** &quot; : TinyGPS::cardinal(gps.f_course()), 6);

                  }
                  //compare the latest reading with the array of red light camera points and find which is closest.
                  minDist = getClosestPt(flat, flon);
                  //minDist = md[j];
                  //if (j == 2){j = 0;}else{j++;}

                  //indicate that GPS is active and receiving data
                  flash(1);  //flashes the LED on the project box showing GPS signal

                  if (debug) {
                    Serial.print(&quot;Delta = &quot;);Serial.print(minDist, 2);Serial.println(&quot; Meters   &quot;);
                  }

                  //Process alerts via various means based on pre-defined distance thresholds.

                  if (minDist &lt; 50)                 //Warning Alert &lt; 50 meters - in range if red light camera
                  {
                    //red
                    changeWarning(4);
                  }
                  else if (minDist &lt; 200)          //Approaching Alert &lt; 200 meters
                  {
                    //yellow
                    changeWarning(3);
                  }
                  else if (minDist &lt;= 600)          //Initial Alert - 600 meters
                  {
                    //blue - early warning
                    changeWarning(2);
                  }
                  else
                  {
                    //just show status that GPS is working.
                    changeWarning(1);
                  }

                  //for testing
                  //minDist = 40;
                  //updateDisplay(minDist, 65.00);
                  //end testing

                  //updateDisplay(minDist, gps.f_speed_kmph());

      }

      else
      {
          if (debug) {Serial.println(&quot;Polling GPS... waiting for fix...&quot;);}
      }

      oled.clear();

      //Distance to next red light
      oled.drawstring(0, 0, &quot;Dist:&quot;);
      if (minDist == 100000)
      {
        oled.drawstring(30, 0, &quot;?&quot;);
      }
        else
      {
        ftoa(cVal, minDist/1000, 2);
        oled.drawstring(30, 0, cVal);
      }
      oled.drawstring(55, 0, &quot;km&quot;);

      //Cardinal Direction of vehicle
      //strcpy ( cVal, TinyGPS::cardinal(gps.f_course()) );
      strcpy ( cVal, gps.f_course() == TinyGPS::GPS_INVALID_F_ANGLE ? &quot;?&quot; : TinyGPS::cardinal(gps.f_course()));
      oled.drawstring(75, 0, &quot;Dir:&quot;);
      oled.drawstring(100, 0, cVal);

      oled.drawline(0, 12, 128, 12, WHITE);

      //speed
      spd = gps.f_speed_kmph();
      if (spd &lt; 0) {spd=0;}
      ftoa(cVal, spd, 0);
      oled.drawstring(0, 2, &quot;Spd:&quot;);
      oled.drawstring(25, 2, cVal);

      //satellites
      itoa(gps.satellites(), cVal, 0);
      oled.drawstring(65, 2, &quot;Sats:&quot;);
      oled.drawstring(90, 2, cVal);

      //latitude
      ftoa(cVal, flat, 2);
      oled.drawstring(0, 3, &quot;Lat:&quot;);
      oled.drawstring(25, 3, cVal);
      //longitude
      ftoa(cVal, flon, 2);
      oled.drawstring(65, 3, &quot;Lng:&quot;);
      oled.drawstring(90, 3, cVal);

      //Display all the results
      oled.display();

      //reset minDist for the next round
      minDist = 100000;     //meters

}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
char *ftoa(char *a, double f, int precision)
{
  long p[] = {0,10,100,1000,10000,100000,1000000,10000000,100000000};

  char *ret = a;
  long heiltal = (long)f;
  itoa(heiltal, a, 10);
  while (*a != '&#92;&#48;') a++;
  *a++ = '.';
  long desimal = abs((long)((f - heiltal) * p[precision]));
  itoa(desimal, a, 10);
  return ret;
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
void setupDisplay()
{
    // Draw animated graphics to OLED - we will use the GPS speed to mimic changes in speed of the lanes.
    oled.clear();   // clears the screen and buffer
    //oled.drawbitmap(0, 2,  Road, 128, 32, 1);     //road - dash lines - draw the animating road
    //oled.drawbitmap(95, 4,  JukeIcon, 34, 40, 1);  //keep drawing the car icon in place
    oled.fillrect(0, 0, 128, 2, WHITE);            //keep drawing the top continuous line
    oled.fillrect(0, 30, 128, 2, WHITE);           //keep drawing the bottom continous line
    oled.display();
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
void updateDisplay(int minDist, float spd)
{
    if (i==0){i=128;}  //we have 128 pixels to loop through for animation of the road dashed lines. reset when it gets to 0.

    // Draw animated graphics to OLED - we will use the GPS speed to mimic changes in speed of the lanes.
    //oled.drawbitmap(i, 16,  Road, 128, 32, 1);     //road - dash lines - draw the animating road
    //oled.drawbitmap(i-128, 16,  Road, 128, 32, 1);  //road - dash lines - draw the road ahead to keep contents on the screen

    //map values based on dist from camera, min dist on ground of 20m, max dist on ground of 500m, min dist in px to car, max dist in px from car
    mappedDist = map(minDist, 20, 500, 40, 110);
    //oled.drawbitmap(mappedDist, 10,  RedLightCam, 10, 15, 1);  //move the red light camera as it approaches

    //oled.drawbitmap(95, 12,  JukeIcon, 34, 40, 1);  //keep drawing the car icon in place
    oled.fillrect(0, 0, 128, 4, WHITE);            //keep drawing the top continuous line
    oled.fillrect(0, 61, 128, 4, WHITE);           //keep drawing the bottom continous line
    oled.display();
    oled.clear();   // clears the screen and buffer

    // convert speed to an int so it can be used in the map funciton.  1.25 km/h = 125
    //Serial.println(int(spd*10));
    spdProRate = map(int(spd*10), 0, 900, 0, 30);
    //Serial.println(spdProRate);
    //i=i-10;
    i = i - spdProRate;
    if (i &lt; 0) {i=0;}

    //mappedDist = 0;
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
float getClosestPt(float flat, float flon)
{
  float d;
  float d2;
  float md = 10000;
  //int minCoordIndex;
  //int coordsProcessed;

              if (flat != 0 &amp;&amp; flon != 0)
              {
                for (unsigned int x=0; x&lt;175; x++){
                      //In array lat is 2nd col, long is 1st col  e.g. lat:43.xxxx,long:-79.xxxxx - need to get right ones for calc
                      //flat2 =  pgm_read_float_near(&amp;wayPt[x][0]);
                      //flon2 = pgm_read_float_near(&amp;wayPt[x][1]);
                      //if (debug)
                      //{
                      //  Serial.print(&quot;Flat2:  &quot;);Serial.print(flat2, 5);
                      //  Serial.print(&quot;  Flon2:  &quot;);Serial.println(flon2, 5);
                      //}
                      //d = HaverSine(flat, flon, pgm_read_float_near(&amp;wayPt[x][0]), pgm_read_float_near(&amp;wayPt[x][1]));
                      d = gps.distance_between(flat, flon, pgm_read_float_near(&amp;wayPt[x][0]), pgm_read_float_near(&amp;wayPt[x][1]))/1000 ;
                      if (debug)
                      {
                        //Serial.print(&quot;DistanceCalcualted d1: &quot;);Serial.print(d, 4); Serial.print(&quot; d2:&quot;); Serial.print(d2, 4); Serial.println(&quot;&quot;);
                        //Serial.print(&quot;DistanceCalcualted d1: &quot;);Serial.print(d, 4); Serial.println(&quot;&quot;);
                      }
                      if (d &lt; md)
                      {
                        md = d;
                        //minCoordIndex = x;
                      }
                      //coordsProcessed++;
                  }

                  //convert to meters
                  md = md * 1000;

                  //Serial.print(&quot; Processed:&quot;);Serial.println(coordsProcessed);
                  /*
                  Serial.println(&quot;&quot;);
                  Serial.println(&quot;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&quot;);
                  Serial.print(&quot; Index:&quot;);Serial.println(minCoordIndex);
                  Serial.print(&quot; Processed:&quot;);Serial.println(coordsProcessed);
                  Serial.println(&quot;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&quot;);
                  Serial.println(&quot;&quot;);
                  */
                }
                //coordsProcessed = 0;
 return md;
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 float HaverSine(float lat1, float lon1, float lat2, float lon2)
{
  //float ToRad = PI / 180.0;
  //float R = 6371;   // radius earth in Km

  float dLat = (lat2-lat1) * ToRad;
  float dLon = (lon2-lon1) * ToRad;

  float a = sin(dLat/2) * sin(dLat/2) +
	  cos(lat1 * ToRad) * cos(lat2 * ToRad) *
	  sin(dLon/2) * sin(dLon/2);

  float c = 2 * atan2(sqrt(a), sqrt(1-a));

  float d = R * c;
  return d;  //distance returned in Kilometers
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bool feedgps()
{
  while (nss.available())
  {
    if (gps.encode(nss.read()))
      return true;
  }
  return false;
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
static void print_float(float val, float invalid, int len, int prec)
{
  char sz[32];
  if (val == invalid)
  {
    strcpy(sz, &quot;*******&quot;);
    sz[len] = 0;
        if (len &gt; 0)
          sz[len-1] = ' ';
    for (int i=7; i&lt;len; ++i)
        sz[i] = ' ';
    Serial.print(sz);
  }
  else
  {
    Serial.print(val, prec);
    int vi = abs((int)val);
    int flen = prec + (val &lt; 0.0 ? 2 : 1);
    flen += vi &gt;= 1000 ? 4 : vi &gt;= 100 ? 3 : vi &gt;= 10 ? 2 : 1;
    for (int i=flen; i&lt;len; ++i)
      Serial.print(&quot; &quot;);
  }
  feedgps();
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/*
void beep(int howmany, int itone) {

 if (itone == 0){itone=2200;}

 for (int i=0; i &lt; howmany; i++){
    tone(piezo, itone, 10);
    delay(100);
  }
}
*/
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
static void print_str(const char *str, int len)
{
  int slen = strlen(str);
  for (int i=0; i&lt;len; ++i)
    Serial.print(i&lt;slen ? str[i] : ' ');
  feedgps();
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
void flash(int howmany) {
 for (int i=0; i &lt; howmany; i++){
    digitalWrite(GPSActive, HIGH);
    delay(100);
    digitalWrite(GPSActive, LOW);
    delay(100);
  }
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
void heartbeat(boolean nd){

  //show if there is no data - hearbeat of system - shows it is working.  Fast blink.
  if (nd == false){

    if (gpsStatCounter == 2)
      {
          analogWrite(redPin, 127);
          analogWrite(greenPin, 255);
          analogWrite(bluePin, 0);
          delay(50);
          analogWrite(redPin, 255);
          analogWrite(greenPin, 255);
          analogWrite(bluePin, 255);
          //delay(50);

          gpsStatCounter = 0;
      }
      else
      {
      gpsStatCounter++;
      }
  }

}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
void changeWarning(int stateLevel)
{
    switch (stateLevel) {

    case 1:
      //green LED - show for status that GPS is getting data
      analogWrite(greenPin, 155);
      delay(200);
      break;

     case 2:
      //early warning.
      analogWrite(bluePin, 155);
      delay(200);
      break;

    case 3:
      //yellow
      analogWrite(redPin, 0);
      analogWrite(greenPin, 190);
      delay(200);
      break;

    case 4:
      //in and just before red light camera
      analogWrite(redPin, 155);
      delay(200);
      break;

    default:
      //all off
      analogWrite(greenPin, 255);
      analogWrite(bluePin, 255);
      analogWrite(redPin, 255);
      break;
    }

    //turn the LEDs back off
    analogWrite(greenPin, 255);
    analogWrite(bluePin, 255);
    analogWrite(redPin, 255);

}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
static void print_int(unsigned long val, unsigned long invalid, int len)
{
  char sz[32];
  if (val == invalid)
    strcpy(sz, &quot;*******&quot;);
  else
    sprintf(sz, &quot;%ld&quot;, val);
  sz[len] = 0;
  for (int i=strlen(sz); i&lt;len; ++i)
    sz[i] = ' ';
  if (len &gt; 0)
    sz[len-1] = ' ';
  Serial.print(sz);
  feedgps();
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
void blinkLED()
{
state = !state;
digitalWrite(statusLED, state);
}

</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.plastibots.com/index.php/2012/04/10/red-light-camera-alerter/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Arduino Temperature / Humidity Sensor</title>
		<link>http://www.plastibots.com/index.php/2012/04/05/arduino-temperature-humidity-sensor/</link>
		<comments>http://www.plastibots.com/index.php/2012/04/05/arduino-temperature-humidity-sensor/#comments</comments>
		<pubDate>Thu, 05 Apr 2012 21:06:14 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[OLED]]></category>

		<guid isPermaLink="false">http://www.plastibots.com/?p=2333</guid>
		<description><![CDATA[The projects I do tend to fall in one of two buckets &#8211; either proof-of-concept (so I can learn new stuff) or items that have some sort of functional use.   The need for this project came about when my &#8230; <a href="http://www.plastibots.com/index.php/2012/04/05/arduino-temperature-humidity-sensor/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>The projects I do tend to fall in one of two buckets &#8211; either proof-of-concept (so I can learn new stuff) or items that have some sort of functional use.  <img class="alignright size-full wp-image-2337" title="HuTmp1b" alt="" src="http://www.plastibots.com/wordpress/wp-content/uploads/2012/04/HuTmp1b.jpg" width="300" height="131" /> The need for this project came about when my wife was prodding me about the humidity in the house and whether our humidifier was doing it&#8217;s job correctly.  Most people would just go out and buy a temp / humidity sensor and be done with it.  However, if you have a look around here, you will see that I don&#8217;t fit that mold.  Instead, I decided to build an accurate temp / humidity sensor with a Sensiron SHT11 to read the values, a RBBB Arduino kit to process everything and an Adafruit 128&#215;32 OLED to display the results &#8211; all wrapped up in&#8230; LEGO!   Read on for more&#8230;</p>
<p><span id="more-2333"></span></p>
<p>Admittedly, I would not normally spend the money required to outright build this gizmo (approx $95 incl shipping for all parts).  Instead, I was able to acquire the parts for a fraction of this price.   As a result, the purpose of this build is twofold. 1) Create a sensor that can be used in my house on an ongoing basis; 2) Review the parts to provide insight for those considering using them for similar or other projects.</p>
<p>Parts:</p>
<ul>
<li><a href="https://www.adafruit.com/products/661" target="_blank">Adafruit Monochrome 128&#215;32 OLED Display</a> &#8211; ($17.50)</li>
<li><a href="http://canada.newark.com/sensirion/sht11/humidity-sensor/dp/69C4848?Ntt=sht11" target="_blank">Newark Sensiron SHT11 Humidity / Temperature Sensor</a> ($29.xx)</li>
<li><a href="http://shop.moderndevice.com/products/rbbb-kit" target="_blank">Modern Device RBBB Arduino Kit</a> (3.3v)  ($13.00)</li>
<li><a href="https://www.adafruit.com/products/504" target="_blank">Adafruit Through Hole 5-Way Navigation Switch</a> ($2.95)</li>
<li><a href="http://www.dipmicro.com/store/WIRE-K30BLK" target="_blank">Insulated Silver-Plated Copper 30Ga Wire</a> (~1.00)</li>
<li>The rest of the parts (caps, resistors, LED) I had as spares.</li>
</ul>
<p>There were a few goals that I wanted to achieve with this project.  Make it small and compact, easy to use, and conserve as little power as possible.    Getting it into a small package was aided by the RBBB.  I could have gone a step further by just making a standalone Atmega, but the LEGO shell was my starting place and everything fit fine within the space it had.   For power conservation, I used the sleep abilities of the chip and tied it to Interrupt2 tied to the toggle switch.  Pushing the switch &#8216;in&#8217; would trigger the interrupt and wake the unit.   I also have power for the OLED and the SHT11 sensor shut down just before it goes to sleep, and back on immediately after it wakes.  To do this, I used 2 digital pins set to HIGH / LOW as needed.    I am running the unit off 2x 3V 2032 cells in series, which are put through a 3.3v regulator to power the board and components.    When running with all components powered it pulls 12mA.  In sleep mode it pulls 0.6mA.  I&#8217;d like to get it lower, but think that my use of the regulator is partially killing it due to the voltage drop out.</p>
<p style="text-align: center;"><a href="http://www.plastibots.com/wordpress/wp-content/uploads/2012/04/HuTmp1.jpg"><img class="size-medium wp-image-2323  aligncenter" alt="" src="http://www.plastibots.com/wordpress/wp-content/uploads/2012/04/HuTmp1-300x131.jpg" width="300" height="131" /></a></p>
<p><img class="size-full wp-image-2343 alignright" title="HuTmp11" alt="" src="http://www.plastibots.com/wordpress/wp-content/uploads/2012/04/HuTmp11.jpg" width="198" height="200" />The key to the accurate humidity / temp readings is the Sensiron SHT11 sensor.  It&#8217;s tiny &#8211; really tiny.   There are 4 connections: 3.3V- 5V, GND, Data, CLK.  In order to protect the sensor, it has been mounted to the side of the unit inside a clear plastic housing.  The housing has a hole in the side to allow air to flow freely, but limits the any water that might find its way in there (because you never know when it might rain inside the house <img src='http://www.plastibots.com/wordpress/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-0955337107322324";
/* 728x90ImgOnly */
google_ad_slot = "4816127144";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p>Since everything is so small, I used very fine 30 gauge silver plated copper wire for this.  It worked quite well for what I needed to do here.</p>
<p>Before migrating all the components into the project, I set everything up on a breadboard and used the Uno to test the sketches.     Interestingly, I found getting the 5-way switch working the most challenging.  It has a common anode I am using as both an Interrupt link (Pin2) as well as toggle switch for scrolling the OLED.</p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-0955337107322324";
/* 728x90ImgOnly */
google_ad_slot = "4816127144";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p style="text-align: center;"><a href="http://www.plastibots.com/wordpress/wp-content/uploads/2012/04/HuTmp3.jpg"><img class="size-medium wp-image-2327 aligncenter" title="HumidityTempSensor2" alt="" src="http://www.plastibots.com/wordpress/wp-content/uploads/2012/04/HuTmp3-172x300.jpg" width="172" height="300" /></a></p>
<p>Below showing the completed RBBB kit.  Initially, this came with an earlier Bootloader, but I updated to the <a href="http://arduino.cc/en/Tutorial/ArduinoToBreadboard" target="_blank">Uno one with ease</a>.</p>
<p><a href="http://www.plastibots.com/wordpress/wp-content/uploads/2012/04/HuTmp3B1.jpg"><img class="aligncenter size-medium wp-image-2357" title="HuTmp3B" alt="" src="http://www.plastibots.com/wordpress/wp-content/uploads/2012/04/HuTmp3B1-300x113.jpg" width="300" height="113" /></a></p>
<p>The next step was to start fitting the components into the case.  The first parts to go in were the switch and red/green status LED.  The LED was a pull from an old portable DVD player. After that was done, one side was cut to make room for the length of the RBBB kit.  Being a die-hard LEGO fan and spending most of my life building, I was always against bastardizing LEGO for things like this &#8211; until I discovered Arduino / micro-controllers.  Sorry AFOL&#8217;s. <img src='http://www.plastibots.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />    The 3rd pic shows the bits all soldered together using that nice 30Ga wire.  The 4th shows a test fit with the RBBB inserted.  I made the mistake of completing the RBBB kit as per instructions only to realize that I did not want the rows of breadboard pins as would not need them.. So, out came the solder sucker and I removed them (hence the burn marks you see in other pics).  In the last picture, you can see a side view showing the SHT11 sensor.. Did I mention this thing is tiny!?</p>

<a href='http://www.plastibots.com/index.php/2012/04/05/arduino-temperature-humidity-sensor/hutmp4/' title='HumidityTempSensor4'><img width="150" height="150" src="http://www.plastibots.com/wordpress/wp-content/uploads/2012/04/HuTmp4-150x150.jpg" class="attachment-thumbnail" alt="HumidityTempSensor4" /></a>
<a href='http://www.plastibots.com/index.php/2012/04/05/arduino-temperature-humidity-sensor/hutmp7/' title='HumidityTempSensor6'><img width="150" height="150" src="http://www.plastibots.com/wordpress/wp-content/uploads/2012/04/HuTmp7-150x150.jpg" class="attachment-thumbnail" alt="HumidityTempSensor6" /></a>
<a href='http://www.plastibots.com/index.php/2012/04/05/arduino-temperature-humidity-sensor/hutmp5/' title='HumidityTempSensor7'><img width="150" height="150" src="http://www.plastibots.com/wordpress/wp-content/uploads/2012/04/HuTmp5-150x150.jpg" class="attachment-thumbnail" alt="HumidityTempSensor7" /></a>
<a href='http://www.plastibots.com/index.php/2012/04/05/arduino-temperature-humidity-sensor/hutmp8/' title='HumidityTempSensor8'><img width="150" height="150" src="http://www.plastibots.com/wordpress/wp-content/uploads/2012/04/HuTmp8-150x150.jpg" class="attachment-thumbnail" alt="HumidityTempSensor8" /></a>
<a href='http://www.plastibots.com/index.php/2012/04/05/arduino-temperature-humidity-sensor/hutmp2-2/' title='HuTmp2'><img width="150" height="150" src="http://www.plastibots.com/wordpress/wp-content/uploads/2012/04/HuTmp21-150x150.jpg" class="attachment-thumbnail" alt="HuTmp2" /></a>
<a href='http://www.plastibots.com/index.php/2012/04/05/arduino-temperature-humidity-sensor/hutmp3b-2/' title='HuTmp3B'><img width="150" height="150" src="http://www.plastibots.com/wordpress/wp-content/uploads/2012/04/HuTmp3B1-150x150.jpg" class="attachment-thumbnail" alt="HuTmp3B" /></a>

<p><strong><span style="text-decoration: underline;">The Verdict:</span></strong></p>
<p><strong>Adafruit 128&#215;32 OLED:</strong> If you are looking for a crisp display with a small footprint, then this is the unit for you.  Don&#8217;t expect to be able to read this thing from afar.  However, up close, the display is clear, and crisp.  Because it does not have a backlight, and each pixel is self- illuminated, it has low power consumption and is easy to read.   Out of the box, the display is slow to render for anything where rapid updates are necessary.  However, the driver can easily be modified to use the Arduino SPI hardware to speed up its response.  For this purpose, its not really necessary as I am not drawing rapid graphics or animating.  If you are doing that, then you want to do this easy mod.  Just remember that you must then also use the dedicated hardware SPI pins.</p>
<p><strong>Sensiron SHT11: </strong>Did I mention the sensor is small?  Ok, I know I did &#8211; so it&#8217;s small.   This is great for integrating it into small projects like this.   Sensiron claims the unit has a high degree of accuracy (+/- 0.4&#8242;C and +/-3% RH).  When pitching the results against other temperature gauges in our house, I had different readings on all of them.  When I tested the readings against a classic mercury unit, it was off by about 1 degree.   It also responded well to rapid temperature changes at about a 1-2 hz rate.  Not super fast, but good enough for measuring changes in room temperature.  I did some tests where I set the update frequency to less than 500 Ms and it still took about 1+ seconds to return a result &#8211; so it seems that the sensor requires this time to produce and return an accurate reading.</p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-0955337107322324";
/* 728x90ImgOnly */
google_ad_slot = "4816127144";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p><strong>Modern Device RBBB Kit:</strong> If you are looking for a small Arduino footprint, then this is a nice unit.  It is not the smallest out there, but good enough for most small projects.  For the price of about $13 plus shipping you can get a full setup in either 3.3v or 5v, the board, parts and an Atmega 328P with bootloader.  The only caveat is that it comes with the Diecimila Bootloader, but you can change it to whatever you like easily.  Yes, I could have put together a standalone kit with a little more soldering, but considering time and cost, it is not really worth it.</p>
<p><strong><span style="text-decoration: underline;">The Code:</span> </strong><a href="http://www.plastibots.com/wordpress/wp-content/uploads/2012/04/HumidityTempSensor1_4.zip">(download it</a>)</p>
<p>Or click below to view it:</p>
<pre class="brush: csharp; collapse: true; light: false; title: ; toolbar: true; notranslate">
#include                   //SSD
#include                       //for OLED
#include &lt;avr/sleep.h&gt;
#include &lt;avr/power.h&gt;
#include                     //HumidityTemp Sensor SHT11

//OLED PINS
#define OLED_RESET 7    // RST on OLED
#define OLED_DC 8       // S/C on OLED
#define OLED_CS 6       // CS on OLED  - SPI slave-select
#define OLED_MOSI 11    // DATA on OLED - hardware SPI MOSI
#define OLED_CLK 13     // CLK on OLED - hardware SPI clock

//SHT11 Tmp/Humidity Sensor
// Specify data and clock connections and instantiate SHT1x object
#define dataPin  9
//#define clockPin 11
#define clockPin 10
SHT1x sht1x(dataPin, clockPin);
float temp_c;
float temp_f;
float humidity;

//#define SHTPwrPin 4  -not used. When using this, current draw went from 0.6mA when off to 37mA when off!!!!  put back
//to 5V pin and back to 0.6mA when off - much better!
#define OLEDPwrPin 3
int redLED = A2;
int grnLED = A3;
int LEDcounter = 0;

int SHTReadCounter = 0;
int centerToggle = 2;
int upToggle = 12;
int dnToggle = 5;
//switch debouncing
long debounceDelay = 20;    // the debounce time; increase if the output flickers -
long lastDebounceTime = 0;  // the last time the output pin was toggled
//for up toggle
int upButtonState;             // the current reading from the input pin
int upLastButtonState = LOW;   // the previous reading from the input pin
//for down toggle
int dnButtonState;             // the current reading from the input pin
int dnLastButtonState = LOW;   // the previous reading from the input pin

//end switch debouncing

volatile int toggle = 1;
char cVal[32];

int displayState = 1;                         //up and down toggles will change the display to different states

long shutoffStartMillis = 0;                  //Store the value to start the shutoff timer from in Milliseconds.
//**********************************
//Change this to determine how long the device stays on - in MS
long shutOffDelayMS = 180000;                  //In Milliseconds - Determines how long to keep LED system on (after shutoff timer clicked) in Milliseconds  10000 (10sec), 60000 (1min) 600000 (10min)
//**********************************
boolean debug = false;                         //turn debugging on or off here

//OLED
SSD1306 oled(OLED_MOSI, OLED_CLK, OLED_DC, OLED_RESET, OLED_CS);

void (*restart)(void) = 0;

/***************************************************
 *  Name:        pin2Interrupt
 *
 ***************************************************/
void pin2Interrupt(void)
{
  /* This will bring us back from sleep. */

  /* We detach the interrupt to stop it from
   * continuously firing while the interrupt pin
   * is low.
   */

  //appears that the interrup is not working correctly and re-triggering things.  Try a restart instead
  restart();

  //  - removed while testing restart() function.  Put these back if restart removed
  //toggle = 1;
  //delay(100);

  detachInterrupt(0);

}

/***************************************************
 *  Description: Enters the arduino into sleep mode.
 ***************************************************/
void enterSleep(void)
{

  /* Setup pin2 as an interrupt and attach handler. */
  //attachInterrupt(interrupt, function, mode)
  //attachInterrupt(0, pin2Interrupt, LOW);
  attachInterrupt(0, pin2Interrupt, FALLING);

  delay(100);

  //Serial.println(&quot;Going to sleep....&quot;);

  set_sleep_mode(SLEEP_MODE_PWR_DOWN);

  sleep_enable();

  sleep_mode();

  /* The program will continue from here. */

  /* First thing to do is disable sleep. */
  sleep_disable();
}

void setup()
{
  Serial.begin(38400);
  pinMode(A5, OUTPUT);   //testing blink
  /* Setup the pin direction. */
  pinMode(centerToggle, INPUT);
  //pinMode(SHTPwrPin, OUTPUT);
  pinMode(OLEDPwrPin, OUTPUT);
  pinMode(redLED, OUTPUT);
  pinMode(grnLED, OUTPUT);
  digitalWrite(grnLED, HIGH);  //turn off the green LED - common annode - so they have to be high
  digitalWrite(redLED, HIGH);  //turn off the gred LED - common annode - so they have to be high

  digitalWrite(upToggle, LOW);
  digitalWrite(dnToggle, LOW);
  //digitalWrite(SHTPwrPin, LOW);
  digitalWrite(OLEDPwrPin, LOW);

  //*********  OLED SETUP STUFF ******************************************************************/
  SPI.begin ();  //for OLED
  // OLED: By default, we'll generate the high voltage from the 3.3v line internally! (neat!)
  oled.ssd1306_init(SSD1306_SWITCHCAPVCC);
  //*********  OLED SETUP STUFF ******************************************************************/
  //oled.clear();
  //oled.display();

// displayState = 1;

  if (debug)
  {
    Serial.println(&quot;Initialisation complete.&quot;);
    Serial.println(&quot;Entering sleep&quot;);
  }
  //delay(200);
  //enterSleep();

  oled.clear();

}

void doHumTmp(void)
{

    // Read values from the sensor
    if (SHTReadCounter == 20)  //this is based on the delay at the bottom. if delay changes, this value should as well
    {
    temp_c = sht1x.readTemperatureC();
    temp_f = sht1x.readTemperatureF();
    humidity = sht1x.readHumidity();
    SHTReadCounter = 0;
      if (debug)
      {
        // Print the values to the serial port
        Serial.print(&quot;Temperature: &quot;);
        Serial.print(temp_c, DEC);
        Serial.print(&quot;C / &quot;);
        Serial.print(temp_f, DEC);
        Serial.print(&quot;F. Humidity: &quot;);
        Serial.print(humidity);
        Serial.println(&quot;%&quot;);
      }

    }

    oled.clear();

    if (temp_c &lt; 0 || temp_f &lt; 0 || humidity &lt; 0)     {       //calibrating       //oled.drawstring([character position from left - by pixel], [line number 0,1,2,3], &quot;1&quot;);       blinkLED(redLED);       oled.drawline(0, 9, 128, 9, WHITE);       oled.drawstring(0, 2, &quot;Calibrating...&quot;);       oled.drawline(0, 30, 128, 30, WHITE);     }     else if(displayState == 1) //good readings show - 2 display states     {       blinkLED(grnLED);       //Temp in C and F       oled.drawstring(0, 0, &quot;Temp: &quot;);       ftoa(cVal, temp_c, 1);       oled.drawstring(35, 0, cVal);       //oled.drawchar(65, 0, 9);       //draw degree symbol       //oled.drawcircle([x position px], [y pos line], [diameter units??], WHITE);       oled.drawcircle(61, 1, 1.5, WHITE);       oled.drawstring(64, 0, &quot;C&quot;);       //degrees F       ftoa(cVal, temp_f, 1);       oled.drawstring(85, 0, cVal);       //oled.drawchar(115, 0, 9);       oled.drawcircle(110, 1, 1.5, WHITE);       oled.drawstring(114, 0, &quot;F&quot;);       //draw split line       oled.drawline(0, 15, 128, 15, WHITE);       /*       int upstate = digitalRead(upToggle);       itoa(upstate, cVal, 0);       oled.drawstring(0, 2, &quot;up:&quot;);       oled.drawstring(10, 2, cVal);       int dnstate = digitalRead(dnToggle);       itoa(dnstate, cVal, 0);       oled.drawstring(45, 2, &quot;dn:&quot;);       oled.drawstring(50, 2, cVal);       */       ftoa(cVal, humidity, 1);       oled.drawstring(0, 3, &quot;Humidity:&quot;);       oled.drawstring(60, 3, cVal);       oled.drawstring(85, 3, &quot;%&quot;);     }     else if (displayState == 2)//display state would be 2 here     {      blinkLED(grnLED);      oled.drawstring(0, 0, &quot;Sensor: Sensiron SHT11 Temp &amp; Humidity&quot;);      oled.drawstring(0, 2, &quot;OLED:Adaft SSD1306 128x32&quot;);     }     else if (displayState == 3)     {      blinkLED(grnLED);      oled.drawstring(0, 0, &quot;Board: Modern Device RBBB Kit&quot;);      oled.drawstring(0, 2, &quot;Chip: Atmega 328P w/UNO Bootloader&quot;);     }     else if (displayState == 4)     {      blinkLED(grnLED);      oled.drawstring(0, 0, &quot;Sketch:&quot;);      oled.drawstring(0, 1, &quot;HumidityTempSensor1_4&quot;);     }     //Display all the results     oled.display();     delay(100);     SHTReadCounter++ ; } /***************************************************  *  Name:        loop  *  Description: Main application loop.  *  Operation Our code will operate as follows: 1.  Set up the serial port and set pin 2 (INT0) as an input; 2.  Run the loop function which will: 3.  Stay awake for 3 seconds; 4.  Once the 3 seconds have elapsed, SLEEP_MODE_PWR_DOWN will be entered; 5.  All code execution stops; 6.  The user then pushes the switch and pin 2 (INT0) will become low; 7.  The INT0 interrupt will fire and bring the Arduino out of sleep mode; 8.  Code execution continues where it had previously stopped. Circuit:  http://donalmorrissey.blogspot.com/2010/04/arduino-external-interrupts.html  ***************************************************/ //int seconds=0; void loop() {   if (debug)   {    // Serial.println(&quot;Still awake....&quot;);   }    //Will put the unit to sleep after a pre-defined amount of time   if (shutoffStartMillis != 0 &amp;&amp; millis() - shutoffStartMillis &gt; shutOffDelayMS)    //if shutoff time has elapsed, turn the LEDs off  1000ms = 1 second
  {
       //delay(100);

       shutoffStartMillis = 0;
       //power down the SHT11 Sensor and other ports
       digitalWrite(upToggle, LOW);
       digitalWrite(dnToggle, LOW);
       //digitalWrite(SHTPwrPin, LOW);

       //Power down the OLED
       oled.clear();
       oled.display();
       //digitalWrite(OLED_RESET, LOW);
       digitalWrite(OLEDPwrPin, LOW);

       //go to sleep
       if (debug) {Serial.println(&quot;Entering sleep&quot;);}
       delay(200);
       //seconds = 0;
       enterSleep();

  }

  //watch the up and down toggle

  //int upToggleReading = digitalRead(upToggle);
  //int dnToggleReading = digitalRead(dnToggle);

  //will be able to read each other toggle pin as LOW when it is pressed.
  if (debug)
  {
   // Serial.print(&quot;UpToggle: &quot;); Serial.print(digitalRead(upToggle));    // Read the pin and display the value
   // Serial.print(&quot;  DnToggle: &quot;); Serial.println(digitalRead(dnToggle));    // Read the pin and display the value
   // Serial.print(&quot;  DisplayState: &quot;); Serial.println(displayState);    // Read the pin and display the value
  }

  if (digitalRead(upToggle) == 0)
  {
    //displayState++;
    //if (displayState &gt; 2) {displayState = 1;}   //simple method to only go to 2 states
    displayState = 1;
    delay(100);
  }

  if (digitalRead(dnToggle) == 0)
  {

    //if (displayState &lt; 1) {displayState = 2;}   //simple method to only go to 2 states

    if (displayState &lt; 4)
    {
      displayState++;
    }  //dont let it go past a max value
    delay(100);
  }

  /*
     Serial.print(&quot;ButtonState: &quot;); Serial.print(upButtonState);
     Serial.print(&quot;  LastButtonState: &quot;); Serial.print(upLastButtonState);
     Serial.print(&quot;   DisplayState: &quot;); Serial.println(displayState);

     Serial.print(&quot;ButtonState: &quot;); Serial.print(dnButtonState);
     Serial.print(&quot;  LastButtonState: &quot;); Serial.print(dnLastButtonState);
     Serial.print(&quot;   DisplayState: &quot;); Serial.println(displayState);
*/

  // save the reading.  Next time through the loop,
  // it'll be the lastButtonState:
  //upLastButtonState = upToggleReading;
  //dnLastButtonState = dnToggleReading;

  if (toggle == 1)
  {
    shutoffStartMillis = millis();      //get a start value to start the countdown from.
    displayState = 1;  //ensure the display defaults to the main screen
    //digitalWrite(SHTPwrPin, HIGH);
    digitalWrite(OLEDPwrPin, HIGH);
    delay(1000);
    //*********  OLED SETUP STUFF ******************************************************************/
    //have to do this again with each power on state or the OLED does not come on.
    SPI.begin ();  //for OLED
    // OLED: By default, we'll generate the high voltage from the 3.3v line internally! (neat!)
    oled.ssd1306_init(SSD1306_SWITCHCAPVCC);
    //*********  OLED SETUP STUFF ******************************************************************/
    delay(500);
    //oled.clear();
    //oled.display();

    doHumTmp();

    //provide power to the toggle switch up and down.
    digitalWrite(upToggle, HIGH);
    digitalWrite(dnToggle, HIGH);

    delay(500); //give it some time to calibrate etc
    toggle = 0;

  }
  else
  {
    //show the temp and humidity values
    doHumTmp();
  }

  LEDcounter++;
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
char *ftoa(char *a, double f, int precision)
{
  long p[] = {0,10,100,1000,10000,100000,1000000,10000000,100000000};

  char *ret = a;
  long heiltal = (long)f;
  itoa(heiltal, a, 10);
  while (*a != '&#92;&#48;') a++;
  *a++ = '.';
  long desimal = abs((long)((f - heiltal) * p[precision]));
  itoa(desimal, a, 10);
  return ret;
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
static void print_str(const char *str, int len)
{
  int slen = strlen(str);
  for (int i=0; i&lt;len; ++i)
    Serial.print(i }
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
static void print_int(unsigned long val, unsigned long invalid, int len)
{
  char sz[32];
  if (val == invalid)
    strcpy(sz, &quot;*******&quot;);
  else
    sprintf(sz, &quot;%ld&quot;, val);
  sz[len] = 0;
  for (int i=strlen(sz); i&lt;len; ++i)     sz[i] = ' ';   if (len &gt; 0)
    sz[len-1] = ' ';
  Serial.print(sz);
}

void blinkLED(int led)
{
 if (LEDcounter == 10)   //we do not want the LED blinking with every cycle as it is seizure enducing!
 {
    if (led == redLED)
    {
      digitalWrite(redLED, LOW);
      delay(50);
      digitalWrite(redLED, HIGH);
    }
    else
    {
      digitalWrite(grnLED, LOW);
      delay(50);
      digitalWrite(grnLED, HIGH);
    }
    LEDcounter = 0;
 }

}

</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.plastibots.com/index.php/2012/04/05/arduino-temperature-humidity-sensor/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Adafruit Monochrome 128&#215;32 OLED graphic display</title>
		<link>http://www.plastibots.com/index.php/2012/03/04/adafruit-monochrome-128x32-oled-graphic-display/</link>
		<comments>http://www.plastibots.com/index.php/2012/03/04/adafruit-monochrome-128x32-oled-graphic-display/#comments</comments>
		<pubDate>Sun, 04 Mar 2012 21:57:58 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[OLED]]></category>

		<guid isPermaLink="false">http://www.plastibots.com/?p=2296</guid>
		<description><![CDATA[I recently got my hands on the Adafruit Monochrome 128&#215;32 OLED graphic display for my next project.  This is a 128&#215;32 OLED B+W graphics chip and it&#8217;s tiny!  Don&#8217;t let its size fool you however. Being an OLED display,  text/graphics &#8230; <a href="http://www.plastibots.com/index.php/2012/03/04/adafruit-monochrome-128x32-oled-graphic-display/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><img class="size-medium wp-image-2304 alignright" title="SSD1306AdafruitOLED_1" src="http://www.plastibots.com/wordpress/wp-content/uploads/2012/03/SSD1306AdafruitOLED_1-300x199.jpg" alt="" width="300" height="199" /> I recently got my hands on the <a href="https://www.adafruit.com/products/661" target="_blank">Adafruit Monochrome 128&#215;32 OLED graphic display</a> for my next project.  This is a 128&#215;32 OLED B+W graphics chip and it&#8217;s tiny!  Don&#8217;t let its size fool you however. Being an OLED display,  text/graphics contrasts well against the black background.  My initial intent for this display was to use it to provide information to you GPS Red Light Camera project.  It&#8217;s job would be to provide key information such as; the distance to the next red light camera location, the direction of the vehicle (and possibly direction of the camera later on), speed, # of satellites, as well as Lat and Log.  However, after some dry runs, I found that reading the information was too difficult if it was sunny out.  Of course the obvious holds true that I should not be taking the time to read this sort of info while driving anyhow.  The intent was more of an info display for viewing while stopped etc.   However, the purpose of this write-up is not to discuss the merits of these things, but rather the quality of this display. More info on the project will come soon.</p>
<p><span id="more-2296"></span></p>
<p>So, how about the quality.  My first test was take some graphics and try to render them to the tiny screen.   Keep in mind we are working with 128W x 32H pixels here folks.  The Adafruit <a href="http://ladyada.net/products/oled12864/" target="_blank">tutorial</a> references a handle little app called LCD Assist that allows you to convert a monochrome bitmap to a character array which you can dump directly into your sketch and have it display the image.  The image to the right shows a rendering of a car.  The pixelation that is showing is due to my resizing the original image down to something that I could fit on the screen.  The two lines are drawn using a built-in <em>drawline</em> function.   The second image shows the rendering of text and variables to the screen.</p>
<p><img class="size-medium wp-image-2305 alignright" title="SSD1306AdafruitOLED_2" src="http://www.plastibots.com/wordpress/wp-content/uploads/2012/03/SSD1306AdafruitOLED_2-300x201.jpg" alt="" width="300" height="201" /></p>
<p>Example (draws Latitude and Longitude and their related values):</p>
<p>&nbsp;</p>
<div id="_mcePaste">//latitude</div>
<div id="_mcePaste">ftoa(cVal, flat, 2);</div>
<div id="_mcePaste">oled.drawstring(0, 3, &#8220;Lat:&#8221;);</div>
<div id="_mcePaste">oled.drawstring(25, 3, cVal);</div>
<div id="_mcePaste">//longitude</div>
<div id="_mcePaste">ftoa(cVal, flon, 2);</div>
<div id="_mcePaste">oled.drawstring(65, 3, &#8220;Lng:&#8221;);</div>
<div id="_mcePaste">oled.drawstring(90, 3, cVal);</div>
<p>&nbsp;</p>
<p>Edit: I&#8217;ve recently added this display to my <a href="http://www.plastibots.com/?p=2333">Temp / Humidity Monitor</a>.</p>
<p>&nbsp;</p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-0955337107322324";
/* 728x90ImgOnly */
google_ad_slot = "4816127144";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p><strong><span style="text-decoration: underline;">The good:</span></strong></p>
<ul>
<li>At $17.xx, this is reasonably priced for a small, crisp, thin, OLED package.</li>
<li>As always, Adafruit does a great job with providing drivers, samples, and a tutorial to help even the newest of noobs get this thing up-and-running.</li>
<li>It&#8217;s thin &#8211; really thin.  Great for small projects where space is limited but you want to dump lots of info to the screen.</li>
<li>Four mounting holes are provided on the board.  It&#8217;s hard to tell, but the above OLED is mounted to a piece of clear acrylic.</li>
<li>Having the connections all broken out (and labeled) to a header is a must have for those of us who cant work with those tiny ribbon connectors.</li>
<li>Headers are also supplied &#8211; its nice to see small added touches like this and Adafruit does this with most all of their products.  The passion shows through.  It would be a shame to wait a week or so to find out you don&#8217;t have a spare header laying around and your favourite electronics store is closed for the day!</li>
<li>Support! Let&#8217;s not forget the intangibles &#8211; Adafruit had an excellent <a href="http://forums.adafruit.com/" target="_blank">forum </a>where you can post your questions and get answers fast.  It&#8217;s an excellent community and everyone there is very welcoming and want to help.  Even Adafruit staff often weigh in to offer support.</li>
</ul>
<p>&nbsp;</p>
<p><strong><span style="text-decoration: underline;">The not so good:</span></strong></p>
<ul>
<li>Wiring:  Rrequires a lot of wires &#8211; a total of 7.  However, this is to be expected given the nature of what it is.   I managed to find a flat-wired CAT5 cable in my search for something small and flexible.  (The options are limited if you want to keep the cable to a minimum).  The problem with this particular cable was that the encompassing insulator is moulded around all 8 internal wires.  After carefully stripping back all 8 on both ends, I figured I had to find something else if I was going to do this again (which I am &#8211; more in that in another post).  As irony would have it, I later came across <a href="http://www.dealextreme.com/p/network-retractable-cable-473" target="_blank">these</a>.  Already ordered 4 for next time around!  An aside note:  I like to look of people&#8217;s faces when they see me take apart things immediately after they arrive.  The look of  why!?  Then they get it once they know what I do for sh*ts and giggles&#8230; err&#8230; I mean my hobby.</li>
<li>Sunlight:  It was difficult to view the text in bright sunlight while in the vehicle.  This is part due to its size and secondly that you can only get so much contrast with this (or most any other) display.  I am sure that if I was able to inset the OLED in some sort of compartment, the result would be much better.</li>
<li>Size:  This is a tiny OLED.  However, I knew that going in so I can&#8217;t really complain.  I put this here as it is important to know what you need going into a project.  This unit works great if you are working with a project that needs to be small.  If you want something a little larger, Adafruit sells a <a href="https://www.adafruit.com/products/326" target="_blank">128&#215;64 OLED</a> that is the sibling to this one.  I decided to take another leap and am currently working with the <a href="https://www.adafruit.com/products/358" target="_blank">1.8&#8243; TFT LCD display</a>, and am already very impressed with the result.  More on this later.</li>
</ul>
<p>&nbsp;</p>
<p><strong><span style="text-decoration: underline;">Other thoughts:</span></strong></p>
<ul>
<li>For simple displaying of text, the provied driver works fine.  However, as part of my project, I was animating a road against a vehicle icon and it was too slow for my needs.  I followed the simple instructions on this <a href="http://forums.adafruit.com/viewtopic.php?f=19&amp;t=19079&amp;start=15#p103938" target="_blank">simple tweak you can do</a> to use hardware SPI to speed things up.   Once I did this, it ran much faster and supported the necessary animations I was doing.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.plastibots.com/index.php/2012/03/04/adafruit-monochrome-128x32-oled-graphic-display/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Review &#8211; AVAGO &#8211; ASMT-LW60 &#8211; LED Fibre Optic Strip</title>
		<link>http://www.plastibots.com/index.php/2012/01/14/review-avago-asmt-lw60-led-fibre-optic-strip/</link>
		<comments>http://www.plastibots.com/index.php/2012/01/14/review-avago-asmt-lw60-led-fibre-optic-strip/#comments</comments>
		<pubDate>Sat, 14 Jan 2012 13:43:00 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Reviews]]></category>
		<category><![CDATA[LED]]></category>

		<guid isPermaLink="false">http://www.plastibots.com/?p=2260</guid>
		<description><![CDATA[I&#8217;d say that LEDs have  been one of the fastest spreading new technologies in the last 10 years.   Consider now that most cars are being manufactured with LED lighting for all the turn/marker/brake/DRL lights.  They have even made an &#8230; <a href="http://www.plastibots.com/index.php/2012/01/14/review-avago-asmt-lw60-led-fibre-optic-strip/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-2275" title="NewarkAvagoLEDFibreOptic" src="http://www.plastibots.com/wordpress/wp-content/uploads/2012/01/NewarkAvagoLEDFibreOptic.jpg" alt="" width="222" height="200" />I&#8217;d say that LEDs have  been one of the fastest spreading new technologies in the last 10 years.   Consider now that most cars are being manufactured with LED lighting for all the turn/marker/brake/DRL lights.  They have even made an impact with home lighting &#8211; even though people are being gouged with inflated pricing (IMHO) from places like Home Depot, Rona, Lowes etc..  This will change as LEDs become mainstream&#8230; Just wish I had invested in those companies who first got on the bandwagon!</p>
<p>Anyway, I decided to go away from the typical LED strip and try something new.  The <a href="http://canada.newark.com/avago-technologies/asmt-lw60/led-strip-2-led-white/dp/05M6888" target="_blank"><strong>Avago ASMT-LW60&#8242;s</strong></a> are classified as LED strips, but I am not sure I agree.  They are unique in that they use fibre optics to provide the illumination while a tiny SMD LED is buried inside each end of the light unit.</p>
<p><span id="more-2260"></span></p>
<p>These little guys are about 15cm in length and the LED emitters are tiny.  They would fit well in tiny spaces.  As I write this, one use came to mind &#8211; if you are looking to illuminate things such as car ignition switches, or car AC/heater vents, these would be ideal as you can stick them around the inside as they are small and thin.   What is also nice is the fibre optic flex tube is clear when not illuminated.</p>

<a href='http://www.plastibots.com/index.php/2012/01/14/review-avago-asmt-lw60-led-fibre-optic-strip/newarkavagoledfibreoptic1/' title='NewarkAvagoLEDFibreOptic1'><img width="150" height="150" src="http://www.plastibots.com/wordpress/wp-content/uploads/2012/01/NewarkAvagoLEDFibreOptic11-150x150.jpg" class="attachment-thumbnail" alt="NewarkAvagoLEDFibreOptic1" /></a>
<a href='http://www.plastibots.com/index.php/2012/01/14/review-avago-asmt-lw60-led-fibre-optic-strip/newarkavagoledfibreoptic2/' title='NewarkAvagoLEDFibreOptic2'><img width="150" height="150" src="http://www.plastibots.com/wordpress/wp-content/uploads/2012/01/NewarkAvagoLEDFibreOptic2-150x150.jpg" class="attachment-thumbnail" alt="NewarkAvagoLEDFibreOptic2" /></a>
<a href='http://www.plastibots.com/index.php/2012/01/14/review-avago-asmt-lw60-led-fibre-optic-strip/newarkavagoledfibreoptic/' title='NewarkAvagoLEDFibreOptic'><img width="150" height="150" src="http://www.plastibots.com/wordpress/wp-content/uploads/2012/01/NewarkAvagoLEDFibreOptic-150x150.jpg" class="attachment-thumbnail" alt="NewarkAvagoLEDFibreOptic" /></a>

<p>In order to use these guys, you can power from one or both sides.   This is easier to do if you wrap them around something circular and both ends meet at the same place &#8211; just parallel the connections to 12v and your&#8217;re done.  However, if you are setting them up in a linear fashion, you will need to run a set of leads to both ends to illuminate both LEDs.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-0955337107322324";
/* 728x90ImgOnly */
google_ad_slot = "4816127144";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p>&nbsp;</p>
<p><span style="font-weight: bold; text-decoration: underline;">Features / Specs:</span></p>
<ul>
<li>LED STRIP, 2 LED, WHITE</li>
<li>LED Module Type: Plug &amp; Play</li>
<li>LED Color: White</li>
<li>Power Module Configuration: Strip</li>
<li>Supply Voltage: 12V</li>
<li>Forward Current @ Test: 20mA</li>
<li>Power Rating: 363mW</li>
<li>Operating Temperature Range: -30°C to +60°C</li>
<li>Color: White</li>
<li>RoHS Compliant: Yes</li>
<li><a href="http://www.avagotech.com/docs/AV00-0112EN" target="_blank"><strong>Datasheet</strong></a></li>
</ul>
<p>&nbsp;</p>
<p><strong><span style="text-decoration: underline;">The Good:</span></strong></p>
<ul>
<li>These things are cool.  Although I have not come up with a plan yet, I KNOW I will have a use for these at some point.</li>
<li>Each side of the end modules has a tiny hole, so you can string these together in series (the fibre cable part).</li>
<li>Each perf board has solder points for + and &#8211; clearly marked.</li>
<li>The light is a nice white light (no blue and no yellow).  Perfect for clear illumination of objects in the dark.</li>
</ul>
<p><strong><span style="text-decoration: underline;">The Not So Good:</span></strong></p>
<ul>
<li>They are fagile.  The fibre flex cable came out of one of the end units shortly after I unpacked them.  I know that I must have pulled the two apart, but it was not much force.  The rest of the connections were ok.  I fixed the problem with a little silicon and slipped the fibre cable back into the socket with ease.</li>
<li>At 12v, these little units are not bright &#8211; don&#8217;t go looking to provide oodles of illumination here.  However, they do illuminate the area they are around well enough.</li>
</ul>
<p><strong>Summary:</strong></p>
<p>I can&#8217;t wait to use these in something.   Look around my blog and you will see the variety of LED mods I have done to my 12&#8242; Juke.  I am sure these guys will find a place in my car.   There has been a lot of discussion around the lack of lighting for the door window/lock controls on the driver&#8217;s side.  These units may be a perfect solution for this since you can wind/run them around the innards due to their size and flexibility.  I just have to see if the stock buttons are the types that can be illuminated from behind&#8230;   As for pricing, these are about <a href="http://canada.newark.com/avago-technologies/asmt-lw60/led-strip-2-led-white/dp/05M6888" target="_blank"><strong>$6.50 USD</strong></a> at the time of writing.  Not bad for a specialized solution.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.plastibots.com/index.php/2012/01/14/review-avago-asmt-lw60-led-fibre-optic-strip/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Review &#8211; OPTEK &#8211; Warm White LED Strip</title>
		<link>http://www.plastibots.com/index.php/2012/01/14/review-optek-warm-white-led-strip/</link>
		<comments>http://www.plastibots.com/index.php/2012/01/14/review-optek-warm-white-led-strip/#comments</comments>
		<pubDate>Sat, 14 Jan 2012 12:58:28 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[MyDYI Hacks & Other Stuff]]></category>
		<category><![CDATA[Reviews]]></category>
		<category><![CDATA[LED]]></category>

		<guid isPermaLink="false">http://www.plastibots.com/?p=2248</guid>
		<description><![CDATA[Lately, I&#8217;ve been toying around with different LED strips for my projects.   I&#8217;ve had the chance to use a variety of LED strips (both RGB, and single colour types).  They come in many flavours &#8211; water proof, 3m-backed, silcone &#8230; <a href="http://www.plastibots.com/index.php/2012/01/14/review-optek-warm-white-led-strip/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Lately, I&#8217;ve been toying around with different LED strips for my projects.   I&#8217;ve had the chance to use a variety of LED strips (both RGB, and single colour types).  They come in many flavours &#8211; water proof, 3m-backed, silcone encased, sealed, non-sealed, exposed etc.   All have their advantages / disadvantages.</p>

<a href='http://www.plastibots.com/index.php/2012/01/14/review-optek-warm-white-led-strip/newarkoptek/' title='NewarkOptek'><img width="150" height="150" src="http://www.plastibots.com/wordpress/wp-content/uploads/2012/01/NewarkOptek-150x150.jpg" class="attachment-thumbnail" alt="NewarkOptek" /></a>
<a href='http://www.plastibots.com/index.php/2012/01/14/review-optek-warm-white-led-strip/newarkoptek1/' title='NewarkOptek1'><img width="150" height="150" src="http://www.plastibots.com/wordpress/wp-content/uploads/2012/01/NewarkOptek1-150x150.jpg" class="attachment-thumbnail" alt="NewarkOptek1" /></a>
<a href='http://www.plastibots.com/index.php/2012/01/14/review-optek-warm-white-led-strip/newarkoptek2/' title='NewarkOptek2'><img width="150" height="150" src="http://www.plastibots.com/wordpress/wp-content/uploads/2012/01/NewarkOptek2-150x150.jpg" class="attachment-thumbnail" alt="NewarkOptek2" /></a>

<p><span id="more-2248"></span></p>
<p>&nbsp;</p>
<p>In this case, I am reviewing the warm white LED strip from Optek.   The unit came well packaged from <a href="http://canada.newark.com/optek-technology/ovq12s30ww7/led-strip-30-led-warm-white/dp/19P2485" target="_blank"><strong>Newark</strong></a>.  Typically when you get strips like this, they come of a larger LED strip roll (usually 5 meters), so the product often looks like it was cut with a set of scissors &#8211; no big deal.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-0955337107322324";
/* 728x90ImgOnly */
google_ad_slot = "4816127144";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p><strong><span style="text-decoration: underline;">Features / Specs:</span></strong></p>
<ul>
<li>Part #OVQ12S30WW7</li>
<li>LED STRIP, 30 LED, WARM WHITE</li>
<li>LED Module Type: Board + LED</li>
<li>LED Color: Warm White</li>
<li>CCT: 3300K</li>
<li>Luminous Flux @ Test: 60lm</li>
<li>Power Module Configuration: Strip</li>
<li>Supply Voltage: 12V</li>
<li>Power Rating: 1.6W</li>
<li>RoHS Compliant: Yes</li>
<li><a href="http://www.optekinc.com/datasheets/OVQ12S30B7.pdf" target="_blank">D<strong>atasheet</strong></a></li>
</ul>
<p>&nbsp;</p>
<p><strong><span style="text-decoration: underline;">The Good:</span></strong></p>
<ul>
<li>Light colour is as specified &#8211; warm white.  This strip would serve well in locations where you want to cast a warm natural light (eg under kitchen cabinets).</li>
<li>Although, these are not as bright as their 5050 SMD counterparts, they are softer on the eyes.</li>
<li>Comes with 3M tape on the back.  I have not tried to secure the strip to anything since I haven&#8217;t decided a use for it yet.  I&#8217;m sure it&#8217;ll find its way in my car, or my workbench&#8230; somewhere&#8230;</li>
<li>The unit is less than 3mm high x 8mm wide, so they can be tucked away pretty much anywhere.</li>
<li>Price is very reasonable.</li>
</ul>
<p><strong><span style="text-decoration: underline;">The Not So Good:</span></strong></p>
<ul>
<li>These LEDs are not bright.  Don&#8217;t expect to use these where you are looking to illuminate objects from a distance.  Only a few feet max.</li>
<li>They are not waterproof.  Depending on your situation, this could make or break this buy.</li>
</ul>
<p>&nbsp;</p>
<p><strong>Summary:</strong></p>
<p>If you are looking for a LED strip that can be stuck on pretty much any surface, that casts a nice warm glow and has a small footprint (width and height), this is a nice choice.   If you are looking to mount these in an environment that has to look clean, don&#8217;t forget that you will likely have to create some sort of carrier or barrier for these (so viewers won&#8217;t see the raw LEDs and the copper strip).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.plastibots.com/index.php/2012/01/14/review-optek-warm-white-led-strip/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Review &#8211; Optek LED Strip</title>
		<link>http://www.plastibots.com/index.php/2012/01/06/review-optek-led-strip/</link>
		<comments>http://www.plastibots.com/index.php/2012/01/06/review-optek-led-strip/#comments</comments>
		<pubDate>Sat, 07 Jan 2012 01:43:29 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.plastibots.com/?p=2229</guid>
		<description><![CDATA[After completing my Juke footwell / glove box LED mod, I decided that the footwell LEDs just were not bright enough.   I came across these Optek 3 LED white lights from Newark that have just the right white light &#8230; <a href="http://www.plastibots.com/index.php/2012/01/06/review-optek-led-strip/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>After completing my<a href="http://www.plastibots.com/?p=2174"> Juke footwell / glove box LED mod</a>, I decided that the footwell LEDs just were not bright enough.   I came across these <a href="http://canada.newark.com/optek-technology/ovm12f3w7/led-strip-3-led-white-16lm/dp/19P2475" target="_blank">Optek 3 LED white lights</a> from <a href="http://www.newark.com/optek-technology/ " target="_blank">Newark</a> that have just the right white light and luminosity.  These LED bars are built tough.  The LEDs appear to be set in a hardened liquid plastic.  Wires run in one end and out the other &#8211; it seems that these strips were built as a series set of 3x LED bars and cut to order.  I ordered 2 and both were joined together.  Before installing them above the footwell area, I had to do something about the white.   After masking off the LEDs,  I gave them a few coats of Plastidip to make them black.</p>
<p><br class="spacer_" /></p>
<p style="text-align: center;"><img class="aligncenter size-medium wp-image-2293" title="Optek LED" src="http://www.plastibots.com/wordpress/wp-content/uploads/2011/11/OVM12F3R7-300x300.jpg" alt="" width="300" height="300" /></p>
<p>I am impressed with the end result.  I was after something that would provide nice white light when I am looking for something down in the footwell area during the dark&#8230;  They cast a bright wide swath of light to illuminate the entire footwell area.  They also cast enough light to see under the seats as well.</p>
<p>Illumination with the Optek 3x LED Bar:</p>

<a href='http://www.plastibots.com/index.php/2012/01/06/review-optek-led-strip/jukeintledsupdated1/' title='JukeIntLEDsUpdated1'><img width="150" height="150" src="http://www.plastibots.com/wordpress/wp-content/uploads/2012/01/JukeIntLEDsUpdated1-150x150.jpg" class="attachment-thumbnail" alt="JukeIntLEDsUpdated1" /></a>
<a href='http://www.plastibots.com/index.php/2012/01/06/review-optek-led-strip/jukeintledsupdated2/' title='JukeIntLEDsUpdated2'><img width="150" height="150" src="http://www.plastibots.com/wordpress/wp-content/uploads/2012/01/JukeIntLEDsUpdated2-150x150.jpg" class="attachment-thumbnail" alt="JukeIntLEDsUpdated2" /></a>

<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p>The original LED illumination:</p>
<p><img class="alignnone" title="Original" src="http://www.plastibots.com/wordpress/wp-content/uploads/2011/11/Juke-IntLEDRTfootwell.jpg" alt="" width="400" height="300" /><img class="alignnone" title="Original LED" src="http://www.plastibots.com/wordpress/wp-content/uploads/2011/11/JukeIntLED-frontLEDs21-300x225.jpg" alt="" width="300" height="225" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.plastibots.com/index.php/2012/01/06/review-optek-led-strip/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
