<?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>RGB LED Archives - Digital Me</title>
	<atom:link href="https://ba0sh1.com/tag/rgb-led/feed/" rel="self" type="application/rss+xml" />
	<link>https://ba0sh1.com/tag/rgb-led/</link>
	<description>Electronics, Computers at leisure time</description>
	<lastBuildDate>Mon, 11 Jul 2022 13:40:30 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.1.1</generator>
	<item>
		<title>Project Crystal (Part 2)</title>
		<link>https://ba0sh1.com/2012/06/13/project-crystal-part-2/</link>
					<comments>https://ba0sh1.com/2012/06/13/project-crystal-part-2/#respond</comments>
		
		<dc:creator><![CDATA[Baoshi]]></dc:creator>
		<pubDate>Tue, 12 Jun 2012 19:23:55 +0000</pubDate>
				<category><![CDATA[Project]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Arduino Sleep]]></category>
		<category><![CDATA[Distance Sensor]]></category>
		<category><![CDATA[LED Strip]]></category>
		<category><![CDATA[PIR Sensor]]></category>
		<category><![CDATA[PWM]]></category>
		<category><![CDATA[RGB LED]]></category>
		<guid isPermaLink="false">https://ba0sh1.com/?p=88</guid>

					<description><![CDATA[<p>It took me a while but I&#8217;ve made some progress &#8230; Here are the photos of finished board: Working as a software engineer for ten over years, I did not initially consider...</p>
<p>The post <a rel="nofollow" href="https://ba0sh1.com/2012/06/13/project-crystal-part-2/">Project Crystal (Part 2)</a> appeared first on <a rel="nofollow" href="https://ba0sh1.com">Digital Me</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>It took me a while but I&#8217;ve made some progress &#8230;<br><br>Here are the photos of finished board:</p>



<span id="more-88"></span>



<figure class="is-layout-flex wp-block-gallery-1 wp-block-gallery columns-3 is-cropped"><ul class="blocks-gallery-grid"><li class="blocks-gallery-item"><figure><img decoding="async" width="800" height="600" src="https://ba0sh1.com/wp-content/uploads/2012/06/377c9-crystal_back.jpg" alt="Controller board back view" data-id="103" data-full-url="https://ba0sh1.com/wp-content/uploads/2012/06/377c9-crystal_back.jpg" data-link="https://ba0sh1.com/crystal_back/" class="wp-image-103" srcset="https://ba0sh1.com/wp-content/uploads/2012/06/377c9-crystal_back.jpg 800w, https://ba0sh1.com/wp-content/uploads/2012/06/377c9-crystal_back-300x225.jpg 300w, https://ba0sh1.com/wp-content/uploads/2012/06/377c9-crystal_back-768x576.jpg 768w" sizes="(max-width: 800px) 100vw, 800px" /><figcaption class="blocks-gallery-item__caption">Controller board back view</figcaption></figure></li><li class="blocks-gallery-item"><figure><img decoding="async" loading="lazy" width="800" height="600" src="https://ba0sh1.com/wp-content/uploads/2012/06/2a4f5-crystal_front.jpg" alt="Controller board front view" data-id="102" data-full-url="https://ba0sh1.com/wp-content/uploads/2012/06/2a4f5-crystal_front.jpg" data-link="https://ba0sh1.com/crystal_front/" class="wp-image-102" srcset="https://ba0sh1.com/wp-content/uploads/2012/06/2a4f5-crystal_front.jpg 800w, https://ba0sh1.com/wp-content/uploads/2012/06/2a4f5-crystal_front-300x225.jpg 300w, https://ba0sh1.com/wp-content/uploads/2012/06/2a4f5-crystal_front-768x576.jpg 768w" sizes="(max-width: 800px) 100vw, 800px" /><figcaption class="blocks-gallery-item__caption">Controller board front view</figcaption></figure></li><li class="blocks-gallery-item"><figure><img decoding="async" loading="lazy" width="800" height="600" src="https://ba0sh1.com/wp-content/uploads/2012/06/6836f-crystal_sensors.jpg" alt="PIR sensor and distance sensor" data-id="105" data-full-url="https://ba0sh1.com/wp-content/uploads/2012/06/6836f-crystal_sensors.jpg" data-link="https://ba0sh1.com/crystal_sensors/" class="wp-image-105" srcset="https://ba0sh1.com/wp-content/uploads/2012/06/6836f-crystal_sensors.jpg 800w, https://ba0sh1.com/wp-content/uploads/2012/06/6836f-crystal_sensors-300x225.jpg 300w, https://ba0sh1.com/wp-content/uploads/2012/06/6836f-crystal_sensors-768x576.jpg 768w" sizes="(max-width: 800px) 100vw, 800px" /><figcaption class="blocks-gallery-item__caption">PIR sensor and distance sensor</figcaption></figure></li></ul></figure>



<p>Working as a software engineer for ten over years, I did not initially consider Adruino programming is of any difficulty. But I soon realized that I have been deeply spoiled by the modern operation systems. Giving a task that is so naturally to be implemented as a thread, it is never trivial in micro controller system. I spend one whole day to map out a flow chart of the control tasks, then turn the chart into C code. I can imaging that the time would have double or trippled if I don&#8217;t do this. Old school way rules, isn&#8217;t it?</p>



<p>I have attached the flow chart and Arduino sketch here. Sorry I dislike documentation, just refer to the inline comments and flow chart in case needed.</p>



<div class="wp-block-file"><object class="wp-block-file__embed" data="https://ba0sh1.com/wp-content/uploads/2012/06/b303f-crystal_flowchart.pdf" type="application/pdf" style="width:100%;height:600px" aria-label="Embed of Embed of Crystal_Flowchart.pdf.."></object><a href="https://ba0sh1.com/wp-content/uploads/2012/06/b303f-crystal_flowchart.pdf">Crystal_Flowchart.pdf</a><a href="https://ba0sh1.com/wp-content/uploads/2012/06/b303f-crystal_flowchart.pdf" class="wp-block-file__button" download>Download</a></div>



<div class="wp-block-file"><a href="https://ba0sh1.com/wp-content/uploads/2012/06/648ad-crystal_sketch.zip">Crystal_Sketch.zip</a><a href="https://ba0sh1.com/wp-content/uploads/2012/06/648ad-crystal_sketch.zip" class="wp-block-file__button" download>Download</a></div>



<p>Having a license term is still better then nothing, so I make this one:</p>



<ol><li>Tribute goes to&nbsp;<a href="http://makeprojects.com/User/9189/Francisco+Castro" target="_blank" rel="noopener">Francisco Castro</a>&nbsp;and his&nbsp;<a href="http://makeprojects.com/Project/Luminch-One/1773/1" target="_blank" rel="noopener">Luminch One</a>&nbsp;project.</li><li>The redesign here is provided on AS-IS basis. If it works, it is designed by ba0sh1.</li><li>If it doesn&#8217;t work, I do not know who designed it</li></ol>



<p>And enjoy the demo video. My first YouTube upload <img src="https://s.w.org/images/core/emoji/14.0.0/72x72/1f600.png" alt="😀" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>



<figure class="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
<iframe loading="lazy" title="Project Crystal Demo" width="640" height="360" src="https://www.youtube.com/embed/vYRVWFtfnt4?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div></figure>
<p>The post <a rel="nofollow" href="https://ba0sh1.com/2012/06/13/project-crystal-part-2/">Project Crystal (Part 2)</a> appeared first on <a rel="nofollow" href="https://ba0sh1.com">Digital Me</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://ba0sh1.com/2012/06/13/project-crystal-part-2/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Project Crystal (Part 1)</title>
		<link>https://ba0sh1.com/2012/05/24/project-crystal-part-1/</link>
					<comments>https://ba0sh1.com/2012/05/24/project-crystal-part-1/#comments</comments>
		
		<dc:creator><![CDATA[Baoshi]]></dc:creator>
		<pubDate>Thu, 24 May 2012 03:35:26 +0000</pubDate>
				<category><![CDATA[Project]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Distance Sensor]]></category>
		<category><![CDATA[LED Strip]]></category>
		<category><![CDATA[PIR Sensor]]></category>
		<category><![CDATA[PWM]]></category>
		<category><![CDATA[RGB LED]]></category>
		<guid isPermaLink="false">https://ba0sh1.com/?p=26</guid>

					<description><![CDATA[<p>A small project I did while waiting for the Raspberry Pi &#8211; Arduino controlled RGB LED light. The initial idea was stolen taken from Luminch One I made several redesigns: RGB LED strip instead of...</p>
<p>The post <a rel="nofollow" href="https://ba0sh1.com/2012/05/24/project-crystal-part-1/">Project Crystal (Part 1)</a> appeared first on <a rel="nofollow" href="https://ba0sh1.com">Digital Me</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>A small project I did while waiting for the Raspberry Pi &#8211; Arduino controlled RGB LED light.</p>
<p>The initial idea was <del>stolen</del> taken from <a href="http://makeprojects.com/Project/Luminch-One/1773/1" target="_blank" rel="noopener">Luminch One</a></p>
<p>I made several redesigns:</p>
<ol>
<li>RGB LED strip instead of original high-powered LED</li>
<li>Use battery power.</li>
</ol>
<div>
<p><span id="more-1261"></span>The journey for battery power ends up to be much more complex. The major concern is standby (light off) power consumption. I wished the circuit could remain standby for at least one week. With three 3100mAh 18650 battery cell at 3.7V each, the maximum allowed current draw works out as 3100 * 0.8 / 7 (days) / 24 (hrs) = 14.7mA (<a href="http://www.powerstream.com/battery-capacity-calculations.htm" target="_blank" rel="noopener">reference</a> here, number of cells actually does not help, but LED light needs 12V). However, the Arduino Nano alone consumes 20mA when running. After removing the power LED, it still consumes about 17mA. The distance sensor, Sharp GP2Y0A21YK0F takes another whopping 20mA. With these two monsters, standby time is 3100 * 0.8 / 37mA = 67 Hours ~ 2.8 days (show stopper).</p>
<p>It seems I need to turn off distance sensor and put Arduino into sleep mode during standby. It is solved by adding a Passive Infrared (PIR) sensor which powers on GP2Y0A21YK0F only when human (or pet) walks near the light. Together with AVR sleep mode the current now reduces to 2mA standby. My standby time is 51 days <img src="https://s.w.org/images/core/emoji/14.0.0/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>Here comes the schematic.</p>
<figure id="attachment_63" aria-describedby="caption-attachment-63" style="width: 1262px" class="wp-caption alignnone"><img decoding="async" loading="lazy" class="    wp-image-63 size-full" title="Crystal schematic" src="https://ba0sh1.com/wp-content/uploads/2012/06/69689-crystal_sch.png" alt="Crystal schematic" width="1262" height="769" srcset="https://ba0sh1.com/wp-content/uploads/2012/06/69689-crystal_sch.png 1262w, https://ba0sh1.com/wp-content/uploads/2012/06/69689-crystal_sch-300x183.png 300w, https://ba0sh1.com/wp-content/uploads/2012/06/69689-crystal_sch-1024x624.png 1024w, https://ba0sh1.com/wp-content/uploads/2012/06/69689-crystal_sch-768x468.png 768w" sizes="(max-width: 1262px) 100vw, 1262px" /><figcaption id="caption-attachment-63" class="wp-caption-text">Crystal schematic</figcaption></figure>
<p>Notes:</p>
<ol>
<li>Q1 controls power to the Sharp sensor. I tried to drive this sensor directly from an Arduino pin but failed. The sensor output is unstable. I believe GP2Y0A21YK0F  specified 20mA power draw is only average value. Its peak current is quite higher.</li>
<li>Q2 is reverse voltage protection (<a href="http://youtu.be/IrB-FPcv1Dc" target="_blank" rel="noopener">reference</a>)</li>
<li>J_LIGHT is the main RGB LED light. J_LIGHT_BK is for backup.</li>
<li>R1/R2 is voltage divider for battery voltage measurement.</li>
<li>J_INDI connects to a Bi-color (Red/Green) LED light as indication.</li>
</ol>
<div>
<p> The final construction will be on a perf-board. So I start Eagle PCB, set grid to 0.1inch and route the design. All files at the bottom.</p>
<p>Next part will include Arduino sketch, photos, and demo video. Stay tuned &#8230;</p>
</div>
</div>


<p></p>
<p>The post <a rel="nofollow" href="https://ba0sh1.com/2012/05/24/project-crystal-part-1/">Project Crystal (Part 1)</a> appeared first on <a rel="nofollow" href="https://ba0sh1.com">Digital Me</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://ba0sh1.com/2012/05/24/project-crystal-part-1/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
	</channel>
</rss>
