<?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> &#187; P1</title>
	<atom:link href="https://gonazar.x10.mx/?cat=11&#038;feed=rss2" rel="self" type="application/rss+xml" />
	<link>https://gonazar.x10.mx</link>
	<description></description>
	<lastBuildDate>Sat, 02 Sep 2017 04:26:41 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.0.38</generator>
	<item>
		<title>Project 1: Electronics and Software</title>
		<link>https://gonazar.x10.mx/?p=896</link>
		<comments>https://gonazar.x10.mx/?p=896#comments</comments>
		<pubDate>Mon, 24 Nov 2014 08:37:32 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[P1]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://gonazar.x10.mx/?p=896</guid>
		<description><![CDATA[This part has taken me a long time, mainly because I worry too much about burning electronics and lack of resources to debug things. It also didn&#8217;t help that I kept starting and stopping work on this so it was hard to maintain continuous progress. I&#8217;d forget what it was I was doing or what [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>This part has taken me a long time, mainly because I worry too much about burning electronics and lack of resources to debug things. It also didn&#8217;t help that I kept starting and stopping work on this so it was hard to maintain continuous progress. I&#8217;d forget what it was I was doing or what I got stuck on.</p>
<p>Additionally, there were a lot of features I wanted to include in this that required various bits of hardware and logic to run it all. In retrospect, it would have been better to create a roadmap or outline of what I waned to accomplish, then work on individual parts and put it all together. However in some sense I thought it wouldn&#8217;t be too difficult to put it altogether in one go, so I just winged it. Working on multiple parts of the code simultaneously is not a good idea. Especially when you get bugs and have no idea where they are originating from.</p>
<p>Since I am writing this in post, it&#8217;s much easier for me to outline what has been done and give a proper road map of where this is going:</p>
<ol>
<li>Create time keeping electronics that display on an LCD</li>
<li>Add LED Lamp brightness control (input from a potentiometer and create PWM output)</li>
<li>Add alarm functionality (manual alarm set + sunrise effect for alarm action)</li>
<li>Add button array for user input (include debouncing and UI logic)</li>
<li>Modify firmware to be able to display time, alarm time and modify either by using button inputs (remove manual time/alarm set)</li>
<li>Add switches to change modes (might be trouble since we&#8217;re running out of digital I/Os)</li>
<li>Add Winamp communication functionality to buttons in different modes (media buttons, playlist selection, volume)</li>
<li>Create script on computer to handle communication between MCU and Winamp</li>
<li>Add an independent power supply</li>
<li>Move all electronics to custom PCB boards or Prototyping boards</li>
<li>Design and print an enclosure to hold all the electronics.</li>
</ol>
<p>Steps 1-3 were fairly easy since I relied heavily on <a href="http://startingelectronics.com/beginners/start-electronics-now/tut16-arduino-clock/">this tutorial</a> and the RTC library. Step 4 was a bit more challenging since at first I didn&#8217;t know how to approach debouncing on multiple buttons. This changed after I resolved to use a button map and used that for checking debouncing. Subsequently, once the buttons were figured out, adding alarm functionality for step 5 was a matter of playing with the RTC library a bit more in depth.</p>
<p>Step 6 has been one of the more difficult challenges. I needed two switches but only had one digital I/O left. Instead I opted to use analog pins, however due to the time it takes to process the value of these pins I think I was accumulating latency and errors. Since the switches are flip/rocker switches I don&#8217;t have to worry about debouncing and don&#8217;t need to check the value as often. As far as I can tell this bug has been resolved, but more testing is needed to see if it&#8217;s been totally cleared.</p>
<p>Step 7 and 8 have been mostly figured out on another program. Earlier this year I was already playing with trying to make an external Winamp controller, before I changed the goal of this project to a led lamp with the same functionality. In the other program I had used an PS/2 mouse as an input, utilizing a low level serial communication to interface the two buttons and mouse wheel. A python script was already in place to handle commands from the external MCU for media control, playlist selection and volume. This project was mainly dropped because originally I wanted to display currently playing tracks on the small 2&#215;16 character LCD. However the majority of my music is Japanese and uses many asian characters that the LCD is not able to display, making it effectively useless. With the LED Lamp however, I plan to just use the computer monitor to display this data which means I can also modify the python script as an interface for selecting playlists.</p>
<p>Step 9 was something I had wanted ever since I installed the LED strip. The LED strip runs at 12 V and draws about 0.5 A, while the MCU and all the electronics run at 5V with about 100mA draw. Throughout the prototyping process I have been using my Hydra which is a programmable digital power supply which was set for 5V and 12V outputs. While great for prototyping, I did not want this project dependent on it if it were to become a stand alone product. Thus, added a 9V regulator and utilized the DC input socket of the arduino. I have a 12V 1.6A switching power supply which feeds the LED strip and this small regulator which in turn powers everything else.</p>
<p>Step 10 is one of the slowest parts mainly because I am unsure of how to proceed. Ideally I would have liked to have a custom PCB, but it&#8217;s incredibly expensive or time consuming to manufacture a single board. Therefore I have to resort to prototyping board on which I have very limited space. On this board I need to fit the power circuit, PWM transistors circuits, a pin socket for the potentiometer, and the real-time clock circuit (in which the coin cell batter takes up a huge amount of space). The button array has already been moved to a much nicer board with fancy colorful buttons.</p>
<p>Step 11 I will not be able to start until the last board is finished. Otherwise I won&#8217;t know for sure the dimensions I need to fit everything in.</p>
]]></content:encoded>
			<wfw:commentRss>https://gonazar.x10.mx/?feed=rss2&#038;p=896</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Project 1: Mechanical Design and Construction</title>
		<link>https://gonazar.x10.mx/?p=893</link>
		<comments>https://gonazar.x10.mx/?p=893#comments</comments>
		<pubDate>Mon, 24 Nov 2014 08:17:07 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[P1]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://gonazar.x10.mx/?p=893</guid>
		<description><![CDATA[With the rough design in mind I designed all the joint components in Solidworks for 3D printing. In total there are 6 joint pieces per side; two at the base, two at the top, and two small nubs that will connect the reflector (not shown above). The two joint pieces at the base are pretty straight [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>With the rough design in mind I designed all the joint components in Solidworks for 3D printing.</p>
<p><img class="aligncenter  wp-image-904" src="http://gonazar.x10.mx/wp-content/uploads/2014/11/LEDLamp2.jpg" alt="LEDLamp2" width="292" height="400" /></p>
<p>In total there are 6 joint pieces per side; two at the base, two at the top, and two small nubs that will connect the reflector (not shown above). The two joint pieces at the base are pretty straight forward, the only important feature in this was to make the inner piece, which fits inside the copper tube, hollow so that the LED wires could be run internally. The top two joint pieces are the most complex of this design. The outer (left) piece has a large hole in the bottom so that it can be fixed to to the copper tube. The majority of this piece is hollow aside from the core which supports the axial screw. The hollow cavity is for extra slack in the wires so the connecting piece can rotate without tugging on them. The inner (right) piece is the crux of this joint system.</p>
<p><img class="aligncenter size-large wp-image-907" src="http://gonazar.x10.mx/wp-content/uploads/2014/11/LEDLamp5.jpg" alt="LEDLamp5" width="492" height="644" /></p>
<p>a) Hole for axial screw and bolt. b) slot for aluminum bar with a notch for the led wires. c) Hole for locking screw to fix aluminum bar in place. d) Slots to allow reflector to move from front to back. e) Mounting hole for telescoping bar.</p>
<table>
<tr style="background-color:#3E3E3E;">
<td><img class="wp-image-906 aligncenter" src="http://gonazar.x10.mx/wp-content/uploads/2014/11/LEDLamp4.jpg" alt="LEDLamp4" width="403" height="250" /></td>
<td><img class="wp-image-905 aligncenter" src="http://gonazar.x10.mx/wp-content/uploads/2014/11/LEDLamp3.jpg" alt="LEDLamp3" width="284" height="250" /></td>
</tr>
</table>
<p>The bottom reflector nub attaches to both ends of a brass bar and slots into the inner-top joint. The top nub also attaches to both ends of a brass bar which connect to the top of the telescoping bars.</p>
<p><img class="aligncenter size-large wp-image-899" src="http://gonazar.x10.mx/wp-content/uploads/2014/11/IMG_7209-1024x768.jpg" alt="IMG_7209" width="640" height="480" /></p>
<p>The most difficult part of this was determining tolerances since I had not yet made anything that joined to other parts (of various materials). Additionally, I found that the 3D printed PLA changes over time, depending on the shape and the way it was extruded, it can shrink, expand and even warp if under stress over a long period of time.</p>
<p><img class="aligncenter size-large wp-image-901" src="http://gonazar.x10.mx/wp-content/uploads/2014/11/IMG_7211-1024x768.jpg" alt="IMG_7211" width="640" height="480" /></p>
<p><img class="aligncenter size-large wp-image-902" src="http://gonazar.x10.mx/wp-content/uploads/2014/11/IMG_7212-1024x768.jpg" alt="IMG_7212" width="640" height="480" /></p>
<p>The only way to resolve this was by trial and error. Parts were designed to fit snugly however I quickly realized I needed at least 0.1&#8243; extra clearance to get &#8216;snug&#8217; fits.</p>
<p><img class="aligncenter size-large wp-image-900" src="http://gonazar.x10.mx/wp-content/uploads/2014/11/IMG_7210-1024x768.jpg" alt="IMG_7210" width="640" height="480" /></p>
<p>Joints aside, I also needed to get together the non plastic parts that would fill in everything in between. I sourced 2&#8243; #6-32 machine screws + nuts, 1/2&#8243; wood screws, a 1/4&#8243;aluminum bar, 2 1/8&#8243; brass rods, a piece of 3/4&#8243; diameter copper pipe (meant for plumbing) and a 8&#8242; plank of 1&#215;3, all from Home Depot. All the metal components were cut to size and polished with steel wool to achieve a very nice shine. The wood was cut to length, however I found despite being very careful to pick one that was straight, after cutting it it turned out to be very warped.</p>
<p>Additionally I picked up a sheet of poster board from the dollar store which would become my reflector and a set of bunny ears (telescoping TV antennas) which was the single worst purchase I&#8217;ve ever made. I don&#8217;t think I&#8217;ve been scammed worse than for the bunny ears which cost me ~$10 for 2 pieces of telescoping metal, a plastic shell and a copper wire that was screwed to the bottom of each &#8216;ear&#8217; that went out to the TV. I had no idea these things were that simple and it certainly was worth much much less than $10.</p>
<p>With all the joints printed, it was a simple matter to assemble everything together. It really is amazing to be able to develop a concept in my mind and make it into a reality. However, like any other prototyping process, design flaws may not be realized until after the thing has been built.</p>
<p><img class="aligncenter size-large wp-image-908" src="http://gonazar.x10.mx/wp-content/uploads/2014/11/IMG_7223-1024x768.jpg" alt="IMG_7223" width="640" height="480" /></p>
<p>Two of the major issues I found with my design are weight distribution and using screws in rotational joints. Looking back at the design, I had imagined that the majority of the lamp would be fairly light, but having used metal bars, pipes and rods with a light cedar base, the lamp is very top heavy. This was further compounded with the fact that the rotational joints had fixed slots for the nuts, meaning the joints would loosen every time it was moved. Even if the top heavy lamp managed to stay upright, there was a good chance the reflector section would just spin downwards since the joints would not be tight enough for friction to hold it&#8217;s position.</p>
<p>In the mean time, I&#8217;ve left the lamp mostly upright, which is still usable. Now that it&#8217;s been tested, I have a better idea of what I want to do and the design requirements for revision 2. Ah, the life of prototyping.</p>
]]></content:encoded>
			<wfw:commentRss>https://gonazar.x10.mx/?feed=rss2&#038;p=893</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Project 1: LED Lamp Design</title>
		<link>https://gonazar.x10.mx/?p=857</link>
		<comments>https://gonazar.x10.mx/?p=857#comments</comments>
		<pubDate>Fri, 07 Nov 2014 17:21:52 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[P1]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[3D modelling]]></category>
		<category><![CDATA[3D printing]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[microcontrollers]]></category>

		<guid isPermaLink="false">http://gonazar.x10.mx/?p=857</guid>
		<description><![CDATA[In my previous post I talked about influences that lead to the idea of this lamp. Concerning Japanese lighting elements, I&#8217;d like to add that two key defining aspects I&#8217;ve learned from them are indirect lighting and ambient lighting. In most cases in common household a point source (bulb) lamp is used to light an area [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>In my previous post I talked about influences that lead to the idea of this lamp. Concerning Japanese lighting elements, I&#8217;d like to add that two key defining aspects I&#8217;ve learned from them are indirect lighting and ambient lighting. In most cases in common household a point source (bulb) lamp is used to light an area while using a shade to block direct light. Having a direct view of a bulb can sometimes be too bright for the eye. Typically these lamps are either directed upwards to reflect off the ceiling or downwards to light up the floor. With ambient lighting we focus on smaller areas to create a contrast with light at dark. Some examples of this are using focused point sources directly on walls to light up a certain section, a highlight lamp to bring out a feature in the space and using edge lighting near the ceiling or floor.</p>
<p><img class="aligncenter" src="http://www.cmstatic1.com/33926/33926.214619.jpg" alt="" width="400" height="380" /></p>
<p>In my room I have a lot of blank wall space which I like to use like a reflective surface for lighting as previously mentioned. Additionally, my bed has no headboard, but has a 4&#8243; ledge the length of the wall about a foot above it, perfect for mounting my lamp. However I don&#8217;t want to mount directly to it since it has a nice finished surface, so I&#8217;ll need a base to my lamp that will sit on it.</p>
<p><a href="http://gonazar.x10.mx/wp-content/uploads/2014/11/001.jpg"><img class="aligncenter size-large wp-image-858" src="http://gonazar.x10.mx/wp-content/uploads/2014/11/001-1024x744.jpg" alt="001" width="640" height="465" /></a></p>
<p>This is my target design. The idea was to create 3D printed hinges and connectors and whatever raw materials I could easily pick up at home depot. In this case I planned to pick up a 2&#215;4, some sort of pipe and metal bars. The design of the reflector (not a shade) was the more complex aspect of this. I wanted the reflector to be capable of multiple orientations for different lighting dynamics. In the top left you can see in one mode it reflects upwards, directing the light toward the wall and ceiling for ambient lighting. In the next the reflector is straight and covers a larger area downwards. Below that the reflector is curved to focus light right below it.</p>
<p>To achieve these modes I designed a custom hinge (mid bottom). In the stationary half it connects to the pipe holding it up through which wires are fed for a clean wireless appearance. The LED strip itself is adhered to an aluminum bar slotted into bottom of the rotational part of the hinge.  At the top of the rotational part, there is a slot that splits into two directions. This is for the base of the reflector so that it can be changed to reflect forwards or backwards. At the very top of the rotational part there will be a hole to add a small telescoping pipe. This will attach to the top of the reflector so that the curvature can be adjusted.</p>
<p>The electronics enclosure will be set in the middle of the base with wires being fed under or behind it in channels. Since the the ATmega is part of the arduino development board, it&#8217;s easier to run everything with pin connectors than create a custom pcb. This also allows for different orientations of circuits so that the LCD can be perpendicular to the board and secondary boards for buttons, clock electronics can be mounted to the walls. The arduino will be at the bottom with a power splitting circuit to split off a 5v feed to run the microcontroller from the 12V supply.</p>
<p>The diagonal split between the top and bottom of the electronics box is to maximize access to the electronics while minimizing the number of pieces. There is a lip on the front edge so that the pieces will hinge and rotate around that edge. This is to minimize the length of the wires attaching the button array and LCD to the bottom half of the electronics and allowing access without having to disconnect them.</p>
]]></content:encoded>
			<wfw:commentRss>https://gonazar.x10.mx/?feed=rss2&#038;p=857</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Project 1: LED Sunrise Lamp &#8211; Intro</title>
		<link>https://gonazar.x10.mx/?p=829</link>
		<comments>https://gonazar.x10.mx/?p=829#comments</comments>
		<pubDate>Thu, 06 Nov 2014 07:06:25 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[P1]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[3D printing]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[microcontrollers]]></category>
		<category><![CDATA[scripts]]></category>
		<category><![CDATA[winamp]]></category>

		<guid isPermaLink="false">http://gonazar.x10.mx/?p=829</guid>
		<description><![CDATA[To start this project off, I want to talk about the inspiration and influences. In the last several years I have been heavily influenced by Japanese architecture and interior design. With compact, simple, clean designs Japanese homes can be comfortable while being extremely efficient with space. Homes can be converted into beautiful spaces that not [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>To start this project off, I want to talk about the inspiration and influences.</p>
<p>In the last several years I have been heavily influenced by Japanese architecture and interior design. With compact, simple, clean designs Japanese homes can be comfortable while being extremely efficient with space. Homes can be converted into beautiful spaces that not only are physically comforting, but visually relaxing and allowing the residents to more easily achieve a peace of mind or zen state.</p>
<p>One of my favorite elements in design is lighting. It has a very important effect on spaces and how they are perceived. It&#8217;s also something dynamic that changes with the time of day, weather and mood. I believe it&#8217;s very common to use mood lighting, but in American culture I think this is used often to describe just an adjustable light to a dimmer setting. However, lights can set moods in many different situations. Different combinations of flashing colored lights could either set a fun dance party, or fear and caution in emergency settings. Even the different wavelengths hitting your eye from your computer monitor can make subtle changes. Hours of staring at a white screen can cause strain in your eyes, headaches and possibly a higher stress level. While viewing a darker screen like my blog is a bit easier on the eyes. Programs such as f.lux tint your computer screen to softer colors after the sun has set for exactly these reasons.</p>
<p>So my goal with this is to create a light that sets a mood upon waking up, or really to use the light to make it easier to wake up. Here in Vancouver, Canada we&#8217;re only getting about 9 hours of sunlight this time of year. It&#8217;s dark when we wake up and it&#8217;s dark before we leave work. It can be pretty depressing, especially considering we get so much rain it&#8217;s cloudy all the time and we almost never see the sun. For this reason I want to make a lamp that is easy on the eyes and has an alarm function that will turn it on when I have to wake up.</p>
<p>This particular function exists in another Japanese innovation. A certain capsule hotel in Kyoto called <a href="http://ninehours.co.jp/en/">Nine Hours</a>, which opened up only a few years ago, uses much more technology than it&#8217;s 70&#8217;s and 80&#8217;s predecessors. One of these innovations is <a href="https://www.youtube.com/watch?v=CRT4dU6r-KQ#t=150">ambient lighting in the entire ceiling of the capsule that can be triggered by an alarm to simulate sunrise</a>.</p>
<p>To replicate this I outlined a few requirements:</p>
<ul>
<li>LED based ambient lighting
<ul>
<li>With adjustable brightness</li>
<li>And an adjustable shade</li>
</ul>
</li>
<li>Alarm Clock functions
<ul>
<li>LCD Display showing time</li>
<li>Adjustable time</li>
<li>Adjustable alarm</li>
</ul>
</li>
<li>Music control
<ul>
<li>Interface with the computer to control Winamp</li>
<li>Typical music player commands play/pause/next/back/vol up/vol down</li>
<li>Additional control to switch playlists</li>
</ul>
</li>
</ul>
<p>The music control is another addition that I wanted since I go to sleep with music. With the controls of the alarm next to the bed it seemed convenient to be able to control music from it as well. One bonus from this would be that I would be able to set certain music to play on the alarm function as well.</p>
<p>To meet these requirements I will be using the following resources:</p>
<ul>
<li>3D printed parts to build the lamp</li>
<li>Arduino ATMega to control the lamp, LCD display and computer interface</li>
<li>Electronics for timekeeping and interfacing; buttons, knobs etc.</li>
<li>Power supply to run it all</li>
<li>3D printed case to house all the electronics</li>
<li>scripts on the computer to interface microcontroller communication and the music player software</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>https://gonazar.x10.mx/?feed=rss2&#038;p=829</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
