<?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>waihung.net &#187; electronics</title>
	<atom:link href="http://waihung.net/tag/electronics/feed/" rel="self" type="application/rss+xml" />
	<link>http://waihung.net</link>
	<description></description>
	<lastBuildDate>Sat, 11 May 2013 15:43:30 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>PCD8544 Nokia 3310 Graphical LCD</title>
		<link>http://waihung.net/pcd8544-nokia-3310-graphical-lcd/</link>
		<comments>http://waihung.net/pcd8544-nokia-3310-graphical-lcd/#comments</comments>
		<pubDate>Thu, 14 Feb 2013 18:16:30 +0000</pubDate>
		<dc:creator>waihung</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[lcd]]></category>

		<guid isPermaLink="false">http://waihung.net/?p=1516</guid>
		<description><![CDATA[Remember the good old Nokia 3310? For display, it&#8217;s using a Philips PCD8544 Graphical LCD. It features a whopping 84 x 48 pixels of resolution to ensure true clarity when playing Space Impact or Snake II Apparently now you can buy a module with this graphical LCD on it for around RM 10 shipped from China. Well, if you have ...]]></description>
				<content:encoded><![CDATA[<p>Remember the good old Nokia 3310?</p>
<p><a href="http://waihung.net/wp-content/uploads/2013/02/nokia-33101.jpg"><img class="alignnone  wp-image-1518" alt="nokia-3310[1]" src="http://waihung.net/wp-content/uploads/2013/02/nokia-33101.jpg" width="160" height="240" /></a></p>
<p>For display, it&#8217;s using a Philips PCD8544 Graphical LCD. It features a whopping 84 x 48 pixels of resolution to ensure true clarity when playing Space Impact or Snake II <img src='http://waihung.net/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>Apparently now you can buy a module with this graphical LCD on it for around RM 10 shipped from China.</p>
<p><a href="http://waihung.net/wp-content/uploads/2013/02/IMG_1033.jpg"><img class="alignnone  wp-image-1521" alt="IMG_1033" src="http://waihung.net/wp-content/uploads/2013/02/IMG_1033-1024x768.jpg" width="614" height="461" /></a></p>
<p>Well, if you have a Nokia 3310 lying around you can rip out its&#8217; LCD but take note that its a pain in the butt to solder.</p>
<p>This module I got has everything in it including the cool white backlight. Yes, backlight is important.</p>
<p><a href="http://waihung.net/wp-content/uploads/2013/02/IMG_1034.jpg"><img class="alignnone  wp-image-1522" alt="IMG_1034" src="http://waihung.net/wp-content/uploads/2013/02/IMG_1034-1024x768.jpg" width="614" height="461" /></a></p>
<p>The difference between Graphical LCD and a normal LCD like I&#8217;ve used in <a title="Arduino Interfacing with HD44780 LCD" href="http://waihung.net/arduino-interfacing-with-hd44780-lcd/" target="_blank">this article</a> is that you can selectively turn on or off every pixel and form your desired image. In a typical LCD like the HD 44780, you can only send specified ASCII characters and display corresponding texts.</p>
<p>Like most recent electronic components, this PCD8544 Graphical LCD runs on 3.3V logic. If you&#8217;re using a 5V microcontroller (ex. Arduino Uno), you&#8217;ll need a level shifter like 74HC4050. If not, you&#8217;ll fry this LCD right away.</p>
<p><a href="http://waihung.net/wp-content/uploads/2013/02/IMG_1035.jpg"><img class="alignnone  wp-image-1523" alt="IMG_1035" src="http://waihung.net/wp-content/uploads/2013/02/IMG_1035-1024x768.jpg" width="614" height="461" /></a></p>
<p>A level shifter converts a 5V signal to a 3.3V signal. It&#8217;s a pretty simple IC to use.</p>
<p><a href="http://waihung.net/wp-content/uploads/2013/02/74hc40501.jpg"><img class="alignnone size-full wp-image-1524" alt="74hc4050[1]" src="http://waihung.net/wp-content/uploads/2013/02/74hc40501.jpg" width="403" height="310" /></a></p>
<p>Vcc connects to 3.3V and this IC is capable of level shifting 6 channels. The &#8216;A&#8217; pin connects to the 5v MCU and the &#8216;Y&#8217; pin connects to the GLCD.</p>
<p>The connections are as below :</p>
<p>pin 7 &#8211; Serial clock out (SCLK)<br />
pin 6 &#8211; Serial data out (DIN)<br />
pin 5 &#8211; Data/Command select (D/C)<br />
pin 4 &#8211; LCD chip select (CS)<br />
pin 3 &#8211; LCD reset (RST)</p>
<p>It&#8217;s not that much of a hassle to use a level shifter, you can build the entire circuit on a small breadboard.</p>
<p><a href="http://waihung.net/wp-content/uploads/2013/02/IMG_1028.jpg"><img class="alignnone  wp-image-1525" alt="IMG_1028" src="http://waihung.net/wp-content/uploads/2013/02/IMG_1028-1024x768.jpg" width="614" height="461" /></a></p>
<p><a href="http://waihung.net/wp-content/uploads/2013/02/IMG_1031.jpg"><img class="alignnone  wp-image-1526" alt="IMG_1031" src="http://waihung.net/wp-content/uploads/2013/02/IMG_1031-1024x768.jpg" width="614" height="461" /></a></p>
<p>I&#8217;m using Adafruit&#8217;s Library and modified the sample sketch to display bitmap images.</p>
<p><a href="http://waihung.net/wp-content/uploads/2013/02/glcd_code.png"><img class="alignnone size-full wp-image-1527" alt="glcd_code" src="http://waihung.net/wp-content/uploads/2013/02/glcd_code.png" width="500" height="600" /></a></p>
<p>I found a software that can convert your typical JPEG, GIF, PNG or BMP images to binary, meaning &#8217;0&#8242; and &#8217;1&#8242;s so that you can turn on or off individual pixels on the graphical LCD.</p>
<p>It&#8217;s called Image2GLCD.exe and it can be downloaded here &#8211;&gt; <a href="http://www.avrportal.com/?page=image2glcd" target="_blank">http://www.avrportal.com/?page=image2glcd</a> Credits to Jirawat Kongkaen for an awesome app.</p>
<p><a href="http://waihung.net/wp-content/uploads/2013/02/image2glcd.png"><img class="alignnone size-full wp-image-1528" alt="image2glcd" src="http://waihung.net/wp-content/uploads/2013/02/image2glcd.png" width="508" height="208" /></a></p>
<p>Follow the settings shown above and click on Save. A file called Image2GLCD.c will be generated and in it you will find the image bits.</p>
<p><a href="http://waihung.net/wp-content/uploads/2013/02/image2glcd_bits.png"><img class="alignnone  wp-image-1529" alt="image2glcd_bits" src="http://waihung.net/wp-content/uploads/2013/02/image2glcd_bits.png" width="500" height="361" /></a></p>
<p>Copy this into your Arduino sketch and to display them just issue this command.</p>
<p><strong>display.drawBitmap(0, 0, img, 80, 45, BLACK);</strong></p>
<p>img being the name of your char variable. Remember to follow it up with <strong>display.display();</strong></p>
<p><a href="http://waihung.net/wp-content/uploads/2013/02/glcd_code2.png"><img class="alignnone size-full wp-image-1531" alt="glcd_code2" src="http://waihung.net/wp-content/uploads/2013/02/glcd_code2.png" width="500" height="600" /></a></p>
<p>Here&#8217;s a demonstration video :</p>
<p><a href="http://www.youtube.com/watch?v=y6Fvxi58Sjk&#038;fmt=18">http://www.youtube.com/watch?v=y6Fvxi58Sjk</a></p>
<p><a href="http://waihung.net/sketch/GLCD_Code.rar" class="button_link hover_fade target_blank"><span>Download Code</span></a></p>
]]></content:encoded>
			<wfw:commentRss>http://waihung.net/pcd8544-nokia-3310-graphical-lcd/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Arduino + Visual Basic : Servo Control</title>
		<link>http://waihung.net/arduino-visual-basic-servo-control/</link>
		<comments>http://waihung.net/arduino-visual-basic-servo-control/#comments</comments>
		<pubDate>Tue, 12 Feb 2013 16:36:57 +0000</pubDate>
		<dc:creator>waihung</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[servo]]></category>
		<category><![CDATA[VB]]></category>

		<guid isPermaLink="false">http://waihung.net/?p=1504</guid>
		<description><![CDATA[To start off, here is a demo video on how the program works. http://www.youtube.com/watch?v=C6_ZEk9Jri0 Servo motor provides angular control to users, and unlike normal DC motors, it can only rotate from 0 to 180 degrees. It is very accurate and are often used in robotic applications. Normally every servo motor has 3 connections, 5V (Red), Ground (Black) and Signal (White). ...]]></description>
				<content:encoded><![CDATA[<p>To start off, here is a demo video on how the program works.</p>
<p><a href="http://www.youtube.com/watch?v=C6_ZEk9Jri0&#038;fmt=18">http://www.youtube.com/watch?v=C6_ZEk9Jri0</a></p>
<p>Servo motor provides angular control to users, and unlike normal DC motors, it can only rotate from 0 to 180 degrees. It is very accurate and are often used in robotic applications.</p>
<p><a href="http://waihung.net/wp-content/uploads/2013/02/IMG_1011.jpg"><img class="alignnone  wp-image-1506" alt="IMG_1011" src="http://waihung.net/wp-content/uploads/2013/02/IMG_1011-1024x768.jpg" width="614" height="461" /></a></p>
<p>Normally every servo motor has 3 connections, 5V (Red), Ground (Black) and Signal (White). The signal is connected to Digital Pin 9 of the Arduino.</p>
<p><a href="http://waihung.net/wp-content/uploads/2013/02/IMG_1010.jpg"><img class="alignnone  wp-image-1507" alt="IMG_1010" src="http://waihung.net/wp-content/uploads/2013/02/IMG_1010-1024x768.jpg" width="614" height="461" /></a></p>
<p>As requested by one of my dear readers, I have made a simple Visual Basic program that will control the servo motor that is connected to an Arduino.</p>
<p><a href="http://waihung.net/wp-content/uploads/2013/02/vb_servo_form.png"><img class="alignnone  wp-image-1508" alt="vb_servo_form" src="http://waihung.net/wp-content/uploads/2013/02/vb_servo_form-1024x576.png" width="614" height="346" /></a></p>
<p><a href="http://waihung.net/wp-content/uploads/2013/02/vb_servo_sketch.png"><img class="alignnone size-full wp-image-1509" alt="vb_servo_sketch" src="http://waihung.net/wp-content/uploads/2013/02/vb_servo_sketch.png" width="500" height="689" /></a></p>
<p>The Visual Basic and Arduino codes can be downloaded below.</p>
<p><a href="http://waihung.net/sketch/Arduino+VB+Servo.rar" class="button_link hover_fade target_blank"><span>Download Code</span></a></p>
]]></content:encoded>
			<wfw:commentRss>http://waihung.net/arduino-visual-basic-servo-control/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bluetooth Controlled Relay</title>
		<link>http://waihung.net/bluetooth-controlled-relay/</link>
		<comments>http://waihung.net/bluetooth-controlled-relay/#comments</comments>
		<pubDate>Tue, 12 Feb 2013 10:20:15 +0000</pubDate>
		<dc:creator>waihung</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[bluetooth]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[relay]]></category>

		<guid isPermaLink="false">http://waihung.net/?p=1481</guid>
		<description><![CDATA[A relay is an isolated switch, there is no connection between the switching device and the connection. Relay is often used when controlling high voltage devices so that the intricate low voltage devices will not be damaged. There are many types of relays but the most commonly used ones are electromechanical relays. They are cheap, simple and provide very good ...]]></description>
				<content:encoded><![CDATA[<p>A relay is an isolated switch, there is no connection between the switching device and the connection. Relay is often used when controlling high voltage devices so that the intricate low voltage devices will not be damaged.</p>
<p>There are many types of relays but the most commonly used ones are electromechanical relays. They are cheap, simple and provide very good isolation between the control circuitry and the connection.</p>
<p>The diagram below shows the inner workings of a typical electromechanical relay.</p>
<p><img class="alignnone size-full wp-image-1482" alt="relay-pump-circuit-diagram[1]" src="http://waihung.net/wp-content/uploads/2013/02/relay-pump-circuit-diagram1.jpg" width="310" height="165" /></p>
<p>The control circuitry is connected to a coil in the relay, and when the relay is energized, it will create a temporary magnetic field that will cause the relay contact to close and complete the circuit on the other side of the relay (usually a high voltage circuit).</p>
<p>Relays usually come in a box shape, like the ones I got below.</p>
<p><img class="alignnone  wp-image-1483" alt="IMG_1005" src="http://waihung.net/wp-content/uploads/2013/02/IMG_1005-1024x768.jpg" width="614" height="461" /></p>
<p>On the left is a 5V relay and on the right is a 24V relay. What this means is that the relay on the left requires just 5V to energize the relay coil while the one on the right requires 24V. Depending on the application, a 24V relay may be used if lets say a microcontroller wants to detect whether there is a 24V input.</p>
<p><img class="alignnone  wp-image-1484" alt="IMG_1006" src="http://waihung.net/wp-content/uploads/2013/02/IMG_1006-1024x768.jpg" width="614" height="461" /></p>
<p>These relays are rated to conduct up to 240V AC @ 10A or 30V DC @ 10A.</p>
<p>Below is a schematic diagram on how to connect a relay, I used an LED to display whether the relay is turned on or off.</p>
<p><img class="alignnone  wp-image-1485" alt="relay_sch" src="http://waihung.net/wp-content/uploads/2013/02/relay_sch-1024x602.png" width="614" height="361" /></p>
<p>Since this is a very simple circuit, I built it on a donut board.</p>
<p><img class="alignnone  wp-image-1486" alt="IMG_0998" src="http://waihung.net/wp-content/uploads/2013/02/IMG_0998-1024x768.jpg" width="614" height="461" /></p>
<p><img class="alignnone  wp-image-1487" alt="IMG_1000" src="http://waihung.net/wp-content/uploads/2013/02/IMG_1000-1024x768.jpg" width="614" height="461" /></p>
<p>The relay requires 3 connections, 5V, Ground and an Output pin from a microcontroller. The two connections on the screw terminal block will be shorted when the relay is turned on.</p>
<p>I plan on using Bluetooth to control the relay, so I used a bluetooth module highlighted in my <a title="Arduino Bluetooth" href="http://waihung.net/arduino-bluetooth/" target="_blank">previous post</a>.</p>
<p><img class="alignnone  wp-image-1248" alt="IMG_0769" src="http://waihung.net/wp-content/uploads/2012/08/IMG_0769-1024x768.jpg" width="614" height="461" /></p>
<p>I programmed the Arduino to turn the relay on or off upon receiving an &#8216;o&#8217; input. It will also print out the status of the relay. You can download this code at the end of the article.</p>
<p><img class="alignnone size-full wp-image-1488" alt="bt_relay_code" src="http://waihung.net/wp-content/uploads/2013/02/bt_relay_code.png" width="500" height="787" /></p>
<p><img class="alignnone  wp-image-1489" alt="IMG_1002" src="http://waihung.net/wp-content/uploads/2013/02/IMG_1002-1024x768.jpg" width="614" height="461" /></p>
<p>Here is a video demonstration :</p>
<p><a href="http://www.youtube.com/watch?v=AwLw7Db32TI&#038;fmt=18">http://www.youtube.com/watch?v=AwLw7Db32TI</a></p>
<p><a href="http://waihung.net/sketch/bt_relay.ino" class="button_link hover_fade target_blank"><span>Download Code</span></a></p>
]]></content:encoded>
			<wfw:commentRss>http://waihung.net/bluetooth-controlled-relay/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Persistence of Vision</title>
		<link>http://waihung.net/pov/</link>
		<comments>http://waihung.net/pov/#comments</comments>
		<pubDate>Sat, 08 Dec 2012 14:49:27 +0000</pubDate>
		<dc:creator>waihung</dc:creator>
				<category><![CDATA[Microchip PIC]]></category>
		<category><![CDATA[PCB]]></category>
		<category><![CDATA[eagle]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[pcb]]></category>
		<category><![CDATA[PIC]]></category>
		<category><![CDATA[PIC16F84A]]></category>

		<guid isPermaLink="false">http://waihung.net/?p=1419</guid>
		<description><![CDATA[Persistence of vision is a phenomenon where our eyes retain images for a fraction of a second. By taking advantage of this phenomenon, we can quickly project images by portions and the human eyes will still perceive it as a complete image. Persistence of vision or POV in short is commonly found in electronic projects and there are a multitude ...]]></description>
				<content:encoded><![CDATA[<p>Persistence of vision is a phenomenon where our eyes retain images for a fraction of a second. By taking advantage of this phenomenon, we can quickly project images by portions and the human eyes will still perceive it as a complete image.</p>
<p>Persistence of vision or POV in short is commonly found in electronic projects and there are a multitude of kits that you can buy out there.</p>
<p>The electronics club in my college wanted to make a hands-on lab for the juniors and my lecturer chose the POV project. He bought a kit as a sample and I had to reverse engineer it so that we can make the kit ourselves and save a whole lot of money.</p>
<p>Here&#8217;s the kit from Nixie Electronics.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/12/IMG_0558.jpg"><img class="alignnone  wp-image-1422" title="IMG_0558" src="http://waihung.net/wp-content/uploads/2012/12/IMG_0558-765x1024.jpg" alt="" width="459" height="614" /></a></p>
<p>And it costs a whopping RM 240 (or USD 80) !</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/12/IMG_0538.jpg"><img class="alignnone  wp-image-1426" title="IMG_0538" src="http://waihung.net/wp-content/uploads/2012/12/IMG_0538-1024x765.jpg" alt="" width="614" height="459" /></a></p>
<p>Why buy when we can make it ourselves <img src='http://waihung.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Let&#8217;s begin.</p>
<p>Using EAGLE, I draw out the schematics and also the PCB.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/12/pov_motor_sch.png"><img class="alignnone  wp-image-1429" title="pov_motor_sch" src="http://waihung.net/wp-content/uploads/2012/12/pov_motor_sch-1024x557.png" alt="" width="614" height="334" /></a></p>
<p><a href="http://waihung.net/wp-content/uploads/2012/12/sch_pov_mcu.png"><img class="alignnone  wp-image-1430" title="sch_pov_mcu" src="http://waihung.net/wp-content/uploads/2012/12/sch_pov_mcu-1024x483.png" alt="" width="614" height="290" /></a></p>
<p><a href="http://waihung.net/wp-content/uploads/2012/12/pov_eagle.png"><img class="alignnone  wp-image-1431" title="pov_eagle" src="http://waihung.net/wp-content/uploads/2012/12/pov_eagle-1024x576.png" alt="" width="614" height="346" /></a></p>
<p>I designed the PCB to fit in a standard 25cm by 15cm board. I can make two sets of PCB using one board.</p>
<p>Printed out the PCB layout on a transparency sheet and the fun begins!</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/12/IMG_0356.jpg"><img class="alignnone  wp-image-1432" title="IMG_0356" src="http://waihung.net/wp-content/uploads/2012/12/IMG_0356-1024x765.jpg" alt="" width="614" height="459" /></a></p>
<p>Exposing the UV board to fluorescent light for about 10 minutes. Used a heavy glass to press on the transparency sheet.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/12/IMG_0440.jpg"><img class="alignnone  wp-image-1434" title="IMG_0440" src="http://waihung.net/wp-content/uploads/2012/12/IMG_0440-1024x765.jpg" alt="" width="614" height="459" /></a></p>
<p>Because the board is quite big, I shifted the light source to the other side at around 5 minutes to ensure every part of the board gets an even exposure.</p>
<p>After exposure, the board is immersed in a sodium hydroxide solution to wash off the exposed photoresist layer.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/12/IMG_0449.jpg"><img class="alignnone  wp-image-1435" title="IMG_0449" src="http://waihung.net/wp-content/uploads/2012/12/IMG_0449-1024x765.jpg" alt="" width="614" height="459" /></a></p>
<p>Next, the board is immersed in a ferric chloride solution. Ferric chloride reacts with copper to form copper chloride. In other words, the copper on the board will dissolve in the ferric chloride solution but the photoresist layer that is covering all the tracks will protect the copper underneath from dissolving, thus resulting in copper tracks formed on the board.</p>
<p>Half way through the process. You can see the parts without the photoresist layer are being dissolved.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/12/IMG_0453.jpg"><img class="alignnone  wp-image-1436" title="IMG_0453" src="http://waihung.net/wp-content/uploads/2012/12/IMG_0453-1024x765.jpg" alt="" width="614" height="459" /></a></p>
<p>Do not dispose the ferric chloride solution by pouring it down the sink or drain! Find a proper chemical disposal service or at least just store it in a plastic bottle for the meantime.</p>
<p>The PCB in its&#8217; full glory after the etching process is complete.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/12/IMG_0460.jpg"><img class="alignnone  wp-image-1437" title="IMG_0460" src="http://waihung.net/wp-content/uploads/2012/12/IMG_0460-1024x765.jpg" alt="" width="614" height="459" /></a></p>
<p>Got myself a pretty nice handsaw to cut the PCB.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/12/IMG_0470.jpg"><img class="alignnone  wp-image-1438" title="IMG_0470" src="http://waihung.net/wp-content/uploads/2012/12/IMG_0470-1024x765.jpg" alt="" width="614" height="459" /></a></p>
<p>Stanley MiniHack, can be found in most hardware shops for around RM 10.<br />
Product link : <a href="http://goo.gl/7TU68" target="_blank">http://goo.gl/7TU68</a></p>
<p><a href="http://waihung.net/wp-content/uploads/2012/12/IMG_0463.jpg"><img class="alignnone  wp-image-1440" title="IMG_0463" src="http://waihung.net/wp-content/uploads/2012/12/IMG_0463-1024x765.jpg" alt="" width="614" height="459" /></a></p>
<p>Almost perfect cut.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/12/IMG_0465.jpg"><img class="alignnone  wp-image-1441" title="IMG_0465" src="http://waihung.net/wp-content/uploads/2012/12/IMG_0465-1024x765.jpg" alt="" width="614" height="459" /></a></p>
<p>Drilling holes for components to go through.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/12/IMG_0468.jpg"><img class="alignnone  wp-image-1442" title="IMG_0468" src="http://waihung.net/wp-content/uploads/2012/12/IMG_0468-1024x765.jpg" alt="" width="614" height="459" /></a></p>
<p>To mount the DC motor, I had to go get some screws from a specialised nuts and bolts store. Couldn&#8217;t find it at a regular hardware shop.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/12/IMG_0471.jpg"><img class="alignnone  wp-image-1443" title="IMG_0471" src="http://waihung.net/wp-content/uploads/2012/12/IMG_0471-1024x765.jpg" alt="" width="614" height="459" /></a></p>
<p>Fitting the DC motor on the PCB. Thank god I got the measurements correctly when drawing the PCB. All the screw holes lined up perfectly.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/12/IMG_0472.jpg"><img class="alignnone  wp-image-1444" title="IMG_0472" src="http://waihung.net/wp-content/uploads/2012/12/IMG_0472-1024x765.jpg" alt="" width="614" height="459" /></a></p>
<p>The board with all the components on.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/12/IMG_0474.jpg"><img class="alignnone  wp-image-1445" title="IMG_0474" src="http://waihung.net/wp-content/uploads/2012/12/IMG_0474-1024x765.jpg" alt="" width="614" height="459" /></a></p>
<p>The spinning PCB. I used blue super-bright LEDs instead of regular ones.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/12/IMG_0478.jpg"><img class="alignnone  wp-image-1446" title="IMG_0478" src="http://waihung.net/wp-content/uploads/2012/12/IMG_0478-1024x765.jpg" alt="" width="614" height="459" /></a></p>
<p><a href="http://waihung.net/wp-content/uploads/2012/12/IMG_0475.jpg"><img class="alignnone  wp-image-1447" title="IMG_0475" src="http://waihung.net/wp-content/uploads/2012/12/IMG_0475-1024x765.jpg" alt="" width="614" height="459" /></a></p>
<p><a href="http://waihung.net/wp-content/uploads/2012/12/IMG_0477.jpg"><img class="alignnone  wp-image-1448" title="IMG_0477" src="http://waihung.net/wp-content/uploads/2012/12/IMG_0477-1024x765.jpg" alt="" width="614" height="459" /></a></p>
<p>Testing the PCB.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/12/IMG_0481.jpg"><img class="alignnone  wp-image-1449" title="IMG_0481" src="http://waihung.net/wp-content/uploads/2012/12/IMG_0481-1024x765.jpg" alt="" width="614" height="459" /></a></p>
<p>Now comes the hard part. The issue now is getting power to the spinning board. Because the board will constantly spin, you can&#8217;t just solder jumper wires.</p>
<p>We have to make use of the rotating spindle of the motor to transfer the power because it moves together with the spinning board.</p>
<p>Noticed that I carried a track to one of the screws on the motor? That is ground. The body of the dc motor is actually electrically connected to the spindle.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/12/IMG_0472.jpg"><img class="alignnone  wp-image-1444" title="IMG_0472" src="http://waihung.net/wp-content/uploads/2012/12/IMG_0472-1024x765.jpg" alt="" width="614" height="459" /></a></p>
<p>So that is half the work done, what about 5V?</p>
<p>We can create another layer on the spindle by first insulating part of it. I devised my own way that is to use shrink wraps. Bought the smallest diameter available.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/12/IMG_0485.jpg"><img class="alignnone  wp-image-1450" title="IMG_0485" src="http://waihung.net/wp-content/uploads/2012/12/IMG_0485-1024x765.jpg" alt="" width="614" height="459" /></a></p>
<p>Cut it to about half of the spindle&#8217;s height and apply heat (use lighter or match stick). It will shrink to the size of the spindle nicely.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/12/IMG_0488.jpg"><img class="alignnone  wp-image-1452" title="IMG_0488" src="http://waihung.net/wp-content/uploads/2012/12/IMG_0488-1024x765.jpg" alt="" width="614" height="459" /></a></p>
<p>Wind an exposed copper wire around the shrink wrap.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/12/IMG_0497.jpg"><img class="alignnone  wp-image-1453" title="IMG_0497" src="http://waihung.net/wp-content/uploads/2012/12/IMG_0497-1024x765.jpg" alt="" width="614" height="459" /></a></p>
<p>To transfer 5V to the outer part of the spindle, let&#8217;s turn to the PCB first. There are two big square pads beside the motor. They are connected to 5V.</p>
<p>Now we need to solder something to the pads that will make a connection to the outer part of the spindle. Take note that the spindle must be free to move.</p>
<p>I sacrificed a pen and took out its&#8217; spring. Stretched it out and cut to the correct length.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/12/IMG_0502.jpg"><img class="alignnone  wp-image-1454" title="IMG_0502" src="http://waihung.net/wp-content/uploads/2012/12/IMG_0502-1024x765.jpg" alt="" width="614" height="459" /></a></p>
<p>The spring is actually made out of a wire that has elastic tension. We can make use of that to create a tension so that it is always in contact with the outer part of the spindle.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/12/IMG_0508.jpg"><img class="alignnone  wp-image-1455" title="IMG_0508" src="http://waihung.net/wp-content/uploads/2012/12/IMG_0508-1024x765.jpg" alt="" width="614" height="459" /></a></p>
<p>With that sorted out, we can proceed to mount the spinning board on the motor.</p>
<p>First, connect the ground to the inner part of the spindle. I used the wire connector (I wished I knew the proper name). See the picture below.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/12/IMG_0562.jpg"><img class="alignnone  wp-image-1474" title="IMG_0562" src="http://waihung.net/wp-content/uploads/2012/12/IMG_0562-1024x765.jpg" alt="" width="614" height="459" /></a></p>
<p>Took out the inner connector to use it to secure the ground wire to the spindle.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/12/IMG_0559.jpg"><img class="alignnone  wp-image-1475" title="IMG_0559" src="http://waihung.net/wp-content/uploads/2012/12/IMG_0559-1024x765.jpg" alt="" width="614" height="459" /></a></p>
<p>And the 5V connection to the outer part of the spindle. It will be quite a squeeze to get a soldering iron in between.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/12/IMG_0533.jpg"><img class="alignnone  wp-image-1457" title="IMG_0533" src="http://waihung.net/wp-content/uploads/2012/12/IMG_0533-1024x765.jpg" alt="" width="614" height="459" /></a></p>
<p>The last step is to drill holes for the mounting bracket. It is just a regular L bracket that can be found in all hardware shops.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/12/IMG_0509.jpg"><img class="alignnone  wp-image-1458" title="IMG_0509" src="http://waihung.net/wp-content/uploads/2012/12/IMG_0509-1024x765.jpg" alt="" width="614" height="459" /></a></p>
<p>Quite a tight fit, might need to change the PCB layout a bit in the next revision.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/12/IMG_0549.jpg"><img class="alignnone  wp-image-1459" title="IMG_0549" src="http://waihung.net/wp-content/uploads/2012/12/IMG_0549-1024x765.jpg" alt="" width="614" height="459" /></a></p>
<p>I haven&#8217;t figured out what to use for the base yet. Might need to use the mechanical lab to fabricate a heavy steel base for this. In the meantime, I just use a G clamp to secure it to a table.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/12/IMG_0529.jpg"><img class="alignnone  wp-image-1460" title="IMG_0529" src="http://waihung.net/wp-content/uploads/2012/12/IMG_0529-1024x765.jpg" alt="" width="614" height="459" /></a></p>
<p>Let it spin <img src='http://waihung.net/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p><a href="http://www.youtube.com/watch?v=3AlAlqrqlu4&#038;fmt=18">http://www.youtube.com/watch?v=3AlAlqrqlu4</a></p>
<p>This project utilizes a PIC16F84A to blink the LEDs to form the characters.</p>
<p>The code can be downloaded below.</p>
<p><a href="http://waihung.net/sketch/POV_PIC_code.rar" class="button_link hover_fade target_blank alignleft blue"><span>Download Code</span></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Thanks for reading.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://waihung.net/pov/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Arduino Tip : Built-in Pull-Up Resistors</title>
		<link>http://waihung.net/arduino-tip-built-in-pull-up-resistors/</link>
		<comments>http://waihung.net/arduino-tip-built-in-pull-up-resistors/#comments</comments>
		<pubDate>Sat, 17 Nov 2012 04:20:28 +0000</pubDate>
		<dc:creator>waihung</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[electronics]]></category>

		<guid isPermaLink="false">http://waihung.net/?p=1411</guid>
		<description><![CDATA[I&#8217;ve just found out a pretty awesome feature on the Arduino, or rather on all ATmega 328Ps. Below is a simple circuit that uses an ordinary push button to light up an LED. Normally I&#8217;ll need a pull-up resistor as shown in the red box, but with the built-in pull up resistors, I can totally remove that part and save ...]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve just found out a pretty awesome feature on the Arduino, or rather on all ATmega 328Ps.</p>
<p>Below is a simple circuit that uses an ordinary push button to light up an LED. Normally I&#8217;ll need a pull-up resistor as shown in the red box, but with the built-in pull up resistors, I can totally remove that part and save myself a resistor and some hassle when routing PCBs.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/11/pullup_sch.png"><img class="alignnone  wp-image-1412" title="pullup_sch" src="http://waihung.net/wp-content/uploads/2012/11/pullup_sch-1024x426.png" alt="" width="502" height="209" /></a></p>
<p>As an example, I&#8217;ll be using the sample sketch found in the Arduino IDE. It&#8217;s located under Examples -&gt; 02. Digital -&gt; Button.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/11/pullup_sketch.png"><img class="alignnone size-full wp-image-1413" title="pullup_sketch" src="http://waihung.net/wp-content/uploads/2012/11/pullup_sketch.png" alt="" width="514" height="693" /></a></p>
<p>The only difference was I added a line that enables the built-in pull up resistors.</p>
<p>digitalWrite(buttonPin, HIGH);</p>
<p>See the video below to see it in action :</p>
<p><a href="http://www.youtube.com/watch?v=cN-Av8_hT5Q&#038;fmt=18">http://www.youtube.com/watch?v=cN-Av8_hT5Q</a></p>
<p>The only downside is, it doesn&#8217;t have built-in pull down resistors.</p>
<p>This shouldn&#8217;t be too much of a problem because the normal practice in electronics will be to use pull-ups and detect LOW signals.</p>
]]></content:encoded>
			<wfw:commentRss>http://waihung.net/arduino-tip-built-in-pull-up-resistors/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Arduino Bluetooth LCD</title>
		<link>http://waihung.net/arduino-bluetooth-lcd/</link>
		<comments>http://waihung.net/arduino-bluetooth-lcd/#comments</comments>
		<pubDate>Fri, 14 Sep 2012 16:31:02 +0000</pubDate>
		<dc:creator>waihung</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[bluetooth]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[lcd]]></category>

		<guid isPermaLink="false">http://waihung.net/?p=1310</guid>
		<description><![CDATA[Did a simple test with the Bluetooth module, send a text from the computer and display it on an LCD. Useful for displaying messages wirelessly, something like the queue counter displays you see in banks. I used the same exact sample code from the Arduino IDE. You can find it in File -&#62; Examples -&#62; LiquidCrystal -&#62; SerialDisplay. Just connect ...]]></description>
				<content:encoded><![CDATA[<p>Did a simple test with the Bluetooth module, send a text from the computer and display it on an LCD. Useful for displaying messages wirelessly, something like the queue counter displays you see in banks.</p>
<p>I used the same exact sample code from the Arduino IDE. You can find it in File -&gt; Examples -&gt; LiquidCrystal -&gt; SerialDisplay.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/09/bt_lcd_code.png"><img class="alignnone size-full wp-image-1312" title="bt_lcd_code" src="http://waihung.net/wp-content/uploads/2012/09/bt_lcd_code.png" alt="" width="500" height="756" /></a></p>
<p>Just connect the TXD and RXD pins from the Bluetooth module to the Arduino. TXD to RXD and vice versa.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/08/IMG_0770.jpg"><img class="alignnone  wp-image-1249" title="IMG_0770" src="http://waihung.net/wp-content/uploads/2012/08/IMG_0770-1024x768.jpg" alt="" width="614" height="461" /></a></p>
<p>The circuit.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/09/IMG_1105.jpg"><img class="alignnone  wp-image-1313" title="IMG_1105" src="http://waihung.net/wp-content/uploads/2012/09/IMG_1105-1024x764.jpg" alt="" width="614" height="458" /></a></p>
<p>Here&#8217;s a video of me sending texts to the LCD from my computer through Bluetooth.</p>
<p><a href="http://www.youtube.com/watch?v=9MTBTpbgShM&#038;fmt=18">http://www.youtube.com/watch?v=9MTBTpbgShM</a></p>
]]></content:encoded>
			<wfw:commentRss>http://waihung.net/arduino-bluetooth-lcd/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Skylab SKM53 GPS Module</title>
		<link>http://waihung.net/skylab-skm53-gps-module/</link>
		<comments>http://waihung.net/skylab-skm53-gps-module/#comments</comments>
		<pubDate>Mon, 10 Sep 2012 10:21:23 +0000</pubDate>
		<dc:creator>waihung</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Reviews]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[gps]]></category>

		<guid isPermaLink="false">http://waihung.net/?p=1287</guid>
		<description><![CDATA[I got this GPS Module from ebay at just under RM 80. It&#8217;s not cheap but this is the cheapest solution to get GPS signal for any electronic projects. The module has a built-in GPS antenna and also the Skylab SKM53 chip. The moment when I tried to plug the module on a breadboard, I realised that the pitch of ...]]></description>
				<content:encoded><![CDATA[<p>I got this GPS Module from ebay at just under RM 80. It&#8217;s not cheap but this is the cheapest solution to get GPS signal for any electronic projects.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/09/IMG_1017.jpg"><img class="alignnone  wp-image-1290" title="IMG_1017" src="http://waihung.net/wp-content/uploads/2012/09/IMG_1017-1024x764.jpg" alt="" width="614" height="458" /></a></p>
<p>The module has a built-in GPS antenna and also the Skylab SKM53 chip.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/09/IMG_1018.jpg"><img class="alignnone  wp-image-1291" title="IMG_1018" src="http://waihung.net/wp-content/uploads/2012/09/IMG_1018-1024x764.jpg" alt="" width="614" height="458" /></a></p>
<p>The moment when I tried to plug the module on a breadboard, I realised that the pitch of the pins is not of regular size, its 2mm instead of the standard 2.54mm that we all get used to. Bummer. (Pitch is the distance between each pins, the standard distance is 0.1 inch which also translates to 2.54mm)</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/09/IMG_1022.jpg"><img class="alignnone  wp-image-1292" title="IMG_1022" src="http://waihung.net/wp-content/uploads/2012/09/IMG_1022-1024x764.jpg" alt="" width="614" height="458" /></a></p>
<p>I had to make a PCB that will convert it into the standard 2.54mm pitch.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/09/IMG_1030.jpg"><img class="alignnone  wp-image-1293" title="IMG_1030" src="http://waihung.net/wp-content/uploads/2012/09/IMG_1030-1024x764.jpg" alt="" width="614" height="458" /></a></p>
<p>Without a laser printer, I had to trace the PCB on a transparency sheet.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/09/IMG_1025.jpg"><img class="alignnone  wp-image-1294" title="IMG_1025" src="http://waihung.net/wp-content/uploads/2012/09/IMG_1025-1024x764.jpg" alt="" width="614" height="458" /></a></p>
<p>As usual, I&#8217;m using the photoresist method.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/09/IMG_1029.jpg"><img class="alignnone  wp-image-1295" title="IMG_1029" src="http://waihung.net/wp-content/uploads/2012/09/IMG_1029-1024x764.jpg" alt="" width="614" height="458" /></a></p>
<p>Applying some minor corrections before etching the board.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/09/IMG_1033.jpg"><img class="alignnone  wp-image-1296" title="IMG_1033" src="http://waihung.net/wp-content/uploads/2012/09/IMG_1033-1024x764.jpg" alt="" width="614" height="458" /></a></p>
<p>Had to draw some dots to guide my drilling process.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/09/IMG_1036.jpg"><img class="alignnone  wp-image-1297" title="IMG_1036" src="http://waihung.net/wp-content/uploads/2012/09/IMG_1036-1024x764.jpg" alt="" width="614" height="458" /></a></p>
<p>The final product.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/09/IMG_1071.jpg"><img class="alignnone  wp-image-1298" title="IMG_1071" src="http://waihung.net/wp-content/uploads/2012/09/IMG_1071-1024x764.jpg" alt="" width="614" height="458" /></a></p>
<p>I&#8217;ll admit that it&#8217;s not the best soldering work. Just wanted to get it up and running.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/09/IMG_1073.jpg"><img class="alignnone  wp-image-1299" title="IMG_1073" src="http://waihung.net/wp-content/uploads/2012/09/IMG_1073-1024x764.jpg" alt="" width="614" height="458" /></a></p>
<p>I modified a sketch that I found online to display the GPS data on an LCD.</p>
<p>The sketch requires two libraries :</p>
<p>1. SoftwareSerial (included in Arduino 1.0 and above)<br />
2. <a href="http://arduiniana.org/libraries/tinygps/" target="_blank">TinyGPS</a></p>
<p><a href="http://waihung.net/wp-content/uploads/2012/09/gps_arduino_sketch.png"><img class="alignnone size-full wp-image-1300" title="gps_arduino_sketch" src="http://waihung.net/wp-content/uploads/2012/09/gps_arduino_sketch.png" alt="" width="500" height="674" /></a></p>
<p><a href="http://waihung.net/sketch/gps.ino" class="button_link hover_fade medium_button blue"><span>Download Sketch</span></a></p>
<p><a href="http://waihung.net/wp-content/uploads/2012/09/IMG_1094.jpg"><img class="alignnone  wp-image-1304" title="IMG_1094" src="http://waihung.net/wp-content/uploads/2012/09/IMG_1094-1024x764.jpg" alt="" width="614" height="458" /></a></p>
<p>The GPS module takes around a minute to get a lock on the location. The LCD will then display the latitude and longtitude of the current location.</p>
<p>To find out where the corresponding latitude and longtitude is, you can enter it into the search bar of <a href="http://maps.google.com" target="_blank">http://maps.google.com</a> in the form of latitude,longtitude.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/09/google_maps_gps.png"><img class="alignnone  wp-image-1305" title="google_maps_gps" src="http://waihung.net/wp-content/uploads/2012/09/google_maps_gps.png" alt="" width="679" height="567" /></a></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://waihung.net/skylab-skm53-gps-module/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>RadioShack in Malaysia !</title>
		<link>http://waihung.net/radioshack-in-malaysia/</link>
		<comments>http://waihung.net/radioshack-in-malaysia/#comments</comments>
		<pubDate>Wed, 05 Sep 2012 11:17:54 +0000</pubDate>
		<dc:creator>waihung</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[electronics]]></category>

		<guid isPermaLink="false">http://waihung.net/?p=1265</guid>
		<description><![CDATA[The RadioShack name might not be familiar to some of you, but if you&#8217;ve read through electronic websites, you would probably notice that the people over at the US often get their electronic hardware supplies from RadioShack. RadioShack is an American electronic supplies store and their outlets over in the US are huge. I was hoping for the same thing ...]]></description>
				<content:encoded><![CDATA[<p>The RadioShack name might not be familiar to some of you, but if you&#8217;ve read through electronic websites, you would probably notice that the people over at the US often get their electronic hardware supplies from RadioShack. RadioShack is an American electronic supplies store and their outlets over in the US are huge. I was hoping for the same thing here when they announced that a new store will be opening here in Mid Valley Megamall, Kuala Lumpur.</p>
<p>I found the shop at Lot S-084 on the Second Floor.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/09/IMG_1042.jpg"><img class="alignnone  wp-image-1266" title="IMG_1042" src="http://waihung.net/wp-content/uploads/2012/09/IMG_1042-1024x764.jpg" alt="" width="614" height="458" /></a></p>
<p>I was hoping it to be as big as Ace Hardware in Mid Valley.</p>
<p>The first thing I stumbled across is the Arduino shelve. Finally, a proper retail store selling Arduinos, no worries about warranty issues, online purhase and postage. I asked the salesperson and they confirmed that the Arduinos do come with a 1 year warranty.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/09/IMG_1043.jpg"><img class="alignnone  wp-image-1267" title="IMG_1043" src="http://waihung.net/wp-content/uploads/2012/09/IMG_1043-1024x764.jpg" alt="" width="614" height="458" /></a></p>
<p>Looking close, the prices are quite steep, though they come in retail boxes and there might be some goodies in it (I&#8217;m not really sure though).</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/09/IMG_1044.jpg"><img class="alignnone  wp-image-1268" title="IMG_1044" src="http://waihung.net/wp-content/uploads/2012/09/IMG_1044-1024x764.jpg" alt="" width="614" height="458" /></a></p>
<p>Arduino Uno R3 for RM 139.90. I got it for around RM 100 online from an official distributor.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/09/IMG_1045.jpg"><img class="alignnone  wp-image-1269" title="IMG_1045" src="http://waihung.net/wp-content/uploads/2012/09/IMG_1045-1024x764.jpg" alt="" width="614" height="458" /></a></p>
<p>Proto Shield for RM 69.90. Honestly I think it should be a bit cheaper since the shield doesn&#8217;t really contain any electronic components, apart from an LED.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/09/IMG_1046.jpg"><img class="alignnone  wp-image-1270" title="IMG_1046" src="http://waihung.net/wp-content/uploads/2012/09/IMG_1046-1024x764.jpg" alt="" width="614" height="458" /></a></p>
<p>Below the Arduino shelve, I can see some unique stuff that we don&#8217;t get to buy over here previously.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/09/IMG_1047.jpg"><img class="alignnone  wp-image-1271" title="IMG_1047" src="http://waihung.net/wp-content/uploads/2012/09/IMG_1047-1024x764.jpg" alt="" width="614" height="458" /></a></p>
<p>Kits from Make magazine. Check out the price for the Ultimate Microcontroller Pack.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/09/IMG_1049.jpg"><img class="alignnone  wp-image-1272" title="IMG_1049" src="http://waihung.net/wp-content/uploads/2012/09/IMG_1049-1024x764.jpg" alt="" width="614" height="458" /></a></p>
<p>My favourite thing about the RadioShack store is their electronic components rack. It looks like those racks they use in car workshops. Everything is clearly labelled.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/09/IMG_1050.jpg"><img class="alignnone  wp-image-1273" title="IMG_1050" src="http://waihung.net/wp-content/uploads/2012/09/IMG_1050-764x1024.jpg" alt="" width="458" height="614" /></a></p>
<p>Another rack.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/09/IMG_1054.jpg"><img class="alignnone  wp-image-1274" title="IMG_1054" src="http://waihung.net/wp-content/uploads/2012/09/IMG_1054-764x1024.jpg" alt="" width="458" height="614" /></a></p>
<p>RadioShack branded multimeters. Prices are quite reasonable, considering that RadioShack stuffs have a considerable amount of quality.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/09/IMG_1053.jpg"><img class="alignnone  wp-image-1275" title="IMG_1053" src="http://waihung.net/wp-content/uploads/2012/09/IMG_1053-1024x764.jpg" alt="" width="614" height="458" /></a></p>
<p><a href="http://waihung.net/wp-content/uploads/2012/09/IMG_1055.jpg"><img class="alignnone  wp-image-1276" title="IMG_1055" src="http://waihung.net/wp-content/uploads/2012/09/IMG_1055-764x1024.jpg" alt="" width="458" height="614" /></a></p>
<p>And I found something, I watch the EEVblog on YouTube and he reviewed many multimeters and found out that the best one for under USD 100 is the Extech one. Nice to see that it&#8217;s now available at a retail store.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/09/IMG_1056.jpg"><img class="alignnone  wp-image-1277" title="IMG_1056" src="http://waihung.net/wp-content/uploads/2012/09/IMG_1056-764x1024.jpg" alt="" width="458" height="614" /></a></p>
<p>Finally, some electronic kits and sensors.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/09/IMG_1057.jpg"><img class="alignnone  wp-image-1278" title="IMG_1057" src="http://waihung.net/wp-content/uploads/2012/09/IMG_1057-764x1024.jpg" alt="" width="458" height="614" /></a></p>
<p><a href="http://waihung.net/wp-content/uploads/2012/09/IMG_1059.jpg"><img class="alignnone  wp-image-1279" title="IMG_1059" src="http://waihung.net/wp-content/uploads/2012/09/IMG_1059-1024x764.jpg" alt="" width="614" height="458" /></a></p>
<p><a href="http://waihung.net/wp-content/uploads/2012/09/IMG_1060.jpg"><img class="alignnone  wp-image-1280" title="IMG_1060" src="http://waihung.net/wp-content/uploads/2012/09/IMG_1060-1024x764.jpg" alt="" width="614" height="458" /></a></p>
<p>Overall, there are not many actual RadioShack stuff in the store, almost half of it are things that are already available over here. They sell thumb drives, wireless routers, handphone cases, audio/video cables and basic hardware tools. Only half of the things in the store would catch the attention of electronic enthusiasts.</p>
<p>I wish that they would bring over more stuffs that are available in the US. Having said that, it&#8217;s still nice to see some rare items on sale and I hope that the RadioShack name will stay in Malaysia for some time. (Info : This is not the first time RadioShack set its&#8217; foot in Malaysia, they have stores in Bangsar back in the 90s but it didn&#8217;t caught on.)</p>
<p>If you&#8217;ve got time do drop by and check them out <img src='http://waihung.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://waihung.net/radioshack-in-malaysia/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Arduino Bluetooth</title>
		<link>http://waihung.net/arduino-bluetooth/</link>
		<comments>http://waihung.net/arduino-bluetooth/#comments</comments>
		<pubDate>Thu, 30 Aug 2012 15:36:32 +0000</pubDate>
		<dc:creator>waihung</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[bluetooth]]></category>
		<category><![CDATA[electronics]]></category>

		<guid isPermaLink="false">http://waihung.net/?p=1243</guid>
		<description><![CDATA[I bought a bluetooth to serial module from dealextreme.com, it allows wireless bluetooth communication between an Arduino and a bluetooth capable device such as a computer or a smartphone. I don&#8217;t have the luxury of owning a smartphone so I&#8217;ll just be using my computer. The price is USD 8.60 which translates to around RM 27. Dealextreme provides free shipping ...]]></description>
				<content:encoded><![CDATA[<p>I bought a bluetooth to serial module from dealextreme.com, it allows wireless bluetooth communication between an Arduino and a bluetooth capable device such as a computer or a smartphone. I don&#8217;t have the luxury of owning a smartphone so I&#8217;ll just be using my computer.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/08/jymcu_dx.jpg"><img class="alignnone  wp-image-1262" title="jymcu_dx" alt="" src="http://waihung.net/wp-content/uploads/2012/08/jymcu_dx.jpg" width="596" height="458" /></a></p>
<p>The price is USD 8.60 which translates to around RM 27. Dealextreme provides free shipping too but the only downside is it&#8217;ll take two weeks. From my research, this is the cheapest way to get wireless communication to an Arduino. Other solutions will easily cost more than RM 100.</p>
<p>Received it exactly two weeks in my mail, comes with a female-to-female jumper cable just in case if the user decides to place the bluetooth module away from the Arduino.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/08/IMG_0768.jpg"><img class="alignnone  wp-image-1247" title="IMG_0768" alt="" src="http://waihung.net/wp-content/uploads/2012/08/IMG_0768-1024x768.jpg" width="614" height="461" /></a></p>
<p>Close-up shots.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/08/IMG_0769.jpg"><img class="alignnone  wp-image-1248" title="IMG_0769" alt="" src="http://waihung.net/wp-content/uploads/2012/08/IMG_0769-1024x768.jpg" width="614" height="461" /></a></p>
<p><a href="http://waihung.net/wp-content/uploads/2012/08/IMG_0770.jpg"><img class="alignnone  wp-image-1249" title="IMG_0770" alt="" src="http://waihung.net/wp-content/uploads/2012/08/IMG_0770-1024x768.jpg" width="614" height="461" /></a></p>
<p>From the picture above, there&#8217;s only four pins to be connected. Vcc, GND, RXD and TXD. Vcc can be anywhere between +3.6 to +6V as stated and GND is connected to.. ground.</p>
<p>The RXD pin will be connected to the Arduino&#8217;s TX pin, which is Digital Pin 1 and the TXD pin will be connected to the RX pin, which is the Digital Pin 0.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/08/arduino_rx_tx.jpg"><img class="alignnone  wp-image-1250" title="arduino_rx_tx" alt="" src="http://waihung.net/wp-content/uploads/2012/08/arduino_rx_tx.jpg" width="614" height="425" /></a></p>
<p>Pretty simple logic, the Bluetooth module RXD pin receives signals which are transmitted by the Arduino&#8217;s TX pin and vice versa.</p>
<p>I&#8217;ve decided to go the lazy way by connecting the module straight on a breadboard.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/08/IMG_0773.jpg"><img class="alignnone  wp-image-1251" title="IMG_0773" alt="" src="http://waihung.net/wp-content/uploads/2012/08/IMG_0773-1024x768.jpg" width="614" height="461" /></a></p>
<p>I&#8217;ve also included an LED on Digital Pin 13.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/08/IMG_0775.jpg"><img class="alignnone  wp-image-1252" title="IMG_0775" alt="" src="http://waihung.net/wp-content/uploads/2012/08/IMG_0775-1024x768.jpg" width="614" height="461" /></a></p>
<p>Because my computer didn&#8217;t have a built-in Bluetooth module, I have to get a Bluetooth USB adapter.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/08/IMG_0772.jpg"><img class="alignnone  wp-image-1253" title="IMG_0772" alt="" src="http://waihung.net/wp-content/uploads/2012/08/IMG_0772-1024x768.jpg" width="614" height="461" /></a></p>
<p>To test out the Bluetooth module, I wrote a simple code which will toggle an LED on or off according to the instructions sent from the computer. Sending a &#8217;1&#8242; will toggle the LED on or off. Other characters are not accepted.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/08/code.png"><img class="alignnone size-full wp-image-1254" title="code" alt="" src="http://waihung.net/wp-content/uploads/2012/08/code.png" width="500" height="628" /></a></p>
<p>Here&#8217;s a demonstration video <img src='http://waihung.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href="http://www.youtube.com/watch?v=B7pcEL8Wcmg&#038;fmt=18">http://www.youtube.com/watch?v=B7pcEL8Wcmg</a></p>
<p><a href="http://waihung.net/sketch/serial_toggle_led.ino" class="button_link hover_fade target_blank"><span>Download Code</span></a></p>
]]></content:encoded>
			<wfw:commentRss>http://waihung.net/arduino-bluetooth/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Digital Alarm Clock</title>
		<link>http://waihung.net/digital-alarm-clock/</link>
		<comments>http://waihung.net/digital-alarm-clock/#comments</comments>
		<pubDate>Sat, 28 Jul 2012 15:34:02 +0000</pubDate>
		<dc:creator>waihung</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Reviews]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[DS1307]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[PCF8574A]]></category>

		<guid isPermaLink="false">http://waihung.net/?p=1149</guid>
		<description><![CDATA[I&#8217;ve decided to make a Digital Alarm Clock for my diploma final year project. Before I start this post, here&#8217;s a video about it http://www.youtube.com/watch?v=O5yD_u8CIEI &#160; The Hardware &#160; Features &#160; The Making of the Digital Alarm Clock This Digital Alarm Clock project started its&#8217; life on a breadboard, and with a brand new ATmega328P MCU bought from Cytron. Together ...]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve decided to make a Digital Alarm Clock for my diploma final year project. Before I start this post, here&#8217;s a video about it <img src='http://waihung.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href="http://www.youtube.com/watch?v=O5yD_u8CIEI&#038;fmt=18">http://www.youtube.com/watch?v=O5yD_u8CIEI</a></p>
<p>&nbsp;</p>
<h3>The Hardware</h3>
<ul class="fancy_list">
<li class="arrow_list">Atmel ATmega328P Microcontroller with 32kB Program Memory and running at 16MHz</li>
<li class="arrow_list">Philips PCF8574A IO Port Expander</li>
<li class="arrow_list">Maxim DS1307 Real-Time Clock</li>
<li class="arrow_list">16&#215;2 HD44780 Monochrome LCD with Blue Backlight</li>
<li class="arrow_list">UM66 Melody IC</li>
<li class="arrow_list">4&#215;3 Numerical Keypad</li>
<li class="arrow_list">LM7805 Voltage Regulator</li>
</ul>
<p>&nbsp;</p>
<h3>Features</h3>
<ul class="fancy_list">
<li class="arrow_list blue_sprite">Display Time in 12-Hour AM/PM Format</li>
<li class="arrow_list blue_sprite">Display Date in dd/mm/yyyy Format</li>
<li class="arrow_list blue_sprite">Display Day</li>
<li class="arrow_list blue_sprite">Set Alarm Time</li>
<li class="arrow_list blue_sprite">Set Date</li>
<li class="arrow_list blue_sprite">Set Time</li>
<li class="arrow_list blue_sprite">Menu Based Navigation System</li>
<li class="arrow_list blue_sprite">Anti-Sleepiness Alarm Function</li>
<li class="arrow_list blue_sprite">Auto Generated Day Function</li>
</ul>
<p>&nbsp;</p>
<h3>The Making of the Digital Alarm Clock</h3>
<p>This Digital Alarm Clock project started its&#8217; life on a breadboard, and with a brand new ATmega328P MCU bought from Cytron.</p>
<p>Together with the Microcontroller, I bought the UC00B USB to Serial adapter to program the MCU using the Arduino IDE.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/05/IMG_0105.jpg"><img class="alignnone  wp-image-1105" title="IMG_0105" src="http://waihung.net/wp-content/uploads/2012/05/IMG_0105-1024x764.jpg" alt="" width="614" height="458" /></a></p>
<p>To make it work on the Arduino platform, the microcontroller must have the appropriate bootloader. There are many ways to burn the bootloader but I settled on the ArduinoISP method (using my Arduino Uno R3).</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/07/IMG_0351.jpg"><img class="alignnone  wp-image-1193" title="IMG_0351" src="http://waihung.net/wp-content/uploads/2012/07/IMG_0351-1024x764.jpg" alt="" width="614" height="458" /></a></p>
<p>I made a video on the bootloader burning process.</p>
<p><a href="http://www.youtube.com/watch?v=NsGTJKQIEsM&#038;fmt=18">http://www.youtube.com/watch?v=NsGTJKQIEsM</a></p>
<p>After successfully burning the bootloader, I can now use the Cytron UC00B USB to Serial adapter to upload code into the MCU.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/07/IMG_0354.jpg"><img class="alignnone  wp-image-1194" title="IMG_0354" src="http://waihung.net/wp-content/uploads/2012/07/IMG_0354-1024x764.jpg" alt="" width="614" height="458" /></a></p>
<p>With the basic Arduino circuit done, I can start the programming and also assembling other hardware components.</p>
<p>To read more on how to make your own Arduino on a breadboard, read this <a title="Making Your Own Arduino Part 1 (Burning Bootloader)" href="http://waihung.net/making-your-own-arduino-part-1-burning-bootloader/" target="_blank">post </a> <img src='http://waihung.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Next, I made some special push buttons so that the user can identify its&#8217; function more easily.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/07/IMG_0456.jpg"><img class="alignnone  wp-image-1198" title="IMG_0456" src="http://waihung.net/wp-content/uploads/2012/07/IMG_0456-1024x764.jpg" alt="" width="614" height="458" /></a></p>
<p>Here&#8217;s how I assembled these push buttons.</p>
<p><a href="http://www.youtube.com/watch?v=tFRikvcH5B0&#038;fmt=18">http://www.youtube.com/watch?v=tFRikvcH5B0</a></p>
<p>I ended up using 4 breadboards to completely construct the prototype circuit.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/07/IMG_0458.jpg"><img class="alignnone  wp-image-1200" title="IMG_0458" src="http://waihung.net/wp-content/uploads/2012/07/IMG_0458-1024x764.jpg" alt="" width="614" height="458" /></a></p>
<p>&nbsp;</p>
<h3>Writing the Code</h3>
<p>First and foremost, I should mention and give credit to a few libraries that I&#8217;ve had to use in my code.</p>
<ul class="fancy_list">
<li class="bullet_list orange_sprite">Wire by Arduino (<a href="http://arduino.cc/en/Reference/Wire" target="_blank">Source</a>) : Establish I2C connection to/from the PCF8574A and DS1307</li>
<li class="bullet_list orange_sprite">LiquidCrystal by Arduino (<a href="http://arduino.cc/playground/Main/LiquidCrystal" target="_blank">Source</a>) : Interface with the HD44780 LCD</li>
<li class="bullet_list orange_sprite">I2CKeypad by Angel Sancho (<a href="http://arduino.cc/playground/Main/I2CPortExpanderAndKeypads" target="_blank">Source</a>) : Interface with the 4&#215;3 Keypad through the PCF8574A</li>
<li class="bullet_list orange_sprite">TrueRandom by Peter Knight (<a href="http://code.google.com/p/tinkerit/wiki/TrueRandom" target="_blank">Source</a>) : Generate true random numbers for the random math question</li>
</ul>
<p>Other than the libraries mention above, the code is solely written by yours truly.</p>
<p>It is 1,029 lines long, and takes up around 16kB of program memory. It took me close to 50 hours to come up with this.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/07/digital_clock_code.png"><img class="alignnone size-full wp-image-1204" title="digital_clock_code" src="http://waihung.net/wp-content/uploads/2012/07/digital_clock_code.png" alt="" width="500" height="600" /></a></p>
<p>My initial idea of using an ATmega16 to cut cost was scrapped because this code and the bootloader takes up around 18kB of  program memory, which is more than the 16kB capacity of the ATmega16.</p>
<p>&nbsp;</p>
<h3>Designing the Schematic and PCB in Eagle 6.2.0</h3>
<p>I chose to use the Eagle software to design the schematic and PCB because the library is huge and it&#8217;s simple to use (IMHO).</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/07/eagle_digital_clock_1.png"><img class="alignnone  wp-image-1205" title="eagle_digital_clock_1" src="http://waihung.net/wp-content/uploads/2012/07/eagle_digital_clock_1-1024x576.png" alt="" width="516" height="290" /></a></p>
<p>This is the final revision of the schematic :</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/07/digital_alarm_clock_sch.png"><img class="alignnone  wp-image-1206" title="digital_alarm_clock_sch" src="http://waihung.net/wp-content/uploads/2012/07/digital_alarm_clock_sch-1024x668.png" alt="" width="614" height="401" /></a></p>
<p>Initially, I plan to make a dual layer PCB but because of time constraint, I had to settle for a single layer PCB.</p>
<p>This is the final revision of my PCB.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/07/pcb_top.png"><img class="alignnone  wp-image-1207" title="pcb_top" src="http://waihung.net/wp-content/uploads/2012/07/pcb_top-1024x616.png" alt="" width="614" height="370" /></a></p>
<p><a href="http://waihung.net/wp-content/uploads/2012/07/pcb_bottom.png"><img class="alignnone  wp-image-1208" title="pcb_bottom" src="http://waihung.net/wp-content/uploads/2012/07/pcb_bottom-1024x616.png" alt="" width="614" height="370" /></a></p>
<p>I&#8217;ll admit that I used autoroute, and it&#8217;s not that smart, so I had to give it a bigger workspace to work on. Thus I&#8217;m using a 25cm by 15cm PCB.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/07/IMG_0746.jpg"><img class="alignnone  wp-image-1212" title="IMG_0746" src="http://waihung.net/wp-content/uploads/2012/07/IMG_0746-764x1024.jpg" alt="" width="458" height="614" /></a></p>
<p>Printed the PCB layout on a transparency sheet to mask the PCB from UV exposure.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/07/IMG_0745.jpg"><img class="alignnone  wp-image-1211" title="IMG_0745" src="http://waihung.net/wp-content/uploads/2012/07/IMG_0745-764x1024.jpg" alt="" width="458" height="614" /></a></p>
<p>I&#8217;ve wrote a post before this on how to make your own PCB. You can read them <a title="Home Made PCB – Etching Photo Resist Layer (Part 1)" href="http://waihung.net/home-made-pcb-etching-photo-resist-layer/" target="_blank">here</a> <img src='http://waihung.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>The end result.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/07/pcb_uv_layer.jpg"><img class="alignnone  wp-image-1213" title="pcb_uv_layer" src="http://waihung.net/wp-content/uploads/2012/07/pcb_uv_layer.jpg" alt="" width="577" height="432" /></a></p>
<p><a href="http://waihung.net/wp-content/uploads/2012/07/IMG_0665.jpg"><img class="alignnone  wp-image-1214" title="IMG_0665" src="http://waihung.net/wp-content/uploads/2012/07/IMG_0665-1024x764.jpg" alt="" width="614" height="458" /></a></p>
<p>&nbsp;</p>
<h3>Tour of the Board</h3>
<p><a href="http://waihung.net/wp-content/uploads/2012/07/IMG_0671.jpg"><img class="alignnone  wp-image-1217" title="IMG_0671" src="http://waihung.net/wp-content/uploads/2012/07/IMG_0671-1024x764.jpg" alt="" width="614" height="458" /></a></p>
<p>At the centre of the board is where all the magic happens, ATmega328P MCU, DS1307 Real-Time Clock and the PCF8574A IO Port Expander.</p>
<p>There is also a backup battery for the DS1307 Real-Time Clock IC. Even if the power runs out, the &#8216;clock&#8217; will still continue to tick.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/07/IMG_07141.jpg"><img class="alignnone  wp-image-1218" title="IMG_07141" src="http://waihung.net/wp-content/uploads/2012/07/IMG_07141-1024x768.jpg" alt="" width="614" height="461" /></a></p>
<p>The 6 Buttons. Menu, Back, Forward, Cancel, OK and Alarm ON/OFF.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/07/IMG_0734.jpg"><img class="alignnone  wp-image-1227" title="IMG_0734" src="http://waihung.net/wp-content/uploads/2012/07/IMG_0734-1024x768.jpg" alt="" width="614" height="461" /></a></p>
<p>At the bottom left is the 4&#215;3 Numerical Keypad for user input. It is used for setting the time, date and also answering the math question.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/07/IMG_0716.jpg"><img class="alignnone  wp-image-1219" title="IMG_0716" src="http://waihung.net/wp-content/uploads/2012/07/IMG_0716-1024x768.jpg" alt="" width="614" height="461" /></a></p>
<p>At the top left are the buzzer, the UM66 Melody IC, and a 10k potentiometer to adjust the LCD Contrast.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/07/IMG_0721.jpg"><img class="alignnone  wp-image-1221" title="IMG_0721" src="http://waihung.net/wp-content/uploads/2012/07/IMG_0721-1024x768.jpg" alt="" width="614" height="461" /></a></p>
<p>Lastly, at the left hand side of the board is the programmer port, where I can plug in the UC00B USB to Serial adapter to upload a new code into the ATmega328P.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/07/IMG_0674.jpg"><img class="alignnone  wp-image-1222" title="IMG_0674" src="http://waihung.net/wp-content/uploads/2012/07/IMG_0674-1024x764.jpg" alt="" width="614" height="458" /></a></p>
<p>&nbsp;</p>
<h3>Features</h3>
<h4>Menu-Based Navigation System</h4>
<p>The user can press the Back and Forward button to scroll through the Menu. To select the desired function, press Enter.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/07/menu_sys.jpg"><img class="alignnone  wp-image-1224" title="menu_sys" src="http://waihung.net/wp-content/uploads/2012/07/menu_sys-1024x612.jpg" alt="" width="614" height="367" /></a></p>
<h4>Anti-Sleepiness Alarm Function</h4>
<p>To turn off the Alarm, the user has to answer a simple math question. The alarm will not turn off until a correct answer has been entered. The question is generated randomly everytime the alarm rings.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/07/2.jpg"><img class="alignnone  wp-image-1228" title="2" src="http://waihung.net/wp-content/uploads/2012/07/2.jpg" alt="" width="593" height="343" /></a></p>
<h4>Auto Generated Day Function</h4>
<p>To set the date, the user doesn&#8217;t have to enter the Day. The code has an algorithm that will determine the correct Day that corresponds to the date entered.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/07/auto_day.jpg"><img class="alignnone  wp-image-1229" title="auto_day" src="http://waihung.net/wp-content/uploads/2012/07/auto_day-1024x311.jpg" alt="" width="614" height="187" /></a></p>
<p>&nbsp;</p>
<h3>Project Costing</h3>
<p>Below is a list of all the components that are used in this project and also their cost. So much money!</p>
<p>The total cost shown below does not even reflect the true amount of money I spent, there are things like troubleshooting cost, buying new components to try out, soldering cost, flux, damaged components, etc.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/07/digital_alarm_clock_cost.png"><img class="alignnone size-full wp-image-1232" title="digital_alarm_clock_cost" src="http://waihung.net/wp-content/uploads/2012/07/digital_alarm_clock_cost.png" alt="" width="385" height="637" /></a></p>
<p>&nbsp;</p>
<p>Looking aside the cost, I&#8217;m thankful that I&#8217;m able to complete this project and I did learn alot from it.</p>
<p>I hope you&#8217;ve enjoyed reading this post as much as I&#8217;ve did during the making of this project.</p>
<p>Thank you <img src='http://waihung.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://waihung.net/digital-alarm-clock/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>BBFuino from Cytron</title>
		<link>http://waihung.net/bbfuino-from-cytron/</link>
		<comments>http://waihung.net/bbfuino-from-cytron/#comments</comments>
		<pubDate>Wed, 11 Jul 2012 15:44:13 +0000</pubDate>
		<dc:creator>waihung</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Reviews]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[electronics]]></category>

		<guid isPermaLink="false">http://waihung.net/?p=1133</guid>
		<description><![CDATA[BBFuino is a breadboard-friendly Arduino created by the guys over at Cytron Technologies (cytron.com.my) It is sold for RM 55 but I managed to grab it for only RM 1 cent! Thanks to their 1 cent promotion I managed to get other amazing stuffs as well. Back to the BBFuino. The BBFuino is not a complete Arduino in the sense ...]]></description>
				<content:encoded><![CDATA[<p>BBFuino is a breadboard-friendly Arduino created by the guys over at Cytron Technologies (<a href="http://www.cytron.com.my" target="_blank">cytron.com.my</a>)</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/07/IMG_0639.jpg"><img class="alignnone  wp-image-1145" title="IMG_0639" src="http://waihung.net/wp-content/uploads/2012/07/IMG_0639-1024x764.jpg" alt="" width="717" height="535" /></a></p>
<p><a href="http://waihung.net/wp-content/uploads/2012/07/IMG_0642.jpg"><img class="alignnone  wp-image-1146" title="IMG_0642" src="http://waihung.net/wp-content/uploads/2012/07/IMG_0642-1024x764.jpg" alt="" width="717" height="535" /></a></p>
<p><a href="http://waihung.net/wp-content/uploads/2012/07/IMG_0638.jpg"><img class="alignnone  wp-image-1147" title="IMG_0638" src="http://waihung.net/wp-content/uploads/2012/07/IMG_0638-1024x764.jpg" alt="" width="717" height="535" /></a></p>
<p>It is sold for RM 55 but I managed to grab it for only RM 1 cent! Thanks to their 1 cent promotion <img src='http://waihung.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href="http://waihung.net/wp-content/uploads/2012/07/cytron_1cent_order_1.jpg"><img class="alignnone  wp-image-1135" title="cytron_1cent_order_1" src="http://waihung.net/wp-content/uploads/2012/07/cytron_1cent_order_1.jpg" alt="" width="662" height="672" /></a></p>
<p>I managed to get other amazing stuffs as well. Back to the BBFuino.</p>
<p>The BBFuino is not a complete Arduino in the sense that it needs an external USB to Serial adapter. In their website, they stated that it works with their UC00A or UC00B. I only bought the UC00B because it&#8217;s cheaper. However, in the User&#8217;s Manual, they did not mention how to connect the UC00B to the BBFuino.</p>
<p>The UC00B.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/05/IMG_0157.jpg"><img class="alignnone  wp-image-1121" title="IMG_0157" src="http://waihung.net/wp-content/uploads/2012/05/IMG_0157-1024x764.jpg" alt="" width="430" height="321" /></a></p>
<p>Here&#8217;s my hand-drawn schematic <img src='http://waihung.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href="http://waihung.net/wp-content/uploads/2012/07/bbfuino_sch.png"><img class="alignnone  wp-image-1139" title="bbfuino_sch" src="http://waihung.net/wp-content/uploads/2012/07/bbfuino_sch.png" alt="" width="663" height="479" /></a></p>
<p>I did not have a female to female jumper in hand so had to resort to this.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/07/IMG_0630.jpg"><img class="alignnone  wp-image-1140" title="IMG_0630" src="http://waihung.net/wp-content/uploads/2012/07/IMG_0630-1024x764.jpg" alt="" width="717" height="535" /></a></p>
<p>Here&#8217;s a video on uploading a simple blink sketch to the BBFuino.</p>
<div class='video_frame'><iframe id='youtube_video_1' class='youtube_video' style='height:360px;width:640px' src='http://www.youtube.com/embed/QUMSOZuTANk?autohide=2&amp;autoplay=0&amp;controls=1&amp;disablekb=0&amp;fs=0&amp;hd=0&amp;loop=0&amp;rel=0&amp;showinfo=1&amp;showsearch=1&amp;wmode=transparent&amp;enablejsapi=1' width='640' height='360' frameborder='0'></iframe></div>
<p>Next post will be mounting an 8&#215;2 LCD on the BBFuino <img src='http://waihung.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://waihung.net/bbfuino-from-cytron/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Making Your Own Arduino Part 2 (Arduino on Breadboard)</title>
		<link>http://waihung.net/making-your-own-arduino-part-2-arduino-on-breadboard/</link>
		<comments>http://waihung.net/making-your-own-arduino-part-2-arduino-on-breadboard/#comments</comments>
		<pubDate>Sat, 26 May 2012 17:01:41 +0000</pubDate>
		<dc:creator>waihung</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[electronics]]></category>

		<guid isPermaLink="false">http://waihung.net/?p=1118</guid>
		<description><![CDATA[This post is a follow up of Part 1. Read it here if you have not done so. Now I will address one of the issues of making your own Arduino. On the Uno boards, there&#8217;s an IC which is responsible as a USB to serial converter and it makes it possible to program the Arduino and also communicate with it ...]]></description>
				<content:encoded><![CDATA[<p>This post is a follow up of Part 1. Read it <a title="Making Your Own Arduino Part 1 (Burning Bootloader)" href="http://waihung.net/making-your-own-arduino-part-1-burning-bootloader/" target="_blank">here</a> if you have not done so.</p>
<p>Now I will address one of the issues of making your own Arduino. On the Uno boards, there&#8217;s an IC which is responsible as a USB to serial converter and it makes it possible to program the Arduino and also communicate with it from the computer. The problem here is the IC is an SMD (Surface Mounted Device). The R3 uses an ATmega 16U2 while the older revisions uses the 8U2.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/05/atmega16u2.jpg"><img class="alignnone  wp-image-1119" title="atmega16u2" src="http://waihung.net/wp-content/uploads/2012/05/atmega16u2.jpg" alt="" width="490" height="339" /></a></p>
<p>Then, what about the older Arduinos? The Duemilanove? Still no luck, it uses a FT232RL chip, which is also an SMD.</p>
<p>To make it easier, I&#8217;ll show you an alternative. Just get a ready made USB to Serial chip <img src='http://waihung.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>There are so many of them online, but I&#8217;ve decided to get it from Cytron because their service is top-notch.</p>
<p>It&#8217;s called the UC00B. Only RM 19.00. Link <a href="http://www.cytron.com.my/viewProduct.php?pid=KiEGLQUCNzEmKCkSJCkEMb85ip9G4M1yK5G4dgzRe3s=" target="_blank">here</a>.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/05/IMG_0106.jpg"><img class="alignnone  wp-image-1120" title="IMG_0106" src="http://waihung.net/wp-content/uploads/2012/05/IMG_0106-1024x764.jpg" alt="" width="717" height="535" /></a></p>
<p>Close-up.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/05/IMG_0157.jpg"><img class="alignnone  wp-image-1121" title="IMG_0157" src="http://waihung.net/wp-content/uploads/2012/05/IMG_0157-1024x764.jpg" alt="" width="717" height="535" /></a></p>
<p><a href="http://waihung.net/wp-content/uploads/2012/05/IMG_0108.jpg"><img class="alignnone  wp-image-1122" title="IMG_0108" src="http://waihung.net/wp-content/uploads/2012/05/IMG_0108-1024x764.jpg" alt="" width="717" height="535" /></a></p>
<p>Installation is pretty easy. Just download the driver from Cytron&#8217;s website and execute the installer. Here&#8217;s what you&#8217;ll see in the device manager after installation.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/05/uc00b_driver.png"><img class="alignnone  wp-image-1123" title="uc00b_driver" src="http://waihung.net/wp-content/uploads/2012/05/uc00b_driver.png" alt="" width="715" height="516" /></a></p>
<p>With this done, we can concentrate on the Arduino.</p>
<p>There are many schematics available online for constructing an Arduino on a breadboard, but after an extensive research and some personal modifications, I&#8217;ve come up with this.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/05/arduino_breadboard_sch.png"><img class="alignnone  wp-image-1124" title="arduino_breadboard_sch" src="http://waihung.net/wp-content/uploads/2012/05/arduino_breadboard_sch-952x1024.png" alt="" width="666" height="717" /></a></p>
<p>You can download the EAGLE schematic file <a href="http://waihung.net/wp-content/uploads/2012/05/arduino_breadboard.zip" target="_blank">here</a>.</p>
<p>Here&#8217;s the constructed circuit on a breadboard.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/05/IMG_0154.jpg"><img class="alignnone  wp-image-1126" title="IMG_0154" src="http://waihung.net/wp-content/uploads/2012/05/IMG_0154-1024x764.jpg" alt="" width="717" height="535" /></a></p>
<p>Without the connections to the UC00B, the circuit is in fact very simple.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/05/IMG_0159.jpg"><img class="alignnone  wp-image-1127" title="IMG_0159" src="http://waihung.net/wp-content/uploads/2012/05/IMG_0159-1024x764.jpg" alt="" width="717" height="535" /></a></p>
<p>There are many ways of connecting the UC00B to the breadboard but I&#8217;ve gone the lazy way <img src='http://waihung.net/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p><a href="http://waihung.net/wp-content/uploads/2012/05/IMG_0156.jpg"><img class="alignnone  wp-image-1128" title="IMG_0156" src="http://waihung.net/wp-content/uploads/2012/05/IMG_0156-1024x764.jpg" alt="" width="717" height="535" /></a></p>
<p>Finally to test it, just upload a simple blink sketch.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/05/arduino_blink.png"><img class="alignnone size-full wp-image-1129" title="arduino_blink" src="http://waihung.net/wp-content/uploads/2012/05/arduino_blink.png" alt="" width="500" height="600" /></a></p>
<p>If it says Done uploading means the Arduino is working fine.</p>
<p>I hope this post is helpful to those who want to go into the Arduino world but can&#8217;t afford a full fledged Uno board.</p>
<p>Have a good day <img src='http://waihung.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://waihung.net/making-your-own-arduino-part-2-arduino-on-breadboard/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
		<item>
		<title>Making Your Own Arduino Part 1 (Burning Bootloader)</title>
		<link>http://waihung.net/making-your-own-arduino-part-1-burning-bootloader/</link>
		<comments>http://waihung.net/making-your-own-arduino-part-1-burning-bootloader/#comments</comments>
		<pubDate>Mon, 21 May 2012 16:34:59 +0000</pubDate>
		<dc:creator>waihung</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[electronics]]></category>

		<guid isPermaLink="false">http://waihung.net/?p=1102</guid>
		<description><![CDATA[Need more Arduinos? Don&#8217;t go out and spend on another one. Why don&#8217;t make one yourself? In this post I&#8217;m going to focus on the heart of an Arduino, the Atmel ATmega 328P. A brief introduction on this little beast. 8-bit MCU 32kB Flash Memory 1kB EEPROM 2kB SRAM 23 general purpose IO lines 6-channel 10 bit ADC SPI and ...]]></description>
				<content:encoded><![CDATA[<p>Need more Arduinos? Don&#8217;t go out and spend on another one. Why don&#8217;t make one yourself? <img src='http://waihung.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>In this post I&#8217;m going to focus on the heart of an Arduino, the Atmel ATmega 328P.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/05/ATmega3281.jpg"><img class="alignnone size-medium wp-image-1104" title="ATmega328[1]" src="http://waihung.net/wp-content/uploads/2012/05/ATmega3281-300x225.jpg" alt="" width="300" height="225" /></a></p>
<p>A brief introduction on this little beast.</p>
<ul>
<li>8-bit MCU</li>
<li>32kB Flash Memory</li>
<li>1kB EEPROM</li>
<li>2kB SRAM</li>
<li>23 general purpose IO lines</li>
<li>6-channel 10 bit ADC</li>
<li>SPI and I2C capabilities</li>
</ul>
<p>The ATmega 328P first appeared on the Arduino Duemilanove where it replaces the ATmega 168 which has a smaller program memory.</p>
<p>I tried to get one from Jalan Pasar but it costs RM 40+, an outrageous price. Decided to get it online from Cytron together with the USB to UART adapter which I will highlight in the next post.</p>
<p>Ordered on Saturday, arrived on Monday morning.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/05/IMG_0105.jpg"><img class="alignnone  wp-image-1105" title="IMG_0105" src="http://waihung.net/wp-content/uploads/2012/05/IMG_0105-1024x764.jpg" alt="" width="717" height="535" /></a></p>
<p>The ATmega 328P, they even applied a sticker on it to clearly show the function of each pin. Some may like it, some may not but I don&#8217;t mind it at all. Thanks Cytron <img src='http://waihung.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href="http://waihung.net/wp-content/uploads/2012/05/IMG_0109.jpg"><img class="alignnone  wp-image-1106" title="IMG_0109" src="http://waihung.net/wp-content/uploads/2012/05/IMG_0109-1024x764.jpg" alt="" width="717" height="535" /></a></p>
<p>To burn the bootloader on the new chip, you need another Arduino. In this demonstration I used my Uno R3.</p>
<p>First things first, before we start, we need to upload the Arduino ISP sketch into the Uno R3. I uploaded the one from the 0023 version because the 1.0 was giving me problems.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/05/arduino_isp_sketch.png"><img class="alignnone size-full wp-image-1107" title="arduino_isp_sketch" src="http://waihung.net/wp-content/uploads/2012/05/arduino_isp_sketch.png" alt="" width="500" height="600" /></a></p>
<p>Next, following the guide found on the official Arduino website (<a href="http://arduino.cc/en/Tutorial/ArduinoToBreadboard" target="_blank">here</a>), here is the blank ATmega 328P MCU connected to the Uno R3.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/05/IMG_0112.jpg"><img class="alignnone  wp-image-1108" title="IMG_0112" src="http://waihung.net/wp-content/uploads/2012/05/IMG_0112-1024x764.jpg" alt="" width="717" height="535" /></a></p>
<p><a href="http://waihung.net/wp-content/uploads/2012/05/IMG_0116.jpg"><img class="alignnone  wp-image-1109" title="IMG_0116" src="http://waihung.net/wp-content/uploads/2012/05/IMG_0116-1024x764.jpg" alt="" width="717" height="535" /></a></p>
<p><a href="http://waihung.net/wp-content/uploads/2012/05/IMG_0114.jpg"><img class="alignnone  wp-image-1110" title="IMG_0114" src="http://waihung.net/wp-content/uploads/2012/05/IMG_0114-1024x764.jpg" alt="" width="717" height="535" /></a></p>
<p>Now fire up the Arduino 1.0 IDE, under Tools and Programmer, select Arduino as ISP.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/05/arduino_as_isp.png"><img class="alignnone size-full wp-image-1111" title="arduino_as_isp" src="http://waihung.net/wp-content/uploads/2012/05/arduino_as_isp.png" alt="" width="507" height="606" /></a></p>
<p>To start the process, simply click on Burn Bootloader.</p>
<p>This will take some time, here&#8217;s a video of the whole process.</p>
<div class='video_frame'><iframe id='youtube_video_2' class='youtube_video' style='height:360px;width:640px' src='http://www.youtube.com/embed/NsGTJKQIEsM?autohide=2&amp;autoplay=0&amp;controls=1&amp;disablekb=0&amp;fs=0&amp;hd=0&amp;loop=0&amp;rel=0&amp;showinfo=1&amp;showsearch=1&amp;wmode=transparent&amp;enablejsapi=1' width='640' height='360' frameborder='0'></iframe></div>
<p>When the TX and RX lights stop flashing, it&#8217;s done.</p>
<p>To test it, I swapped the original ATmega 328P on my Uno R3 to the new one I just got from Cytron.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/05/IMG_0121.jpg"><img class="alignnone  wp-image-1112" title="IMG_0121" src="http://waihung.net/wp-content/uploads/2012/05/IMG_0121-1024x764.jpg" alt="" width="717" height="535" /></a></p>
<p>It works! Stay tuned for Part 2 where I&#8217;ll be assembling a full circuit on the breadboard and program it using a USB to UART converter.</p>
]]></content:encoded>
			<wfw:commentRss>http://waihung.net/making-your-own-arduino-part-1-burning-bootloader/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>5 Digit 7-Segment Display</title>
		<link>http://waihung.net/5-digit-7-segment-display/</link>
		<comments>http://waihung.net/5-digit-7-segment-display/#comments</comments>
		<pubDate>Sat, 21 Apr 2012 16:26:45 +0000</pubDate>
		<dc:creator>waihung</dc:creator>
				<category><![CDATA[Microchip PIC]]></category>
		<category><![CDATA[Reviews]]></category>
		<category><![CDATA[7segment]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[PIC]]></category>
		<category><![CDATA[PIC16F877A]]></category>

		<guid isPermaLink="false">http://waihung.net/?p=1061</guid>
		<description><![CDATA[I&#8217;ve been working on a digital clock project so I thought I will get 4 units of 7-segment displays and put all of them on a PCB to show the time. When I was at the electronics store, I stumbled upon this. I bought this because it has 5 digits on a single package and it looks much neater than ...]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve been working on a digital clock project so I thought I will get 4 units of 7-segment displays and put all of them on a PCB to show the time. When I was at the electronics store, I stumbled upon this.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/04/IMG_0453.jpg"><img class="alignnone  wp-image-1063" title="IMG_0453" src="http://waihung.net/wp-content/uploads/2012/04/IMG_0453-1024x768.jpg" alt="" width="717" height="538" /></a></p>
<p>I bought this because it has 5 digits on a single package and it looks much neater than the individual 7 segment displays.</p>
<p>The reason why I wrote this post is not so much to show the display but rather to highlight a technique called multiplexing.</p>
<p>I will start by showing you the pins of this 5 digit display.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/04/IMG_0451.jpg"><img class="alignnone  wp-image-1064" title="IMG_0451" src="http://waihung.net/wp-content/uploads/2012/04/IMG_0451-1024x768.jpg" alt="" width="717" height="538" /></a></p>
<p>In a single digit 7-segment display, there are 8 connections, the 7 individual connections for the 7 LEDs and also one ground connection (for common-cathode type). But does that mean if we have 5 digits we need to use 40 pins? (5 digits x 8 connections)</p>
<p>From the picture above you can see that this 5 digit display only has 22 pins, and even then, not all are used for the 5 digits. Some are for the decimal points and the colon. In fact for the 5 digits, we only need 12 pins. How do we make it work?</p>
<p>This is a pinout diagram that I&#8217;ve drawn out myself (I can&#8217;t find any information about this particular display on the Internet).</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/04/IMG_0466.jpg"><img class="alignnone  wp-image-1065" title="IMG_0466" src="http://waihung.net/wp-content/uploads/2012/04/IMG_0466-1024x768.jpg" alt="" width="717" height="538" /></a></p>
<p>There are only 7 pins which controls the 7 segments on <strong>ALL</strong> of the digits but at any one time these 7 pins can only control a single digit. To decide which digits to control, we use the top right-most pins, sending a low on one these pins means selecting that particular digit to be controlled. Sounds confusing?</p>
<p>Let me try again. In simple words, we can only change or display one digit at a time. But with the sheer speed of microcontrollers, we can display each digits one after another so quickly that the human eye can&#8217;t notice and will appear as if all digits are on at the same time. This method is called multiplexing.</p>
<p>I&#8217;ll probably do a video soon to explain more about multiplexing and how it works but for the meantime here&#8217;s a demonstration on making the display show all 5 digits at the same time.</p>
<p>It&#8217;s been a long time since I used a PIC microcontroller.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/04/IMG_0462.jpg"><img class="alignnone  wp-image-1066" title="IMG_0462" src="http://waihung.net/wp-content/uploads/2012/04/IMG_0462-1024x768.jpg" alt="" width="717" height="538" /></a></p>
<p>And the 5 digit 7-segment display. Only 14 connections used.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/04/IMG_0463.jpg"><img class="alignnone  wp-image-1067" title="IMG_0463" src="http://waihung.net/wp-content/uploads/2012/04/IMG_0463-1024x768.jpg" alt="" width="717" height="538" /></a></p>
<p>Finally, the code which made it all work.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/04/code_5digit.png"><img class="alignnone size-full wp-image-1069" title="code_5digit" src="http://waihung.net/wp-content/uploads/2012/04/code_5digit.png" alt="" width="750" height="1942" /></a></p>
<p>I used 1ms of delay to display each digit and that is fast enough to fool the human&#8217;s eye. Any faster than that will cause distortion and any slower than that will cause the digits to flicker.</p>
<p>The whole circuit in action. The display is actually adequately bright but the camera didn&#8217;t really do it justice.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/04/IMG_0456.jpg"><img class="alignnone  wp-image-1068" title="IMG_0456" src="http://waihung.net/wp-content/uploads/2012/04/IMG_0456-1024x768.jpg" alt="" width="717" height="538" /></a></p>
<p>A dark shot.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/04/IMG_0460.jpg"><img class="alignnone  wp-image-1070" title="IMG_0460" src="http://waihung.net/wp-content/uploads/2012/04/IMG_0460-1024x768.jpg" alt="" width="717" height="538" /></a></p>
<p>Now I&#8217;m off to write an assembly code to interface with the DS1307 Real Time Clock IC. Stay tuned <img src='http://waihung.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://waihung.net/5-digit-7-segment-display/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>DS1307 Real-Time Clock IC</title>
		<link>http://waihung.net/ds1307-real-time-clock-ic/</link>
		<comments>http://waihung.net/ds1307-real-time-clock-ic/#comments</comments>
		<pubDate>Tue, 10 Apr 2012 17:34:33 +0000</pubDate>
		<dc:creator>waihung</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[electronics]]></category>

		<guid isPermaLink="false">http://waihung.net/?p=1045</guid>
		<description><![CDATA[The DS1307 IC is used to accurately count time and date. Once set, and as long as it has power, it will continually count the time by itself. It uses the I2C bus to transfer data to the microcontroller. Below are the key features of this IC.  Real-Time Clock (RTC) Counts Seconds, Minutes, Hours, Date of the Month, Month, Day ...]]></description>
				<content:encoded><![CDATA[<p>The DS1307 IC is used to accurately count time and date. Once set, and as long as it has power, it will continually count the time by itself. It uses the I2C bus to transfer data to the microcontroller. Below are the key features of this IC.</p>
<ul>
<li> Real-Time Clock (RTC) Counts Seconds, Minutes, Hours, Date of the Month, Month, Day of the week, and Year with Leap-Year Compensation Valid Up to 2100</li>
<li>56-Byte, Battery-Backed, General-Purpose RAM with Unlimited Writes</li>
<li>I²C Serial Interface</li>
<li>Programmable Square-Wave Output Signal</li>
<li>Automatic Power-Fail Detect and Switch Circuitry</li>
<li>Consumes Less than 500nA in Battery-Backup Mode with Oscillator Running</li>
<li>Optional Industrial Temperature Range: -40°C to +85°C</li>
<li>Available in 8-Pin Plastic DIP or SO</li>
</ul>
<p>The DS1307 IC has only 8 pins and the pinout are as follows :</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/04/26881.gif"><img class="alignnone size-full wp-image-1047" title="2688[1]" src="http://waihung.net/wp-content/uploads/2012/04/26881.gif" alt="" width="377" height="252" /></a></p>
<p>Because the DS1307 communicates through I2C interface, we need two pull up resistors for both the SDA and SCL channel. I used 10k in my circuit.</p>
<p>For the crystal, the datasheet states that it needs a 32.768kHz Quartz Crystal. You will usually find these on digital watches.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/04/32768HZ1.jpg"><img class="alignnone  wp-image-1051" title="32768HZ[1]" src="http://waihung.net/wp-content/uploads/2012/04/32768HZ1.jpg" alt="" width="217" height="217" /></a></p>
<p>The DS1307 needs a coin cell battery to provide backup power in case the power on the main circuit goes off, for instance when the user is changing the battery of the device. The coin cell battery is connected to Vbat and GND.</p>
<p>I got this coin cell battery holder, it&#8217;s for the CR2032 type.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/04/IMG_0348.jpg"><img class="alignnone  wp-image-1049" title="IMG_0348" src="http://waihung.net/wp-content/uploads/2012/04/IMG_0348-1024x768.jpg" alt="" width="717" height="538" /></a></p>
<p>And a cheap battery to go with it.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/04/IMG_0393.jpg"><img class="alignnone  wp-image-1048" title="IMG_0393" src="http://waihung.net/wp-content/uploads/2012/04/IMG_0393-721x1024.jpg" alt="" width="505" height="717" /></a></p>
<p>A coin cell battery is usually rated at 3V but I got 3.3V out of this guy. A quick read on the datasheet confirms that it&#8217;s alright.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/04/IMG_0349.jpg"><img class="alignnone  wp-image-1050" title="IMG_0349" src="http://waihung.net/wp-content/uploads/2012/04/IMG_0349-1024x768.jpg" alt="" width="717" height="538" /></a></p>
<p>Here&#8217;s the DS1307 IC set up on the Arduino Prototype Shield.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/04/IMG_0432.jpg"><img class="alignnone  wp-image-1052" title="IMG_0432" src="http://waihung.net/wp-content/uploads/2012/04/IMG_0432-1024x768.jpg" alt="" width="717" height="538" /></a></p>
<p>I found a well written library called the RTClib and in it there&#8217;s an example sketch which sets the time on the DS1307 IC. Upon the first power up, the DS1307 will start counting from 1/1/2000 0:00 which is not right, so we need to set it up to the correct date and time. We&#8217;ll only need to do this once as long as the coin cell battery is not removed.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/04/rtc_code1.png"><img class="alignnone size-full wp-image-1053" title="rtc_code1" src="http://waihung.net/wp-content/uploads/2012/04/rtc_code1.png" alt="" width="522" height="815" /></a></p>
<p>What this code does is basically sets the time and date according to when the sketch is compiled. Of course there will be a slight delay from the time the code compiles and it is fully uploaded to the Arduino. I think it&#8217;s less of a problem on the newer Arduinos that are using the Atmel 8U2 and 16U2 as the upload times are significantly faster.</p>
<p>The code will read the time and date from the DS1307 and display it on the Serial Monitor.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/04/rtc1.png"><img class="alignnone size-full wp-image-1054" title="rtc1" src="http://waihung.net/wp-content/uploads/2012/04/rtc1.png" alt="" width="363" height="367" /></a></p>
<p>Now that I know the time and date is correct, I went on to build a fully independent circuit. Which means the circuit is not in any way connected to a computer.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/04/IMG_0433.jpg"><img class="alignnone  wp-image-1055" title="IMG_0433" src="http://waihung.net/wp-content/uploads/2012/04/IMG_0433-1024x768.jpg" alt="" width="717" height="538" /></a></p>
<p>Used an LCD to display the time and date and the circuit is powered by a 9V battery.</p>
<p>With the RTClib, the programming is made so much easier and I can go as far to say that it&#8217;s cheating. LOL. To be frank, I&#8217;m still very new and don&#8217;t have much knowledge on the I2C communication. With such good libraries on the Arduino platform, it has made me kind of lazy <img src='http://waihung.net/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p><a href="http://waihung.net/wp-content/uploads/2012/04/rtc_code2.png"><img class="alignnone size-full wp-image-1056" title="rtc_code2" src="http://waihung.net/wp-content/uploads/2012/04/rtc_code2.png" alt="" width="500" height="846" /></a></p>
<p>I have thought of building a permanent digital clock circuit on a PCB and I&#8217;m still deciding on what power source to use so that the batteries doesn&#8217;t need to be changed often. To do that I need to know the power consumption so I hooked up the circuit in series with the multimeter and measured its&#8217; current usage.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/04/IMG_0435.jpg"><img class="alignnone  wp-image-1057" title="IMG_0435" src="http://waihung.net/wp-content/uploads/2012/04/IMG_0435-1024x768.jpg" alt="" width="717" height="538" /></a></p>
<p>Around 67mA. It&#8217;s not much but I think I can get it lower by using a 7 segment display. I think I&#8217;ll try this on a PIC microcontroller too to compare their power consumption.</p>
<p>Till then <img src='http://waihung.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://waihung.net/ds1307-real-time-clock-ic/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Arduino Tip : Turn your Analog pins into Digital I/O</title>
		<link>http://waihung.net/arduino-tip-turn-your-analog-pins-into-digital-io/</link>
		<comments>http://waihung.net/arduino-tip-turn-your-analog-pins-into-digital-io/#comments</comments>
		<pubDate>Thu, 05 Apr 2012 15:05:29 +0000</pubDate>
		<dc:creator>waihung</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[electronics]]></category>

		<guid isPermaLink="false">http://waihung.net/?p=1032</guid>
		<description><![CDATA[Recently I&#8217;ve just found out that I can actually turn my Analog input pins into Digital Inputs or Outputs. It&#8217;s really simple. Usually for the digital pins, we write instructions such as digitalWrite(13, HIGH). To do that with analog pins, simply use digits 14 to 19. Pin 14 being Analog 0, 15 being Analog 1 and so on. Or you ...]]></description>
				<content:encoded><![CDATA[<p>Recently I&#8217;ve just found out that I can actually turn my Analog input pins into Digital Inputs or Outputs. It&#8217;s really simple.</p>
<p>Usually for the digital pins, we write instructions such as digitalWrite(13, HIGH). To do that with analog pins, simply use digits 14 to 19.</p>
<p>Pin 14 being Analog 0, 15 being Analog 1 and so on. Or you can just write digitalWrite(A0, HIGH).</p>
<p>Here&#8217;s a simple sketch to test that out. Turn on an LED that&#8217;s connected to Analog 0.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/04/analog_to_dig_code_1.png"><img class="alignnone size-full wp-image-1034" title="analog_to_dig_code_1" src="http://waihung.net/wp-content/uploads/2012/04/analog_to_dig_code_1.png" alt="" width="500" height="600" /></a></p>
<p>The proof.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/04/IMG_0388.jpg"><img class="alignnone  wp-image-1036" title="IMG_0388" src="http://waihung.net/wp-content/uploads/2012/04/IMG_0388-1024x768.jpg" alt="" width="717" height="538" /></a></p>
<p>What about Digital Inputs? Just treat the Analog pins like they&#8217;re digital by using pins 14 to 19 or A0 to A5.</p>
<p>I wrote a sample sketch to test whether the Analog pins can be turned to Digital inputs. When the button is pressed, the LED will light up for two seconds.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/04/analog_to_dig_code_2.png"><img class="alignnone size-full wp-image-1037" title="analog_to_dig_code_2" src="http://waihung.net/wp-content/uploads/2012/04/analog_to_dig_code_2.png" alt="" width="500" height="647" /></a></p>
<p>Ta-da!</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/04/IMG_0390.jpg"><img class="alignnone  wp-image-1039" title="IMG_0390" src="http://waihung.net/wp-content/uploads/2012/04/IMG_0390-1024x768.jpg" alt="" width="717" height="538" /></a></p>
<p>No digital pins were used in these tests <img src='http://waihung.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://waihung.net/arduino-tip-turn-your-analog-pins-into-digital-io/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Arduino Twitter Feed Viewer</title>
		<link>http://waihung.net/arduino-twitter-feed-viewer/</link>
		<comments>http://waihung.net/arduino-twitter-feed-viewer/#comments</comments>
		<pubDate>Tue, 03 Apr 2012 15:58:34 +0000</pubDate>
		<dc:creator>waihung</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[ethernet]]></category>
		<category><![CDATA[lcd]]></category>

		<guid isPermaLink="false">http://waihung.net/?p=1019</guid>
		<description><![CDATA[The reason why I got the Ethernet Shield is because I found that there are lots of interesting things to do with it. One of it is to make the Arduino obtain live twitter feeds from the Internet and display it on an LCD. I got the inspiration from the example Twitter sketch in the Ethernet Library. I just modified ...]]></description>
				<content:encoded><![CDATA[<p>The reason why I got the Ethernet Shield is because I found that there are lots of interesting things to do with it. One of it is to make the Arduino obtain live twitter feeds from the Internet and display it on an LCD.</p>
<p>I got the inspiration from the example Twitter sketch in the Ethernet Library. I just modified it so that now it displays the feeds on the LCD instead of the Serial Monitor.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/04/IMG_0370.jpg"><img class="alignnone  wp-image-1021" title="IMG_0370" src="http://waihung.net/wp-content/uploads/2012/04/IMG_0370-1024x768.jpg" alt="" width="717" height="538" /></a></p>
<p>The sketch.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/04/twitter_code.png"><img class="alignnone size-full wp-image-1022" title="twitter_code" src="http://waihung.net/wp-content/uploads/2012/04/twitter_code.png" alt="" width="500" height="1703" /></a></p>
<p>Did you notice the sketch size? 16kB! I think this is the first time I&#8217;m using that much. Probably because I&#8217;m using both the Ethernet and LiquidCrystal library. If I have an older Arduino with ATmega 168 I won&#8217;t be able to do this anymore.</p>
<p>In the sketch I had to change the usual pin assignments for the LCD. Because the Ethernet Shield is using pins 10, 11, 12 and 13, I had to avoid using these for the LCD. Also I tried not to use pin 4 because that&#8217;s reserved for the SD card on the shield.</p>
<p>This is how it looked like, two shields on top of the Arduino Uno.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/04/IMG_0365.jpg"><img class="alignnone  wp-image-1023" title="IMG_0365" src="http://waihung.net/wp-content/uploads/2012/04/IMG_0365-1024x768.jpg" alt="" width="717" height="538" /></a></p>
<p>Notice that my home made shield is tilted? This is why.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/04/IMG_0375.jpg"><img class="alignnone  wp-image-1025" title="IMG_0375" src="http://waihung.net/wp-content/uploads/2012/04/IMG_0375-1024x768.jpg" alt="" width="717" height="538" /></a></p>
<p>I made the Prototype Shield before I got the Ethernet Shield. I did not expect the Ethernet port to be that high. The board is now hitting on the port. Luckily, the contact between the pins are still good and all I have to do is to apply some cellotape to prevent the pins from shorting out. Time for Home Made Prototype Shield R2? <img src='http://waihung.net/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>Another angle.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/04/IMG_0376.jpg"><img class="alignnone  wp-image-1026" title="IMG_0376" src="http://waihung.net/wp-content/uploads/2012/04/IMG_0376-1024x768.jpg" alt="" width="717" height="538" /></a></p>
<p>When mounted on the Arduino Uno itself, it&#8217;s fine though there&#8217;s just less than 1mm of clearance.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/04/IMG_0371.jpg"><img class="alignnone  wp-image-1027" title="IMG_0371" src="http://waihung.net/wp-content/uploads/2012/04/IMG_0371-1024x768.jpg" alt="" width="717" height="538" /></a></p>
<p>Lesson learnt. In my next revision of the Prototype Shield, I have to take into account of other type of shields too.</p>
<p>Thanks for reading. Take care <img src='http://waihung.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://waihung.net/arduino-twitter-feed-viewer/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Arduino SD Card</title>
		<link>http://waihung.net/arduino-sd-card/</link>
		<comments>http://waihung.net/arduino-sd-card/#comments</comments>
		<pubDate>Wed, 28 Mar 2012 15:50:02 +0000</pubDate>
		<dc:creator>waihung</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Reviews]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[electronics]]></category>

		<guid isPermaLink="false">http://waihung.net/?p=1003</guid>
		<description><![CDATA[The Arduino Ethernet Shield I bought last week also has a MicroSD card slot on it. It allows the Arduino to read or write files on the memory card and this is particularly useful for data logging purposes. Yes, you can use the EEPROM on the Arduino but it&#8217;s only limited to 1024 bytes and it&#8217;s not removable. This shield ...]]></description>
				<content:encoded><![CDATA[<p>The Arduino Ethernet Shield I bought last week also has a MicroSD card slot on it. It allows the Arduino to read or write files on the memory card and this is particularly useful for data logging purposes. Yes, you can use the EEPROM on the Arduino but it&#8217;s only limited to 1024 bytes and it&#8217;s not removable.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/IMG_0271.jpg"><img class="alignnone  wp-image-995" title="IMG_0271" src="http://waihung.net/wp-content/uploads/2012/03/IMG_0271-1024x768.jpg" alt="" width="717" height="538" /></a></p>
<p>This shield only supports MicroSD cards but other 3rd party shields support normal SD cards as well. And with the new Library, SDHC and MicroSDHC cards are supported too <img src='http://waihung.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>The card slot on the official shield is spring loaded, which means push to insert and also push to eject.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/IMG_0319.jpg"><img class="alignnone  wp-image-1005" title="IMG_0319" src="http://waihung.net/wp-content/uploads/2012/03/IMG_0319-1024x768.jpg" alt="" width="717" height="538" /></a></p>
<p>I&#8217;m using a standard microSD card. I believe it&#8217;s Class 4 judging by the write speeds.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/card.jpg"><img class="alignnone  wp-image-1006" title="card" src="http://waihung.net/wp-content/uploads/2012/03/card-1024x397.jpg" alt="" width="717" height="278" /></a></p>
<p>To test it out, I loaded the SD CardInfo sample sketch and on my first try, it didn&#8217;t work. Later I found out that I also need to provide external power higher than 5 Volts. I used a 9V battery. I suspect that it&#8217;s the 3.3V voltage regulator. All voltage regulators have a minimum voltage input rating, they are usually around 2 Volts higher than its&#8217; regulated voltage.</p>
<p>After applying sufficient voltage, this came out.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/sd_info.png"><img class="alignnone size-full wp-image-1007" title="sd_info" src="http://waihung.net/wp-content/uploads/2012/03/sd_info.png" alt="" width="363" height="748" /></a></p>
<p>Oh yeah, the SD Library only supports FAT filesystem. Make sure you&#8217;ve formatted the card before putting it in the Arduino.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/sd_format.png"><img class="alignnone size-full wp-image-1008" title="sd_format" src="http://waihung.net/wp-content/uploads/2012/03/sd_format.png" alt="" width="267" height="464" /></a></p>
<p>To test out the capability of the SD Library, I made up a simple circuit that consists of a push button and the Arduino will log how many times the button is pressed.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/IMG_0328.jpg"><img class="alignnone  wp-image-1009" title="IMG_0328" src="http://waihung.net/wp-content/uploads/2012/03/IMG_0328-1024x768.jpg" alt="" width="717" height="538" /></a></p>
<p>Here&#8217;s the code.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/datalogger_sketch.png"><img class="alignnone size-full wp-image-1010" title="datalogger_sketch" src="http://waihung.net/wp-content/uploads/2012/03/datalogger_sketch.png" alt="" width="500" height="860" /></a></p>
<p>And after a few pushes of the button, I read the card with my computer.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/sd_dir.png"><img class="alignnone  wp-image-1011" title="sd_dir" src="http://waihung.net/wp-content/uploads/2012/03/sd_dir.png" alt="" width="583" height="365" /></a></p>
<p>The log file.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/log_file.png"><img class="alignnone size-full wp-image-1012" title="log_file" src="http://waihung.net/wp-content/uploads/2012/03/log_file.png" alt="" width="384" height="330" /></a></p>
<p>The abilities of an Arduino are endless. The question is, is there anything that the Arduino can&#8217;t do?</p>
]]></content:encoded>
			<wfw:commentRss>http://waihung.net/arduino-sd-card/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Arduino Ethernet Shield R3</title>
		<link>http://waihung.net/arduino-ethernet-shield-r3/</link>
		<comments>http://waihung.net/arduino-ethernet-shield-r3/#comments</comments>
		<pubDate>Sat, 24 Mar 2012 17:39:04 +0000</pubDate>
		<dc:creator>waihung</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Reviews]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[ethernet]]></category>

		<guid isPermaLink="false">http://waihung.net/?p=988</guid>
		<description><![CDATA[Got myself an Arduino Ethernet Shield R3, the latest revision. I made an unboxing video for it, though it may be boring to some of you but I hope it&#8217;s at least informative The box. The header pins are gold plated. The Wiznet W5100 chipset, the heart of the Arduino Ethernet Shield. The Ethernet Shield stacked on top of the ...]]></description>
				<content:encoded><![CDATA[<p>Got myself an Arduino Ethernet Shield R3, the latest revision.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/543153_275125749233287_232109560201573_655958_1606374516_n1.jpg"><img class="alignnone  wp-image-990" title="eth_r3_homebrew" src="http://waihung.net/wp-content/uploads/2012/03/543153_275125749233287_232109560201573_655958_1606374516_n1.jpg" alt="" width="630" height="456" /></a></p>
<p>I made an unboxing video for it, though it may be boring to some of you but I hope it&#8217;s at least informative <img src='http://waihung.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<div class='video_frame'><iframe id='youtube_video_3' class='youtube_video' style='height:360px;width:640px' src='http://www.youtube.com/embed/xkLRP0xPaJE?autohide=2&amp;autoplay=0&amp;controls=1&amp;disablekb=0&amp;fs=0&amp;hd=0&amp;loop=0&amp;rel=0&amp;showinfo=1&amp;showsearch=1&amp;wmode=transparent&amp;enablejsapi=1' width='640' height='360' frameborder='0'></iframe></div>
<p>The box.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/IMG_0259.jpg"><img class="alignnone  wp-image-991" title="IMG_0259" src="http://waihung.net/wp-content/uploads/2012/03/IMG_0259-1024x768.jpg" alt="" width="717" height="538" /></a></p>
<p>The header pins are gold plated.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/IMG_0298.jpg"><img class="alignnone  wp-image-992" title="IMG_0298" src="http://waihung.net/wp-content/uploads/2012/03/IMG_0298-1024x768.jpg" alt="" width="717" height="538" /></a></p>
<p>The Wiznet W5100 chipset, the heart of the Arduino Ethernet Shield.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/IMG_0266.jpg"><img class="alignnone  wp-image-993" title="IMG_0266" src="http://waihung.net/wp-content/uploads/2012/03/IMG_0266-1024x768.jpg" alt="" width="717" height="538" /></a></p>
<p>The Ethernet Shield stacked on top of the Arduino Uno R3.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/IMG_0270.jpg"><img class="alignnone  wp-image-994" title="IMG_0270" src="http://waihung.net/wp-content/uploads/2012/03/IMG_0270-1024x768.jpg" alt="" width="717" height="538" /></a></p>
<p>The Shield also includes a microSD card slot and it is supported by the official SD Library.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/IMG_0271.jpg"><img class="alignnone  wp-image-995" title="IMG_0271" src="http://waihung.net/wp-content/uploads/2012/03/IMG_0271-1024x768.jpg" alt="" width="717" height="538" /></a></p>
<p>The 10/100 Ethernet jack.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/IMG_0301.jpg"><img class="alignnone  wp-image-996" title="IMG_0301" src="http://waihung.net/wp-content/uploads/2012/03/IMG_0301-1024x768.jpg" alt="" width="717" height="538" /></a></p>
<p>To test it, I used a sample sketch found on one of the articles on homebrew-tech.com,<br />
<a href="http://www.homebrew-tech.com/arduino/brewing-arduino-announcement/arduinor3testingethernetshieldr3" target="_blank">Arduino R3: Testing Ethernet Shield R3</a>.</p>
<p>Before that, I plugged in an Ethernet cable from the Shield to my switch.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/IMG_0307.jpg"><img class="alignnone  wp-image-999" title="IMG_0307" src="http://waihung.net/wp-content/uploads/2012/03/IMG_0307-1024x768.jpg" alt="" width="717" height="538" /></a></p>
<p>Basically, the Arduino serves up a webpage where the user can turn an LED on or off.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/eth_web_test.png"><img class="alignnone size-full wp-image-997" title="eth_web_test" src="http://waihung.net/wp-content/uploads/2012/03/eth_web_test.png" alt="" width="361" height="291" /></a></p>
<p>The LED is connected to Digital Pin 8.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/IMG_0294.jpg"><img class="alignnone  wp-image-998" title="IMG_0294" src="http://waihung.net/wp-content/uploads/2012/03/IMG_0294-1024x768.jpg" alt="" width="717" height="538" /></a></p>
<p>More exciting projects coming soon <img src='http://waihung.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://waihung.net/arduino-ethernet-shield-r3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LCD Smartie PCB</title>
		<link>http://waihung.net/lcd-smartie-pcb/</link>
		<comments>http://waihung.net/lcd-smartie-pcb/#comments</comments>
		<pubDate>Thu, 22 Mar 2012 16:01:42 +0000</pubDate>
		<dc:creator>waihung</dc:creator>
				<category><![CDATA[PCB]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[lcd]]></category>
		<category><![CDATA[lcd smartie]]></category>
		<category><![CDATA[pcb]]></category>

		<guid isPermaLink="false">http://waihung.net/?p=965</guid>
		<description><![CDATA[If you&#8217;ve read my previous post on LCD Smartie, you&#8217;ll realise that I made my circuit on a breadboard. I liked it a lot so I decided to make a permanent PCB for it. I&#8217;m doing this so that I can practise my soldering too. I will be using a pre-made PCB because it&#8217;s quite a simple circuit. This is ...]]></description>
				<content:encoded><![CDATA[<p>If you&#8217;ve read my previous post on LCD Smartie, you&#8217;ll realise that I made my circuit on a breadboard. I liked it a lot so I decided to make a permanent PCB for it.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/01/lcd_test.jpg"><img class="alignnone  wp-image-348" title="lcd_test" src="http://waihung.net/wp-content/uploads/2012/01/lcd_test-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>I&#8217;m doing this so that I can practise my soldering too. I will be using a pre-made PCB because it&#8217;s quite a simple circuit.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/IMG_0176.jpg"><img class="alignnone  wp-image-967" title="IMG_0176" src="http://waihung.net/wp-content/uploads/2012/03/IMG_0176-1024x768.jpg" alt="" width="717" height="538" /></a></p>
<p>This is called a strip board because it has strips of copper on it so that any component that is on the same column will have electrical connection with each other.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/IMG_0177.jpg"><img class="alignnone  wp-image-968" title="IMG_0177" src="http://waihung.net/wp-content/uploads/2012/03/IMG_0177-1024x768.jpg" alt="" width="717" height="538" /></a></p>
<p>I bought a few of these as spares and stored them for a long time, and they oxidised. I need to rub those off with a sand paper before soldering anything on it. The difference is simply like night and day.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/IMG_0178.jpg"><img class="alignnone  wp-image-969" title="IMG_0178" src="http://waihung.net/wp-content/uploads/2012/03/IMG_0178-1024x768.jpg" alt="" width="717" height="538" /></a></p>
<p>I&#8217;ll be using an old parallel cable from my 1998 HP printer.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/IMG_0173.jpg"><img class="alignnone  wp-image-970" title="IMG_0173" src="http://waihung.net/wp-content/uploads/2012/03/IMG_0173-1024x768.jpg" alt="" width="717" height="538" /></a></p>
<p>On one end is a DB-25 port, which plugs into the computer.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/IMG_0171.jpg"><img class="alignnone  wp-image-971" title="IMG_0171" src="http://waihung.net/wp-content/uploads/2012/03/IMG_0171-1024x768.jpg" alt="" width="717" height="538" /></a></p>
<p>And on the other, a DB-36 port which plugs into the printer. This port is of no use so I&#8217;ll be getting rid of it.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/IMG_0172.jpg"><img class="alignnone  wp-image-972" title="IMG_0172" src="http://waihung.net/wp-content/uploads/2012/03/IMG_0172-1024x768.jpg" alt="" width="717" height="538" /></a></p>
<p>Pried the case apart and revealed the individual wires.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/IMG_0180.jpg"><img class="alignnone  wp-image-973" title="IMG_0180" src="http://waihung.net/wp-content/uploads/2012/03/IMG_0180-1024x768.jpg" alt="" width="717" height="538" /></a></p>
<p>I won&#8217;t be cutting the port header off so soon. I&#8217;ll refer to the schematic, cut and solder each wire individually before moving to the next one. That will minimize confusion because there&#8217;s just too much of them.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/IMG_0191.jpg"><img class="alignnone  wp-image-974" title="IMG_0191" src="http://waihung.net/wp-content/uploads/2012/03/IMG_0191-1024x768.jpg" alt="" width="717" height="538" /></a></p>
<p>The parallel port cannot provide power, so I need to pull 5 Volts from the USB port to power up the LCD. I cut off the USB cable of one of my faulty mouse to be used on the PCB.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/IMG_0193.jpg"><img class="alignnone  wp-image-975" title="IMG_0193" src="http://waihung.net/wp-content/uploads/2012/03/IMG_0193-1024x768.jpg" alt="" width="717" height="538" /></a></p>
<p>I just need three components. A 16 pin female header, 10k potentiometer and an LCD of course.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/IMG_0184.jpg"><img class="alignnone  wp-image-976" title="IMG_0184" src="http://waihung.net/wp-content/uploads/2012/03/IMG_0184-1024x768.jpg" alt="" width="717" height="538" /></a></p>
<p>These are what I used to solder. A Hakko 20W soldering iron, some random solder sucker and a roll of solder wire.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/IMG_0243.jpg"><img class="alignnone  wp-image-977" title="IMG_0243" src="http://waihung.net/wp-content/uploads/2012/03/IMG_0243-1024x768.jpg" alt="" width="717" height="538" /></a></p>
<p>The end result. I used zip ties to secure the cable to prevent any external force from pulling the cable off the PCB.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/IMG_0247.jpg"><img class="alignnone  wp-image-978" title="IMG_0247" src="http://waihung.net/wp-content/uploads/2012/03/IMG_0247-1024x768.jpg" alt="" width="717" height="538" /></a></p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/IMG_0245.jpg"><img class="alignnone  wp-image-979" title="IMG_0245" src="http://waihung.net/wp-content/uploads/2012/03/IMG_0245-1024x768.jpg" alt="" width="717" height="538" /></a></p>
<p>What&#8217;s left is to plug in the LCD and turn on the computer <img src='http://waihung.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/IMG_0235.jpg"><img class="alignnone  wp-image-980" title="IMG_0235" src="http://waihung.net/wp-content/uploads/2012/03/IMG_0235-1024x768.jpg" alt="" width="717" height="538" /></a></p>
<p>Lights off.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/IMG_0229.jpg"><img class="alignnone  wp-image-981" title="IMG_0229" src="http://waihung.net/wp-content/uploads/2012/03/IMG_0229-1024x768.jpg" alt="" width="717" height="538" /></a></p>
<p>You can actually do a lot of things with LCD Smartie. To find out more, you can check it out at <a href="http://lcdsmartie.sourceforge.net" target="_blank">http://lcdsmartie.sourceforge.net</a></p>
<p>Thanks for reading <img src='http://waihung.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://waihung.net/lcd-smartie-pcb/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Two Arduinos Talking To Each Other</title>
		<link>http://waihung.net/two-arduinos-talking-to-each-other/</link>
		<comments>http://waihung.net/two-arduinos-talking-to-each-other/#comments</comments>
		<pubDate>Thu, 15 Mar 2012 16:53:06 +0000</pubDate>
		<dc:creator>waihung</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[PCB]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[nano]]></category>
		<category><![CDATA[pcb]]></category>

		<guid isPermaLink="false">http://waihung.net/?p=917</guid>
		<description><![CDATA[I wanted to play with keypads so I went to look for one at Jalan Pasar, but unfortunately they all cost at least RM20. I just wanted something cheap to experiment with first. So, I asked the salesperson are there any keypads that are cheaper than those, she immediately reached for a shelve and took this out. It&#8217;s a paper ...]]></description>
				<content:encoded><![CDATA[<p>I wanted to play with keypads so I went to look for one at Jalan Pasar, but unfortunately they all cost at least RM20. I just wanted something cheap to experiment with first. So, I asked the salesperson are there any keypads that are cheaper than those, she immediately reached for a shelve and took this out.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/2012-03-15-22-41-30.683.jpg"><img class="alignnone  wp-image-919" title="2012-03-15 22-41-30.683" src="http://waihung.net/wp-content/uploads/2012/03/2012-03-15-22-41-30.683-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>It&#8217;s a paper based keypad and it costs less than RM 7. Perfect for my needs. Another plus point about this keypad is I don&#8217;t need to solder any wires or headers on it.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/2012-03-15-22-42-24.697.jpg"><img class="alignnone  wp-image-920" title="2012-03-15 22-42-24.697" src="http://waihung.net/wp-content/uploads/2012/03/2012-03-15-22-42-24.697-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>It already comes with a female header and all I need to do is to plug in a male-to-male header into it. That will make it easier to be plugged into a breadboard.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/2012-03-15-22-43-09.427.jpg"><img class="alignnone  wp-image-921" title="2012-03-15 22-43-09.427" src="http://waihung.net/wp-content/uploads/2012/03/2012-03-15-22-43-09.427-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>Remember this circuit?</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/7seg1.jpg"><img class="alignnone  wp-image-922" title="7seg1" src="http://waihung.net/wp-content/uploads/2012/03/7seg1-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>It&#8217;s the 7 Segment circuit from two posts ago. Now I plan to add in the keypad to display the digits according to what I press on the keypad.</p>
<p>Unfortunately, I ran out of digital pins. I didn&#8217;t expect this day to come so soon, I thought the Arduino Mega is overkill but now I understand why some people prefer it over the Uno.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/2012-03-15-22-44-38.484.jpg"><img class="alignnone  wp-image-923" title="2012-03-15 22-44-38.484" src="http://waihung.net/wp-content/uploads/2012/03/2012-03-15-22-44-38.484-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>From the picture, you might think that the pins are just enough. But actually it&#8217;s not. I&#8217;m already taking the first two digital pins which are RX and TX and they have 1k of resistance from the MCU&#8217;s pin.</p>
<p>Since I don&#8217;t have the luxury of owning a Mega, what I can do is to make use of my two Arduinos, the Uno and the Nano. I connected the keypad to the Nano and program it to talk to the Uno through serial communication.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/2012-03-15-22-45-23.192.jpg"><img class="alignnone  wp-image-924" title="2012-03-15 22-45-23.192" src="http://waihung.net/wp-content/uploads/2012/03/2012-03-15-22-45-23.192-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>Connecting it is pretty simple, the TX pin from the Nano goes to RX on the Uno and RX from the Nano goes to TX on the Uno. Basically just inverting them.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/2012-03-15-22-46-54.091.jpg"><img class="alignnone  wp-image-925" title="2012-03-15 22-46-54.091" src="http://waihung.net/wp-content/uploads/2012/03/2012-03-15-22-46-54.091-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>I also linked both the 5V and Ground together so that they can share the power source. All I need to do is to either power up the Nano or the Uno.</p>
<p>Here is the code I wrote for the Uno,</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/2arduino_code1.png"><img class="alignnone size-full wp-image-926" title="2arduino_code1" src="http://waihung.net/wp-content/uploads/2012/03/2arduino_code1.png" alt="" width="500" height="860" /></a></p>
<p>and the Nano,</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/2arduino_code2.png"><img class="alignnone size-full wp-image-927" title="2arduino_code2" src="http://waihung.net/wp-content/uploads/2012/03/2arduino_code2.png" alt="" width="500" height="727" /></a></p>
<p>Two Arduinos working hand in hand <img src='http://waihung.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/2012-03-15-22-58-31.586.jpg"><img class="alignnone  wp-image-928" title="2012-03-15 22-58-31.586" src="http://waihung.net/wp-content/uploads/2012/03/2012-03-15-22-58-31.586-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>And finally, here&#8217;s a demonstration video.</p>
<div class='video_frame'><iframe id='youtube_video_4' class='youtube_video' style='height:360px;width:640px' src='http://www.youtube.com/embed/-kzZk6Sl15A?autohide=2&amp;autoplay=0&amp;controls=1&amp;disablekb=0&amp;fs=0&amp;hd=0&amp;loop=0&amp;rel=0&amp;showinfo=1&amp;showsearch=1&amp;wmode=transparent&amp;enablejsapi=1' width='640' height='360' frameborder='0'></iframe></div>
<p>Thanks for reading <img src='http://waihung.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://waihung.net/two-arduinos-talking-to-each-other/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Giveaway : 3 Months of Instructables Pro Membership</title>
		<link>http://waihung.net/giveaway-3-months-of-instructables-pro-membership/</link>
		<comments>http://waihung.net/giveaway-3-months-of-instructables-pro-membership/#comments</comments>
		<pubDate>Wed, 14 Mar 2012 02:00:41 +0000</pubDate>
		<dc:creator>waihung</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[PCB]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[pcb]]></category>

		<guid isPermaLink="false">http://waihung.net/?p=906</guid>
		<description><![CDATA[Hi. If you&#8217;ve liked my Facebook page, you would probably notice that my article on the Home Made Arduino Prototype Shield that I posted at Instructables has been selected by the editors to appear on the front page of Instructables. Yes, you heard it, front page! Thanks for all of your support I received two emails, stating that my article ...]]></description>
				<content:encoded><![CDATA[<p>Hi. If you&#8217;ve liked my Facebook page, you would probably notice that my article on the Home Made Arduino Prototype Shield that I posted at Instructables has been selected by the editors to appear on the front page of Instructables. Yes, you heard it, front page! Thanks for all of your support <img src='http://waihung.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/inst_front-copy.png"><img class="alignnone  wp-image-908" title="inst_front copy" src="http://waihung.net/wp-content/uploads/2012/03/inst_front-copy-874x1024.png" alt="" width="612" height="717" /></a></p>
<p>I received two emails, stating that my article is featured on the front page and both of these emails gave me a free Pro account.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/3months.png"><img class="alignnone  wp-image-909" title="3months" src="http://waihung.net/wp-content/uploads/2012/03/3months.png" alt="" width="591" height="292" /></a></p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/front.png"><img class="alignnone  wp-image-910" title="front" src="http://waihung.net/wp-content/uploads/2012/03/front.png" alt="" width="593" height="308" /></a></p>
<p>They are giving me a 1 year Pro membership and another 3 months Pro membership for free. So I&#8217;ve decided to give away the 3 months Pro membership to one of my lucky readers <img src='http://waihung.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/gift_cert.png"><img class="alignnone  wp-image-911" title="gift_cert" src="http://waihung.net/wp-content/uploads/2012/03/gift_cert.png" alt="" width="516" height="375" /></a></p>
<p>What is a Pro membership? These are some of the highlights found on the Instructables website.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/pro_member.png"><img class="alignnone size-full wp-image-912" title="pro_member" src="http://waihung.net/wp-content/uploads/2012/03/pro_member.png" alt="" width="587" height="706" /></a></p>
<p>Since I have only one Pro membership to give away, I&#8217;ll select the first person who writes me a comment below <img src='http://waihung.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Please write down your real e-mail address in the field before commenting.</p>
<p>Lastly, I would like to say a big thank you to the kind people at Instructables.</p>
]]></content:encoded>
			<wfw:commentRss>http://waihung.net/giveaway-3-months-of-instructables-pro-membership/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Building a Circuit on the Arduino Prototype Shield</title>
		<link>http://waihung.net/building-a-circuit-on-the-arduino-prototype-shield/</link>
		<comments>http://waihung.net/building-a-circuit-on-the-arduino-prototype-shield/#comments</comments>
		<pubDate>Sun, 11 Mar 2012 10:22:55 +0000</pubDate>
		<dc:creator>waihung</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[PCB]]></category>
		<category><![CDATA[7segment]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[electronics]]></category>

		<guid isPermaLink="false">http://waihung.net/?p=899</guid>
		<description><![CDATA[Hi. Sorry for the long absence, I&#8217;ve been very busy with internship for the past 1 week. I found some time to do a short demonstration on building a circuit on my home made Arduino Prototype Shield. If you&#8217;re interested in reading how I made the shield myself, here&#8217;s Part 1, Part 2 and Part 3. I&#8217;ve decided to show ...]]></description>
				<content:encoded><![CDATA[<p>Hi. Sorry for the long absence, I&#8217;ve been very busy with internship for the past 1 week. I found some time to do a short demonstration on building a circuit on my home made Arduino Prototype Shield. If you&#8217;re interested in reading how I made the shield myself, here&#8217;s <a title="Home Made PCB – Etching Photo Resist Layer (Part 1)" href="http://waihung.net/home-made-pcb-etching-photo-resist-layer/" target="_blank">Part 1</a>, <a title="Home Made PCB – Etching Copper Layer (Part 2)" href="http://waihung.net/home-made-pcb-etching-copper-layer-part-2/" target="_blank">Part 2</a> and <a title="Home Made PCB – Arduino Prototype Shield (Part 3)" href="http://waihung.net/home-made-pcb-arduino-prototype-shield-part-3/" target="_blank">Part 3</a>.</p>
<p>I&#8217;ve decided to show the circuit construction in a video for the convenience of my readers. Without further ado, here it is.</p>
<div class='video_frame'><iframe id='youtube_video_5' class='youtube_video' style='height:360px;width:640px' src='http://www.youtube.com/embed/eCWwcV8j5W4?autohide=2&amp;autoplay=0&amp;controls=1&amp;disablekb=0&amp;fs=0&amp;hd=0&amp;loop=0&amp;rel=0&amp;showinfo=1&amp;showsearch=1&amp;wmode=transparent&amp;enablejsapi=1' width='640' height='360' frameborder='0'></iframe></div>
<p>As mentioned in the video, I used a common anode 7 segment display. What this means is, to turn on a specific LED, the microcontroller have to send a LOW signal. To turn the whole 7 segment display off, all of the pins have to be set HIGH.</p>
<p>Here&#8217;s a simple pinout diagram I found on the internet.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/7segLed.gif"><img class="alignnone  wp-image-901" title="7segLed" src="http://waihung.net/wp-content/uploads/2012/03/7segLed.gif" alt="" width="270" height="191" /></a></p>
<p>With that in mind, I wrote a function to properly display digits and also to clear the whole display if desired. Here is the code.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/arduino_7seg_code.png"><img class="alignnone size-full wp-image-902" title="arduino_7seg_code" src="http://waihung.net/wp-content/uploads/2012/03/arduino_7seg_code.png" alt="" width="628" height="2140" /></a></p>
<p>There are many interesting things that a 7 segment display can do. In the next post, I&#8217;ll be showing an example of it <img src='http://waihung.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Thanks for reading.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://waihung.net/building-a-circuit-on-the-arduino-prototype-shield/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Home Made PCB &#8211; Arduino Prototype Shield (Part 3)</title>
		<link>http://waihung.net/home-made-pcb-arduino-prototype-shield-part-3/</link>
		<comments>http://waihung.net/home-made-pcb-arduino-prototype-shield-part-3/#comments</comments>
		<pubDate>Thu, 01 Mar 2012 11:40:20 +0000</pubDate>
		<dc:creator>waihung</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[PCB]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[pcb]]></category>

		<guid isPermaLink="false">http://waihung.net/?p=863</guid>
		<description><![CDATA[This is Part 3 and also the final part of my journey in making my first home made PCB. If you&#8217;ve not read the previous parts, here is Part 1 and Part 2. My aim of this project is to create my own Arduino Prototype Shield. With the PCB done, it&#8217;s time to turn to the components that will be ...]]></description>
				<content:encoded><![CDATA[<p>This is Part 3 and also the final part of my journey in making my first home made PCB. If you&#8217;ve not read the previous parts, here is <a title="Home Made PCB – Etching Photo Resist Layer (Part 1)" href="http://waihung.net/home-made-pcb-etching-photo-resist-layer/" target="_blank">Part 1</a> and <a title="Home Made PCB – Etching Copper Layer (Part 2)" href="http://waihung.net/home-made-pcb-etching-copper-layer-part-2/" target="_blank">Part 2</a>.</p>
<p>My aim of this project is to create my own Arduino Prototype Shield. With the PCB done, it&#8217;s time to turn to the components that will be mounted on the board.</p>
<p>Nothing spectacular, just some connectors and a mini breadboard.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/2012-02-29-18-52-50.539.jpg"><img class="alignnone  wp-image-865" title="2012-02-29 18-52-50.539" src="http://waihung.net/wp-content/uploads/2012/03/2012-02-29-18-52-50.539-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>There&#8217;s a reason why I chose a dark blue breadboard. The truth is I&#8217;m very particular about colour schemes. When possible I&#8217;ll always coordinate the colours in the things that I buy or make, for example my desktop computer that I assembled myself. Everything in it has to be in the right colour or matching colour. I guess I have colour OCD lol.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/SDC10252.jpg"><img class="alignnone  wp-image-866" title="&lt;KENOX S860  / Samsung S860&gt;" src="http://waihung.net/wp-content/uploads/2012/03/SDC10252.jpg" alt="" width="538" height="403" /></a></p>
<p>Coming back to this project, the PCB that I bought is actually yellow in colour but unfortunately, I can&#8217;t find it in any other colour. It looks absolutely disgusting. This is a PCB I did in college.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/2012-03-01-19-19-45.485.jpg"><img class="alignnone  wp-image-867" title="2012-03-01 19-19-45.485" src="http://waihung.net/wp-content/uploads/2012/03/2012-03-01-19-19-45.485-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>I have no control over that project because we were required to follow instructions. But this is my own project so I&#8217;ve got to do something about it and I bought this.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/2012-02-28-18-23-13.750.jpg"><img class="alignnone  wp-image-856" title="2012-02-28 18-23-13.750" src="http://waihung.net/wp-content/uploads/2012/02/2012-02-28-18-23-13.750-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>A white spray paint. I wanted a white &#8211; dark blue &#8211; black colour scheme. I think it&#8217;ll look awesome <img src='http://waihung.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>This is the board after painting. Took a full day to dry because I applied a very thick coat. It actually looks very shiny but the camera did not pick that up.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/2012-02-29-18-49-45.890.jpg"><img class="alignnone  wp-image-869" title="2012-02-29 18-49-45.890" src="http://waihung.net/wp-content/uploads/2012/03/2012-02-29-18-49-45.890-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>Then I drilled holes for the components to go through and soldered the components.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/2012-02-29-22-25-37.774.jpg"><img class="alignnone  wp-image-870" title="2012-02-29 22-25-37.774" src="http://waihung.net/wp-content/uploads/2012/03/2012-02-29-22-25-37.774-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>Pardon my soldering skills. It&#8217;s been a long time since I used a soldering iron, I&#8217;ve been relying on breadboard too much these days.</p>
<p>This is how it looks like the right side up.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/2012-02-29-22-24-00.400.jpg"><img class="alignnone  wp-image-871" title="2012-02-29 22-24-00.400" src="http://waihung.net/wp-content/uploads/2012/03/2012-02-29-22-24-00.400-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/2012-02-29-22-24-12.414.jpg"><img class="alignnone  wp-image-872" title="2012-02-29 22-24-12.414" src="http://waihung.net/wp-content/uploads/2012/03/2012-02-29-22-24-12.414-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>The last step would be to stick the mini breadboard on it.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/2012-02-29-22-26-22.606.jpg"><img class="alignnone  wp-image-873" title="2012-02-29 22-26-22.606" src="http://waihung.net/wp-content/uploads/2012/03/2012-02-29-22-26-22.606-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>Here is the final product in a few angles.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/2012-02-29-22-28-34.790.jpg"><img class="alignnone  wp-image-874" title="2012-02-29 22-28-34.790" src="http://waihung.net/wp-content/uploads/2012/03/2012-02-29-22-28-34.790-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/2012-02-29-22-29-18.727.jpg"><img class="alignnone  wp-image-875" title="2012-02-29 22-29-18.727" src="http://waihung.net/wp-content/uploads/2012/03/2012-02-29-22-29-18.727-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>The Arduino Prototype Shield mounted on my Arduino Uno R3.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/2012-02-29-22-30-47.457.jpg"><img class="alignnone  wp-image-876" title="2012-02-29 22-30-47.457" src="http://waihung.net/wp-content/uploads/2012/03/2012-02-29-22-30-47.457-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/2012-02-29-22-31-08.170.jpg"><img class="alignnone  wp-image-877" title="2012-02-29 22-31-08.170" src="http://waihung.net/wp-content/uploads/2012/03/2012-02-29-22-31-08.170-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/2012-02-29-22-31-23.923.jpg"><img class="alignnone  wp-image-878" title="2012-02-29 22-31-23.923" src="http://waihung.net/wp-content/uploads/2012/03/2012-02-29-22-31-23.923-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/2012-02-29-22-31-37.745.jpg"><img class="alignnone  wp-image-879" title="2012-02-29 22-31-37.745" src="http://waihung.net/wp-content/uploads/2012/03/2012-02-29-22-31-37.745-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/2012-02-29-22-32-12.856.jpg"><img class="alignnone  wp-image-880" title="2012-02-29 22-32-12.856" src="http://waihung.net/wp-content/uploads/2012/03/2012-02-29-22-32-12.856-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>Lastly, I did this just for laughs. Arduino on an Arduino lol.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/03/2012-03-01-20-00-52.707.jpg"><img class="alignnone  wp-image-886" title="2012-03-01 20-00-52.707" src="http://waihung.net/wp-content/uploads/2012/03/2012-03-01-20-00-52.707-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>That&#8217;s the end of my project and I hope that you&#8217;ve enjoyed reading it. Thank you <img src='http://waihung.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://waihung.net/home-made-pcb-arduino-prototype-shield-part-3/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Home Made PCB &#8211; Etching Copper Layer (Part 2)</title>
		<link>http://waihung.net/home-made-pcb-etching-copper-layer-part-2/</link>
		<comments>http://waihung.net/home-made-pcb-etching-copper-layer-part-2/#comments</comments>
		<pubDate>Wed, 29 Feb 2012 15:42:27 +0000</pubDate>
		<dc:creator>waihung</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[PCB]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[pcb]]></category>

		<guid isPermaLink="false">http://waihung.net/?p=849</guid>
		<description><![CDATA[This is Part 2 of my journey in making my first Home Made PCB. If you&#8217;ve not read Part 1, here it is. In the last post, I showed the entire process of etching the photo resist layer. Now what&#8217;s left of the photo resist layer (green in colour) is the actual PCB layout. Beneath the photo resist layer is ...]]></description>
				<content:encoded><![CDATA[<p>This is Part 2 of my journey in making my first Home Made PCB. If you&#8217;ve not read Part 1, <a title="Home Made PCB – Etching Photo Resist Layer (Part 1)" href="http://waihung.net/home-made-pcb-etching-photo-resist-layer/" target="_blank">here</a> it is.</p>
<p>In the last post, I showed the entire process of etching the photo resist layer. Now what&#8217;s left of the photo resist layer (green in colour) is the actual PCB layout.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/2012-02-27-22-40-50.688.jpg"><img class="alignnone  wp-image-834" title="2012-02-27 22-40-50.688" src="http://waihung.net/wp-content/uploads/2012/02/2012-02-27-22-40-50.688-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>Beneath the photo resist layer is the copper layer and from the picture above, they are still intact. Our aim is to actually get rid of the copper layers that are not covered with the photo resist layer. Any copper that is hidden below the photo resist layer will remain intact in the etching process.</p>
<p>I bought this bottle of ferric chloride etchant for only RM 6.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/2012-02-25-17-24-46.492.jpg"><img class="alignnone  wp-image-727" title="2012-02-25 17-24-46.492" src="http://waihung.net/wp-content/uploads/2012/02/2012-02-25-17-24-46.492-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>It&#8217;s pretty concentrated so a small amount would suffice. Always use a plastic container because this stuff is corrosive.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/2012-02-27-22-55-40.347.jpg"><img class="alignnone  wp-image-851" title="2012-02-27 22-55-40.347" src="http://waihung.net/wp-content/uploads/2012/02/2012-02-27-22-55-40.347-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>Dipped the whole board into the solution and the whole process took about 20 minutes. It took so long because I did not heat up the etchant. The trick of doing this properly is to leave it for 4-5 minutes and then agitate it for 30 seconds and then repeat the process again and again till all the copper layers are etched away.</p>
<p>This is how it looks like when the process is complete. All of the unwanted copper areas are gone and now what&#8217;s left are those hiding below the photo resist layer.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/2012-02-27-23-23-46.501.jpg"><img class="alignnone  wp-image-852" title="2012-02-27 23-23-46.501" src="http://waihung.net/wp-content/uploads/2012/02/2012-02-27-23-23-46.501-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>I tried to wash it off with water but it didn&#8217;t work. So I went to a pharmacy to get this.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/2012-02-28-18-26-40.437.jpg"><img class="alignnone  wp-image-853" title="2012-02-28 18-26-40.437" src="http://waihung.net/wp-content/uploads/2012/02/2012-02-28-18-26-40.437-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>The pharmacy guy looked at me suspiciously and asked me what do I want to do with it. If I told him that it&#8217;s for my electronic project sure it&#8217;ll take some explanation. I just told him that I need to fill up my first aid kit lol.</p>
<p>By the way those swabs are soaked with rubbing alcohol and they&#8217;re exactly what I needed. The box contains 100 swabs and it costs RM 6. And it really works.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/2012-02-28-19-35-29.140.jpg"><img class="alignnone  wp-image-854" title="2012-02-28 19-35-29.140" src="http://waihung.net/wp-content/uploads/2012/02/2012-02-28-19-35-29.140-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>The board with all of its copper glory.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/2012-02-28-19-47-06.937.jpg"><img class="alignnone  wp-image-855" title="2012-02-28 19-47-06.937" src="http://waihung.net/wp-content/uploads/2012/02/2012-02-28-19-47-06.937-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>That&#8217;s it for Part 2. In Part 3, I&#8217;ll be posting the final steps in making this board an Arduino Prototype Shield.</p>
<p>In the mean time, here&#8217;s a teaser for you all. Try and guess what I&#8217;ll be doing and post it in the comments section below.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/2012-02-28-18-23-13.750.jpg"><img class="alignnone  wp-image-856" title="2012-02-28 18-23-13.750" src="http://waihung.net/wp-content/uploads/2012/02/2012-02-28-18-23-13.750-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>Thank you <img src='http://waihung.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Part 3 is up. Read it <a title="Home Made PCB – Arduino Prototype Shield (Part 3)" href="http://waihung.net/home-made-pcb-arduino-prototype-shield-part-3/" target="_blank">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://waihung.net/home-made-pcb-etching-copper-layer-part-2/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Home Made PCB &#8211; Etching Photo Resist Layer (Part 1)</title>
		<link>http://waihung.net/home-made-pcb-etching-photo-resist-layer/</link>
		<comments>http://waihung.net/home-made-pcb-etching-photo-resist-layer/#comments</comments>
		<pubDate>Tue, 28 Feb 2012 13:09:03 +0000</pubDate>
		<dc:creator>waihung</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[PCB]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[pcb]]></category>

		<guid isPermaLink="false">http://waihung.net/?p=815</guid>
		<description><![CDATA[I&#8217;ve always wanted to make my own Arduino Prototype Shield. This shield allows the user to use a breadboard on an Arduino. It&#8217;s a very simple shield but if I were to buy it, it will cost me at least RM30. An example would be this Prototype Shield from sparkfun.com. It is sold for USD 15, which translates to approximately ...]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve always wanted to make my own Arduino Prototype Shield. This shield allows the user to use a breadboard on an Arduino. It&#8217;s a very simple shield but if I were to buy it, it will cost me at least RM30. An example would be this Prototype Shield from sparkfun.com. It is sold for USD 15, which translates to approximately RM 45.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/07914-0031.jpg"><img class="alignnone size-medium wp-image-818" title="07914-003[1]" src="http://waihung.net/wp-content/uploads/2012/02/07914-0031-300x300.jpg" alt="" width="300" height="300" /></a></p>
<p>That is a colossal amount of money for something so simple. So I took the challenge to make this myself. I bought all of the tools needed for this process and if you&#8217;ve not checked it out, you might want to read <a title="Tools To Make Your Own PCB" href="http://waihung.net/tools-to-make-your-own-pcb/" target="_blank">this</a> first.</p>
<p>I found an Eagle PCB file for this at the arduino website and I did some modifications like adding my own name on it.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/proto_pcb_eagle.png"><img class="alignnone  wp-image-819" title="proto_pcb_eagle" src="http://waihung.net/wp-content/uploads/2012/02/proto_pcb_eagle-1024x677.png" alt="" width="717" height="474" /></a></p>
<p>Then I tried to print it out on a transparency paper but it didn&#8217;t turn out well.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/2012-02-27-19-56-27.495.jpg"><img class="alignnone  wp-image-820" title="2012-02-27 19-56-27.495" src="http://waihung.net/wp-content/uploads/2012/02/2012-02-27-19-56-27.495-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>It didn&#8217;t turn out well because I printed it using an inkjet printer. The ink will dry up very quickly and the printing will fade in just a matter of minutes. To do this properly I need to print it with a laser printer or any printer that uses toner, not ink. Unfortunately I don&#8217;t have such luxury so I have to get it done outside.</p>
<p>I print them out on a normal piece of A4 paper first and went to a photocopying shop to ask them to print it out on my transparency paper. Believe it or not most shops were not willing to print on transparency paper because they worry that it might get stuck in their machines. I finally get it done at a shop near my house and that&#8217;s the 5th shop that I tried. Thank God the owner was kind enough to try it after some persuasion.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/2012-02-27-19-09-04.451.jpg"><img class="alignnone  wp-image-821" title="2012-02-27 19-09-04.451" src="http://waihung.net/wp-content/uploads/2012/02/2012-02-27-19-09-04.451-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>This is the result. It&#8217;s a million times better than what my printer can do.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/2012-02-27-20-10-06.912.jpg"><img class="alignnone  wp-image-822" title="2012-02-27 20-10-06.912" src="http://waihung.net/wp-content/uploads/2012/02/2012-02-27-20-10-06.912-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>I printed a few examples of the same circuit on the transparency paper and I stacked two of them on top of each other to get a perfect image.</p>
<p>The preparation is done and now it&#8217;s time to go into a dark room for the rest of the process. When I said dark room I meant a room without any fluorescent or sun light. It is just like developing camera films the old school way. I can have a light but it must not be fluorescent, white or sunlight. Single coloured lights such as red, blue or yellow can be used. I&#8217;m using an old spotlight and it uses a traditional yellow bulb. My webcam automatically turned on its&#8217; white balance mode and the light appears to be white but in fact it is yellow.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/2012-02-27-20-11-47.793.jpg"><img class="alignnone  wp-image-823" title="2012-02-27 20-11-47.793" src="http://waihung.net/wp-content/uploads/2012/02/2012-02-27-20-11-47.793-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>I opened up the PCB packaging and the PCB is covered by a blue sticker to prevent it from accidently exposed to light. This blue sticker also allows me to draw some lines to guide me when cutting the PCB to length.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/2012-02-27-20-13-43.505.jpg"><img class="alignnone  wp-image-824" title="2012-02-27 20-13-43.505" src="http://waihung.net/wp-content/uploads/2012/02/2012-02-27-20-13-43.505-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>The protective blue sticker layer.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/2012-02-27-20-14-26.281.jpg"><img class="alignnone  wp-image-825" title="2012-02-27 20-14-26.281" src="http://waihung.net/wp-content/uploads/2012/02/2012-02-27-20-14-26.281-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>Tried to be as accurate as possible but the low lighting condition doesn&#8217;t help at all.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/2012-02-27-20-24-31.886.jpg"><img class="alignnone  wp-image-826" title="2012-02-27 20-24-31.886" src="http://waihung.net/wp-content/uploads/2012/02/2012-02-27-20-24-31.886-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>Used a small hand saw to cut it. I did this in my room and now the floor is covered with dust. Bad choice of work area.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/2012-02-27-20-43-41.482.jpg"><img class="alignnone  wp-image-827" title="2012-02-27 20-43-41.482" src="http://waihung.net/wp-content/uploads/2012/02/2012-02-27-20-43-41.482-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>Sanded off the rough edges using an 80 grit sand paper. The roughest I can find. Looks pretty decent to me.</p>
<p>Now it&#8217;s time to peel off the protective layer (the blue sticker).</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/2012-02-27-20-46-55.383.jpg"><img class="alignnone  wp-image-828" title="2012-02-27 20-46-55.383" src="http://waihung.net/wp-content/uploads/2012/02/2012-02-27-20-46-55.383-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>I must now stick the transparency paper on it as quickly as possible to avoid any unwanted exposure.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/2012-02-27-20-52-18.615.jpg"><img class="alignnone  wp-image-829" title="2012-02-27 20-52-18.615" src="http://waihung.net/wp-content/uploads/2012/02/2012-02-27-20-52-18.615-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>To properly press the transparency paper against the PCB, I used my sister&#8217;s photo frame.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/2012-02-27-21-01-13.116.jpg"><img class="alignnone  wp-image-830" title="2012-02-27 21-01-13.116" src="http://waihung.net/wp-content/uploads/2012/02/2012-02-27-21-01-13.116-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>Set my phone&#8217;s timer to 8 minutes to properly expose the board. I&#8217;m using a normal fluorescent lamp so that&#8217;s why it took so long. If you&#8217;re using UV light, 90 seconds is more than enough.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/2012-02-27-20-54-17.958.jpg"><img class="alignnone  wp-image-831" title="2012-02-27 20-54-17.958" src="http://waihung.net/wp-content/uploads/2012/02/2012-02-27-20-54-17.958-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>The waiting begins.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/2012-02-27-21-04-05.969.jpg"><img class="alignnone  wp-image-832" title="2012-02-27 21-04-05.969" src="http://waihung.net/wp-content/uploads/2012/02/2012-02-27-21-04-05.969-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>While waiting, I prepared the etchant for the photo resist layer. Just mixed some sodium hydroxide crystals with water. Two to three teaspoons is enough.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/2012-02-27-21-06-32.396.jpg"><img class="alignnone  wp-image-833" title="2012-02-27 21-06-32.396" src="http://waihung.net/wp-content/uploads/2012/02/2012-02-27-21-06-32.396-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>After 8 minutes I took out the PCB and dipped it into the etchant solution. Constantly agitated the board in the solution for around 10 minutes and the unwanted areas were washed off. Here&#8217;s the final result.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/2012-02-27-22-40-50.688.jpg"><img class="alignnone  wp-image-834" title="2012-02-27 22-40-50.688" src="http://waihung.net/wp-content/uploads/2012/02/2012-02-27-22-40-50.688-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>I&#8217;ll continue this in the next post. The next step will be to etch the unwanted copper areas. Stay tuned <img src='http://waihung.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Part 2 is up. Click <a title="Home Made PCB – Etching Copper Layer (Part 2)" href="http://waihung.net/home-made-pcb-etching-copper-layer-part-2/" target="_blank">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://waihung.net/home-made-pcb-etching-photo-resist-layer/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Tools To Make Your Own PCB</title>
		<link>http://waihung.net/tools-to-make-your-own-pcb/</link>
		<comments>http://waihung.net/tools-to-make-your-own-pcb/#comments</comments>
		<pubDate>Sat, 25 Feb 2012 13:00:58 +0000</pubDate>
		<dc:creator>waihung</dc:creator>
				<category><![CDATA[PCB]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[pcb]]></category>

		<guid isPermaLink="false">http://waihung.net/?p=716</guid>
		<description><![CDATA[Today after work I went to Jalan Pasar to do some shopping. Went to get some tools and supplies to make my own PCB at home. I made the PCB shown above in college, it was for an IR Transmitter and Receiver project. I&#8217;ve always wanted to make my own PCB at home but couldn&#8217;t find the time and resources ...]]></description>
				<content:encoded><![CDATA[<p>Today after work I went to Jalan Pasar to do some shopping. Went to get some tools and supplies to make my own PCB at home.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/2012-02-26-20-03-57.670.jpg"><img class="alignnone  wp-image-718" title="2012-02-26 20-03-57.670" src="http://waihung.net/wp-content/uploads/2012/02/2012-02-26-20-03-57.670-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>I made the PCB shown above in college, it was for an IR Transmitter and Receiver project. I&#8217;ve always wanted to make my own PCB at home but couldn&#8217;t find the time and resources to do it until now.</p>
<p>The first thing I bought was a hand drill, it is necessary to make holes for the components to go through the board. It retails for RM 65 and it doesn&#8217;t have any warranty. Fingers crossed.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/2012-02-25-17-12-45.581.jpg"><img class="alignnone  wp-image-719" title="2012-02-25 17-12-45.581" src="http://waihung.net/wp-content/uploads/2012/02/2012-02-25-17-12-45.581-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>The drill is pretty simple. No speed adjustments or a trigger, just an on/off switch.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/2012-02-25-17-13-59.935.jpg"><img class="alignnone  wp-image-720" title="2012-02-25 17-13-59.935" src="http://waihung.net/wp-content/uploads/2012/02/2012-02-25-17-13-59.935-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>Comes with 0.5, 1.0, 1.5, 2.4 and 3.0 mm drill bits.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/2012-02-25-17-14-51.544.jpg"><img class="alignnone  wp-image-721" title="2012-02-25 17-14-51.544" src="http://waihung.net/wp-content/uploads/2012/02/2012-02-25-17-14-51.544-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>I&#8217;ll be using only the 1.0mm drill bit. It&#8217;s large enough for most components to through. So far I&#8217;ve not been able to find any shops that sells 1.0mm drill bit, I&#8217;ve got to be extra careful with it for now.</p>
<p>Next are the PCBs. I&#8217;m planning to go down the photo-resist route so I bought the appropriate type. They cost RM 11 each.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/2012-02-25-17-17-05.033.jpg"><img class="alignnone  wp-image-722" title="2012-02-25 17-17-05.033" src="http://waihung.net/wp-content/uploads/2012/02/2012-02-25-17-17-05.033-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>This board can also be exposed using normal fluorescent light. It takes longer though, around 6 to 10 minutes as stated.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/2012-02-26-20-38-58.356.jpg"><img class="alignnone  wp-image-723" title="2012-02-26 20-38-58.356" src="http://waihung.net/wp-content/uploads/2012/02/2012-02-26-20-38-58.356-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>I&#8217;ll be using my mum&#8217;s reading light. It uses a fluorescent lamp tube.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/2012-02-26-20-42-39.555.jpg"><img class="alignnone  wp-image-724" title="2012-02-26 20-42-39.555" src="http://waihung.net/wp-content/uploads/2012/02/2012-02-26-20-42-39.555-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/2012-02-26-20-43-09.262.jpg"><img class="alignnone  wp-image-725" title="2012-02-26 20-43-09.262" src="http://waihung.net/wp-content/uploads/2012/02/2012-02-26-20-43-09.262-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>Next, is the etchant chemical for the photo resist coating. They are actually sodium hydroxide, so I bought them in the crystal form. Don&#8217;t show it in front of a police, it looks very suspicious lol. Just mix it with water and you&#8217;re good to go.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/2012-02-25-17-18-05.238.jpg"><img class="alignnone  wp-image-726" title="2012-02-25 17-18-05.238" src="http://waihung.net/wp-content/uploads/2012/02/2012-02-25-17-18-05.238-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>Finally, this is the ferric chloride acid for etching the copper layer. They cost RM 6 per bottle.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/2012-02-25-17-24-46.492.jpg"><img class="alignnone  wp-image-727" title="2012-02-25 17-24-46.492" src="http://waihung.net/wp-content/uploads/2012/02/2012-02-25-17-24-46.492-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>A word of warning for those who are using this. <strong>Do not pour it into your sink or drain after using.</strong> It is poisonous and corrosive. Doing so will only cause it to end up in your drinks or food in the future. Collect all of the used chemical and send it to your local chemical disposal shop.</p>
<p>I already have in mind what I&#8217;m going to make, it&#8217;s going to be exciting <img src='http://waihung.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  I should be posting an update on the PCB making process in a few days. Stay tuned.</p>
]]></content:encoded>
			<wfw:commentRss>http://waihung.net/tools-to-make-your-own-pcb/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>555 Timer Flashing LED</title>
		<link>http://waihung.net/555-timer-flashing/</link>
		<comments>http://waihung.net/555-timer-flashing/#comments</comments>
		<pubDate>Thu, 23 Feb 2012 14:59:49 +0000</pubDate>
		<dc:creator>waihung</dc:creator>
				<category><![CDATA[555 Timer]]></category>
		<category><![CDATA[555]]></category>
		<category><![CDATA[electronics]]></category>

		<guid isPermaLink="false">http://waihung.net/?p=704</guid>
		<description><![CDATA[I found a 555 Timer IC from an old PCB and decided to play with it. Basically what a 555 Timer does is provide time delays by creating oscillations. Just imagine it like a function generator but only for square waves. I don&#8217;t have much knowledge in the 555 Timer but from what I&#8217;ve read so far, it has 3 modes ...]]></description>
				<content:encoded><![CDATA[<p>I found a 555 Timer IC from an old PCB and decided to play with it. Basically what a 555 Timer does is provide time delays by creating oscillations. Just imagine it like a function generator but only for square waves.</p>
<p>I don&#8217;t have much knowledge in the 555 Timer but from what I&#8217;ve read so far, it has 3 modes of operation. They are monostable, bistable, and astable. In this demo, I&#8217;ll be using the astable mode because it can provide a square wave oscillation at pin 3. With that, I can do a simple flashing LED circuit like I&#8217;ve done in the past with both PIC and the Arduino. Only this time there&#8217;s no microcontroller and programming involved.</p>
<p>In a microcontroller, we can program it to flash the LED in any desired intervals but for the 555 Timer, the intervals (or the oscillation frequency) is based on the resistor and capacitor values used in the circuit. Actually I&#8217;m still not familiar with how to calculate it, so I went to look for a schematic online.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/circuit-flashing-led-schematic1.gif"><img class="alignnone size-full wp-image-706" title="circuit-flashing-led-schematic[1]" src="http://waihung.net/wp-content/uploads/2012/02/circuit-flashing-led-schematic1.gif" alt="" width="347" height="272" /></a></p>
<p>This circuit uses a 1uF capacitor but unfortunately I don&#8217;t have it, so I played mix and match with all the resistors and capacitors I have to get a low enough frequency that the LED flashes can be seen by the eye.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/2012-02-23-22-28-54.525.jpg"><img class="alignnone  wp-image-707" title="2012-02-23 22-28-54.525" src="http://waihung.net/wp-content/uploads/2012/02/2012-02-23-22-28-54.525-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>Somehow I ended up using two 100uF capacitors in the circuit and I will report back why. In the meantime, here&#8217;s a video showing how the circuit works.</p>
<div class='video_frame'><iframe id='youtube_video_6' class='youtube_video' style='height:360px;width:640px' src='http://www.youtube.com/embed/tDs2nu9ljfM?autohide=2&amp;autoplay=0&amp;controls=1&amp;disablekb=0&amp;fs=0&amp;hd=0&amp;loop=0&amp;rel=0&amp;showinfo=1&amp;showsearch=1&amp;wmode=transparent&amp;enablejsapi=1' width='640' height='360' frameborder='0'></iframe></div>
<p>Thanks for reading <img src='http://waihung.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://waihung.net/555-timer-flashing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Arduino Playing a Melody</title>
		<link>http://waihung.net/arduino-playing-a-melody/</link>
		<comments>http://waihung.net/arduino-playing-a-melody/#comments</comments>
		<pubDate>Tue, 21 Feb 2012 13:20:33 +0000</pubDate>
		<dc:creator>waihung</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[electronics]]></category>

		<guid isPermaLink="false">http://waihung.net/?p=688</guid>
		<description><![CDATA[There are many ways a microcontroller can display its&#8217; output, but they can be categorized into three types, sight, motion and sound. Sight means that the output is visual based, such as LEDs and LCDs. I&#8217;ve done many examples on that so today I&#8217;m going to step into new territory, sound. To produce sound, we need a speaker. Normal speakers ...]]></description>
				<content:encoded><![CDATA[<p>There are many ways a microcontroller can display its&#8217; output, but they can be categorized into three types, sight, motion and sound. Sight means that the output is visual based, such as LEDs and LCDs. I&#8217;ve done many examples on that so today I&#8217;m going to step into new territory, sound.</p>
<p>To produce sound, we need a speaker. Normal speakers are overkill in this simple demonstration, so I dug out a computer buzzer from an old Pentium II PC and to my delight, it still works!</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/2012-02-21-20-03-46.279.jpg"><img class="alignnone  wp-image-689" title="2012-02-21 20-03-46.279" src="http://waihung.net/wp-content/uploads/2012/02/2012-02-21-20-03-46.279-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>It has two leads, positive and negative. On the other end, there&#8217;s a pin header where normally it&#8217;ll be plugged into a computer motherboard.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/2012-02-21-20-04-59.790.jpg"><img class="alignnone  wp-image-691" title="2012-02-21 20-04-59.790" src="http://waihung.net/wp-content/uploads/2012/02/2012-02-21-20-04-59.790-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>To overcome that, I&#8217;ve used two jumper cables to connect it to the Arduino. I&#8217;ll be using the Uno R3 because these jumper cables can be plugged straight into it. Positive to Digital Pin 8 and negative to Ground.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/2012-02-21-20-06-16.704.jpg"><img class="alignnone  wp-image-698" title="2012-02-21 20-06-16.704" src="http://waihung.net/wp-content/uploads/2012/02/2012-02-21-20-06-16.704-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>I wish that I can write my own code to produce a melody but unfortunately, I&#8217;m not musically inclined so I used a sample sketch from the <a title="Arduino Cookbook" href="http://waihung.net/arduino-cookbook/" target="_blank">Arduino Cookbook</a>.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/twinkle_star_code.png"><img class="alignnone size-full wp-image-695" title="twinkle_star_code" src="http://waihung.net/wp-content/uploads/2012/02/twinkle_star_code.png" alt="" width="500" height="750" /></a></p>
<p>So, here it is, playing Twinkle Twinkle Little Star <img src='http://waihung.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<div class='video_frame'><iframe id='youtube_video_7' class='youtube_video' style='height:360px;width:640px' src='http://www.youtube.com/embed/loQXR67wBsM?autohide=2&amp;autoplay=0&amp;controls=1&amp;disablekb=0&amp;fs=0&amp;hd=0&amp;loop=0&amp;rel=0&amp;showinfo=1&amp;showsearch=1&amp;wmode=transparent&amp;enablejsapi=1' width='640' height='360' frameborder='0'></iframe></div>
]]></content:encoded>
			<wfw:commentRss>http://waihung.net/arduino-playing-a-melody/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Arduino Fake Screenshot Trigger</title>
		<link>http://waihung.net/arduino-fake-screenshot-trigger/</link>
		<comments>http://waihung.net/arduino-fake-screenshot-trigger/#comments</comments>
		<pubDate>Sun, 19 Feb 2012 15:59:52 +0000</pubDate>
		<dc:creator>waihung</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[nano]]></category>

		<guid isPermaLink="false">http://waihung.net/?p=679</guid>
		<description><![CDATA[I think most of you will be wondering what I&#8217;m on about. For those of you who are working in an office, and you have a computer on your desk, most of the time you&#8217;ll tend to surf the Internet when there&#8217;s less work or when the boss is not around. This is all nice but what happens if your ...]]></description>
				<content:encoded><![CDATA[<p>I think most of you will be wondering what I&#8217;m on about. For those of you who are working in an office, and you have a computer on your desk, most of the time you&#8217;ll tend to surf the Internet when there&#8217;s less work or when the boss is not around. This is all nice but what happens if your boss suddenly comes barging into your room or cubicle and it wouldn&#8217;t be nice for him/her to see that you&#8217;re not doing work, right?</p>
<p>The purpose of this project that I&#8217;m doing is to solve this once and for all. With the push of a button, a fake screenshot of Excel will be immediately shown on your screen. Of course this button can be placed anywhere on your desk, I will most likely place it near the floor where I can gently hit it with my foot to trigger it. In the video I have the button on the breadboard to make it easier for me to demonstrate. Without further ado, here&#8217;s the video.</p>
<div class='video_frame'><iframe id='youtube_video_8' class='youtube_video' style='height:360px;width:640px' src='http://www.youtube.com/embed/RR0vNyaf0Ig?autohide=2&amp;autoplay=0&amp;controls=1&amp;disablekb=0&amp;fs=0&amp;hd=0&amp;loop=0&amp;rel=0&amp;showinfo=1&amp;showsearch=1&amp;wmode=transparent&amp;enablejsapi=1' width='640' height='360' frameborder='0'></iframe></div>
<p>As mentioned in the video, I&#8217;ve written the program in Visual Basic. The program is very simple, once it detects that the button is being pressed, it will launch another form and that particular form will display the full screen image.</p>
<p>Here is the main program.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/fsscr000.jpg"><img class="alignnone  wp-image-681" title="fsscr000" src="http://waihung.net/wp-content/uploads/2012/02/fsscr000-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>Once it is launched, it will automatically start running and receiving serial data from the Arduino.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/fsscr001.jpg"><img class="alignnone  wp-image-682" title="fsscr001" src="http://waihung.net/wp-content/uploads/2012/02/fsscr001-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>And when the button is pressed, it will launch a new form that will display the full screen image. Here&#8217;s the new form.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/fsscr002.jpg"><img class="alignnone  wp-image-683" title="fsscr002" src="http://waihung.net/wp-content/uploads/2012/02/fsscr002-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>If desired, the image can be changed, perhaps to a screenshot showing Microsoft Word?</p>
<p>Finally, we still need to program the Arduino to send data over the serial port.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/button_vb_code.png"><img class="alignnone size-full wp-image-684" title="button_vb_code" src="http://waihung.net/wp-content/uploads/2012/02/button_vb_code.png" alt="" width="500" height="762" /></a></p>
<p>Besides the reason stated above, this project can also be useful if the user wants to leave his/her computer for a moment and wish to hide what they&#8217;re doing.</p>
<p>Lastly, I should mention that I will not be held liable for any decline of productivity in your office <img src='http://waihung.net/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>Thanks for reading.</p>
]]></content:encoded>
			<wfw:commentRss>http://waihung.net/arduino-fake-screenshot-trigger/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Arduino Controlled by Visual Basic Program</title>
		<link>http://waihung.net/arduino-controlled-by-visual-basic-program/</link>
		<comments>http://waihung.net/arduino-controlled-by-visual-basic-program/#comments</comments>
		<pubDate>Fri, 17 Feb 2012 13:45:15 +0000</pubDate>
		<dc:creator>waihung</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[VB]]></category>

		<guid isPermaLink="false">http://waihung.net/?p=669</guid>
		<description><![CDATA[Before this I&#8217;ve always used the Serial Monitor of the Arduino IDE to communicate with the Arduino. Actually what the Serial Monitor does is basically reading or sending data through the Serial interface. In my future project, I want to create an application in the computer that allows the user to click some buttons to control the Arduino. Currently, the ...]]></description>
				<content:encoded><![CDATA[<p>Before this I&#8217;ve always used the Serial Monitor of the Arduino IDE to communicate with the Arduino. Actually what the Serial Monitor does is basically reading or sending data through the Serial interface. In my future project, I want to create an application in the computer that allows the user to click some buttons to control the Arduino.</p>
<p>Currently, the only programming language that I&#8217;m familiar with and is able to create a GUI (Graphical User Interface) Program (aka not the white text on a black background program) is Visual Basic. I&#8217;ll be using the Express edition since it&#8217;s free. Who doesn&#8217;t like free stuff? <img src='http://waihung.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>In this demonstration, I&#8217;ll be creating a simple program in Visual Basic 2010 that allows the user to turn an LED On or Off on the Arduino. The LED is connected to Digital Pin 13 of the Arduino Uno.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/2012-02-17-20-34-13.228.jpg"><img class="alignnone  wp-image-671" title="2012-02-17 20-34-13.228" alt="" src="http://waihung.net/wp-content/uploads/2012/02/2012-02-17-20-34-13.228-1024x576.jpg" width="717" height="403" /></a></p>
<p>Don&#8217;t freak out cause I didn&#8217;t use a resistor for the LED. This particular type of LED I bought has very high impedance, I&#8217;m not worried that it will burn out.</p>
<p>I wrote a code for the Arduino so that it can receive instructions from the computer.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/arduino_vb_code.png"><img class="alignnone size-full wp-image-673" title="arduino_vb_code" alt="" src="http://waihung.net/wp-content/uploads/2012/02/arduino_vb_code.png" width="500" height="600" /></a></p>
<p>I enclosed the 1 and 0 with inverted commas because the value that I&#8217;ll be sending from the computer will actually be in ASCII.</p>
<p>Here is a screenshot of the program written in Visual Studio 2010 Express.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/arduino_vb_1.png"><img class="alignnone  wp-image-675" title="arduino_vb_1" alt="" src="http://waihung.net/wp-content/uploads/2012/02/arduino_vb_1-1024x576.png" width="717" height="403" /></a></p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/arduino_vb_2.png"><img class="alignnone  wp-image-676" title="arduino_vb_2" alt="" src="http://waihung.net/wp-content/uploads/2012/02/arduino_vb_2-1024x576.png" width="717" height="403" /></a></p>
<p>The serial port baud rate is set to 9600 and the Arduino Uno is using COM4. Visual Basic 2010 comes with the SerialPort function, so it&#8217;s pretty simple to program.</p>
<p>Here is a video demonstrating how the program and the Arduino work together.</p>
<div class='video_frame'><iframe id='youtube_video_9' class='youtube_video' style='height:360px;width:640px' src='http://www.youtube.com/embed/Vz4KVOetlB0?autohide=2&amp;autoplay=0&amp;controls=1&amp;disablekb=0&amp;fs=0&amp;hd=0&amp;loop=0&amp;rel=0&amp;showinfo=1&amp;showsearch=1&amp;wmode=transparent&amp;enablejsapi=1' width='640' height='360' frameborder='0'></iframe></div>
<p>Thanks for reading <img src='http://waihung.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href="http://waihung.net/sketch/Arduino_LED.rar" class="button_link hover_fade target_blank"><span>Download Code</span></a></p>
]]></content:encoded>
			<wfw:commentRss>http://waihung.net/arduino-controlled-by-visual-basic-program/feed/</wfw:commentRss>
		<slash:comments>29</slash:comments>
		</item>
		<item>
		<title>Arduino Voltmeter</title>
		<link>http://waihung.net/arduino-voltmeter/</link>
		<comments>http://waihung.net/arduino-voltmeter/#comments</comments>
		<pubDate>Tue, 14 Feb 2012 14:22:16 +0000</pubDate>
		<dc:creator>waihung</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[ADC]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[nano]]></category>

		<guid isPermaLink="false">http://waihung.net/?p=643</guid>
		<description><![CDATA[I&#8217;ve been experimenting on ADCs alot recently and I suddenly thought of doing this small experiment. I&#8217;ll try to turn my Arduino into a voltmeter by using its&#8217; analog input and the very powerful map() function. I&#8217;ll be using a HD44780 character LCD to display the voltage output and a 10k potentiometer to vary the input voltage going into the ...]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve been experimenting on ADCs alot recently and I suddenly thought of doing this small experiment. I&#8217;ll try to turn my Arduino into a voltmeter by using its&#8217; analog input and the very powerful map() function.</p>
<p>I&#8217;ll be using a HD44780 character LCD to display the voltage output and a 10k potentiometer to vary the input voltage going into the analog input. The Arduino analog inputs can only take in maximum of 5 Volts. Any higher than that you&#8217;ll risk burning the Arduino.</p>
<p>Here&#8217;s the code :</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/voltmeter_code.png"><img class="alignnone size-full wp-image-646" title="voltmeter_code" src="http://waihung.net/wp-content/uploads/2012/02/voltmeter_code.png" alt="" width="500" height="674" /></a></p>
<p>That&#8217;s what I love about Arduinos, it is really really simple to program. The Arduino library is huge and you will often find what you need in the library without having to write your own. Oh yeah, this is the circuit and I&#8217;ll compare the readings with my trusty voltmeter in real-time.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/2012-02-14-20-41-14.836.jpg"><img class="alignnone  wp-image-647" title="2012-02-14 20-41-14.836" src="http://waihung.net/wp-content/uploads/2012/02/2012-02-14-20-41-14.836-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>I&#8217;m starting to like the Arduino Nano and I find myself using it more often than my Uno. If you haven&#8217;t read my previous posts about Arduinos, I do have two Arduinos, the Uno R3 and this, the Nano V3.0. First, is because the Nano plugs into a breadboard which is perfect for prototyping and secondly, the Uno R3 is expensive and I don&#8217;t want to risk ruining it if I did anything silly.</p>
<p>Without further ado, this is a video showing how the code works :</p>
<div class='video_frame'><iframe id='youtube_video_10' class='youtube_video' style='height:360px;width:640px' src='http://www.youtube.com/embed/_w0WQPWaFNs?autohide=2&amp;autoplay=0&amp;controls=1&amp;disablekb=0&amp;fs=0&amp;hd=0&amp;loop=0&amp;rel=0&amp;showinfo=1&amp;showsearch=1&amp;wmode=transparent&amp;enablejsapi=1' width='640' height='360' frameborder='0'></iframe></div>
<p>Thanks for reading <img src='http://waihung.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://waihung.net/arduino-voltmeter/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Microchip PIC16F877A ADC Configuration</title>
		<link>http://waihung.net/pic16f877a-adc-configuration/</link>
		<comments>http://waihung.net/pic16f877a-adc-configuration/#comments</comments>
		<pubDate>Sat, 11 Feb 2012 14:02:47 +0000</pubDate>
		<dc:creator>waihung</dc:creator>
				<category><![CDATA[Microchip PIC]]></category>
		<category><![CDATA[ADC]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[PIC16F877A]]></category>

		<guid isPermaLink="false">http://waihung.net/?p=574</guid>
		<description><![CDATA[I&#8217;ll admit that the datasheet is very confusing especially for beginners like me. In this post, I&#8217;ll attempt to summarize everything I know about the ADC on a PIC16F877A and hopefully it will be informative to my dear readers. First and foremost, we must have a clear picture on what the built-in ADC is doing. Think of it like there&#8217;s ...]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ll admit that the datasheet is very confusing especially for beginners like me. In this post, I&#8217;ll attempt to summarize everything I know about the ADC on a PIC16F877A and hopefully it will be informative to my dear readers.</p>
<p>First and foremost, we must have a clear picture on what the built-in ADC is doing. Think of it like there&#8217;s a little guy living inside the chip that&#8217;s doing all the conversion process. By default it is off, and the user need to ask it to &#8216;wake up&#8217; to execute the conversion. Here&#8217;s a flow diagram to better illustrate the ADC process.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/adc_flow.png"><img class="alignnone  wp-image-575" title="adc_flow" src="http://waihung.net/wp-content/uploads/2012/02/adc_flow.png" alt="" width="332" height="776" /></a></p>
<p>The flow diagram above does not include the configuration but I&#8217;ll cover it as I go. Having a rough picture of the ADC process is essential for understanding the ADC on the PIC16F877A.</p>
<p>Now, onto the configuration of the ADC. There are only <strong>FOUR</strong> registers that you need to understand to configure the ADC. They are <strong>ADCON0, ADCON1, ADRESH </strong>and<strong> ADRESL.</strong> The two most important ones are <strong>ADCON0 </strong>and <strong>ADCON1</strong>. ADRESH and ADRESL are just the registers where the ADC stores the result of the conversion.</p>
<p><span style="text-decoration: underline;"><strong>ADCON0</strong></span></p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/adcon0.png"><img class="alignnone  wp-image-578" title="adcon0" src="http://waihung.net/wp-content/uploads/2012/02/adcon0.png" alt="" width="682" height="108" /></a></p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/adcon0_1.png"><img class="alignnone  wp-image-579" title="adcon0_1" src="http://waihung.net/wp-content/uploads/2012/02/adcon0_1.png" alt="" width="722" height="230" /></a></p>
<p>The user has to select the correct clock conversion. The period must be at least more than 1.6us to obtain an accurate conversion. For example, I&#8217;m using a 4MHz crystal oscillator on my PIC16F877A. So if I select Fosc/2, thats 2MHz and the period is just 500ns and it&#8217;s far less than the 1.6us required.</p>
<p>What if I select Fosc/8? That will give me 0.5MHz and the period is 2us. That is more than 1.6us so it can be selected. So, my ADCON0 is now 01xx xxxx.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/adcon0_2.png"><img class="alignnone  wp-image-581" title="adcon0_2" src="http://waihung.net/wp-content/uploads/2012/02/adcon0_2.png" alt="" width="367" height="170" /></a></p>
<p>Now onto selecting the Analog Channel. The ADC can only have one input at a time so the user must select which pin he/she wants to use.</p>
<p>Referring to the PIC16F877A pinout diagram,</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/adcon0_3.png"><img class="alignnone  wp-image-582" title="adcon0_3" src="http://waihung.net/wp-content/uploads/2012/02/adcon0_3.png" alt="" width="317" height="345" /></a></p>
<p>These are the Analog Channels available. Let&#8217;s say in my circuit I have an input into Analog Channel 3 (which is also PORTA bit 3), so I have to set ADCON0 to 0101 1xxx.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/adcon0_4.png"><img class="alignnone  wp-image-584" title="adcon0_4" src="http://waihung.net/wp-content/uploads/2012/02/adcon0_4.png" alt="" width="726" height="194" /></a></p>
<p>Lastly, we will set all these bits to 0 because this is just the initialization, the actual program has yet to start (Later in the code I will individually set these bits to enable ADC). So that makes ADCON0 to be 0101 1000.</p>
<p><span style="text-decoration: underline;"><strong>ADCON1</strong></span></p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/adcon1.png"><img class="alignnone  wp-image-586" title="adcon1" src="http://waihung.net/wp-content/uploads/2012/02/adcon1.png" alt="" width="680" height="111" /></a></p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/adcon1_1.png"><img class="alignnone  wp-image-587" title="adcon1_1" src="http://waihung.net/wp-content/uploads/2012/02/adcon1_1.png" alt="" width="592" height="64" /></a></p>
<p>The ADFM bit determines how the result of the ADC is justified. The ADC on the PIC16F877A has 10-bits of resolution, so of course a single register (that has 8 bits) is not enough to contain the 10-bits result. Therefore, two registers are required to store the results. ADRESH and ADRESL (H is the high byte while L is the low byte).</p>
<p>Two registers will allow us to store up to 16 bits, but since there are only 10 bits, we have the flexibility to align it right justified or left justified. Hopefully you will get the picture from the diagram below.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/adcon1_2.png"><img class="alignnone  wp-image-588" title="adcon1_2" src="http://waihung.net/wp-content/uploads/2012/02/adcon1_2.png" alt="" width="668" height="314" /></a></p>
<p>Storing the result in left justified mode is weird and unusual but it gives the user flexibility. Let&#8217;s say my application does not need the 10-bit accuracy, 8 bits is more than enough. So I can just take the result in ADRESH and ignore the remaining two least significant bits in ADRESL (you cannot ignore the two highest significant bit because that will cause the result to be inaccurate). That makes it easier to move values to other registers. Yes, the accuracy of the result will be slightly affected but it is not so critical in applications where you don&#8217;t need accuracy, like my ADC Demo shown <a title="Microchip PIC16F877A Analogue to Digital Conversion" href="http://waihung.net/microchip-pic16f877a-analogue-to-digital-conversion/" target="_blank">here</a>. So, now the value of ADCON1 is 0xxx xxxx.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/adcon1_3.png"><img class="alignnone  wp-image-590" title="adcon1_3" src="http://waihung.net/wp-content/uploads/2012/02/adcon1_3.png" alt="" width="734" height="254" /></a></p>
<p>Next is the ADCS2 bit. Earlier, I calculated that Fosc/8 is adequate, so I selected it in ADCON0. But for Fosc/8, we need to set the ADCS2 bit in ADCON1 also. So, the value of ADCON1 will be 00xx xxxx.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/adcon1_4.png"><img class="alignnone  wp-image-591" title="adcon1_4" src="http://waihung.net/wp-content/uploads/2012/02/adcon1_4.png" alt="" width="744" height="515" /></a></p>
<p>Lastly, the most important part of the ADC configuration is to select the mode for each Analog channel. As shown before, we have Analog Channel 0 to 7. All these inputs can either be set to analog or digital. Referring to the table above, if we don&#8217;t need any analog inputs and require more digital pins (let&#8217;s say for a few LCDs), we can set the PCFG3:0 bits to be 011x. But in this case we do need the Analog inputs, so for simplicity we will set all of them to be in analog mode. Therefore, our final value for ADCON1 is 0000 0000.</p>
<p>One important thing to note is that I&#8217;ve selected Vdd as the Vref+ and Vss as the Vref-, that means that my conversion range is from 0V to 5V. If you need it to be other than that, you can set a custom Vref value by choosing other configurations of PCFG3:0.</p>
<p>That should be it for the configuration of the ADC on the PIC16F877A. I hope this will help you to get started. Thanks for reading <img src='http://waihung.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://waihung.net/pic16f877a-adc-configuration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Writing code for PIC Microcontrollers in C (Hi-Tech C Compiler)</title>
		<link>http://waihung.net/writing-code-for-pic-microcontrollers-in-c-hi-tech-c-compiler/</link>
		<comments>http://waihung.net/writing-code-for-pic-microcontrollers-in-c-hi-tech-c-compiler/#comments</comments>
		<pubDate>Fri, 10 Feb 2012 13:44:26 +0000</pubDate>
		<dc:creator>waihung</dc:creator>
				<category><![CDATA[Microchip PIC]]></category>
		<category><![CDATA[ADC]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[PIC16F877A]]></category>

		<guid isPermaLink="false">http://waihung.net/?p=551</guid>
		<description><![CDATA[I&#8217;ve always wanted to learn how to write PIC programs in C. You might think that&#8217;s odd but I was taught how to write in assembly language and not C unlike other universities or colleges. Most of the time it&#8217;s the other way around. Learning assembly code is a good thing actually because these C code will eventually be translated ...]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve always wanted to learn how to write PIC programs in C. You might think that&#8217;s odd but I was taught how to write in assembly language and not C unlike other universities or colleges. Most of the time it&#8217;s the other way around. Learning assembly code is a good thing actually because these C code will eventually be translated back to assembly language by the compiler. By learning the assembly code, you will have a deeper understanding. I&#8217;ve been told by several people that they did not understand my assembly code because they are more familiar with C. Particularly through this email that I received from one of my readers.</p>
<a rel="prettyPhoto" href="http://waihung.net/wp-content/uploads/2012/02/email_hitech.jpg" title=""><img class="framed alignleft" src="http://waihung.net/wp-content/uploads/2012/02/email_hitech.jpg" title="" alt="" width="783" height="150" /></a><p>Yes I&#8217;ll try. From all the Arduino programming, hopefully I&#8217;ll know a thing or two on how to write in C.</p>
<p>But first, when installing MPLAB, make sure that you have installed the Hi-Tech C Compiler also, you will be prompted when the MPLAB installation is done.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/mplab_install_hitech.png"><img class="alignnone size-full wp-image-558" title="mplab_install_hitech" src="http://waihung.net/wp-content/uploads/2012/02/mplab_install_hitech.png" alt="" width="450" height="350" /></a></p>
<p>Next, when creating a project file, choose the Hi-Tech Universal Toolsuite. In it you will find the C Compiler.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/choose_hitech.png"><img class="alignnone size-full wp-image-559" title="choose_hitech" src="http://waihung.net/wp-content/uploads/2012/02/choose_hitech.png" alt="" width="520" height="414" /></a></p>
<p>That&#8217;s about it when creating a project. I&#8217;ll attempt to re-write my assembly code for the ADC Demo I&#8217;ve done in a previous <a title="Microchip PIC16F877A Analogue to Digital Conversion" href="http://waihung.net/microchip-pic16f877a-analogue-to-digital-conversion/" target="_blank">post</a>.</p>
<p><a href="http://waihung.net/wp-content/uploads/2011/12/2012-01-30-00-11-08.056.jpg"><img class="alignnone  wp-image-433" title="2012-01-30 00-11-08.056" src="http://waihung.net/wp-content/uploads/2011/12/2012-01-30-00-11-08.056.jpg" alt="" width="627" height="353" /></a></p>
<p>I&#8217;m using a 10k potentiometer to vary the voltage going into Analog Channel 0. The ADC will convert that voltage input and store it in ADRESH. From there, the code will decide how many LEDs will turn on. The higher the input voltage, the more LEDs will turn on. Without further ado, let&#8217;s get to the code.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/adc_hitech_code.png"><img class="alignnone size-full wp-image-572" title="adc_hitech_code" src="http://waihung.net/wp-content/uploads/2012/02/adc_hitech_code.png" alt="" width="790" height="1312" /></a></p>
<p>Here it is and it took me quite a while to write this simple code. Done some heavy googling to find equivalent functions for set bit and clear bit. I&#8217;ll try to explain the code line by line. Also, I have tested this code on the actual hardware and it works just the same like my old code written in assembly language.</p>
<p>First I got the set bit, clear bit, flip bit and test bit function code from an online forum. For the initialization, we need to include pic.h and htc.h. That&#8217;s where all the function is from. Now instead of calculating the delay manually, we can use the delay function. But of course the compiler needs to know what is your oscillator frequency. I&#8217;ve set it to 4MHz because that&#8217;s what I&#8217;m using. The delay function is given by _delay(in seconds), __delay_ms(in ms) and __delay_us(in us). That&#8217;s far more easier than using assembly code.</p>
<p>The configuration of the ADC is self-explanatory. The following infinite while loop is to test whether the ADC conversion is completed or not. If completed, the code will start testing the values of ADRESH to determine how large it is and correspondingly decide how many LEDs to turn on.</p>
<p>If the value of ADRESH is more than 40, the 1st LED will turn on. If the value of ADRESH is more than 80, the 2nd LED will turn on. That goes on in increments of 40 until it reaches 200. Yes I know 255 is the maximum but I don&#8217;t need accuracy in this code, this is just a demo to show the capabilities of the ADC.</p>
<p>I hope this will help some of my readers out there. If you have any questions, feel free to ask me. I&#8217;ll be glad to answer them (if I can <img src='http://waihung.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ).</p>
]]></content:encoded>
			<wfw:commentRss>http://waihung.net/writing-code-for-pic-microcontrollers-in-c-hi-tech-c-compiler/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fritzing, another schematic/PCB software</title>
		<link>http://waihung.net/fritzing/</link>
		<comments>http://waihung.net/fritzing/#comments</comments>
		<pubDate>Thu, 09 Feb 2012 14:06:31 +0000</pubDate>
		<dc:creator>waihung</dc:creator>
				<category><![CDATA[PCB]]></category>
		<category><![CDATA[Reviews]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[pcb]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://waihung.net/?p=535</guid>
		<description><![CDATA[In an older post, I talked about using EAGLE to draw out schematics and PCBs. Please check it out here. I&#8217;ve stumbled across another software and I found it to be very interesting. Have you ever gone to the Arduino.cc website and stumbled across graphical schematics like these : And also the schematics I&#8217;ve drawn in a previous post? : ...]]></description>
				<content:encoded><![CDATA[<p>In an older post, I talked about using EAGLE to draw out schematics and PCBs. Please check it out <a title="EAGLE PCB Software" href="http://waihung.net/eagle-pcb-software/" target="_blank">here</a>. I&#8217;ve stumbled across another software and I found it to be very interesting.</p>
<p>Have you ever gone to the Arduino.cc website and stumbled across graphical schematics like these :</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/ExampleCircuit_bb1.png"><img class="alignnone  wp-image-537" title="ExampleCircuit_bb[1]" src="http://waihung.net/wp-content/uploads/2012/02/ExampleCircuit_bb1.png" alt="" width="284" height="299" /></a></p>
<p>And also the schematics I&#8217;ve drawn in a previous post? :</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/arduino_lcd_smartie_sch.png"><img class="alignnone size-medium wp-image-503" title="arduino_lcd_smartie_sch" src="http://waihung.net/wp-content/uploads/2012/02/arduino_lcd_smartie_sch-300x252.png" alt="" width="300" height="252" /></a></p>
<p>I will go as far as to say that it&#8217;s kinda cute lol. You can draw all the above using Fritzing. Not only that it can do graphical schematics, it can also do normal schematics and PCB design. The library is not huge but it&#8217;s sufficient for simple circuits.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/fritzing_mode.png"><img class="alignnone size-full wp-image-538" title="fritzing_mode" src="http://waihung.net/wp-content/uploads/2012/02/fritzing_mode.png" alt="" width="316" height="91" /></a></p>
<p>When I&#8217;m presented with schematics that are made out of boxes and lines, I often get confused and it will take me some time to get the picture (I hope I&#8217;m not the only one lol). For example like this :</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/arduino_lcd_smartie_sch2.png"><img class="alignnone size-medium wp-image-504" title="arduino_lcd_smartie_sch2" src="http://waihung.net/wp-content/uploads/2012/02/arduino_lcd_smartie_sch2-300x223.png" alt="" width="300" height="223" /></a></p>
<p>Most of the time these schematics are only available in one colour, black. For some that are used to looking at schematics (or have done so for the most part of your life) then it should be a piece of cake. But what if you could present it graphically? It will be easier for yourself and everyone too!</p>
<p>When you launch Fritzing, you will be presented with a breadboard. You can start designing your schematics by just transferring what you have on your breadboard, don&#8217;t need to figure out the connections again. Not using breadboards for your prototype? Don&#8217;t worry you can use perfboards too.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/bread_perf.png"><img class="alignnone  wp-image-541" title="bread_perf" src="http://waihung.net/wp-content/uploads/2012/02/bread_perf.png" alt="" width="461" height="337" /></a></p>
<p>I&#8217;ll show you some of the interesting library files available in Fritzing.</p>
<p>Arduinos? No problem. Uno, Nano, Mega, Mini and even the Ethernet Shield are available.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/arduino_example.png"><img class="alignnone  wp-image-540" title="arduino_example" src="http://waihung.net/wp-content/uploads/2012/02/arduino_example.png" alt="" width="533" height="396" /></a></p>
<p>These are common components such as RCL, inputs and outputs.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/fritz_common.png"><img class="alignnone  wp-image-542" title="fritz_common" src="http://waihung.net/wp-content/uploads/2012/02/fritz_common.png" alt="" width="543" height="364" /></a></p>
<p>There are also a variety of ICs available.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/fritz_ic.png"><img class="alignnone size-full wp-image-543" title="fritz_ic" src="http://waihung.net/wp-content/uploads/2012/02/fritz_ic.png" alt="" width="507" height="312" /></a></p>
<p>Unfortunately, the library for PIC microcontrollers is still under development but I&#8217;m sure it will arrive soon.</p>
<p>And lastly, the best thing about Fritzing is it&#8217;s <strong>FREE</strong>! Go download it now at <a href="http://fritzing.org" target="_blank">fritzing.org</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://waihung.net/fritzing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Arduino Nano Revived! (Part 2)</title>
		<link>http://waihung.net/arduino-nano-revived-part-2/</link>
		<comments>http://waihung.net/arduino-nano-revived-part-2/#comments</comments>
		<pubDate>Mon, 06 Feb 2012 13:38:39 +0000</pubDate>
		<dc:creator>waihung</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[nano]]></category>

		<guid isPermaLink="false">http://waihung.net/?p=513</guid>
		<description><![CDATA[I bought my Arduino Nano V3.0 from Ebay and it arrived dead. This is Part 2 of my encounter with the Nano. If you&#8217;ve not read Part 1, I strongly recommend you to do so here. Thank you. So I got my new Uno R3 and the first thing I did was trying to burn a bootloader onto the Nano. ...]]></description>
				<content:encoded><![CDATA[<p>I bought my Arduino Nano V3.0 from Ebay and it arrived dead. This is Part 2 of my encounter with the Nano. If you&#8217;ve not read Part 1, I strongly recommend you to do so <a title="Faulty Arduino Nano (Part 1)" href="http://waihung.net/faulty-arduino-nano/" target="_blank">here</a>. Thank you.</p>
<p>So I got my new Uno R3 and the first thing I did was trying to burn a bootloader onto the Nano.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/2012-02-06-20-56-37.687.jpg"><img class="alignnone  wp-image-517" title="2012-02-06 20-56-37.687" src="http://waihung.net/wp-content/uploads/2012/02/2012-02-06-20-56-37.687-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>&#8220;Hi, my name is Uno and I&#8217;m from Italy. Nice to meet you.&#8221; says the Uno. I like to think that electronic items have personalities. Lol.</p>
<p>Back to the burning the bootloader. I followed the schematics on the arduino.cc website and here is how to set it up.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/2012-02-06-21-03-52.757.jpg"><img class="alignnone  wp-image-518" title="2012-02-06 21-03-52.757" src="http://waihung.net/wp-content/uploads/2012/02/2012-02-06-21-03-52.757-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>So I fired up the Arduino IDE and it <strong>failed</strong> again. Done all sorts of tinkering and couldn&#8217;t get it to work. At this point, I assumed that the Nano is a goner. So, I played around with the Uno for some time and chucked the Nano back in its&#8217; box.</p>
<p>Today I had some free time so I took it out again and decided to check <strong>every single connection</strong> on the Nano&#8217;s PCB by referring to the official schematics.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/2012-02-06-13-04-56.677.jpg"><img class="alignnone  wp-image-519" title="2012-02-06 13-04-56.677" src="http://waihung.net/wp-content/uploads/2012/02/2012-02-06-13-04-56.677-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>This was extremely tedious as all the components on the Nano are SMDs (Surface Mounted Device) and the pins are notoriously small. It made my multimeter&#8217;s fine tip probes looked like they&#8217;re giants.</p>
<p>I soldiered on and all was well until I reached pin 29 of the ATmega 328 (there are 32 pins in total!). That is the RESET pin and when I used the continuity test, it detected that the RESET pin is shorted to ground all the time. No, it shouldn&#8217;t do that, it should be pulled high. So I looked around to find any soldering faults that made the RESET pin shorted to ground (praying to God that it&#8217;s not a PCB design fault).</p>
<p>Lo and behold, I found this. On the left side of the Nano, there was a tiny solder joint between the GND and RESET pin. This was causing the chip to be on RESET all the time. The below picture is <strong>after</strong> I fixed the solder joint.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/2012-02-06-14-55-45.822.jpg"><img class="alignnone  wp-image-520" title="2012-02-06 14-55-45.822" src="http://waihung.net/wp-content/uploads/2012/02/2012-02-06-14-55-45.822-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>I removed it easily by using a pen knife and you can see the leftover in the picture above. That is some poor soldering by the folks in Hong Kong (I suspect China but Hong Kong is China, so yeah China lol). Testing the pins again and I no longer find that the RESET pin is shorted to ground. Hopefully this is it.</p>
<p>Connected it to USB and immediately the &#8216;L&#8217; led lit up and blinked, that&#8217;s a good sign. So I uploaded the blink sketch and it was <strong>successful. </strong>Praise the Lord <img src='http://waihung.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/upload_ok.png"><img class="alignnone size-full wp-image-521" title="upload_ok" src="http://waihung.net/wp-content/uploads/2012/02/upload_ok.png" alt="" width="500" height="600" /></a></p>
<p>This has been a frustrating journey in the world of Arduinos. I regretted buying it from Ebay just because it was cheap. I spent so much time tinkering with it and there was once I mistakenly shorted 5V with Ground and a diode blew. I had to remove it and solder a jumper wire between the two pads.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/2012-02-06-14-53-44.105.jpg"><img class="alignnone  wp-image-522" title="2012-02-06 14-53-44.105" src="http://waihung.net/wp-content/uploads/2012/02/2012-02-06-14-53-44.105-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>It&#8217;s not pretty but at least it works. Now I should be more careful not to do anything silly.</p>
<p>But in the end, it was a happy ending and the Nano came back to life. To commemorate the revival of the Nano, I&#8217;ve done this.</p>
<div class='video_frame'><iframe id='youtube_video_11' class='youtube_video' style='height:360px;width:640px' src='http://www.youtube.com/embed/VF9N3MdSCfA?autohide=2&amp;autoplay=0&amp;controls=1&amp;disablekb=0&amp;fs=0&amp;hd=0&amp;loop=0&amp;rel=0&amp;showinfo=1&amp;showsearch=1&amp;wmode=transparent&amp;enablejsapi=1' width='640' height='360' frameborder='0'></iframe></div>
<p>The moral of the story : Don&#8217;t get anything that&#8217;s &#8216;too good to be true&#8217; on Ebay. It usually doesn&#8217;t end well.</p>
<p>Long live the Nano!</p>
]]></content:encoded>
			<wfw:commentRss>http://waihung.net/arduino-nano-revived-part-2/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Faulty Arduino Nano (Part 1)</title>
		<link>http://waihung.net/faulty-arduino-nano/</link>
		<comments>http://waihung.net/faulty-arduino-nano/#comments</comments>
		<pubDate>Mon, 06 Feb 2012 09:55:18 +0000</pubDate>
		<dc:creator>waihung</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[nano]]></category>

		<guid isPermaLink="false">http://waihung.net/?p=288</guid>
		<description><![CDATA[What I&#8217;m writing on this post happened a month ago and it was before I got my Uno R3. After much hassle I&#8217;m finally able to share this with you all. I ordered an Arduino Nano V3.0 on Ebay. The seller is from Hong Kong and it took around 2 weeks for it to arrive. It&#8217;s not a genuine Arduino though, at ...]]></description>
				<content:encoded><![CDATA[<p>What I&#8217;m writing on this post happened a month ago and it was before I got my Uno R3. After much hassle I&#8217;m finally able to share this with you all.</p>
<p>I ordered an Arduino Nano V3.0 on Ebay. The seller is from Hong Kong and it took around 2 weeks for it to arrive. It&#8217;s not a genuine Arduino though, at only USD 15 (RM45) it&#8217;s very cheap so I didn&#8217;t put much thought into it.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/01/nano_ebay.jpg"><img class="alignnone  wp-image-290" title="nano_ebay" src="http://waihung.net/wp-content/uploads/2012/01/nano_ebay-958x1024.jpg" alt="" width="671" height="717" /></a></p>
<p>So came the day it arrived and I was very excited.</p>
<p><a href="http://waihung.net/wp-content/uploads/2011/12/100_7495.jpg"><img class="alignnone size-medium wp-image-296" title="100_7495" src="http://waihung.net/wp-content/uploads/2011/12/100_7495-300x226.jpg" alt="" width="300" height="226" /></a></p>
<p><a href="http://waihung.net/wp-content/uploads/2011/12/100_7496.jpg"><img class="alignnone size-medium wp-image-297" title="100_7496" src="http://waihung.net/wp-content/uploads/2011/12/100_7496-300x226.jpg" alt="" width="300" height="226" /></a></p>
<p><a href="http://waihung.net/wp-content/uploads/2011/12/100_7497.jpg"><img class="alignnone size-medium wp-image-298" title="100_7497" src="http://waihung.net/wp-content/uploads/2011/12/100_7497-300x226.jpg" alt="" width="300" height="226" /></a></p>
<p><a href="http://waihung.net/wp-content/uploads/2011/12/100_7499.jpg"><img class="alignnone size-medium wp-image-299" title="100_7499" src="http://waihung.net/wp-content/uploads/2011/12/100_7499-300x226.jpg" alt="" width="300" height="226" /></a></p>
<p>I knew the Nano was small but I didnt expect it to be this small. An old RM1 coin is bigger than it.</p>
<p>So I plugged it into my computer and it detected the FTDI chip (that&#8217;s a USB to serial converter chip built into older Arduinos).</p>
<p><a href="http://waihung.net/wp-content/uploads/2011/12/device_manager.jpg"><img class="alignnone  wp-image-300" title="device_manager" src="http://waihung.net/wp-content/uploads/2011/12/device_manager.jpg" alt="" width="448" height="317" /></a></p>
<p>The driver installed fine and I tried to upload a sketch through the Arduino IDE (the latest version 1.0 btw).</p>
<p><a href="http://waihung.net/wp-content/uploads/2011/12/upload_error.png"><img class="alignnone size-full wp-image-301" title="upload_error" src="http://waihung.net/wp-content/uploads/2011/12/upload_error.png" alt="" width="500" height="600" /></a></p>
<p>Immediately, an error code was shown and after a quick search, that is a common error code for device not found.</p>
<p>I looked on the Internet for hours, and then I stumbled upon this forum which says pre 2009 models did not properly ground the TEST pin (pin 26) of the FTDI chip.<br />
And, true enough on the PCB it&#8217;s printed year 2009, and to double-check I used the continuity check on my multimeter and detected no connection at all to ground.</p>
<p>Feeling furious and was about to contact the seller, I continue to read the forum and some people managed to make it work by just jumping pins 26 and 25. Miraculously, pin 25 is ground and all I had to do was jump the two pins. Being an SMD, it was easier said than done. I took a good 15 minutes to form a tiny blob of solder between pins 26 and 25.  (I wish that I can show you a picture of it but my camera is absolutely useless in macro mode). So I fired up the Arduino IDE again, and it<strong> failed</strong>, still showing the same error message.</p>
<p>Feeling frustrated, I contacted the seller immediately and he insisted that he tested my unit before sending it out. I didn&#8217;t want to waste any money shipping back my unit to him, so I soldiered on and searched the Internet for more answers. Finally, I found the culprit, my unit did not have the bootloader installed.</p>
<p>In short, the Arduino is actually just a platform utilizing an already established Atmel 328 chip. To program the Atmel chip by itself, you don&#8217;t need a bootloader. But once the Atmel chip is plugged into the Arduino platform, it needs the bootloader so that the Arduino IDE can detect it and subsequently upload sketches into it. If the Atmel chip has the correct bootloader, upon powering up the Arduino, the built in LED (which is connected to Digital Pin 13) will blink as a sign to confirm that it has the bootloader. Mine doesn&#8217;t blink at all. The only LED that lights up is the Power LED. It had to be the missing bootloader.</p>
<p>In the official Arduino site, arduino.cc, there is a cheap, almost free way of burning a bootloader into the chip. It&#8217;s called Parallel Programmer. You can read more about it <a title="here" href="http://arduino.cc/en/Hacking/ParallelProgrammer" target="_blank">here</a>. Basically, the user just need to connect some resistors from some of the pins on the Parallel port to the ICSP header on the Arduino. Below is the schematics taken from the website :</p>
<p><a href="http://waihung.net/wp-content/uploads/2011/12/programmer_schematic1.jpg"><img class="alignnone size-full wp-image-303" title="programmer_schematic[1]" src="http://waihung.net/wp-content/uploads/2011/12/programmer_schematic1.jpg" alt="" width="492" height="242" /></a></p>
<p>Looks simple. Since my new computer doesn&#8217;t have a Parallel port in the Rear IO, I had to dig out my old parallel port header bracket (Thank God that my motherboard still has a parallel port header) and I connected it to the Arduino with a few jumper wires. Tested the connections with my multimeter and it&#8217;s solid.</p>
<p>It&#8217;s a mess but I&#8217;ll do anything to revive my Arduino.</p>
<p><a href="http://waihung.net/wp-content/uploads/2011/12/100_7505.jpg"><img class="alignnone  wp-image-295" title="100_7505" src="http://waihung.net/wp-content/uploads/2011/12/100_7505-773x1024.jpg" alt="" width="541" height="717" /></a></p>
<p><a href="http://waihung.net/wp-content/uploads/2011/12/100_7504.jpg"><img class="alignnone  wp-image-294" title="100_7504" src="http://waihung.net/wp-content/uploads/2011/12/100_7504-1024x773.jpg" alt="" width="717" height="541" /></a></p>
<p>Fired up the IDE again and selected the burn bootloader mode. It <strong>failed</strong> again. Apparently, the Parallel programmer method is not always consistent and might work for some people only. I guess I&#8217;m the unlucky one. There are only two options left now, getting an Atmel chip programmer or getting another Arduino to flash the bootloader on this one. I chose the latter one for an obvious reason, at least I still have an Arduino if all else fails.</p>
<p>Feeling afraid and skeptical towards non-official Arduino boards, I opt for the official ones which are Made in Italy and comes with a nice box (and a few stickers, like you get from buying an Iphone). So I placed an order right away for the latest Arduino Uno R3 and it costed me RM 105 (painful I know). Well at least the Uno R3 doesn&#8217;t use the FTDI chip anymore.</p>
<p><a href="http://waihung.net/wp-content/uploads/2011/12/uno_r3_order.png"><img class="alignnone  wp-image-307" title="uno_r3_order" src="http://waihung.net/wp-content/uploads/2011/12/uno_r3_order-1024x534.png" alt="" width="717" height="374" /></a></p>
<p>I bought it from an official distributor listed on the Arduino.cc website. ( I have already received the Uno R3 but only able to write this post now).</p>
<p>The Arduino adventure continues&#8230; (Part 2 is up, you can read it <a title="Arduino Nano Revived! (Part 2)" href="http://waihung.net/arduino-nano-revived-part-2/" target="_blank">here</a>)</p>
]]></content:encoded>
			<wfw:commentRss>http://waihung.net/faulty-arduino-nano/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>LCD Smartie through Arduino</title>
		<link>http://waihung.net/lcd-smartie-through-arduino/</link>
		<comments>http://waihung.net/lcd-smartie-through-arduino/#comments</comments>
		<pubDate>Sun, 05 Feb 2012 13:40:45 +0000</pubDate>
		<dc:creator>waihung</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[lcd]]></category>
		<category><![CDATA[lcd smartie]]></category>

		<guid isPermaLink="false">http://waihung.net/?p=500</guid>
		<description><![CDATA[I&#8217;ve talked about LCD Smartie a few posts ago but that was connected through the Parallel port. If you&#8217;ve not read it, please do so here. As parallel ports are getting more rare each day, computers start losing parallel ports and electronics will have to move on to a new interface. LCD Smartie is a relatively old project but because ...]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve talked about LCD Smartie a few posts ago but that was connected through the Parallel port. If you&#8217;ve not read it, please do so <a href="/lcd-smartie" target="_blank">here</a>.</p>
<p>As parallel ports are getting more rare each day, computers start losing parallel ports and electronics will have to move on to a new interface. LCD Smartie is a relatively old project but because of its&#8217; popularity among computer enthusiasts, it still lives till today. To give you an idea on how old it is, the latest stable release was on March 2007. That&#8217;s almost five years ago!</p>
<p>In the electronic prototyping world, Arduinos are very popular hence there are many people who tried to use it as a bridge between the computer and the LCD. Not only that, the older Arduinos had FTDI USB to Serial chips built-in and it allowed the Arduino to receive instructions from LCD Smartie. Though newer Arduinos like my Uno R3 doesn&#8217;t use FTDI chips anymore, the ATmega 16U2/8U2 still allowed seamless serial communication to and from the computer so LCD Smartie should work fine too, or at least in my mind. Well, doesn&#8217;t matter, I&#8217;m here to find out.</p>
<p>I&#8217;ve tried some LCD Smartie sketches available online and I found that <a href="http://www.milesburton.com/LCD_Smartie_Powered_By_Arduino_Liquid_Crystal_library" target="_blank">this</a> worked the best.</p>
<p>This is how I connected the LCD to the Arduino.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/arduino_lcd_smartie_sch.png"><img class="alignnone  wp-image-503" title="arduino_lcd_smartie_sch" src="http://waihung.net/wp-content/uploads/2012/02/arduino_lcd_smartie_sch.png" alt="" width="525" height="442" /></a></p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/arduino_lcd_smartie_sch2.png"><img class="alignnone  wp-image-504" title="arduino_lcd_smartie_sch2" src="http://waihung.net/wp-content/uploads/2012/02/arduino_lcd_smartie_sch2.png" alt="" width="493" height="367" /></a></p>
<p>And finally, configure LCD Smartie to use the matrix.dll plugin and set it to the correct port.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/lcd_smartie_arduino_config.png"><img class="alignnone  wp-image-505" title="lcd_smartie_arduino_config" src="http://waihung.net/wp-content/uploads/2012/02/lcd_smartie_arduino_config.png" alt="" width="604" height="413" /></a></p>
<p>That&#8217;s about it and the LCD on the Arduino should receive instructions from the LCD Smartie software.</p>
<p>This is a video to show that the LCD works flawlessly, just like when it was connected through the parallel port.</p>
<div class='video_frame'><iframe id='youtube_video_12' class='youtube_video' style='height:360px;width:640px' src='http://www.youtube.com/embed/Pd6Y6raDSrE?autohide=2&amp;autoplay=0&amp;controls=1&amp;disablekb=0&amp;fs=0&amp;hd=0&amp;loop=0&amp;rel=0&amp;showinfo=1&amp;showsearch=1&amp;wmode=transparent&amp;enablejsapi=1' width='640' height='360' frameborder='0'></iframe></div>
<p>Thanks for reading <img src='http://waihung.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://waihung.net/lcd-smartie-through-arduino/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Arduino Interfacing with HD44780 LCD</title>
		<link>http://waihung.net/arduino-interfacing-with-hd44780-lcd/</link>
		<comments>http://waihung.net/arduino-interfacing-with-hd44780-lcd/#comments</comments>
		<pubDate>Sat, 04 Feb 2012 18:33:35 +0000</pubDate>
		<dc:creator>waihung</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[lcd]]></category>

		<guid isPermaLink="false">http://waihung.net/?p=490</guid>
		<description><![CDATA[In a previous post, I&#8217;ve shown that the HD44780 LCD can be interfaced by a computer. Please read it here if you haven&#8217;t done so. Mostly these LCDs will be interfaced by a microprocessor or a microcontroller in embedded systems. To program a MCU to interface with an LCD is relatively simple once you&#8217;ve read the datasheet. But unfortunately the LCD ...]]></description>
				<content:encoded><![CDATA[<p>In a previous post, I&#8217;ve shown that the HD44780 LCD can be interfaced by a computer. Please read it <a href="/lcd-smartie" target="_blank">here</a> if you haven&#8217;t done so. Mostly these LCDs will be interfaced by a microprocessor or a microcontroller in embedded systems.</p>
<p>To program a MCU to interface with an LCD is relatively simple once you&#8217;ve read the datasheet. But unfortunately the LCD that I bought was from China and it uses a HD44780 <strong>compatible </strong>controller (aka HD44780 rip-off) and the timing&#8217;s a bit off. That&#8217;s why when I tried to use it with a PIC MCU I couldn&#8217;t get it to do what I wanted. Oh yeah did I mention that the datasheet is only available in Chinese? (Yes, I&#8217;m a banana and I can&#8217;t read chinese <img src='http://waihung.net/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  )</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/chinese_datasheet.png"><img class="alignnone  wp-image-491" title="chinese_datasheet" src="http://waihung.net/wp-content/uploads/2012/02/chinese_datasheet.png" alt="" width="669" height="503" /></a></p>
<p>I tried to google translate it but the words just doesn&#8217;t sound right. So I thought why not try it on the Arduino and use the built-in LiquidCrystal library. Lo and behold it worked. I&#8217;ve done some googling and found out that the LiquidCrystal library has a very wide compatibility with numerous HD44780 compatible controllers.</p>
<p>I uploaded the SerialDisplay example so that the Arduino can read inputs from my keyboard and display it on the LCD.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/lcd_serial_read.png"><img class="alignnone size-full wp-image-492" title="lcd_serial_read" src="http://waihung.net/wp-content/uploads/2012/02/lcd_serial_read.png" alt="" width="500" height="724" /></a></p>
<p>Again like I&#8217;ve mentioned before, the capability of the Arduino to send and receive data from a computer is invaluable. Remember in the previous LCD Smartie <a href="/lcd-smartie/" target="_blank">post</a> I mentioned that if you don&#8217;t have a parallel port on your computer (like a laptop) you can use USB but you need to go through a MCU? In the next post or so I&#8217;ll write about how to use LCD Smartie through Arduino. You can now check out the post <a title="LCD Smartie through Arduino" href="http://waihung.net/lcd-smartie-through-arduino/" target="_blank">here</a>.</p>
<p>In the meantime, here&#8217;s a video showing the Arduino interfacing with the LCD.</p>
<div class='video_frame'><iframe id='youtube_video_13' class='youtube_video' style='height:360px;width:640px' src='http://www.youtube.com/embed/sl4N-ZGMjIk?autohide=2&amp;autoplay=0&amp;controls=1&amp;disablekb=0&amp;fs=0&amp;hd=0&amp;loop=0&amp;rel=0&amp;showinfo=1&amp;showsearch=1&amp;wmode=transparent&amp;enablejsapi=1' width='640' height='360' frameborder='0'></iframe></div>
]]></content:encoded>
			<wfw:commentRss>http://waihung.net/arduino-interfacing-with-hd44780-lcd/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Pre-Made Jumper Cables</title>
		<link>http://waihung.net/pre-made-jumper-cables/</link>
		<comments>http://waihung.net/pre-made-jumper-cables/#comments</comments>
		<pubDate>Thu, 02 Feb 2012 12:08:58 +0000</pubDate>
		<dc:creator>waihung</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Microchip PIC]]></category>
		<category><![CDATA[electronics]]></category>

		<guid isPermaLink="false">http://waihung.net/?p=479</guid>
		<description><![CDATA[After a long day at work, I arrived home and found this in my mail box. I mean the physical one, not on the Internet This came all the way from&#8230;. Singapore. I bought some pre-made jumper cables on Ebay for only RM 7.50 after conversion. In the pack there are 70 pieces of jumper cables as claimed by the ...]]></description>
				<content:encoded><![CDATA[<p>After a long day at work, I arrived home and found this in my mail box. I mean the physical one, not on the Internet <img src='http://waihung.net/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/2012-02-02-18-53-30.593.jpg"><img class="alignnone  wp-image-481" title="2012-02-02 18-53-30.593" src="http://waihung.net/wp-content/uploads/2012/02/2012-02-02-18-53-30.593-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>This came all the way from&#8230;. Singapore. I bought some pre-made jumper cables on Ebay for only RM 7.50 after conversion.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/2012-02-02-18-56-19.546.jpg"><img class="alignnone  wp-image-482" title="2012-02-02 18-56-19.546" src="http://waihung.net/wp-content/uploads/2012/02/2012-02-02-18-56-19.546-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>In the pack there are 70 pieces of jumper cables as claimed by the seller, I have yet to count it myself but so far it looks pretty much like 70 cables.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/2012-02-02-18-58-34.000.jpg"><img class="alignnone  wp-image-483" title="2012-02-02 18-58-34.000" src="http://waihung.net/wp-content/uploads/2012/02/2012-02-02-18-58-34.000-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>Comes in a variety of colours.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/2012-02-02-19-01-17.625.jpg"><img class="alignnone  wp-image-484" title="2012-02-02 19-01-17.625" src="http://waihung.net/wp-content/uploads/2012/02/2012-02-02-19-01-17.625-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>The cables are quite consistent in length and quality.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/2012-02-02-19-02-13.828.jpg"><img class="alignnone  wp-image-485" title="2012-02-02 19-02-13.828" src="http://waihung.net/wp-content/uploads/2012/02/2012-02-02-19-02-13.828-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>Using my brand new jumper cables, I reconstructed my PIC16F877A &#8216;Development Board&#8217; and it looks so much better.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/2012-02-02-19-24-05.718.jpg"><img class="alignnone  wp-image-486" title="2012-02-02 19-24-05.718" src="http://waihung.net/wp-content/uploads/2012/02/2012-02-02-19-24-05.718-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>I&#8217;ll go off now to count these cables <img src='http://waihung.net/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://waihung.net/pre-made-jumper-cables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Arduino Oscilloscope</title>
		<link>http://waihung.net/arduino-oscilloscope/</link>
		<comments>http://waihung.net/arduino-oscilloscope/#comments</comments>
		<pubDate>Wed, 01 Feb 2012 08:43:05 +0000</pubDate>
		<dc:creator>waihung</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[ADC]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[oscilloscope]]></category>

		<guid isPermaLink="false">http://waihung.net/?p=458</guid>
		<description><![CDATA[Can&#8217;t afford an oscilloscope? Now you can have your own for much less (albeit a mini one). Watch the video to see how it works. First and foremost, I should mention that I did not come up with the idea, nor the programming of this code. I&#8217;m using the program and code from an open source project called xoscillo. Please ...]]></description>
				<content:encoded><![CDATA[<p>Can&#8217;t afford an oscilloscope? Now you can have your own for much less (albeit a mini one). Watch the video to see how it works.</p>
<div class='video_frame'><iframe id='youtube_video_14' class='youtube_video' style='height:360px;width:640px' src='http://www.youtube.com/embed/eK7dYZN-s24?autohide=2&amp;autoplay=0&amp;controls=1&amp;disablekb=0&amp;fs=0&amp;hd=0&amp;loop=0&amp;rel=0&amp;showinfo=1&amp;showsearch=1&amp;wmode=transparent&amp;enablejsapi=1' width='640' height='360' frameborder='0'></iframe></div>
<p>First and foremost, I should mention that I did not come up with the idea, nor the programming of this code. I&#8217;m using the program and code from an open source project called <strong>xoscillo</strong>. Please check out their website <strong><a href="http://code.google.com/p/xoscillo/" target="_blank">here</a>.</strong></p>
<p>With that in mind, there are only few things you need to get started. The most important is of course your Arduino. You also need an audio cable (3.5mm male to male), some jumper wires, crocodile clips, a 500 ohm resistor, a 10k potentiometer to vary the amplitude, a breadboard to build your circuit, and also a computer.</p>
<p>In the video, I connected my computer sound card to the Arduino because I don&#8217;t have a function generator. I&#8217;m using the sound card to produce different waveforms using a software. If you have your own function generator, it&#8217;s better to use that instead of a computer sound card. And if you want to use a software, simply google &#8216;software function generator&#8217; and you will find a few there.</p>
<p>For those who are using a software and their computer sound card, make sure that you turn off all audio enhancement features. For my sound card, I need to turn off the X-Fi Crystalizer and also the EQ. This is to avoid any signal distortion.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/xfi_off.png"><img class="alignnone  wp-image-461" title="xfi_off" src="http://waihung.net/wp-content/uploads/2012/02/xfi_off.png" alt="" width="448" height="692" /></a></p>
<p>Next, connect a 3.5mm male to male cable to the speaker output of the sound card, and on the other end, use two crocodile clips to connect the ground and left/right channel. You only need one of the channels (left or right) so it&#8217;s your choice. The pinout is as follows.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/35pinout.png"><img class="alignnone size-full wp-image-462" title="35pinout" src="http://waihung.net/wp-content/uploads/2012/02/35pinout.png" alt="" width="430" height="235" /></a></p>
<p>Then connect ground to the ground of the Arduino and left/right signal to either Analog Input 0, 1, 2 or 3. Make sure that the input goes through the resistor and the potentiometer first before going into the Arduino.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/arduinoosc.jpg"><img class="alignnone  wp-image-477" title="arduinoosc" src="http://waihung.net/wp-content/uploads/2012/02/arduinoosc-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>The hardware setup is done so let&#8217;s turn to the software. Go to the xoscillo website and download their lastest code and program (it will be in a zip file). In the zip file you will find two files, ArduinoOscillo.pde and XOscillo.exe. Extract both files to your desktop for convenience.</p>
<p>The .pde file actually contains the firmware to run your Arduino as an oscilloscope. To upload the firmware, simply open it with the Arduino IDE and click Upload. Note : This firmware does not work on Arduino 1.0, you need to open it with an older version, such as 0022 in my demo video. After uploading is done, simply run the included program called XOscillo.exe. Have fun <img src='http://waihung.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Here are some screenshots.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/fsscr004.jpg"><img class="alignnone  wp-image-472" title="fsscr004" src="http://waihung.net/wp-content/uploads/2012/02/fsscr004-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p><a href="http://waihung.net/wp-content/uploads/2012/02/fsscr003.jpg"><img class="alignnone  wp-image-473" title="fsscr003" src="http://waihung.net/wp-content/uploads/2012/02/fsscr003-1024x576.jpg" alt="" width="717" height="403" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://waihung.net/arduino-oscilloscope/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Arduino : Basic Serial Communication</title>
		<link>http://waihung.net/arduino-basic-serial-communication/</link>
		<comments>http://waihung.net/arduino-basic-serial-communication/#comments</comments>
		<pubDate>Wed, 25 Jan 2012 12:58:54 +0000</pubDate>
		<dc:creator>waihung</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[ADC]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[electronics]]></category>

		<guid isPermaLink="false">http://waihung.net/?p=450</guid>
		<description><![CDATA[Besides uploading sketches to an Arduino, the computer can also receive data or send commands through the Serial Monitor in the Arduino IDE. Usually my demo video will be at the end of the post but this time I think I&#8217;ll do it differently, so here it goes. The sketches that were used in the video are as follows. Thanks ...]]></description>
				<content:encoded><![CDATA[<p>Besides uploading sketches to an Arduino, the computer can also receive data or send commands through the Serial Monitor in the Arduino IDE. Usually my demo video will be at the end of the post but this time I think I&#8217;ll do it differently, so here it goes.</p>
<div class='video_frame'><iframe id='youtube_video_15' class='youtube_video' style='height:360px;width:640px' src='http://www.youtube.com/embed/sTXOV1k6Pcw?autohide=2&amp;autoplay=0&amp;controls=1&amp;disablekb=0&amp;fs=0&amp;hd=0&amp;loop=0&amp;rel=0&amp;showinfo=1&amp;showsearch=1&amp;wmode=transparent&amp;enablejsapi=1' width='640' height='360' frameborder='0'></iframe></div>
<p>The sketches that were used in the video are as follows.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/01/serial1.png"><img class="alignnone size-full wp-image-454" title="serial1" src="http://waihung.net/wp-content/uploads/2012/01/serial1.png" alt="" width="500" height="600" /></a></p>
<p><a href="http://waihung.net/wp-content/uploads/2012/01/serial2.png"><img class="alignnone size-full wp-image-453" title="serial2" src="http://waihung.net/wp-content/uploads/2012/01/serial2.png" alt="" width="500" height="600" /></a></p>
<p><a href="http://waihung.net/wp-content/uploads/2012/01/serial3.png"><img class="alignnone size-full wp-image-455" title="serial3" src="http://waihung.net/wp-content/uploads/2012/01/serial3.png" alt="" width="500" height="600" /></a></p>
<p>Thanks for reading <img src='http://waihung.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://waihung.net/arduino-basic-serial-communication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Arduino : Pulse Width Modulation</title>
		<link>http://waihung.net/arduino-pulse-width-modulation/</link>
		<comments>http://waihung.net/arduino-pulse-width-modulation/#comments</comments>
		<pubDate>Thu, 19 Jan 2012 17:04:10 +0000</pubDate>
		<dc:creator>waihung</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[electronics]]></category>

		<guid isPermaLink="false">http://waihung.net/?p=441</guid>
		<description><![CDATA[Pulses are also known as square waves having only two states, either 0 (LOW) or 1 (HIGH). By modulating the period of highs, we can have different average values and this allows us to control the voltage output to a particular device. Yes, the voltage can also be controlled by a potentiometer but a microcontroller&#8217;s digital output can only produce ...]]></description>
				<content:encoded><![CDATA[<p>Pulses are also known as square waves having only two states, either 0 (LOW) or 1 (HIGH). By modulating the period of highs, we can have different average values and this allows us to control the voltage output to a particular device. Yes, the voltage can also be controlled by a potentiometer but a microcontroller&#8217;s digital output can only produce two level of outputs, either +5V or 0V, so in such applications PWM is invaluable.</p>
<p>On the Arduino, not all the digital pins can do PWM. As you can see in the photo below, only pins 3, 5, 6, 9, 10 and 11 have PWM capabilities (at least on the Uno).</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/01/pwm.jpg"><img class="alignnone  wp-image-443" title="pwm" src="http://waihung.net/wp-content/uploads/2012/01/pwm-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>Duty cycle of a square wave is calculated by the percentage of the period of highs over the total period. This is a chart taken from the Arduino website.</p>
<p><img class="alignnone" src="http://arduino.cc/en/uploads/Tutorial/pwm.gif" alt="" width="400" height="438" /></p>
<p>In the Arduino IDE, the PWM function is given by analogWrite(). For example, analogWrite(9, 127) gives a 50% duty cycle wave output at Digital Pin 9.</p>
<p>To demonstrate the effects of PWM, I&#8217;m going to use an LED. For every push of a button, the duty cycle will increase, thus making the LED brighter. In the code, I&#8217;ve also implemented switch debouncing but it&#8217;s quite sketchy and I think it can be improved (I&#8217;m still new at this).</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/01/arduino_pwm_code.png"><img class="alignnone size-full wp-image-447" title="arduino_pwm_code" src="http://waihung.net/wp-content/uploads/2012/01/arduino_pwm_code.png" alt="" width="500" height="860" /></a></p>
<div class='video_frame'><iframe id='youtube_video_16' class='youtube_video' style='height:360px;width:640px' src='http://www.youtube.com/embed/gHmygeNnxwc?autohide=2&amp;autoplay=0&amp;controls=1&amp;disablekb=0&amp;fs=0&amp;hd=0&amp;loop=0&amp;rel=0&amp;showinfo=1&amp;showsearch=1&amp;wmode=transparent&amp;enablejsapi=1' width='640' height='360' frameborder='0'></iframe></div>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://waihung.net/arduino-pulse-width-modulation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Arduino Uno R3</title>
		<link>http://waihung.net/arduino-uno-r3/</link>
		<comments>http://waihung.net/arduino-uno-r3/#comments</comments>
		<pubDate>Fri, 13 Jan 2012 04:48:13 +0000</pubDate>
		<dc:creator>waihung</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Reviews]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[electronics]]></category>

		<guid isPermaLink="false">http://waihung.net/?p=376</guid>
		<description><![CDATA[Finally my Arduino is here. Bought it from homebrew-tech.com which is an official distributor listed on the arduino.cc website. Yeah it&#8217;s expensive but it&#8217;s a genuine Arduino board and not 3rd party ones. Moreover, this is the latest revision of the Uno, the R3. Here is the package. Genuine Arduino Uno R3 made in Italy. Some close-up shots using my HD-5000 ...]]></description>
				<content:encoded><![CDATA[<p>Finally my Arduino is here. Bought it from homebrew-tech.com which is an official distributor listed on the <a href="http://arduino.cc" target="_blank">arduino.cc</a> website.</p>
<p><a href="http://waihung.net/wp-content/uploads/2011/12/uno_r3_order.png"><img class="alignnone  wp-image-307" title="uno_r3_order" src="http://waihung.net/wp-content/uploads/2011/12/uno_r3_order-1024x534.png" alt="" width="717" height="374" /></a></p>
<p>Yeah it&#8217;s expensive but it&#8217;s a genuine Arduino board and not 3rd party ones. Moreover, this is the latest revision of the Uno, the R3.</p>
<p>Here is the package.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/01/2012-01-28-11-58-19.627.jpg"><img class="alignnone  wp-image-377" title="2012-01-28 11-58-19.627" src="http://waihung.net/wp-content/uploads/2012/01/2012-01-28-11-58-19.627-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>Genuine Arduino Uno R3 made in Italy.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/01/2012-01-27-23-12-49.739.jpg"><img class="alignnone  wp-image-378" title="2012-01-27 23-12-49.739" src="http://waihung.net/wp-content/uploads/2012/01/2012-01-27-23-12-49.739-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>Some close-up shots using my HD-5000 webcam.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/01/2012-01-27-17-41-27.476.jpg"><img class="alignnone  wp-image-381" title="2012-01-27 17-41-27.476" src="http://waihung.net/wp-content/uploads/2012/01/2012-01-27-17-41-27.476-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p><a href="http://waihung.net/wp-content/uploads/2012/01/2012-01-27-23-15-09.695.jpg"><img class="alignnone  wp-image-384" title="2012-01-27 23-15-09.695" src="http://waihung.net/wp-content/uploads/2012/01/2012-01-27-23-15-09.695-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p><a href="http://waihung.net/wp-content/uploads/2012/01/2012-01-27-23-15-58.391.jpg"><img class="alignnone  wp-image-386" title="2012-01-27 23-15-58.391" src="http://waihung.net/wp-content/uploads/2012/01/2012-01-27-23-15-58.391-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p><a href="http://waihung.net/wp-content/uploads/2012/01/2012-01-27-23-14-25.285.jpg"><img class="alignnone  wp-image-382" title="2012-01-27 23-14-25.285" src="http://waihung.net/wp-content/uploads/2012/01/2012-01-27-23-14-25.285-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>Connected the Arduino and installed the correct drivers. This is how it shows up in Device Manager.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/01/r3_device_manager.jpg"><img class="alignnone  wp-image-389" title="r3_device_manager" src="http://waihung.net/wp-content/uploads/2012/01/r3_device_manager.jpg" alt="" width="643" height="430" /></a></p>
<p>Now, to test it by loading the blink sketch.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/01/blink_sketch.png"><img class="alignnone size-full wp-image-392" title="blink_sketch" src="http://waihung.net/wp-content/uploads/2012/01/blink_sketch.png" alt="" width="500" height="600" /></a></p>
<p>For those who knows C or C++, you will definitely feel at home when writing sketches on the Arduino IDE. If you noticed, the IDE does have a built-in delay function, just specify the time in ms in delay(). In this case I used delay(1000) which means 1 second of delay. Much easier than programming a PIC MCU.</p>
<p>This is the video of the Uno R3 in action.</p>
<div class='video_frame'><iframe id='youtube_video_17' class='youtube_video' style='height:360px;width:640px' src='http://www.youtube.com/embed/2yaS_pBNtfQ?autohide=2&amp;autoplay=0&amp;controls=1&amp;disablekb=0&amp;fs=0&amp;hd=0&amp;loop=0&amp;rel=0&amp;showinfo=1&amp;showsearch=1&amp;wmode=transparent&amp;enablejsapi=1' width='640' height='360' frameborder='0'></iframe></div>
<p>More posts about the Arduino coming soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://waihung.net/arduino-uno-r3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LCD Smartie</title>
		<link>http://waihung.net/lcd-smartie/</link>
		<comments>http://waihung.net/lcd-smartie/#comments</comments>
		<pubDate>Thu, 12 Jan 2012 12:54:35 +0000</pubDate>
		<dc:creator>waihung</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[computers]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[lcd]]></category>
		<category><![CDATA[lcd smartie]]></category>

		<guid isPermaLink="false">http://waihung.net/?p=350</guid>
		<description><![CDATA[LCD Smartie is a software that helps the computer to interface with a character or graphical LCD. It can show any stats about the computer on the LCD and it is very popular among PC enthusiasts because it allows them to keep track of their computer when they&#8217;re watching a movie or playing a game. It&#8217;s not convenient to switch ...]]></description>
				<content:encoded><![CDATA[<p>LCD Smartie is a software that helps the computer to interface with a character or graphical LCD. It can show any stats about the computer on the LCD and it is very popular among PC enthusiasts because it allows them to keep track of their computer when they&#8217;re watching a movie or playing a game. It&#8217;s not convenient to switch back and forth between full screen mode and desktop mode to check on things. Also, some PC case modders like to put LCDs onto the front of the casing for some extra coolness. Do check out their site <a href="http://lcdsmartie.sourceforge.net/" target="_blank">here</a>.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/01/lcdsmartie.jpg"><img class="alignnone  wp-image-353" title="lcdsmartie" src="http://waihung.net/wp-content/uploads/2012/01/lcdsmartie.jpg" alt="" width="621" height="417" /></a></p>
<p>As you can see from the screenshot, LCD Smartie can handle almost anything on your computer. It can display CPU usage, RAM usage, check your e-mails, check RSS feeds, monitor Internet speed, view your songs and with extra plug-ins, it can do even more.</p>
<p>The first step is to connect the LCD to the computer. For simplicity, the computer must have a built-in parallel port (LCD Smartie doesn&#8217;t support USB to Parallel adapters). For non-geeks, here&#8217;s a background on parallel ports. Parallel ports are almost history now. It was on computers since the 70s and it is used to connect printers (mainly) to the computer (just think of it like USB). I was born in 1990 and I had the privilege of using parallel ports till I got a new printer in year 2003. Parallel ports suddenly went extinct and printers started using USB. This was understandable because USB is much faster and the port is much simpler (only has 4 pins compared to 25 pins and this increases reliability). I remembered my printer started printing garbled words and it turns out that the cable was wearing out. No such things happening now eh? Oh yeah, here&#8217;s how a parallel port looks like.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/01/Parallel-Port1.jpg"><img class="alignnone size-medium wp-image-354" title="" src="http://waihung.net/wp-content/uploads/2012/01/Parallel-Port1-300x225.jpg" alt="" width="300" height="225" /></a></p>
<p>For unfortunate users that don&#8217;t have a parallel port on their computers, the LCD can be interfaced by a microcontroller and the microcontroller can be connected to the computer through USB. That&#8217;s another topic but for now let&#8217;s focus on parallel ports. I&#8217;ve wrote a new post about this, you can read it <a title="LCD Smartie through Arduino" href="http://waihung.net/lcd-smartie-through-arduino/" target="_blank">here</a>.</p>
<p>For laptop users, most certainly your laptop does not have a parallel port (unless you have a laptop more than a decade old). For desktop users, if you don&#8217;t see a parallel port, don&#8217;t lose hope yet. This is the back of my desktop. No parallel port right?</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/01/back.jpg"><img class="alignnone  wp-image-357" title="&lt;KENOX S860  / Samsung S860&gt;" src="http://waihung.net/wp-content/uploads/2012/01/back-487x1024.jpg" alt="" width="390" height="819" /></a></p>
<p>If you have a modern desktop computer, most likely the back of it looks somewhat similar to mine. These days manufacturers pack all sorts of IO ports like HDMI, DVI, SPDIF, Firewire, E-Sata, etc and no wonder they do not have room for a parallel port. Now, the manufacturer can choose to just omit the port from the system or create a parallel port pin on the motherboard so you can add a PCI bracket. Luckily mine still has the pin on the motherboard and I can get a PCI bracket like this to add a parallel port to my computer.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/01/parallel_port_pci_bracket.png"><img class="alignnone size-full wp-image-359" title="parallel_port_pci_bracket" src="http://waihung.net/wp-content/uploads/2012/01/parallel_port_pci_bracket.png" alt="" width="303" height="158" /></a></p>
<p>To check if the pin is present, go look on the surface of your motherboard for this, it will be marked LPT :</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/01/SDC10235.jpg"><img class="alignnone  wp-image-361" title="&lt;KENOX S860  / Samsung S860&gt;" src="http://waihung.net/wp-content/uploads/2012/01/SDC10235-1024x768.jpg" alt="" width="717" height="538" /></a></p>
<p>If you still can&#8217;t find it, the last resort is to get a Parallel PCI card like this but it might not work due to different chipsets, etc.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/01/1-port-parallel-pci-controller-1102-01-csyong@11.jpg"><img class="alignnone size-full wp-image-362" title="1-port-parallel-pci-controller-1102-01-csyong@1[1]" src="http://waihung.net/wp-content/uploads/2012/01/1-port-parallel-pci-controller-1102-01-csyong@11.jpg" alt="" width="300" height="300" /></a></p>
<p>Do take note that your computer must have a PCI slot for this to work (new motherboards do not have any PCI slots and PCI is <strong>NOT</strong> PCI-Express).</p>
<p>Ok, now to connect the LCD to the parallel port, refer to the schematics below :</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/01/lcd447801.gif"><img class="alignnone  wp-image-363" title="lcd44780[1]" src="http://waihung.net/wp-content/uploads/2012/01/lcd447801.gif" alt="" width="492" height="383" /></a></p>
<p>If you&#8217;re a geek (or rather an old one like me), you will find a parallel cable lying around your house. I dug one out of my old printer box and it&#8217;s a DB25 to DB36 type. Initially I thought it was no good but the small pin holes on the DB36 is perfect for inserting a jumper wire in it, the hole size is just right. Here&#8217;s what a DB36 parallel port look like :</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/01/db36.png"><img class="alignnone size-medium wp-image-364" title="db36" src="http://waihung.net/wp-content/uploads/2012/01/db36-300x165.png" alt="" width="300" height="165" /></a></p>
<p>You can still buy parallel cables in Lowyat around RM10 to RM20 depending on the length. If you plan to use the LCD on a breadboard, buy the DB36 type so that you can insert jumper wires in it.</p>
<p>This is how I connected the LCD to the parallel cable.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/01/lcd_breadboard.jpg"><img class="alignnone  wp-image-366" title="lcd_breadboard" src="http://waihung.net/wp-content/uploads/2012/01/lcd_breadboard-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>It&#8217;s a mess but at least it works <img src='http://waihung.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Oh yeah, you need an external 5V power supply for the LCD. The parallel port doesn&#8217;t provide any power.</p>
<p>Here&#8217;s a video of LCD Smartie in action :</p>
<div class='video_frame'><iframe id='youtube_video_18' class='youtube_video' style='height:360px;width:640px' src='http://www.youtube.com/embed/GVMrXMLkMqw?autohide=0&amp;autoplay=0&amp;controls=1&amp;disablekb=0&amp;fs=0&amp;hd=0&amp;loop=0&amp;rel=0&amp;showinfo=1&amp;showsearch=1&amp;wmode=transparent&amp;enablejsapi=1' width='640' height='360' frameborder='0'></iframe></div>
<p>Try out LCD Smartie and have fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://waihung.net/lcd-smartie/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HD44780 2&#215;16 Dot Matrix LCD</title>
		<link>http://waihung.net/hd44780-2x16-dot-matrix-lcd/</link>
		<comments>http://waihung.net/hd44780-2x16-dot-matrix-lcd/#comments</comments>
		<pubDate>Wed, 11 Jan 2012 12:23:37 +0000</pubDate>
		<dc:creator>waihung</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Reviews]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[lcd]]></category>
		<category><![CDATA[lcd smartie]]></category>

		<guid isPermaLink="false">http://waihung.net/?p=341</guid>
		<description><![CDATA[Bought this at Ebay for only RM10 including shipping. This came all the way from China, hence why it is so cheap. Took around two weeks to arrive and here it is. Apparently a paper box is too costly but thank God it arrived in one piece. The connector shown does not come with the LCD, I bought it separately so ...]]></description>
				<content:encoded><![CDATA[<p>Bought this at Ebay for only RM10 including shipping. This came all the way from China, hence why it is so cheap. Took around two weeks to arrive and here it is.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/01/100_7521.jpg"><img class="alignnone  wp-image-344" title="100_7521" src="http://waihung.net/wp-content/uploads/2012/01/100_7521-1024x768.jpg" alt="" width="717" height="538" /></a></p>
<p>Apparently a paper box is too costly but thank God it arrived in one piece.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/01/100_7526.jpg"><img class="alignnone  wp-image-346" title="100_7526" src="http://waihung.net/wp-content/uploads/2012/01/100_7526-1024x773.jpg" alt="" width="717" height="541" /></a></p>
<p>The connector shown does not come with the LCD, I bought it separately so that I can solder it and use the LCD on a breadboard.</p>
<p>Here is the back of the LCD.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/01/100_7524.jpg"><img class="alignnone  wp-image-345" title="100_7524" src="http://waihung.net/wp-content/uploads/2012/01/100_7524-1024x773.jpg" alt="" width="717" height="541" /></a></p>
<p>Usually this LCD is used with a microcontroller but it can also be used on a computer. So, I tested the LCD by connecting it to the computer and it works perfectly.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/01/lcd_test.jpg"><img class="alignnone  wp-image-348" title="lcd_test" src="http://waihung.net/wp-content/uploads/2012/01/lcd_test-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>I will cover on how to use this LCD on a computer in the next post.</p>
]]></content:encoded>
			<wfw:commentRss>http://waihung.net/hd44780-2x16-dot-matrix-lcd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Microchip PIC16F877A Analogue to Digital Conversion</title>
		<link>http://waihung.net/microchip-pic16f877a-analogue-to-digital-conversion/</link>
		<comments>http://waihung.net/microchip-pic16f877a-analogue-to-digital-conversion/#comments</comments>
		<pubDate>Fri, 30 Dec 2011 16:50:37 +0000</pubDate>
		<dc:creator>waihung</dc:creator>
				<category><![CDATA[Microchip PIC]]></category>
		<category><![CDATA[ADC]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[PIC]]></category>
		<category><![CDATA[PIC16F877A]]></category>

		<guid isPermaLink="false">http://waihung.net/?p=427</guid>
		<description><![CDATA[As mentioned in the previous post, the PIC16F877A has a built-in Analogue to Digital converter. What ADC does is basically convert an analogue voltage ranging from -Vref to +Vref (usually 0V to 5V) and converts it to a binary value. The ADC on the PIC16F877A has 10-bit resolution and this provides 1024 steps (2^10=1024) which is more than enough for ...]]></description>
				<content:encoded><![CDATA[<p>As mentioned in the previous post, the PIC16F877A has a built-in Analogue to Digital converter. What ADC does is basically convert an analogue voltage ranging from -Vref to +Vref (usually 0V to 5V) and converts it to a binary value. The ADC on the PIC16F877A has 10-bit resolution and this provides 1024 steps (2^10=1024) which is more than enough for normal applications.</p>
<p>This is how I connected the circuit on a breadboard :</p>
<p><a href="http://waihung.net/wp-content/uploads/2011/12/2012-01-30-00-11-08.056.jpg"><img class="alignnone  wp-image-433" title="2012-01-30 00-11-08.056" src="http://waihung.net/wp-content/uploads/2011/12/2012-01-30-00-11-08.056-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p><a href="http://waihung.net/wp-content/uploads/2011/12/2012-01-30-00-11-34.511.jpg"><img class="alignnone  wp-image-432" title="2012-01-30 00-11-34.511" src="http://waihung.net/wp-content/uploads/2011/12/2012-01-30-00-11-34.511-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>What I had in mind to display the results of the ADC is to have 5 LEDs and the higher the input voltage, the more LEDs will light up. I have a 10k potentiometer to vary the input voltage going into PORTA,0 which is also Analogue Channel 0.</p>
<p>For eagled eyed viewers, you might notice that I have another resistor (550 ohms) before the 10k pot and I&#8217;ve done that to prevent excessive current from going into PORTA,0 when the pot has 0 resistance. This will indeed affect the max voltage going into PORTA,0 and it&#8217;s no longer 5V so I should set a different +Vref value. But I couldn&#8217;t be bothered because the voltage drop on the 550 ohms resistor is just 0.26V. I don&#8217;t need accuracy here anyway.</p>
<p>So let&#8217;s get to the initialization.</p>
<p><span style="text-decoration: underline;">Bank 1</span></p>
<p>TRISA,0 is set to allow input for Analogue Channel 0<br />
TRISD is cleared to allow output to LEDs</p>
<p>ADCON1 is cleared. Result is right justified because I&#8217;ll just take the higher 8 bits for simpler calculation. This will not affect the accuracy much. I wanted clock conversion to be Fosc/8 to get &gt; 1.6us of minimum conversion time (I&#8217;m using a 4MHz crystal here). AN0 to AN7 is set to Analogue mode. +Vref is 5V and -Vref is 0V.</p>
<p><span style="text-decoration: underline;">Bank 0</span></p>
<p>ADCON0 is set to &#8217;0100 0000&#8242; to select Fosc/8 and Analogue Channel 0.</p>
<p>That&#8217;s about it. And the rest of the code can be seen below.</p>
<p><a href="http://waihung.net/wp-content/uploads/2011/12/adc_code.png"><img class="alignnone size-full wp-image-435" title="adc_code" src="http://waihung.net/wp-content/uploads/2011/12/adc_code.png" alt="" width="647" height="1312" /></a></p>
<p>&nbsp;</p>
<p>The video below will show how the code works.</p>
<div class='video_frame'><iframe id='youtube_video_19' class='youtube_video' style='height:360px;width:640px' src='http://www.youtube.com/embed/ikcCGrZpFww?autohide=2&amp;autoplay=0&amp;controls=1&amp;disablekb=0&amp;fs=0&amp;hd=0&amp;loop=0&amp;rel=0&amp;showinfo=1&amp;showsearch=1&amp;wmode=transparent&amp;enablejsapi=1' width='640' height='360' frameborder='0'></iframe></div>
]]></content:encoded>
			<wfw:commentRss>http://waihung.net/microchip-pic16f877a-analogue-to-digital-conversion/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Microchip PIC16F877A</title>
		<link>http://waihung.net/microchip-pic16f877a/</link>
		<comments>http://waihung.net/microchip-pic16f877a/#comments</comments>
		<pubDate>Fri, 30 Dec 2011 08:33:37 +0000</pubDate>
		<dc:creator>waihung</dc:creator>
				<category><![CDATA[Microchip PIC]]></category>
		<category><![CDATA[Reviews]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[PIC]]></category>
		<category><![CDATA[PIC16F877A]]></category>

		<guid isPermaLink="false">http://waihung.net/?p=407</guid>
		<description><![CDATA[Moving up the Microchip PIC16F Microcontroller family, we have the PIC16F877A. This is a very common MCU and it&#8217;s always mentioned in DIY projects. It&#8217;s popular among students, hobbyist and even engineers because it&#8217;s cheap. I got it for only RM23 and oddly enough that&#8217;s cheaper than its&#8217; little brother I mentioned in a previous post, the PIC16F84A. Another reason ...]]></description>
				<content:encoded><![CDATA[<p>Moving up the Microchip PIC16F Microcontroller family, we have the PIC16F877A. This is a very common MCU and it&#8217;s always mentioned in DIY projects.</p>
<p><a href="http://waihung.net/wp-content/uploads/2011/12/2012-01-27-23-09-58.280.jpg"><img class="alignnone  wp-image-410" title="2012-01-27 23-09-58.280" src="http://waihung.net/wp-content/uploads/2011/12/2012-01-27-23-09-58.280-1024x576.jpg" alt="" width="614" height="346" /></a></p>
<p>It&#8217;s popular among students, hobbyist and even engineers because it&#8217;s cheap. I got it for only RM23 and oddly enough that&#8217;s cheaper than its&#8217; little brother I mentioned in a previous post, the PIC16F84A. Another reason is the sheer amount of input and output pins available on this MCU. Among other things, this MCU also has Analog to Digital conversion capability without the need of an external chip.</p>
<p>Together with this MCU, I also got myself two crystal oscillators, 4MHz and 20MHz. These frequencies are very common, or at least what I&#8217;ve seen so far.</p>
<p><a href="http://waihung.net/wp-content/uploads/2011/12/2012-01-28-15-06-25.624.jpg"><img class="alignnone  wp-image-412" title="2012-01-28 15-06-25.624" src="http://waihung.net/wp-content/uploads/2011/12/2012-01-28-15-06-25.624-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>As usual, I&#8217;m going to test the MCU by doing the blink test. For randomness, I&#8217;m going to use the 4MHz crystal to build my circuit. Accompanying the crystal are two 15pF capacitors.</p>
<p><a href="http://waihung.net/wp-content/uploads/2011/12/2012-01-28-16-31-20.329.jpg"><img class="alignnone  wp-image-414" title="2012-01-28 16-31-20.329" src="http://waihung.net/wp-content/uploads/2011/12/2012-01-28-16-31-20.329-1024x576.jpg" alt="" width="717" height="403" /></a></p>
<p>Checking the datasheet, I should use XT for the Oscillator mode.</p>
<p><a href="http://waihung.net/wp-content/uploads/2011/12/16f877a_blink_code.png"><img class="alignnone size-full wp-image-415" title="16f877a_blink_code" src="http://waihung.net/wp-content/uploads/2011/12/16f877a_blink_code.png" alt="" width="571" height="631" /></a></p>
<p>Here&#8217;s a video of the PIC16F877A in action.</p>
<div class='video_frame'><iframe id='youtube_video_20' class='youtube_video' style='height:360px;width:640px' src='http://www.youtube.com/embed/BAEZeFgTGHA?autohide=2&amp;autoplay=0&amp;controls=1&amp;disablekb=0&amp;fs=0&amp;hd=0&amp;loop=0&amp;rel=0&amp;showinfo=1&amp;showsearch=1&amp;wmode=transparent&amp;enablejsapi=1' width='640' height='360' frameborder='0'></iframe></div>
<p>Maybe I&#8217;ll test out the ADC and report back in the next post.</p>
]]></content:encoded>
			<wfw:commentRss>http://waihung.net/microchip-pic16f877a/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>EAGLE PCB Software</title>
		<link>http://waihung.net/eagle-pcb-software/</link>
		<comments>http://waihung.net/eagle-pcb-software/#comments</comments>
		<pubDate>Wed, 28 Dec 2011 06:24:06 +0000</pubDate>
		<dc:creator>waihung</dc:creator>
				<category><![CDATA[PCB]]></category>
		<category><![CDATA[eagle]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[pcb]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://waihung.net/?p=311</guid>
		<description><![CDATA[PCB is the abbreviation of Printed Circuit Boards. They house all the components and contain electrical traces to connect them together. A PCB software helps in designing a PCB whether it is for a huge production or just self-made PCBs. In my college, I was taught how to use the Protel PCB software (now called Altium) and I was told ...]]></description>
				<content:encoded><![CDATA[<p>PCB is the abbreviation of Printed Circuit Boards. They house all the components and contain electrical traces to connect them together. A PCB software helps in designing a PCB whether it is for a huge production or just self-made PCBs. In my college, I was taught how to use the Protel PCB software (now called Altium) and I was told that it is an industry standard. But almost 80 percent of the time when I am browsing an electronic website, they all talk about EAGLE. EAGLE is another type of PCB software and it performs similarly to the Protel software. Well, it&#8217;s good that I&#8217;ve been taught how to use Protel but I have to do something myself, if not I will be left out in the dark.</p>
<p>So, in my free time I went online to search for tutorials and tried to learn EAGLE myself. Initially the learning curve was very steep but after some time when I&#8217;m familiar with the software interface I felt comfortable. At times I really do feel that EAGLE is more user-friendly than Protel (maybe that&#8217;s because I was using a very old version of Protel in college). Soon I felt confident so I tried to design a PCB for my Electronic Dice project (you can read more about it <a href="/electronic-dice" target="_blank">here</a>) but before I start, I want to explain why EAGLE is so popular among students and hobbyist.</p>
<p>The <strong>biggest</strong> difference between EAGLE and Protel/Altium is it&#8217;s <strong>FREE</strong>. They do offer the Light Edition as a freeware and of course it has some limitations but for personal or educational purposes, these limitations will not bother you at all. In their website, they listed the limitations and there are only THREE!</p>
<p>1. The maximum PCB area is only 10cm by 8cm.<br />
2. The user is only limited to designing PCBs with top and bottom layer (most of us use bottom only anyway).<br />
3. The schematic editor is only limited to one sheet.</p>
<p>To read more about it, go to their <a href="http://www.cadsoftusa.com/downloads/freeware/" target="_blank">website</a>. If you need to design PCBs that exceed these limitations, you can opt for the education version which is cheaper. For me, the Light Edition is more than enough so let&#8217;s get to it.</p>
<p>When you launch EAGLE, you are welcomed with the Control Panel where you can find your project files, view the library, edit the design rules, and etc.</p>
<p><a href="http://waihung.net/wp-content/uploads/2011/12/fsscr003.png"><img class="alignnone  wp-image-317" title="fsscr003" src="http://waihung.net/wp-content/uploads/2011/12/fsscr003-1024x576.png" alt="" width="717" height="403" /></a></p>
<p>To start, create a project and then a new schematic file. For any PCB software, you have to design the schematics first and then the program will generate a board file. Here is my completed schematics.</p>
<p><a href="http://waihung.net/wp-content/uploads/2011/12/fsscr004.png"><img class="alignnone  wp-image-318" title="fsscr004" src="http://waihung.net/wp-content/uploads/2011/12/fsscr004-1024x576.png" alt="" width="717" height="403" /></a></p>
<p>Then, just click on the Board button on the top toolbar and EAGLE will automatically generate a board file. The user still have to arrange the components on the board according to their liking. Then, the user have to route the connections either manually or by using the Auto Route feature. For small projects I recommend using manual routing for tidier results. Also, I added a ground plane to avoid wasting copper during the etching process (I personally think that ground planes make the PCB look very cool). Here is the finished product.</p>
<p><a href="http://waihung.net/wp-content/uploads/2011/12/fsscr000.png"><img class="alignnone  wp-image-319" title="fsscr000" src="http://waihung.net/wp-content/uploads/2011/12/fsscr000-1024x576.png" alt="" width="717" height="403" /></a></p>
<p>I wanted a silkscreen so I isolated the unwanted layers and here&#8217;s how it looks like.</p>
<p><a href="http://waihung.net/wp-content/uploads/2011/12/fsscr001.png"><img class="alignnone  wp-image-320" title="fsscr001" src="http://waihung.net/wp-content/uploads/2011/12/fsscr001-1024x576.png" alt="" width="717" height="403" /></a></p>
<p>Not forgetting the most important part, the bottom layer of the PCB.</p>
<p><a href="http://waihung.net/wp-content/uploads/2011/12/fsscr002.png"><img class="alignnone  wp-image-321" title="fsscr002" src="http://waihung.net/wp-content/uploads/2011/12/fsscr002-1024x576.png" alt="" width="717" height="403" /></a></p>
<p>Lastly, these are the final images to be printed out (I&#8217;m not planning to do a PCB based on this project, I did this just as a practise).<br />
Note : The below images are enlarged to 150% for better viewing.</p>
<p><a href="http://waihung.net/wp-content/uploads/2011/12/top_pcb.png"><img class="alignnone size-full wp-image-324" title="top_pcb" src="http://waihung.net/wp-content/uploads/2011/12/top_pcb.png" alt="" width="656" height="396" /></a></p>
<p><a href="http://waihung.net/wp-content/uploads/2011/12/bottom_pcb.png"><img class="alignnone size-full wp-image-323" title="bottom_pcb" src="http://waihung.net/wp-content/uploads/2011/12/bottom_pcb.png" alt="" width="656" height="398" /></a></p>
<p>If you&#8217;re into electronics I highly recommend learning/using EAGLE to design your PCBs. It&#8217;s <strong>FREE</strong> :)</p>
]]></content:encoded>
			<wfw:commentRss>http://waihung.net/eagle-pcb-software/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Electronic Dice</title>
		<link>http://waihung.net/electronic-dice/</link>
		<comments>http://waihung.net/electronic-dice/#comments</comments>
		<pubDate>Mon, 26 Dec 2011 09:15:12 +0000</pubDate>
		<dc:creator>waihung</dc:creator>
				<category><![CDATA[Microchip PIC]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[PIC]]></category>
		<category><![CDATA[PIC16F84A]]></category>

		<guid isPermaLink="false">http://waihung.net/?p=277</guid>
		<description><![CDATA[This was actually one of my assignments and it&#8217;s a pretty simple project with a couple of LEDs to make an electronic dice. When turned on, all the LEDs will light up and the user have to press and hold on the button to roll the dice. Once the user lets go of the button, the rolling will stop and ...]]></description>
				<content:encoded><![CDATA[<p>This was actually one of my assignments and it&#8217;s a pretty simple project with a couple of LEDs to make an electronic dice.</p>
<p>When turned on, all the LEDs will light up and the user have to press and hold on the button to roll the dice. Once the user lets go of the button, the rolling will stop and the dice pattern will be displayed. The LEDs will light up in the same pattern as a traditional dice for easy reading.</p>
<p>Here is how it&#8217;s connected :</p>
<p><a href="http://waihung.net/wp-content/uploads/2011/12/100_7516.jpg"><img class="alignnone  wp-image-282" title="100_7516" src="http://waihung.net/wp-content/uploads/2011/12/100_7516-1024x773.jpg" alt="" width="717" height="541" /></a></p>
<p>And here&#8217;s the assembly code (for curious ones, I edited the asm file using Notepad++).</p>
<p><a href="http://waihung.net/wp-content/uploads/2011/12/dice_code.png"><img class="alignnone size-full wp-image-283" title="dice_code" src="http://waihung.net/wp-content/uploads/2011/12/dice_code.png" alt="" width="465" height="1724" /></a></p>
<p>Before uploading it into the hardware, I was required to perform a software simulation first to show that the code is correct and functional.<br />
Here is a video of the simulation :</p>
<div class='video_frame'><iframe id='vimeo_video_21' class='vimeo_video' style='height:480px;width:640px' src='http://player.vimeo.com/video/35493627?title=1&amp;byline=1&amp;portrait=1&amp;autoplay=0&amp;loop=0&amp;js_api=1&amp;js_swf_id=vimeo_video_21' width='640' height='480' frameborder='0'></iframe></div>
<p>And as expected, it works flawlessly, so here it is in the actual PIC16F84A :</p>
<div class='video_frame'><iframe id='vimeo_video_22' class='vimeo_video' style='height:480px;width:640px' src='http://player.vimeo.com/video/35495791?title=1&amp;byline=1&amp;portrait=1&amp;autoplay=0&amp;loop=0&amp;js_api=1&amp;js_swf_id=vimeo_video_22' width='640' height='480' frameborder='0'></iframe></div>
<p>&nbsp;</p>
<p>Apparently rolling a dice is hard work, now we can just push a button <img src='http://waihung.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://waihung.net/electronic-dice/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>7 Segment Display</title>
		<link>http://waihung.net/7-segment-display/</link>
		<comments>http://waihung.net/7-segment-display/#comments</comments>
		<pubDate>Sat, 24 Dec 2011 16:10:27 +0000</pubDate>
		<dc:creator>waihung</dc:creator>
				<category><![CDATA[Microchip PIC]]></category>
		<category><![CDATA[7segment]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[PIC]]></category>
		<category><![CDATA[PIC16F84A]]></category>

		<guid isPermaLink="false">http://waihung.net/?p=253</guid>
		<description><![CDATA[If your project needs to display simple digits or even words/alphabets, you don&#8217;t need an LCD. It&#8217;s not cost-effective. 7 segment displays come into play here. Essentially there are 7 LEDs placed together in a figure of 8 that if you light a few of them up you can display the digit that you want. As shown above, there are two ...]]></description>
				<content:encoded><![CDATA[<p>If your project needs to display simple digits or even words/alphabets, you don&#8217;t need an LCD. It&#8217;s not cost-effective. 7 segment displays come into play here. Essentially there are 7 LEDs placed together in a figure of 8 that if you light a few of them up you can display the digit that you want.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/01/7segLed.gif"><img class="alignnone size-full wp-image-257" title="7segLed" src="http://waihung.net/wp-content/uploads/2012/01/7segLed.gif" alt="" width="385" height="273" /></a></p>
<p>As shown above, there are two types of 7 segment displays, common cathode and common anode. Both of them produce the same results, it is just how you operate them.<br />
Generally people do prefer the common cathode because sending a logic &#8217;1&#8242; will light the LED up while sending a logic &#8217;0&#8242; will turn the LED off. That is the standard convention. The common anode is the other way around.</p>
<p>So I thought I will get myself the common cathode version to make things simpler, so I went to the shop and bought it. When I came back, I tried to light it up but it just won&#8217;t light up, I thought maybe I got a defective unit. When I&#8217;m about the give up, I tried reversing the polarity and it lit up. The seller gave me the wrong type. If Jalan Pasar is near I won&#8217;t hesitate to go and exchange it for a correct version but it&#8217;s not. It&#8217;s not worth it to go all the way just for a RM1.50 part. Well, since I have not tried using current sinking on a MCU before, why not right. (A MCU output can either be current-sourcing or current-sinking, current-sourcing means that the pin will provide positive voltage while current-sinking means that the output pin can act as a ground, receiving current). This also means that now to turn on the LED I must program the MCU to send a logic &#8217;0&#8242;.</p>
<p>I connect the 7 segment display to the PIC16F84A and wrote a corresponding look-up table.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/01/100_7515.jpg"><img class="alignnone  wp-image-258" title="100_7515" src="http://waihung.net/wp-content/uploads/2012/01/100_7515-1024x773.jpg" alt="" width="717" height="541" /></a></p>
<p>The 7 segment display will display a different number every time the push button is pressed.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/01/7segment_code.jpg"><img class="alignnone size-full wp-image-259" title="7segment_code" src="http://waihung.net/wp-content/uploads/2012/01/7segment_code.jpg" alt="" width="566" height="1021" /></a></p>
<p>A 10ms debouncing is implemented to avoid any logic corruption. The 10ms delay is calculated using the program that I wrote. To find it, click <a href="/microchip-delay-calculator" class="fancy_link blue_sprite blue_text">here &#x2192;</a>.</p>
<p>Here is a video of the 7 segment display in action.</p>
<div class='video_frame'><iframe id='vimeo_video_23' class='vimeo_video' style='height:480px;width:640px' src='http://player.vimeo.com/video/35459857?title=1&amp;byline=1&amp;portrait=1&amp;autoplay=0&amp;loop=0&amp;js_api=1&amp;js_swf_id=vimeo_video_23' width='640' height='480' frameborder='0'></iframe></div>
<p>&nbsp;</p>
<p>Sorry again for the poor video quality. The video looked fine before I uploaded it to vimeo. I shall try and see how I can improve the quality.</p>
]]></content:encoded>
			<wfw:commentRss>http://waihung.net/7-segment-display/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Arduino Cookbook</title>
		<link>http://waihung.net/arduino-cookbook/</link>
		<comments>http://waihung.net/arduino-cookbook/#comments</comments>
		<pubDate>Sat, 24 Dec 2011 07:56:22 +0000</pubDate>
		<dc:creator>waihung</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[book]]></category>
		<category><![CDATA[electronics]]></category>

		<guid isPermaLink="false">http://waihung.net/?p=222</guid>
		<description><![CDATA[No, Arduino is not a dish. It&#8217;s an open-source electronics prototyping platform based on the Atmel microcontroller and uses the C language. It&#8217;s very popular now so I thought I&#8217;ll get one to see what it does. I heard many good things about it. Just ordered an Arduino online and while waiting, I went to the Kinokuniya bookshop in KLCC ...]]></description>
				<content:encoded><![CDATA[<p>No, Arduino is not a dish. It&#8217;s an open-source electronics prototyping platform based on the Atmel microcontroller and uses the C language. It&#8217;s very popular now so I thought I&#8217;ll get one to see what it does. I heard many good things about it.</p>
<p>Just ordered an Arduino online and while waiting, I went to the Kinokuniya bookshop in KLCC to get this book :</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/01/100_7506.jpg"><img class="alignnone  wp-image-224" title="100_7506" src="http://waihung.net/wp-content/uploads/2012/01/100_7506-1024x773.jpg" alt="" width="717" height="541" /></a></p>
<p><a href="http://waihung.net/wp-content/uploads/2012/01/100_7510.jpg"><img class="alignnone  wp-image-223" title="100_7510" src="http://waihung.net/wp-content/uploads/2012/01/100_7510-773x1024.jpg" alt="" width="541" height="717" /></a></p>
<p><a href="http://waihung.net/wp-content/uploads/2012/01/100_7508.jpg"><img class="alignnone  wp-image-225" title="100_7508" src="http://waihung.net/wp-content/uploads/2012/01/100_7508-1024x773.jpg" alt="" width="717" height="541" /></a></p>
<p>It&#8217;s been a long time since I had a proper self-learning book. So far I&#8217;ve only bought 3 self-learning books excluding this one. My memory of those books are so fresh that I can even recall what, when, where and how much I bought them.</p>
<p>I bought my first self-learning book when I was 10. It was HTML for Dummies. It costs only RM10 because I got it at the MPH Clearance Sale. Finished the book in 2 months. Next, was a Macromedia Dreamweaver book (now Macromedia is called Adobe, oh im old) and I bought that when I was 11 after I mastered HTML. This was a little more expensive at RM 60 and I got it at Popular Petaling Street. Lastly, it was a Java Programming book and it was thicker than both of the previous books combined. I got it for RM15 at a flea market in Amcorp Mall when I was 12. Didn&#8217;t manage to finish the book till today because of UPSR and secondary school. I just realized how secondary school ate up all my time that I don&#8217;t even have my own free time to explore and discover.</p>
<p>It&#8217;s OK, my passion&#8217;s back and I shall conquer this book. Till then.</p>
]]></content:encoded>
			<wfw:commentRss>http://waihung.net/arduino-cookbook/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Microchip PIC Delay Calculator</title>
		<link>http://waihung.net/microchip-delay-calculator/</link>
		<comments>http://waihung.net/microchip-delay-calculator/#comments</comments>
		<pubDate>Fri, 23 Dec 2011 02:03:06 +0000</pubDate>
		<dc:creator>waihung</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Microchip PIC]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[PIC]]></category>
		<category><![CDATA[program]]></category>
		<category><![CDATA[VB]]></category>

		<guid isPermaLink="false">http://waihung.net/?p=209</guid>
		<description><![CDATA[Delays are very essential in the operation of a microcontroller. Because microcontrollers execute instructions at a very fast rate (in microseconds), programmers need to apply delay so that it can interact properly with humans, for example, delay must be used to create software debouncing. Unfortunately, the MPLAB IDE does not have a built-in delay function unlike the Arduino IDE (Arduino ...]]></description>
				<content:encoded><![CDATA[<p>Delays are very essential in the operation of a microcontroller. Because microcontrollers execute instructions at a very fast rate (in microseconds), programmers need to apply delay so that it can interact properly with humans, for example, delay must be used to create software debouncing. Unfortunately, the MPLAB IDE does not have a built-in delay function unlike the Arduino IDE (Arduino stuffs coming soon <img src='http://waihung.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ) so the programmer have to write his/her own delay assembly code.</p>
<p>Let&#8217;s say the MCU is running at 4MHz. That&#8217;s a period of 250 nanoseconds. And every instruction cycle takes 4 periods. That&#8217;s 1 microsecond per instruction. If the programmer wants to make a delay of 5ns, that&#8217;s simple. Just execute the nop (no operation) instruction 5 times. But what if it&#8217;s 100ns or even 1 second? That&#8217;s where instructions like decfsz comes in. We can create longer delays by compounding a short section of delay. The idea is there but we need to manually calculate the number of times we should compound the short delay. That is why I wrote this program to simplify the calculation.</p>
<p>First and foremost, I should mention that I got the inspiration from a delay calculation program found on the Cytron website. The program was written by Kong Wai Weng in October 2004. I saw some improvements that have to be made so I wrote a new one myself.</p>
<p>The program is written in Visual Basic 2010 and should work fine on Windows 7, Vista or XP. For linux users, it will even run on Ubuntu or Debian with wine installed. The main highlight of my program is that the user can see the delay subroutine being generated and the program can copy the subroutine to the clipboard by just clicking a simple button. That way the programmer can paste it over at the MPLAB IDE without having to type the long subroutine code and substituting the values of d1, d2 and d3 manually.</p>
<p><a href="http://waihung.net/wp-content/uploads/2011/12/delayprogram.png"><img class="alignnone  wp-image-189" title="delayprogram" alt="" src="http://waihung.net/wp-content/uploads/2011/12/delayprogram.png" width="526" height="342" /></a></p>
<p><a href="http://waihung.net/wp-content/uploads/2011/12/delay-sample.jpg"><img class="alignnone  wp-image-188" title="delay sample" alt="" src="http://waihung.net/wp-content/uploads/2011/12/delay-sample-1024x606.jpg" width="779" height="461" /></a></p>
<p>&nbsp;</p>
<p>For those wondering how the program works, basically the user have to use the trial and error approach. There are three values of d1, d2 and d3, so the user have to try and guess these numbers, and slowly adjusting them to match the delay duration they desire. I tried to write the program in a way that it can predict the values of d1, d2 and d3 but it will consume a lot of processing time as the computer have to try each possible combination of d1, d2 and d3. That&#8217;s 255 times 255 times 255 which is 16.6 million possibilities. And not to mention that it has to be run with a few decimal point so as to get a closer value (which will be rounded off in the end). I figured out the code but most of the time it just locks up the program because the process is just simply too long.</p>
<p>Finally, I hope the program is useful to you. To download it, click on the button below.<br />
To show your support, &#8216;Like&#8217; my website. If you&#8217;ve come across any bugs and errors while using the program, please inform me at waihung@waihung.net.</p>
<p>Thank you.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/01/DelayCalc.exe" class="button_link hover_fade"><span>DOWNLOAD</span></a><br />
.exe  110KB</p>
]]></content:encoded>
			<wfw:commentRss>http://waihung.net/microchip-delay-calculator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Microchip PIC16F84A</title>
		<link>http://waihung.net/microchip-pic16f84a/</link>
		<comments>http://waihung.net/microchip-pic16f84a/#comments</comments>
		<pubDate>Wed, 21 Dec 2011 16:33:59 +0000</pubDate>
		<dc:creator>waihung</dc:creator>
				<category><![CDATA[Microchip PIC]]></category>
		<category><![CDATA[Reviews]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[PIC]]></category>
		<category><![CDATA[PIC16F84A]]></category>

		<guid isPermaLink="false">http://waihung.net/?p=135</guid>
		<description><![CDATA[In a recent lab assignment, I&#8217;m required to build a circuit using the PIC16F84A. I&#8217;m allowed to do it at home so the college &#8216;lend&#8217; us the chips. But after completing the assignment I have to return it (initially I thought the college was going to give the chip to me but I was wrong). I had to buy one for ...]]></description>
				<content:encoded><![CDATA[<p>In a recent lab assignment, I&#8217;m required to build a circuit using the PIC16F84A. I&#8217;m allowed to do it at home so the college &#8216;lend&#8217; us the chips. But after completing the assignment I have to return it (initially I thought the college was going to give the chip to me but I was wrong).<br />
I had to buy one for myself so I could play with it as I wish.</p>
<p>I went to a shop in Pudu which was recommended by my lecturer and they did not carry the normal 4MHz variant. Instead they had only the 20MHz ones which were more expensive at RM30. That is alot for a small microcontroller. I bought it anyway because I can&#8217;t find it elsewhere.</p>
<p>This version I bought supports up to 20MHz, that doesn&#8217;t mean that it supports only 20MHz, it will work just fine with any frequency lower than that.<br />
For the fun of it, I decided why not run it at its&#8217; maximum frequency, so I bought a 20MHz crystal as well to see what this baby can do.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/01/crystal-h49s-20mhz1-e1326988480588.jpg"><img class="alignnone  wp-image-144" title="crystal-h49s-20mhz[1]" src="http://waihung.net/wp-content/uploads/2012/01/crystal-h49s-20mhz1-e1326988480588.jpg" alt="" width="140" height="119" /></a></p>
<p>Connecting a crystal to a microcontroller is different compared to RC circuits. The crystal is connected to pin OSC1 and OSC2 and also requires two 15pF capacitors.<br />
According to the datasheet, you can use any capacitors ranging from 15pF to 33pF in HS mode.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/01/crystal_connection.jpg"><img class="alignnone  wp-image-147" title="crystal_connection" src="http://waihung.net/wp-content/uploads/2012/01/crystal_connection.jpg" alt="" width="240" height="349" /></a></p>
<p>And, when writing the configuration code, the oscillator mode have to be set to HS (High Speed).</p>
<p>Let&#8217;s try this new microcontroller with the obligatory blink test.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/01/100_7493.jpg"><img class="alignnone size-medium wp-image-154" title="100_7493" src="http://waihung.net/wp-content/uploads/2012/01/100_7493-300x226.jpg" alt="" width="300" height="226" /></a></p>
<p><a href="http://waihung.net/wp-content/uploads/2012/01/100_7494.jpg"><img class="alignnone size-medium wp-image-155" title="100_7494" src="http://waihung.net/wp-content/uploads/2012/01/100_7494-300x226.jpg" alt="" width="300" height="226" /></a></p>
<p><a href="http://waihung.net/wp-content/uploads/2012/01/blink_code.jpg"><img class="alignnone size-full wp-image-148" title="blink_code" src="http://waihung.net/wp-content/uploads/2012/01/blink_code.jpg" alt="" width="543" height="589" /></a></p>
<p>The LED is connected to PORT B bit 0 and it turns ON and OFF in an interval of 1 second. In the next post, I will show how I calculate the delay subroutine.<br />
In the meantime, here&#8217;s a video of the microcontroller in action.</p>
<div class='video_frame'><iframe id='vimeo_video_24' class='vimeo_video' style='height:480px;width:640px' src='http://player.vimeo.com/video/35320118?title=1&amp;byline=1&amp;portrait=1&amp;autoplay=0&amp;loop=0&amp;js_api=1&amp;js_swf_id=vimeo_video_24' width='640' height='480' frameborder='0'></iframe></div>
<p>Pardon me for the poor quality of this video. I&#8217;ll get a better camera soon.</p>
<p>More projects coming soon using the PIC16F84A.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://waihung.net/microchip-pic16f84a/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>USB ICSP PIC Programmer</title>
		<link>http://waihung.net/usb-icsp-pic-programmer/</link>
		<comments>http://waihung.net/usb-icsp-pic-programmer/#comments</comments>
		<pubDate>Tue, 20 Dec 2011 05:17:41 +0000</pubDate>
		<dc:creator>waihung</dc:creator>
				<category><![CDATA[Microchip PIC]]></category>
		<category><![CDATA[Reviews]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[PIC]]></category>
		<category><![CDATA[PIC16F84A]]></category>

		<guid isPermaLink="false">http://waihung.net/?p=78</guid>
		<description><![CDATA[From the previous post, I mentioned that I bought this PIC Programmer for only RM 25 from Cytron. This is essentially just an OEM version of the official Microchip Pickit 2 Programmer. The original version could have easily cost more than RM100. Together with this programmer I also bought a ICSP Universal Socket so I can directly plug it into ...]]></description>
				<content:encoded><![CDATA[<p>From the previous post, I mentioned that I bought this PIC Programmer for only RM 25 from Cytron.</p>
<p>This is essentially just an OEM version of the official Microchip Pickit 2 Programmer.<br />
The original version could have easily cost more than RM100.</p>
<p>Together with this programmer I also bought a ICSP Universal Socket so I can directly plug it into the breadboard for easy debugging.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/01/icsp.jpg"><img class="alignnone size-full wp-image-82" title="icsp" src="http://waihung.net/wp-content/uploads/2012/01/icsp.jpg" alt="" width="149" height="147" /></a></p>
<p>&nbsp;</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/01/100_7490.jpg"><img class="alignnone size-medium wp-image-85" title="100_7490" src="http://waihung.net/wp-content/uploads/2012/01/100_7490-300x226.jpg" alt="" width="300" height="226" /></a></p>
<p>The connection schematics are as follows:</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/01/schematics_pic_programmer.jpg"><img class="alignnone  wp-image-86" title="schematics_pic_programmer" src="http://waihung.net/wp-content/uploads/2012/01/schematics_pic_programmer-1024x567.jpg" alt="" width="430" height="238" /></a></p>
<p>Do take note that the above connection is to operate the PIC Microcontroller at 800kHz.<br />
I&#8217;m using the PIC16F84A for this test.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/01/pickit2_software.jpg"><img class="alignnone  wp-image-87" title="pickit2_software" src="http://waihung.net/wp-content/uploads/2012/01/pickit2_software.jpg" alt="" width="388" height="472" /></a></p>
<p>The software detected the PIC16F84A and all there&#8217;s left to do is to load a HEX file and click Write.</p>
<p>Besides programming the MCU, the programmer can also power up the circuit by just ticking the check box on the VDD section.<br />
If desired, the VDD voltage can be varied from 2.5V to 5.0V.<br />
It won&#8217;t go any higher than 5.0V because that is the maximum the USB port can provide.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://waihung.net/usb-icsp-pic-programmer/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Cytron Crazy Sales</title>
		<link>http://waihung.net/cytron-crazy-sales/</link>
		<comments>http://waihung.net/cytron-crazy-sales/#comments</comments>
		<pubDate>Tue, 20 Dec 2011 03:16:56 +0000</pubDate>
		<dc:creator>waihung</dc:creator>
				<category><![CDATA[Microchip PIC]]></category>
		<category><![CDATA[electronics]]></category>

		<guid isPermaLink="false">http://waihung.net/?p=64</guid>
		<description><![CDATA[Cytron had its&#8217; online crazy sales on the 23rd of November and everything on the site is at half price. At half price, the Pickit2 programmer is only RM 25 and the breaboard is only RM 7.50. To share shipping costs, I ordered for my friends as well. I had to have 2 breaboards because the price is just too ...]]></description>
				<content:encoded><![CDATA[<p>Cytron had its&#8217; online crazy sales on the 23rd of November and everything on the site is at half price.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/01/CrazySales2011Highlight1.jpg"><img class="alignnone size-full wp-image-67" title="CrazySales2011Highlight[1]" src="http://waihung.net/wp-content/uploads/2012/01/CrazySales2011Highlight1.jpg" alt="" width="339" height="480" /></a></p>
<p>At half price, the Pickit2 programmer is only RM 25 and the breaboard is only RM 7.50.<br />
To share shipping costs, I ordered for my friends as well.</p>
<p>I had to have 2 breaboards because the price is just too hard to resist.<br />
Having extra breadboards allows me to have extra workspace for my future projects.</p>
<p>The next time Cytron is having sales I&#8217;m gonna start ordering at 12am because these things do run out quickly.</p>
<p>Do visit <a href="http://www.cytron.com.my" target="_blank">http://www.cytron.com.my</a> to see what they have to offer.</p>
]]></content:encoded>
			<wfw:commentRss>http://waihung.net/cytron-crazy-sales/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Multimeter</title>
		<link>http://waihung.net/multimeter/</link>
		<comments>http://waihung.net/multimeter/#comments</comments>
		<pubDate>Tue, 20 Dec 2011 02:00:10 +0000</pubDate>
		<dc:creator>waihung</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Reviews]]></category>
		<category><![CDATA[electronics]]></category>

		<guid isPermaLink="false">http://waihung.net/?p=41</guid>
		<description><![CDATA[Got this relatively cheap digital multimeter at Jalan Pasar for RM 48, including a free 9V battery. There are cheaper ones around RM20 but those looked like it&#8217;s gonna break after a few use. I was told that these cheap multimeters are quite accurate when measuring low voltage or current. Let&#8217;s put it to the test shall we. This is ...]]></description>
				<content:encoded><![CDATA[<p>Got this relatively cheap digital multimeter at Jalan Pasar for RM 48, including a free 9V battery.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/01/100_7480.jpg"><img class="alignnone  wp-image-37" title="100_7480" src="http://waihung.net/wp-content/uploads/2012/01/100_7480-300x226.jpg" alt="" width="300" height="226" /></a></p>
<p>There are cheaper ones around RM20 but those looked like it&#8217;s gonna break after a few use.<br />
I was told that these cheap multimeters are quite accurate when measuring low voltage or current.</p>
<p>Let&#8217;s put it to the test shall we.</p>
<p>This is the LM7805. It&#8217;s a 5V voltage regulator, its&#8217; sole purpose is to downscale any high voltage (as high as 35V) down to just 5V while limiting current flow to 1A.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/01/lm7805-5v-regulator.jpg"><img class="alignnone size-full wp-image-40" title="lm7805-5v-regulator" src="http://waihung.net/wp-content/uploads/2012/01/lm7805-5v-regulator.jpg" alt="" width="300" height="300" /></a><br />
But if you plan to go any higher than 20V, a heatsink is highly recommended.</p>
<p>Let&#8217;s plug it into a breadboard and use a 9V battery as the input for this simple test.</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/01/100_7484.jpg"><img class="alignnone size-medium wp-image-38" title="100_7484" src="http://waihung.net/wp-content/uploads/2012/01/100_7484-300x226.jpg" alt="" width="300" height="226" /></a></p>
<p>&nbsp;</p>
<p><a href="http://waihung.net/wp-content/uploads/2012/01/100_7486.jpg"><img class="alignnone size-medium wp-image-39" title="100_7486" src="http://waihung.net/wp-content/uploads/2012/01/100_7486-300x226.jpg" alt="" width="300" height="226" /></a></p>
<p>As you can see, the reading is exactly 5.00V. I&#8217;ve put it to other tests as well and this multimeter is quite accurate for my needs.</p>
<p>If you are eagle-eyed, you may notice that I&#8217;ve put the reading on hold. That&#8217;s because it fluctuates between 5.00V and 5.01V.<br />
This is not the multimeter&#8217;s fault, I did not put any capacitors to stabilize the voltage.</p>
<p>I&#8217;ve been using it for over two months now and it&#8217;s holding up well.</p>
]]></content:encoded>
			<wfw:commentRss>http://waihung.net/multimeter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
