<?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>Projects Log &#187; avr</title>
	<atom:link href="http://dev.pulsed.net/wp/?cat=18&#038;feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://dev.pulsed.net/wp</link>
	<description>projects, diy</description>
	<lastBuildDate>Mon, 25 Jul 2011 11:22:33 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Breeding Terrarium Thermostat</title>
		<link>http://dev.pulsed.net/wp/?p=42</link>
		<comments>http://dev.pulsed.net/wp/?p=42#comments</comments>
		<pubDate>Sat, 30 Jan 2010 13:53:15 +0000</pubDate>
		<dc:creator>Kevin DEHLINGER</dc:creator>
				<category><![CDATA[DIY]]></category>
		<category><![CDATA[avr]]></category>
		<category><![CDATA[hardware]]></category>

		<guid isPermaLink="false">http://dev.pulsed.net/wp/?p=42</guid>
		<description><![CDATA[warning: work in progress
I&#039;m building a thermostat system for our turtle&#039;s breeding terrarium.
Basicaly, it&#039;ll control the temperatures in two zones of the terrarium, giving me the ability to set up the temperature I want for each zone per time period (e.g. 26Â°c  from 10:00 to 18:30 and at least 20Â°c the rest of the [...]]]></description>
			<content:encoded><![CDATA[<p><strong>warning: work in progress</strong></p>
<p>I&#039;m building a thermostat system for our turtle&#039;s breeding terrarium.<br />
Basicaly, it&#039;ll control the temperatures in two zones of the terrarium, giving me the ability to set up the temperature I want for each zone per time period (e.g. 26Â°c  from 10:00 to 18:30 and at least 20Â°c the rest of the time in Zone1 and 31Â°c from 11:00 to 17h30 and at least 21Â°c the rest of the time in Zone2)</p>
<p>I&#039;m using an atmega168 (not an atmega8 like the schematics says, but it&#039;s pin compatible), a 32.768khz xtal for the time, two 5v relays, and two p-channel mosfets to drive those relays, and an 2&#215;16 LCD.</p>
<p>Here&#039;s what i think the board will look like (design not tested yet)<br />
<img src="http://dev.pulsed.net/misc/turtle_sch.png" alt="http://dev.pulsed.net/misc/turtle_sch.png" /><br />
<span id="more-42"></span><br />
<img src="http://dev.pulsed.net/misc/turtle_th.png" alt="http://dev.pulsed.net/misc/turtle_th.png" /><img src="http://dev.pulsed.net/misc/turtle_th2.png" alt="http://dev.pulsed.net/misc/turtle_th2.png" /></p>
<p>the code is still work in progress, but i&#039;ll post it later </p>
<p>Edit: February 18th 2010<br />
Still no update on the code, but here are some pics of the actual board :<br />
<img src="http://dev.pulsed.net/misc/turtlebrd1.jpg" alt="http://dev.pulsed.net/misc/turtlebrd1.jpg" /><br />
<img src="http://dev.pulsed.net/misc/turtlebrd2.jpg" alt="http://dev.pulsed.net/misc/turtlebrd2.jpg" /><br />
yeah, the DIP IC socket should be reversed, I saw that too late, but no big deal, cause i know that ;) </p>
]]></content:encoded>
			<wfw:commentRss>http://dev.pulsed.net/wp/?feed=rss2&amp;p=42</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cheap DIY servo tester</title>
		<link>http://dev.pulsed.net/wp/?p=41</link>
		<comments>http://dev.pulsed.net/wp/?p=41#comments</comments>
		<pubDate>Mon, 19 Oct 2009 15:04:06 +0000</pubDate>
		<dc:creator>Kevin DEHLINGER</dc:creator>
				<category><![CDATA[DIY]]></category>
		<category><![CDATA[avr]]></category>
		<category><![CDATA[hardware]]></category>

		<guid isPermaLink="false">http://dev.pulsed.net/wp/?p=41</guid>
		<description><![CDATA[I have some cheap servos lying around, with no datasheet available&#8230; since I want to use them for a future robotics project I had to get the information I need one way or another&#8230;

Ladies and gentlemen, let me introduce you the DIY servo tester I made:

So first of all how do servos work? it&#039;s simple, [...]]]></description>
			<content:encoded><![CDATA[<p>I have some cheap servos lying around, with no datasheet available&#8230; since I want to use them for a future robotics project I had to get the information I need one way or another&#8230;</p>
<p><span id="more-41"></span></p>
<p>Ladies and gentlemen, let me introduce you the DIY servo tester I made:<br />
<img src="http://dev.pulsed.net/misc/servotester.jpg" alt="DIY Servo Tester" /></p>
<p>So first of all how do servos work? it&#039;s simple, really, most of them have 3 pins: VCC, GND, and PWM Hook the VCC pin to 5v, the GND one to 0v, and the PWM pin to a device that generates a 50hz pwm signal (a square signal with a variable duty cycle) with the smallest duty cycle handled by the servo the angular position is at its maximum position clockwise, and with the highest duty cycle handled by the servo the angular position is at its maximum counterclockwise. </p>
<p>My problem was to find those values!</p>
<p>As you can see on the picture the length of the pulse was 1.82ms which is 9.13% (duty cycle) of a 50 Hz period (20ms). Since I use the built-in pwm function provided by the atmega168 (the microcontroller I use) the OCR1A value and the top value associated (ICR1) I can generate an accurate square signal. Some internal counter starts at 0 with the output at 5v, when it reaches ORC1A the output goes to 0v, and when it reaches ICR1, the counter resets, and the output goes to 5v again and so on&#8230;</p>
<p>Anyway, there are to buttons, one to make it go CW, decreasing the OCR1A value, one to make it go CCW, increasing the OCR1A values&#8230; now all I have to do is read the values when it won&#039;t go any further in both directions&#8230;</p>
<p>I&#039;m going to post the source code and the schematics as soon as possible !</p>
]]></content:encoded>
			<wfw:commentRss>http://dev.pulsed.net/wp/?feed=rss2&amp;p=41</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>640 Leds display [Project update]</title>
		<link>http://dev.pulsed.net/wp/?p=25</link>
		<comments>http://dev.pulsed.net/wp/?p=25#comments</comments>
		<pubDate>Sun, 08 Jul 2007 17:08:49 +0000</pubDate>
		<dc:creator>Kevin DEHLINGER</dc:creator>
				<category><![CDATA[DIY]]></category>
		<category><![CDATA[Project]]></category>
		<category><![CDATA[avr]]></category>
		<category><![CDATA[led]]></category>

		<guid isPermaLink="false">http://dev.pulsed.net/wp/?p=25</guid>
		<description><![CDATA[Finally i had enough free time to work on the PCB layer, here&#039;s the first version (unverified for now)

click to view the whole layout
Since I can&#039;t etch something >300mm, I have to split each board in two parts.
So we have the logic boards (74&#215;4094, and uln2803) on the top, and the &#034;matrices&#034; boards (with the [...]]]></description>
			<content:encoded><![CDATA[<p>Finally i had enough free time to work on the PCB layer, here&#039;s the first version (unverified for now)</p>
<p><center><br />
<a href="http://dev.pulsed.net/misc/typ_leddisplay_big.png"><img src="http://dev.pulsed.net/misc/typ_leddisplay_thumb.png" alt="PCB layout" /><br \/>click to view the whole layout</a></center></p>
<p>Since I can&#039;t etch something >300mm, I have to split each board in two parts.</p>
<p>So we have the logic boards (74&#215;4094, and uln2803) on the top, and the &#034;matrices&#034; boards (with the led matrices) on the bottom.</p>
<p>The power board (with the mosfets), and the controller board (with the ÂµC) are still in dev.</p>
]]></content:encoded>
			<wfw:commentRss>http://dev.pulsed.net/wp/?feed=rss2&amp;p=25</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[New project] 640 leds display (work in progress)</title>
		<link>http://dev.pulsed.net/wp/?p=21</link>
		<comments>http://dev.pulsed.net/wp/?p=21#comments</comments>
		<pubDate>Sat, 30 Dec 2006 12:36:25 +0000</pubDate>
		<dc:creator>Kevin DEHLINGER</dc:creator>
				<category><![CDATA[DIY]]></category>
		<category><![CDATA[Project]]></category>
		<category><![CDATA[avr]]></category>
		<category><![CDATA[led]]></category>
		<category><![CDATA[to come]]></category>

		<guid isPermaLink="false">http://dev.pulsed.net/wp/?p=21</guid>
		<description><![CDATA[Hi!
Once again i&#039;ve been very busy lately&#8230;
Here&#039;s a preview of my new project&#8230; meet the 640-led-display(-to-be)!



Ok for now only 2 matrices (=128 leds), but there are way to much wire on that breadboard&#8230; even with only two of them!

Project Pictures

Project parts (estimated):
a lot of resistors (about 85)
some capacitors
10x 74HCT4094 (shift register, with latch, and serial [...]]]></description>
			<content:encoded><![CDATA[<p>Hi!</p>
<p>Once again i&#039;ve been very busy lately&#8230;</p>
<p>Here&#039;s a preview of my new project&#8230; meet the 640-led-display(-to-be)!</p>
<p><object width="425" height="350">
<param name="movie" value="http://www.youtube.com/v/2bDUOPklGcw"></param>
<param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/2bDUOPklGcw" type="application/x-shockwave-flash" wmode="transparent" width="425"height="350"></embed></object></p>
<p>Ok for now only 2 matrices (=128 leds), but there are way to much wire on that breadboard&#8230; even with only two of them!<br />
<br \/><br \/><br />
<a href="http://dev.pulsed.net/rand/led/">Project Pictures</a><br />
<br \/><br \/><br \/><br />
<u>Project parts (estimated):</u></p>
<li>a lot of resistors (about 85)</li>
<li>some capacitors</li>
<li>10x 74HCT4094 (shift register, with latch, and serial output for cascading)</li>
<li>10x ULN2803</li>
<li>10x 8&#215;8 led matrices</li>
<li>8x p channel mosfet</li>
<li>1 or 2 atmega8 ÂµC</li>
<p><br \/><br \/><br \/><br />
<u>Todo list:</u></p>
<li>etching</li>
<li>send data over USB</li>
<li>&#8230;</li>
]]></content:encoded>
			<wfw:commentRss>http://dev.pulsed.net/wp/?feed=rss2&amp;p=21</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Project One: a clock with 7 segment displays and an Atmel Atmega8 ÂµC</title>
		<link>http://dev.pulsed.net/wp/?p=20</link>
		<comments>http://dev.pulsed.net/wp/?p=20#comments</comments>
		<pubDate>Mon, 18 Sep 2006 10:39:12 +0000</pubDate>
		<dc:creator>Kevin DEHLINGER</dc:creator>
				<category><![CDATA[DIY]]></category>
		<category><![CDATA[Project]]></category>
		<category><![CDATA[avr]]></category>
		<category><![CDATA[led]]></category>

		<guid isPermaLink="false">http://dev.pulsed.net/wp/?p=20</guid>
		<description><![CDATA[This is my first project with Atmel&#039;s microcontrolers&#8230;
it&#039;s an idea i had to learn how to use digital I/Os, internal timer, interrupts,&#8230;
The hardware/software may not be very optimised, but the clock is quite accurate! :p

1. The timer
How does it work?
the timer is increased by one every P clock ticks (P is the prescaler, its value [...]]]></description>
			<content:encoded><![CDATA[<p>This is my first project with Atmel&#039;s microcontrolers&#8230;<br />
it&#039;s an idea i had to learn how to use digital I/Os, internal timer, interrupts,&#8230;</p>
<p>The hardware/software may not be very optimised, but the clock is quite accurate! :p<br />
<span id="more-20"></span><br />
<u>1. The timer</u></p>
<p>How does it work?</p>
<p>the timer is increased by one every <strong>P</strong> clock ticks (P is the prescaler, its value can be 1,8,64,256,1024), and it generate an interrupt each time it overflows (255 to 0)<br />
Now we have timer_interrupt_frequency = F_CPU/(P*256)<br />
thus with a 11,0592Mhz crystal, and P=64, the timer interrupt frequency is: 11059200/(64*256) = 675Hz (yeah exactly 675, not 675,00000000001 nor 674.9999999999999999999999, &#8230; 675!)</p>
<p>That means that 1 second = 675 interrupts<br />
we just need to increase the seconds every 675 interrupts, the minutes every 60 seconds, the hours every 60 minutes, &#8230;</p>
<p><u>2. the 7 segment displays</u></p>
<p>how to drive 7*4= 28 leds ?<br />
remember, we do not have 28 i/o pins! the solution? Charlieplexing!<br />
the 4 cathods (one per display) of each segments are linked together to 7i/o pins and the 4 common anodes are linked to 4 i/o pins<br />
and we make the whole thing go so fast that human eye sees the four displays on at the same time(remember pov &#034;article&#034;)</p>
<p><u>3. the electronical part</u><br />
<a href="http://dev.pulsed.net/misc/clock.png">schematic</a></p>
<p><u>4. the source code</u></p>
<div style="border: 1px dashed #708090; background-color: #add8e6">
	<code>#define F_CPU 11059200UL  // 11,0592mhz</code><br />
	<code></code><br />
	<code>#include &lt;avr/io.h&gt;</code><br />
	<code>#include &lt;avr/interrupt.h&gt;</code><br />
	<code>#include &lt;stdbool.h&gt;</code><br />
	<code></code><br />
	<code>#define STOP_TIMER    TCCR0 &amp;= 0b11111000</code><br />
	<code>#define START_TIMER   TCCR0 |= 0b00000011 // prescaler = c/64</code><br />
	<code></code><br />
	<code></code><br />
	<code>typedef volatile unsigned char BYTE;</code><br />
	<code>typedef volatile unsigned int WORD;</code><br />
	<code></code><br />
	<code></code><br />
	<code></code><br />
	<code>BYTE minutes=0;</code><br />
	<code>BYTE seconds=0;</code><br />
	<code>BYTE hours=0;</code><br />
	<code>WORD Interrupts=0;</code><br />
	<code></code><br />
	<code>bool s=false;</code><br />
	<code>bool h=false;</code><br />
	<code>bool m=false;</code><br />
	<code></code><br />
	<code></code><br />
	<code>unsigned char segs[]=</code><br />
	<code>{</code><br />
	<code>0b00111111,</code><br />
	<code>0b00000110,</code><br />
	<code>0b01011011,</code><br />
	<code>0b01001111,</code><br />
	<code>0b01100110,</code><br />
	<code>0b01101101,</code><br />
	<code>0b01111101,</code><br />
	<code>0b00000111,</code><br />
	<code>0b01111111,</code><br />
	<code>0b01101111</code><br />
	<code>};</code><br />
	<code></code><br />
	<code></code><br />
	<code>ISR(TIMER0_OVF_vect)</code><br />
	<code>{</code><br />
	<code></code><br />
	<code></code><br />
	<code>Interrupts++;</code><br />
	<code></code><br />
	<code>// at 11,0592mhz with a 'Clock/64' prescaler, 675 interrupts = 1 sec!</code><br />
	<code>if (Interrupts == 675)</code><br />
	<code>{</code><br />
	<code>if(++seconds&gt;=60)</code><br />
	<code>{</code><br />
	<code>seconds=0;</code><br />
	<code>if(++minutes&gt;=60)</code><br />
	<code>{</code><br />
	<code>minutes=0;</code><br />
	<code>if(++hours&gt;=24)</code><br />
	<code>{</code><br />
	<code>hours=0;</code><br />
	<code>}</code><br />
	<code>}</code><br />
	<code>}</code><br />
	<code>Interrupts = 0;</code><br />
	<code>}</code><br />
	<code></code><br />
	<code>}</code><br />
	<code></code><br />
	<code></code><br />
	<code></code><br />
	<code></code><br />
	<code></code><br />
	<code></code><br />
	<code>void ConfigureDevice(void)</code><br />
	<code>{</code><br />
	<code>cli(); // mask interruptions</code><br />
	<code></code><br />
	<code></code><br />
	<code>_SFR_BYTE(DDRD)=0b11111111;</code><br />
	<code>_SFR_BYTE(DDRC)=0b00001111;</code><br />
	<code>_SFR_BYTE(DDRB)=0b00000000;</code><br />
	<code></code><br />
	<code>TCNT0 = 0x00;</code><br />
	<code>START_TIMER;</code><br />
	<code>TIMSK  |= _BV(TOIE0);</code><br />
	<code></code><br />
	<code></code><br />
	<code></code><br />
	<code></code><br />
	<code></code><br />
	<code></code><br />
	<code>sei(); // unmask interruptions</code><br />
	<code>}</code><br />
	<code></code><br />
	<code>int main(void)</code><br />
	<code>{</code><br />
	<code>// format:   8 8 : 8 8</code><br />
	<code>// segment:  8 4   2 1</code><br />
	<code>// segment is used to select each 7segments display one after the other (with pov there's no need to have 4 seven bits ports)</code><br />
	<code>// 8=0b00001000;4=0b00000100;2=0b00000010;1=0b00000001</code><br />
	<code>// btw, it's possible to use only one pin from c port with the 8th from b port (2 bits = 4 combinations) but then we'll need some extra elecronic demux part</code><br />
	<code></code><br />
	<code>unsigned char segment=1;</code><br />
	<code>unsigned char portval=0;</code><br />
	<code>unsigned char temp=0;</code><br />
	<code>ConfigureDevice();</code><br />
	<code></code><br />
	<code>hours=0;</code><br />
	<code>minutes=0;</code><br />
	<code>seconds=0;</code><br />
	<code></code><br />
	<code>while(1)</code><br />
	<code>{</code><br />
	<code></code><br />
	<code>m=(PINB&amp;0b00000100)==0?0:m;</code><br />
	<code>h=(PINB&amp;0b00000010)==0?0:h;</code><br />
	<code></code><br />
	<code>if((PINB&amp;0b00000001)!=0 &amp;&amp; (PINB&amp;0b00000010)!=0 &amp;&amp;  !h)</code><br />
	<code>{</code><br />
	<code>h=true;</code><br />
	<code>seconds=0;</code><br />
	<code>Interrupts=0;</code><br />
	<code>if(++hours&gt;=24)</code><br />
	<code>{</code><br />
	<code>hours=0;</code><br />
	<code>}</code><br />
	<code>}</code><br />
	<code></code><br />
	<code></code><br />
	<code>temp=PINB&amp;0b00000100;</code><br />
	<code>if((PINB&amp;0b00000001)!=0 &amp;&amp; (PINB&amp;0b00000100)!=0 &amp;&amp;  !m)</code><br />
	<code>{</code><br />
	<code>m=true;</code><br />
	<code>seconds=0;</code><br />
	<code>Interrupts=0;</code><br />
	<code>if(++minutes&gt;=60)</code><br />
	<code>{</code><br />
	<code>minutes=0;</code><br />
	<code>}</code><br />
	<code>}</code><br />
	<code></code><br />
	<code></code><br />
	<code></code><br />
	<code>switch(segment)</code><br />
	<code>{</code><br />
	<code>//segs is inverted to use with common anode 7 segments displays (up to 300mA sinking current)</code><br />
	<code>case 1:/*xx:xV*/ portval=~segs[minutes%10];break;</code><br />
	<code>case 2:/*xx:Vx*/ portval=~segs[minutes/10];break;</code><br />
	<code>case 4:/*xV:xx*/ portval=~segs[hours%10];break;</code><br />
	<code>case 8:/*Vx:xx*/ portval=~segs[hours/10];break;</code><br />
	<code>}</code><br />
	<code>_SFR_BYTE(PORTC)=0;</code><br />
	<code>_SFR_BYTE(PORTD)=portval;</code><br />
	<code>_SFR_BYTE(PORTC)=segment;</code><br />
	<code>segment=(segment&lt;&lt;1)&gt;8?1:segment&lt;&lt;1;</code><br />
	<code>}</code><br />
	<code></code><br />
	<code>}</code>
</div>
<p>	<strong>Download this code:</strong> <a href="http://dev.pulsed.net/wp/code/avrclock.c">avrclock.c</a>
</ol>
<p><u>5. the final result</u><br />
<img src="http://dev.pulsed.net/misc/avrclock_done.jpg" alt="result" /></p>
]]></content:encoded>
			<wfw:commentRss>http://dev.pulsed.net/wp/?feed=rss2&amp;p=20</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New projects to come soon</title>
		<link>http://dev.pulsed.net/wp/?p=19</link>
		<comments>http://dev.pulsed.net/wp/?p=19#comments</comments>
		<pubDate>Sun, 27 Aug 2006 10:48:56 +0000</pubDate>
		<dc:creator>Kevin DEHLINGER</dc:creator>
				<category><![CDATA[DIY]]></category>
		<category><![CDATA[avr]]></category>
		<category><![CDATA[to come]]></category>

		<guid isPermaLink="false">http://dev.pulsed.net/wp/?p=19</guid>
		<description><![CDATA[i&#039;ve been less active here lately, but i&#039;m currently working on two DIY projects :)
both of them use an atmega8 avr microcontroller (which is very easy, cheap, and a lot better than mid-range pic)
Since i&#039;m new to avrs my first project will be something easy :p
]]></description>
			<content:encoded><![CDATA[<p>i&#039;ve been less active here lately, but i&#039;m currently working on two DIY projects :)</p>
<p>both of them use an atmega8 avr microcontroller (which is very easy, cheap, and a lot better than mid-range pic)</p>
<p>Since i&#039;m new to avrs my first project will be something easy :p</p>
]]></content:encoded>
			<wfw:commentRss>http://dev.pulsed.net/wp/?feed=rss2&amp;p=19</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
