<?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>john.geek.nz - 38911 Basic Bytes Free</title>
	<atom:link href="http://www.john.geek.nz/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.john.geek.nz</link>
	<description>Geeky Randomness</description>
	<lastBuildDate>Thu, 09 May 2013 21:44:26 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Migrating to new server</title>
		<link>http://www.john.geek.nz/2013/04/migrating-to-new-server/</link>
		<comments>http://www.john.geek.nz/2013/04/migrating-to-new-server/#comments</comments>
		<pubDate>Tue, 09 Apr 2013 21:25:41 +0000</pubDate>
		<dc:creator>John Burns</dc:creator>
				<category><![CDATA[General Randomness]]></category>

		<guid isPermaLink="false">http://linode3.file-it.co.nz/?p=2369</guid>
		<description><![CDATA[I&#8217;m in the middle of migrating to a new server. If you have any problems on my site, please send an email to]]></description>
				<content:encoded><![CDATA[<p>I&#8217;m in the middle of migrating to a new server.</p>
<p>If you have any problems on my site, please send an email to <img src="/wp-content/uploads/2013/04/site_email1.png" width="160" height="18" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.john.geek.nz/2013/04/migrating-to-new-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Update – Bosch BMP085 Source (Raspberry Pi)</title>
		<link>http://www.john.geek.nz/2013/02/update-bosch-bmp085-source-raspberry-pi/</link>
		<comments>http://www.john.geek.nz/2013/02/update-bosch-bmp085-source-raspberry-pi/#comments</comments>
		<pubDate>Tue, 12 Feb 2013 22:32:02 +0000</pubDate>
		<dc:creator>John Burns</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Raspberry Pi]]></category>
		<category><![CDATA[Weather Station]]></category>

		<guid isPermaLink="false">http://www.john.geek.nz/?p=2358</guid>
		<description><![CDATA[I have updated my code to Read data from a Bosch BMP085 with a Raspberry Pi to correct some bugs reported back to me. The main bug was that I&#8217;d forgotten to close the i2c file at the end of bmp085_ReadUP() &#8211; This shouldn&#8217;t have caused any problems if you were calling the function once [...]]]></description>
				<content:encoded><![CDATA[<p>I have updated my code to Read data from a Bosch BMP085 with a Raspberry Pi to correct some bugs reported back to me.</p>
<p>The main bug was that I&#8217;d forgotten to close the i2c file at the end of bmp085_ReadUP() &#8211; This shouldn&#8217;t have caused any problems if you were calling the function once per execution, but if calling it multiple times, it may crash.  On the same note, if you are calling the functions multiple times, you may want to move the opening and closing of the i2c file outside of the functions so the files aren&#8217;t opened and closed multiple times. Thanks to Radu P for reporting these issues.</p>
<p>It looks like <a href="http://www.lm-sensors.org" target="_blank">lm-sensors.org</a> is back up now, but if not, you can find a locally hosted copy of smbus.c and smbus.h in <a href="/2012/12/update-reading-data-from-a-bosch-bmp085-with-a-raspberry-pi/" target="_blank">this earlier blog post</a>.</p>
<p>Note that I&#8217;ve written a number of posts on using this sensor.  <a href="/?s=BMP08" target="_blank">Here is a link to all posts on the topic</a>.<br />
<span id="more-2358"></span><br />
<a href="http://www.john.geek.nz/wp-content/uploads/2013/02/testBMP085.c">Click here for the updated source (testBMP085.c).</a></p>
<p>testBMP085.c</p>
<pre class="wp-code-highlight prettyprint linenums:1">
/*
Raspberry Pi Bosch BMP085 communication code.
By:      John Burns (www.john.geek.nz)
Date:    13 February 2013
License: CC BY-SA v3.0 - http://creativecommons.org/licenses/by-sa/3.0/

This is a derivative work based on:
	BMP085 Extended Example Code
	by: Jim Lindblom
	SparkFun Electronics
	date: 1/18/11
	license: CC BY-SA v3.0 - http://creativecommons.org/licenses/by-sa/3.0/
	Source: http://www.sparkfun.com/tutorial/Barometric/BMP085_Example_Code.pde

Compile with: gcc -Wall -o testBMP085 ./smbus.c ./testBMP085.c


Circuit detail:
	Using a Spark Fun Barometric Pressure Sensor - BMP085 breakout board
	link: https://www.sparkfun.com/products/9694
	This comes with pull up resistors already on the i2c lines.
	BMP085 pins below are as marked on the Sparkfun BMP085 Breakout board

	SDA	- 	P1-03 / IC20-SDA
	SCL	- 	P1-05 / IC20_SCL
	XCLR	- 	Not Connected
	EOC	-	Not Connected
	GND	-	P1-06 / GND
	VCC	- 	P1-01 / 3.3V
	
	Note: Make sure you use P1-01 / 3.3V NOT the 5V pin.
*/

#include &lt;stdio.h&gt;
#include &lt;stdint.h&gt;
#include &lt;fcntl.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;unistd.h&gt;
#include &lt;linux/i2c-dev.h&gt;
#include &lt;linux/i2c.h&gt;
#include &lt;sys/ioctl.h&gt;
#include &quot;smbus.h&quot; 

#define BMP085_I2C_ADDRESS 0x77

const unsigned char BMP085_OVERSAMPLING_SETTING = 3;

// Calibration values - These are stored in the BMP085
short int ac1;
short int ac2; 
short int ac3; 
unsigned short int ac4;
unsigned short int ac5;
unsigned short int ac6;
short int b1; 
short int b2;
short int mb;
short int mc;
short int md;

int b5; 

unsigned int temperature, pressure;


// Open a connection to the bmp085
// Returns a file id
int bmp085_i2c_Begin()
{
	int fd;
	char *fileName = &quot;/dev/i2c-0&quot;;
	
	// Open port for reading and writing
	if ((fd = open(fileName, O_RDWR)) &lt; 0)
		exit(1);
	
	// Set the port options and set the address of the device
	if (ioctl(fd, I2C_SLAVE, BMP085_I2C_ADDRESS) &lt; 0) {					
		close(fd);
		exit(1);
	}

	return fd;
}

// Read two words from the BMP085 and supply it as a 16 bit integer
__s32 bmp085_i2c_Read_Int(int fd, __u8 address)
{
	__s32 res = i2c_smbus_read_word_data(fd, address);
	if (res &lt; 0) {
		close(fd);
		exit(1);
	}

	// Convert result to 16 bits and swap bytes
	res = ((res&lt;&lt;8) &amp; 0xFF00) | ((res&gt;&gt;8) &amp; 0xFF);

	return res;
}

//Write a byte to the BMP085
void bmp085_i2c_Write_Byte(int fd, __u8 address, __u8 value)
{
	if (i2c_smbus_write_byte_data(fd, address, value) &lt; 0) {
		close(fd);
		exit(1);
	}
}

// Read a block of data BMP085
void bmp085_i2c_Read_Block(int fd, __u8 address, __u8 length, __u8 *values)
{
	if(i2c_smbus_read_i2c_block_data(fd, address,length,values)&lt;0) {
		close(fd);
		exit(1);
	}
}


void bmp085_Calibration()
{
	int fd = bmp085_i2c_Begin();
	ac1 = bmp085_i2c_Read_Int(fd,0xAA);
	ac2 = bmp085_i2c_Read_Int(fd,0xAC);
	ac3 = bmp085_i2c_Read_Int(fd,0xAE);
	ac4 = bmp085_i2c_Read_Int(fd,0xB0);
	ac5 = bmp085_i2c_Read_Int(fd,0xB2);
	ac6 = bmp085_i2c_Read_Int(fd,0xB4);
	b1 = bmp085_i2c_Read_Int(fd,0xB6);
	b2 = bmp085_i2c_Read_Int(fd,0xB8);
	mb = bmp085_i2c_Read_Int(fd,0xBA);
	mc = bmp085_i2c_Read_Int(fd,0xBC);
	md = bmp085_i2c_Read_Int(fd,0xBE);
	close(fd);
}

// Read the uncompensated temperature value
unsigned int bmp085_ReadUT()
{
	unsigned int ut = 0;
	int fd = bmp085_i2c_Begin();

	// Write 0x2E into Register 0xF4
	// This requests a temperature reading
	bmp085_i2c_Write_Byte(fd,0xF4,0x2E);
	
	// Wait at least 4.5ms
	usleep(5000);

	// Read the two byte result from address 0xF6
	ut = bmp085_i2c_Read_Int(fd,0xF6);

	// Close the i2c file
	close (fd);
	
	return ut;
}

// Read the uncompensated pressure value
unsigned int bmp085_ReadUP()
{
	unsigned int up = 0;
	int fd = bmp085_i2c_Begin();

	// Write 0x34+(BMP085_OVERSAMPLING_SETTING&lt;&lt;6) into register 0xF4
	// Request a pressure reading w/ oversampling setting
	bmp085_i2c_Write_Byte(fd,0xF4,0x34 + (BMP085_OVERSAMPLING_SETTING&lt;&lt;6));

	// Wait for conversion, delay time dependent on oversampling setting
	usleep((2 + (3&lt;&lt;BMP085_OVERSAMPLING_SETTING)) * 1000);

	// Read the three byte result from 0xF6
	// 0xF6 = MSB, 0xF7 = LSB and 0xF8 = XLSB
	__u8 values[3];
	bmp085_i2c_Read_Block(fd, 0xF6, 3, values);

	up = (((unsigned int) values[0] &lt;&lt; 16) | ((unsigned int) values[1] &lt;&lt; 8) | (unsigned int) values[2]) &gt;&gt; (8-BMP085_OVERSAMPLING_SETTING);

	// Close the i2c file
	close (fd);
	
	return up;
}

// Calculate pressure given uncalibrated pressure
// Value returned will be in units of Pa
unsigned int bmp085_GetPressure(unsigned int up)
{
	int x1, x2, x3, b3, b6, p;
	unsigned int b4, b7;
  
	b6 = b5 - 4000;
	// Calculate B3
	x1 = (b2 * (b6 * b6)&gt;&gt;12)&gt;&gt;11;
	x2 = (ac2 * b6)&gt;&gt;11;
	x3 = x1 + x2;
	b3 = (((((int)ac1)*4 + x3)&lt;&lt;BMP085_OVERSAMPLING_SETTING) + 2)&gt;&gt;2;
  
	// Calculate B4
	x1 = (ac3 * b6)&gt;&gt;13;
	x2 = (b1 * ((b6 * b6)&gt;&gt;12))&gt;&gt;16;
	x3 = ((x1 + x2) + 2)&gt;&gt;2;
	b4 = (ac4 * (unsigned int)(x3 + 32768))&gt;&gt;15;
  
	b7 = ((unsigned int)(up - b3) * (50000&gt;&gt;BMP085_OVERSAMPLING_SETTING));
	if (b7 &lt; 0x80000000)
		p = (b7&lt;&lt;1)/b4;
	else
		p = (b7/b4)&lt;&lt;1;
	
	x1 = (p&gt;&gt;8) * (p&gt;&gt;8);
	x1 = (x1 * 3038)&gt;&gt;16;
	x2 = (-7357 * p)&gt;&gt;16;
	p += (x1 + x2 + 3791)&gt;&gt;4;
  
	return p;
}

// Calculate temperature given uncalibrated temperature
// Value returned will be in units of 0.1 deg C
unsigned int bmp085_GetTemperature(unsigned int ut)
{
	int x1, x2;
  
	x1 = (((int)ut - (int)ac6)*(int)ac5) &gt;&gt; 15;
	x2 = ((int)mc &lt;&lt; 11)/(x1 + md);
	b5 = x1 + x2;

	unsigned int result = ((b5 + 8)&gt;&gt;4);  

	return result;
}

int main(int argc, char **argv)
{
	bmp085_Calibration();
	temperature = bmp085_GetTemperature(bmp085_ReadUT());
	pressure = bmp085_GetPressure(bmp085_ReadUP());
	
	printf(&quot;Temperature\t%0.1f%cC\n&quot;, ((double)temperature)/10,0x00B0);
	printf(&quot;Pressure\t%0.2fhPa\n&quot;, ((double)pressure)/100);
	return 0;
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.john.geek.nz/2013/02/update-bosch-bmp085-source-raspberry-pi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Water Meter Project</title>
		<link>http://www.john.geek.nz/2013/02/water-meter-project/</link>
		<comments>http://www.john.geek.nz/2013/02/water-meter-project/#comments</comments>
		<pubDate>Sat, 02 Feb 2013 01:23:07 +0000</pubDate>
		<dc:creator>John Burns</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Raspberry Pi]]></category>
		<category><![CDATA[Water Meter]]></category>

		<guid isPermaLink="false">http://www.john.geek.nz/?p=2323</guid>
		<description><![CDATA[Our water at home is supplied by way of rainwater off the roof of the house. We have about 55000 Litres (~14500 Gallons) of storage capacity but a long dry summer sees the levels drop considerably. I decided it was time to add a water meter into the circuit to be able to monitor our [...]]]></description>
				<content:encoded><![CDATA[<p>Our water at home is supplied by way of rainwater off the roof of the house.  We have about 55000 Litres (~14500 Gallons) of storage capacity but a long dry summer sees the levels drop considerably.</p>
<p>I decided it was time to add a water meter into the circuit to be able to monitor our water usage.  </p>
<p>I picked up an <a href="http://www.elstermetering.com/en/689.html" target="_blank">Elster S100 water meter</a> complete with an electronic Pulse output.</p>
<p><a href="http://www.john.geek.nz/wp-content/uploads/2013/02/IMG_1587.jpg"><img src="http://www.john.geek.nz/wp-content/uploads/2013/02/IMG_1587-300x255.jpg" alt="IMG_1587" width="300" height="255" class="alignnone size-medium wp-image-2324" /></a></p>
<p>The meter outputs one pulse per Litre of water.  It&#8217;s only a two wire output so it appears to be a simple switched output such as that from a reed switch, but I&#8217;ll need to check before committing to any specific circuit design.</p>
<p>I&#8217;ll Probably use an Atmel AVR Microcontroller to count the pulses.  The AVR will be setup as an SPI Slave to talk to a Raspberry Pi.  I should have a better idea how best to implement it soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.john.geek.nz/2013/02/water-meter-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Update &#8211; Reading data from a Bosch BMP085 with a Raspberry Pi</title>
		<link>http://www.john.geek.nz/2012/12/update-reading-data-from-a-bosch-bmp085-with-a-raspberry-pi/</link>
		<comments>http://www.john.geek.nz/2012/12/update-reading-data-from-a-bosch-bmp085-with-a-raspberry-pi/#comments</comments>
		<pubDate>Sun, 16 Dec 2012 19:34:11 +0000</pubDate>
		<dc:creator>John Burns</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Raspberry Pi]]></category>
		<category><![CDATA[Weather Station]]></category>

		<guid isPermaLink="false">http://www.john.geek.nz/?p=2315</guid>
		<description><![CDATA[Since my earlier post on Reading data from a Bosch BMP085 with a Raspberry Pi, the lm-sensors.org website has gone down. If you need smbus.c or smbus.h, here are copies from back in August 2012. Note that I have made some changes to smbus.c: Defined NULL Changed the path for including smbus.h Here are the [...]]]></description>
				<content:encoded><![CDATA[<p>Since my earlier <a href="http://www.john.geek.nz/2012/08/reading-data-from-a-bosch-bmp085-with-a-raspberry-pi/">post on Reading data from a Bosch BMP085 with a Raspberry Pi</a>, the lm-sensors.org website has gone down.</p>
<p>If you need smbus.c or smbus.h, here are copies from back in August 2012.</p>
<p>Note that I have made some changes to smbus.c:</p>
<ul>
<li>Defined NULL</li>
<li>Changed the path for including smbus.h</li>
</ul>
<p>Here are the two files:</p>
<ul>
<li><a href="http://www.john.geek.nz/wp-content/uploads/2012/12/smbus.c">smbus.c</a></li>
<li><a href="http://www.john.geek.nz/wp-content/uploads/2012/12/smbus.h">smbus.h</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.john.geek.nz/2012/12/update-reading-data-from-a-bosch-bmp085-with-a-raspberry-pi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Update &#8211; Reading data from a Sensirion SHT1x with a Raspberry Pi</title>
		<link>http://www.john.geek.nz/2012/11/update-reading-data-from-a-sensirion-sht1x-with-a-raspberry-pi/</link>
		<comments>http://www.john.geek.nz/2012/11/update-reading-data-from-a-sensirion-sht1x-with-a-raspberry-pi/#comments</comments>
		<pubDate>Wed, 31 Oct 2012 20:26:57 +0000</pubDate>
		<dc:creator>John Burns</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[General Randomness]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Raspberry Pi]]></category>
		<category><![CDATA[Weather Station]]></category>

		<guid isPermaLink="false">http://www.john.geek.nz/?p=2303</guid>
		<description><![CDATA[After a few comments regarding my code to read data from a Sensirion SHT1x with a Raspberry Pi, I&#8217;ve got some updated code. Please see my previous post for general information, but use the code here. The list of changes are: Added Dewpoint calculation from Page 9 of Datasheet Updated Humidity calculation Coefficients to recommended [...]]]></description>
				<content:encoded><![CDATA[<p>After a few comments regarding <a href="/2012/08/reading-data-from-a-sensirion-sht1x-with-a-raspberry-pi/">my code to read data from a Sensirion SHT1x with a Raspberry Pi</a>, I&#8217;ve got some updated code.</p>
<p>Please see my <a href="/2012/08/reading-data-from-a-sensirion-sht1x-with-a-raspberry-pi/">previous post</a> for general information, but use the code here.</p>
<p>The list of changes are:</p>
<ul>
<li>Added Dewpoint calculation from Page 9 of Datasheet</li>
<li>Updated Humidity calculation Coefficients to recommended (12 bit) figures from Page 8 of Datasheet</li>
<li>Updated Temperature calculation Coefficients to recommended (3.3 Volt Interpolated) figures from Page 9 of Datasheet</li>
</ul>
<p>Any references to the datasheet refer to the Version 5, Dec 2011 datasheet found on <a href="http://www.sensirion.com/fileadmin/user_upload/customers/sensirion/Dokumente/Humidity/Sensirion_Humidity_SHT1x_Datasheet_V5.pdf" target="_blank">Sensirions website</a>.</p>
<p>Also note that the bcm2835 GPIO library has been updated and is now version 1.8 &#8211; Get the updated version from <a href="http://www.open.com.au/mikem/bcm2835/" target="_blank">http://www.open.com.au/mikem/bcm2835/</a>.<br />
<span id="more-2303"></span><br />
Here’s the source code you’re looking for: <a href='http://www.john.geek.nz/wp-content/uploads/2012/11/RaspberryPi_SHT1x_01November2012.zip'>RaspberryPi_SHT1x_01November2012.zip</a></p>
<p>Here’s the source of testSHT1x.c. (RPi_SHT1x.c and RPi_SHT1x.h can be found in <a href='http://www.john.geek.nz/wp-content/uploads/2012/11/RaspberryPi_SHT1x_01November2012.zip'>RaspberryPi_SHT1x_01November2012.zip</a>)</p>
<pre class="wp-code-highlight prettyprint linenums:1">
// Compile with: gcc -lm -o testSHT1x ./../bcm2835-1.8/src/bcm2835.c ./RPi_SHT1x.c testSHT1x.c

/*
Raspberry Pi SHT1x communication library.
By:      John Burns (www.john.geek.nz)
Date:    01 November 2012
License: CC BY-SA v3.0 - http://creativecommons.org/licenses/by-sa/3.0/

This is a derivative work based on
	Name: Nice Guy SHT11 library
	By: Daesung Kim
	Date: 04/04/2011
	Source: http://www.theniceguy.net/2722
	License: Unknown - Attempts have been made to contact the author

Dependencies:
	BCM2835 Raspberry Pi GPIO Library - http://www.open.com.au/mikem/bcm2835/

Sensor:
	Sensirion SHT11 Temperature and Humidity Sensor interfaced to Raspberry Pi GPIO port

SHT pins:
	1. GND  - Connected to GPIO Port P1-06 (Ground)
	2. DATA - Connected via a 10k pullup resistor to GPIO Port P1-01 (3V3 Power)
	2. DATA - Connected to GPIO Port P1-18 (GPIO 24)
	3. SCK  - Connected to GPIO Port P1-16 (GPIO 23)
	4. VDD  - Connected to GPIO Port P1-01 (3V3 Power)

Note:
	GPIO Pins can be changed in the Defines of RPi_SHT1x.h
*/

#include &lt;bcm2835.h&gt;
#include &lt;stdio.h&gt;
#include &quot;RPi_SHT1x.h&quot;

void printTempAndHumidity(void)
{
	unsigned char noError = 1;  
	value humi_val,temp_val;
	
	
	// Wait at least 11ms after power-up (chapter 3.1)
	delay(20); 
	
	// Set up the SHT1x Data and Clock Pins
	SHT1x_InitPins();
	
	// Reset the SHT1x
	SHT1x_Reset();
	
	// Request Temperature measurement
	noError = SHT1x_Measure_Start( SHT1xMeaT );
	if (!noError) {
		return;
		}
		
	// Read Temperature measurement
	noError = SHT1x_Get_Measure_Value( (unsigned short int*) &amp;temp_val.i );
	if (!noError) {
		return;
		}

	// Request Humidity Measurement
	noError = SHT1x_Measure_Start( SHT1xMeaRh );
	if (!noError) {
		return;
		}
		
	// Read Humidity measurement
	noError = SHT1x_Get_Measure_Value( (unsigned short int*) &amp;humi_val.i );
	if (!noError) {
		return;
		}

	// Convert intergers to float and calculate true values
	temp_val.f = (float)temp_val.i;
	humi_val.f = (float)humi_val.i;
	
	// Calculate Temperature and Humidity
	SHT1x_Calc(&amp;humi_val.f, &amp;temp_val.f);

	//Print the Temperature to the console
	printf(&quot;Temperature: %0.2f%cC\n&quot;,temp_val.f,0x00B0);

	//Print the Humidity to the console
	printf(&quot;Humidity: %0.2f%%\n&quot;,humi_val.f);
	//Calculate and print the Dew Point
	float fDewPoint;
	SHT1x_CalcDewpoint(humi_val.f ,temp_val.f, &amp;fDewPoint);
	printf(&quot;Dewpoint: %0.2f%cC\n&quot;,fDewPoint,0x00B0);

}

int main ()
{
	//Initialise the Raspberry Pi GPIO
	if(!bcm2835_init())
		return 1;
	
	printTempAndHumidity();

	return 1;
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.john.geek.nz/2012/11/update-reading-data-from-a-sensirion-sht1x-with-a-raspberry-pi/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Raspberry Pi – Increasing the USB power limitations Part 2</title>
		<link>http://www.john.geek.nz/2012/09/raspberry-pi-increasing-the-usb-power-limitations-part-2/</link>
		<comments>http://www.john.geek.nz/2012/09/raspberry-pi-increasing-the-usb-power-limitations-part-2/#comments</comments>
		<pubDate>Sun, 09 Sep 2012 03:28:14 +0000</pubDate>
		<dc:creator>John Burns</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Raspberry Pi]]></category>

		<guid isPermaLink="false">http://www.john.geek.nz/?p=2291</guid>
		<description><![CDATA[Last week I wrote about how to bypass the USB Polyfuses on the Raspberry Pi to Increase the available power for USB devices. Unfortunately, my Raspberry Pi is still unstable (I&#8217;ve tried both Raspian and ARCH Linux), so I&#8217;m playing around a lot with increasing the USB power capability. The next option, which will definitely [...]]]></description>
				<content:encoded><![CDATA[<p>Last week I wrote about how to <a href="http://www.john.geek.nz/2012/09/raspberry-pi-increasing-the-usb-power-limitations/">bypass the USB Polyfuses on the Raspberry Pi to Increase the available power for USB devices</a>.</p>
<p>Unfortunately, my Raspberry Pi is still unstable (I&#8217;ve tried both Raspian and ARCH Linux), so I&#8217;m playing around a lot with increasing the USB power capability.</p>
<p>The next option, which will definitely void the warranty is to completely remove the Polyfuses and run power direct from the DC input to the USB ports.  This bypasses all the fuses on the board and replaces the thin PCB traces with a heavier gauge wire.</p>
<p>Without fuses, you could get into trouble if you don&#8217;t know what you&#8217;re doing.  Consider yourself warned!</p>
<p>Here&#8217;s how to do it.</p>
<p>First, remove the USB Polyfuses from the Raspberry Pi.</p>
<p><div id="attachment_2294" class="wp-caption alignnone" style="width: 196px"><a href="http://www.john.geek.nz/wp-content/uploads/2012/09/Rpi_USB2_01.jpg"><img src="http://www.john.geek.nz/wp-content/uploads/2012/09/Rpi_USB2_01-186x300.jpg" alt="" title="Rpi_USB2_01" width="186" height="300" class="size-medium wp-image-2294" /></a><p class="wp-caption-text">Raspberry Pi with USB Polyfuses removed</p></div><br />
<span id="more-2291"></span><br />
If you don&#8217;t know where the Polyfuses are located, you probably should be doing a bit more research before performing this mod, but otherwise, here is a close up of the board with the Polyfuses removed.</p>
<div id="attachment_2295" class="wp-caption alignnone" style="width: 310px"><a href="http://www.john.geek.nz/wp-content/uploads/2012/09/Rpi_USB2_02.jpg"><img src="http://www.john.geek.nz/wp-content/uploads/2012/09/Rpi_USB2_02-300x288.jpg" alt="" title="Rpi_USB2_02" width="300" height="288" class="size-medium wp-image-2295" /></a><p class="wp-caption-text">Close-up view of the board with the USB polyfuses removed</p></div>
<p>Now take two pieces of hookup wire (Red and Black is recommended!), and run them from the USB header to the DC Input of the board.</p>
<p>Here are some close-ups of where they go.</p>
<div id="attachment_2296" class="wp-caption alignnone" style="width: 298px"><a href="http://www.john.geek.nz/wp-content/uploads/2012/09/Rpi_USB2_03.jpg"><img src="http://www.john.geek.nz/wp-content/uploads/2012/09/Rpi_USB2_03-288x300.jpg" alt="" title="Rpi_USB2_03" width="288" height="300" class="size-medium wp-image-2296" /></a><p class="wp-caption-text">USB end.  Note that each wire is soldered to the power pins of both USB ports.  You may find it easier to make a solder &#8220;bridge&#8221; first.</p></div>
<div id="attachment_2297" class="wp-caption alignnone" style="width: 199px"><a href="http://www.john.geek.nz/wp-content/uploads/2012/09/Rpi_USB2_04.jpg"><img src="http://www.john.geek.nz/wp-content/uploads/2012/09/Rpi_USB2_04-189x300.jpg" alt="" title="Rpi_USB2_04" width="189" height="300" class="size-medium wp-image-2297" /></a><p class="wp-caption-text">DC Power end.  +ve is connected to the polyfuse (F3), while negative is connected to the diode (D17).  Be careful not to overheat the polyfuse or diode.</p></div>
<p>If everything has gone well, you should end up with a board looking like this.</p>
<div id="attachment_2298" class="wp-caption alignnone" style="width: 188px"><a href="http://www.john.geek.nz/wp-content/uploads/2012/09/Rpi_USB2_05.jpg"><img src="http://www.john.geek.nz/wp-content/uploads/2012/09/Rpi_USB2_05-178x300.jpg" alt="" title="Rpi_USB2_05" width="178" height="300" class="size-medium wp-image-2298" /></a><p class="wp-caption-text">The end result.</p></div>
<p>Your USB Ports are now unrestricted (within reason) with regards to their maximum current draw.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.john.geek.nz/2012/09/raspberry-pi-increasing-the-usb-power-limitations-part-2/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Raspberry Pi &#8211; Increasing the USB power limitations</title>
		<link>http://www.john.geek.nz/2012/09/raspberry-pi-increasing-the-usb-power-limitations/</link>
		<comments>http://www.john.geek.nz/2012/09/raspberry-pi-increasing-the-usb-power-limitations/#comments</comments>
		<pubDate>Sun, 02 Sep 2012 03:01:18 +0000</pubDate>
		<dc:creator>John Burns</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Raspberry Pi]]></category>

		<guid isPermaLink="false">http://www.john.geek.nz/?p=2282</guid>
		<description><![CDATA[I bought a Logitech C920 webcam last week. It&#8217;s a very nice unit which outputs Full HD (1920&#215;1080) video. The picture is really clear but it draws more power than the Raspberry pi can supply. For me this power problem affects my network connection. It seems that the Network adapter is very picky when it [...]]]></description>
				<content:encoded><![CDATA[<p>I bought a <a href="http://www.logitech.com/en-nz/webcam-communications/webcams/hd-pro-webcam-c920" target="_blank">Logitech C920 webcam</a> last week.  It&#8217;s a very nice unit which outputs Full HD (1920&#215;1080) video.  The picture is really clear but it draws more power than the Raspberry pi can supply.</p>
<p>For me this power problem affects my network connection.  It seems that the Network adapter is very picky when it comes to it&#8217;s supply voltage.</p>
<p>The Webcam seems to draw about 240mA at 5 volts when it focuses, while the Raspberry Pi is limited to 140mA per USB port and 1.1A total current draw.</p>
<p>The Raspberry Pi limits these currents by way of Polyfuses which are a fuse made of a special polymer.  They &#8220;blow&#8221; like a fuse if too much current goes through them, but then over time &#8220;heal&#8221; and conduct again.  Unfortunately due to their inherit design, before they &#8220;blow&#8221; their resistance increases as the current increases.  This can cause a drop in voltage, commonly referred to as voltage droop.</p>
<p>Without going into too much more detail, this basically means that as a USB device approaches a 140mA current draw, the voltage going to the device will drop and in much that same way, if the total current approaches 1.1 Amps, the system voltage will drop.</p>
<p>I decided the best way to fix this problem is to bypass the Polyfuses on the USB port with wire links.  This would mean that the 140mA limit was bypassed, but the total 1.1 Amp limit would still apply.  Note that this more than likely voids the warranty on your Raspberry Pi.</p>
<p>You first need to find the PolyFuses on your Raspberry Pi.  They are easy to find, they&#8217;re the two green &#8220;blocks&#8221; on the board between the USB port header and the activity LEDs.</p>
<p><div id="attachment_2284" class="wp-caption alignnone" style="width: 310px"><a href="http://www.john.geek.nz/wp-content/uploads/2012/09/photo-1.jpg"><img src="http://www.john.geek.nz/wp-content/uploads/2012/09/photo-1-300x224.jpg" alt="" title="photo 1" width="300" height="224" class="size-medium wp-image-2284" /></a><p class="wp-caption-text">Photo showing the Polyfuses (Green blocks) protecting the USB ports.</p></div><br />
<span id="more-2282"></span><br />
All you need to do is take two short (~20mm) pieces of wire and solder them to each side of the Polyfuses.  Be careful not to unsolder the Activity LEDs.</p>
<div id="attachment_2285" class="wp-caption alignnone" style="width: 310px"><a href="http://www.john.geek.nz/wp-content/uploads/2012/09/photo-2.jpg"><img src="http://www.john.geek.nz/wp-content/uploads/2012/09/photo-2-300x224.jpg" alt="" title="photo 2" width="300" height="224" class="size-medium wp-image-2285" /></a><p class="wp-caption-text">Photo showing wire links soldered to the USB port Polyfuses</p></div>
<p>And that&#8217;s it. Your USB ports are no longer limited to 140mA.  The total board however is still limited to 1.1 Amps.</p>
<p>Remember that there are two easy to access test points on the Raspberry Pi to measure the system voltage.  These points are labelled TP1 and TP2.</p>
<p><a href="http://www.john.geek.nz/wp-content/uploads/2012/09/RPi_TP1_TP2.jpg"><img src="http://www.john.geek.nz/wp-content/uploads/2012/09/RPi_TP1_TP2-300x206.jpg" alt="Measure the system voltage using Test Points 1 and 2 (Circled in red)" title="RPi_TP1_TP2" width="300" height="206" class="alignnone size-medium wp-image-2287" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.john.geek.nz/2012/09/raspberry-pi-increasing-the-usb-power-limitations/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>La Crosse TX23U Anemometer Communication Protocol</title>
		<link>http://www.john.geek.nz/2012/08/la-crosse-tx23u-anemometer-communication-protocol/</link>
		<comments>http://www.john.geek.nz/2012/08/la-crosse-tx23u-anemometer-communication-protocol/#comments</comments>
		<pubDate>Sun, 26 Aug 2012 01:22:28 +0000</pubDate>
		<dc:creator>John Burns</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Raspberry Pi]]></category>
		<category><![CDATA[Weather Station]]></category>

		<guid isPermaLink="false">http://www.john.geek.nz/?p=2271</guid>
		<description><![CDATA[I&#8217;ve previously documented the protocol of the La Crosse TX20 Anemometer, but mine recently failed. The La Crosse TX23U Anemometer is almost half the price of the TX20, so I decided to buy one and see if I could decode the protocol. The big difference between the TX20 and the TX23U is that the TX20 [...]]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve previously documented the <a href="http://www.john.geek.nz/2011/07/la-crosse-tx20-anemometer-communication-protocol/" target="_blank">protocol of the La Crosse TX20 Anemometer</a>, but mine recently failed.</p>
<p>The La Crosse TX23U Anemometer is almost <a href="http://www.scientificsales.co.nz/weather-stations/accessories/la-crosse-accessories.html" target="_blank">half the price of the TX20</a>, so I decided to buy one and see if I could decode the protocol.</p>
<p>The big difference between the TX20 and the TX23U is that the TX20 will send a datagram every two seconds (when the DTR line is pulled low), while the TX23U won&#8217;t send anything until triggered by briefly pulling the Data line low.</p>
<p>Here&#8217;s everything you&#8217;ll ever want to know about the pin out and the communications protocol of the La Crosse TX23.<br />
<span id="more-2271"></span></p>
<p>Wiring Pinout:</p>
<table border="1">
<thead>
<th>Pin</th>
<th>Color</th>
<th>Description</th>
</thead>
<tbody>
<tr>
<td>1</td>
<td>Brown</td>
<td>TxD</td>
</tr>
<tr>
<td>2</td>
<td>Red</td>
<td>Vcc</td>
</tr>
<tr>
<td>3</td>
<td>Green</td>
<td>Not Connected</td>
</tr>
<tr>
<td>4</td>
<td>Yellow</td>
<td>GND</td>
</tr>
</tbody>
</table>
<p>I&#8217;m unsure of what Voltage the TX23U is normally driven with (when connected to a La Crosse Weather Station), but it seems happy running from 3.3 Volts.</p>
<p>TxD should be pulled high to Vcc with a 10k (or similar) pull up resistor.</p>
<p>If you connect the GND and TxD to a oscilloscope (with the pullup resistor from TxD to Vcc) and trigger it by pulling TxD to GND briefly, you&#8217;ll see a waveform similar to the following.</p>
<div id="attachment_2274" class="wp-caption alignnone" style="width: 310px"><a href="http://www.john.geek.nz/wp-content/uploads/2012/08/La_Crosse_TX23U_Protocol.png"><img src="http://www.john.geek.nz/wp-content/uploads/2012/08/La_Crosse_TX23U_Protocol-300x65.png" alt="" title="La_Crosse_TX23U_Protocol" width="300" height="65" class="size-medium  wp-image-2354" /></a><p class="wp-caption-text">The datagram from a La Crosse TX23U Anemometer</p></div>
<p>The datagram starts high due to the pull up resistor.  The TX23U then pulls the data line low for approximately 20 mSec while it (I assume) performs internal calculations.  It then sends a 41 bit datagram.  Each Bit is approximately 1200uSec long, resulting in a bit rate of around 833 bits per second. </p>
<p>It&#8217;s best to calculate the bit rate based on the pin state changes of the start frame as the bit rate seems very dependent on temperature.</p>
<p>Note that all of the values are LSB (Least Significant Bit) First, so you will need to reverse them for standard (MSB First) Integer arithmetic.</p>
<table border="1">
<thead>
<th>Section</th>
<th>Length (bits)</th>
<th>Inverted?</th>
<th>Endianness</th>
<th>Description</th>
<th>Notes</th>
</thead>
<tbody>
<tr>
<td>A</td>
<td>N/A</td>
<td>N/A</td>
<td>N/A</td>
<td>Host pulls TxD low</td>
<td>Signals TX23U to sent measurement</td>
<tr>
<td>B</td>
<td>N/A</td>
<td>N/A</td>
<td>N/A</td>
<td>TxD released</td>
<td>TxD is pulled high due to Pull up Resistor</td>
<tr>
<td>C</td>
<td>N/A</td>
<td>N/A</td>
<td>N/A</td>
<td>TX23U pulls TxD low</td>
<td>Calculation in progress (assumed)</td>
<tr>
<td>D</td>
<td>5</td>
<td>No</td>
<td>LSB first</td>
<td>Start Frame</td>
<td>Always 11011</td>
<tr>
<td>E</td>
<td>4</td>
<td>No</td>
<td>LSB first</td>
<td>Wind Direction</td>
<td>0-15, see table below</td>
<tr>
<td>F</td>
<td>12</td>
<td>No</td>
<td>LSB first</td>
<td>Wind Speed</td>
<td>0-511</td>
<tr>
<td>G</td>
<td>4</td>
<td>No</td>
<td>LSB first</td>
<td>Checksum</td>
<td>See below</td>
<tr>
<td>H</td>
<td>4</td>
<td>Yes</td>
<td>LSB first</td>
<td>Wind Direction</td>
<td>0-15, see table below</td>
<tr>
<td>I</td>
<td>12</td>
<td>Yes</td>
<td>LSB first</td>
<td>Wind Speed</td>
<td>0-511</td>
</tbody>
</table>
<p><strong>A &#8211; Host pulls TxD low</strong><br />
You need to pull TxD low (To GND) to signal to the TX23U that you want a measurement.  Holding it low for 500mSec seems to give reliable results.</p>
<p><strong>B &#8211; TxD released</strong><br />
When the Host releases TxD, it will go high briefly (about 1.2mSec) due to the Pull up resistor.</p>
<p><strong>C &#8211; TX23U pulls TxD low</strong><br />
The TX23U then takes control of the TxD line and pulls it low.  This lasts for about 20mSec while (I assume) the TX23U is taking measurements and calculating values.</p>
<p><strong>D &#8211; Start Frame and Triggering / Detecting start of data</strong><br />
The start frame is always 11011, and due to section C pulling the line low, you can use a rising edge trigger / interrupt to detect the Start Frame.</p>
<p><strong>E &#8211; Wind Direction</strong><br />
The wind direction is supplied as a 4 bit value.  It requires it&#8217;s endianness to be reversed.  Once this is done it&#8217;s a value of 16th&#8217;s of a revolution from North.  Thus it can be multiplied by 22.5 to get a direction in Degrees, or a 16 value array can be used to return the direction. </p>
<p>In the example image above, the Wind direction is read as 1101, and then it&#8217;s endianness is reversed to 1011, which is decimal 11, WSW or 247.5 degrees.</p>
<p>Table of the directions is below.</p>
<table border="1">
<thead>
<th>Binary</th>
<th>Hex</th>
<th>Decimal</th>
<th>Direction</th>
</thead>
<tbody>
<tr>
<td>0000</td>
<td>0</td>
<td>0</td>
<td>N</td>
</tr>
<tr>
<td>0001</td>
<td>1</td>
<td>1</td>
<td>NNE</td>
</tr>
<tr>
<td>0010</td>
<td>2</td>
<td>2</td>
<td>NE</td>
</tr>
<tr>
<td>0011</td>
<td>3</td>
<td>3</td>
<td>ENE</td>
</tr>
<tr>
<td>0100</td>
<td>4</td>
<td>4</td>
<td>E</td>
</tr>
<tr>
<td>0101</td>
<td>5</td>
<td>5</td>
<td>ESE</td>
</tr>
<tr>
<td>0110</td>
<td>6</td>
<td>6</td>
<td>SE</td>
</tr>
<tr>
<td>0111</td>
<td>7</td>
<td>7</td>
<td>SSE</td>
</tr>
<tr>
<td>1000</td>
<td>8</td>
<td>8</td>
<td>S</td>
</tr>
<tr>
<td>1001</td>
<td>9</td>
<td>9</td>
<td>SSW</td>
</tr>
<tr>
<td>1010</td>
<td>A</td>
<td>10</td>
<td>SW</td>
</tr>
<tr>
<td>1011</td>
<td>B</td>
<td>11</td>
<td>WSW</td>
</tr>
<tr>
<td>1100</td>
<td>C</td>
<td>12</td>
<td>W</td>
</tr>
<tr>
<td>1101</td>
<td>D</td>
<td>13</td>
<td>WNW</td>
</tr>
<tr>
<td>1110</td>
<td>E</td>
<td>14</td>
<td>NW</td>
</tr>
<tr>
<td>1111</td>
<td>F</td>
<td>15</td>
<td>NNW</td>
</tr>
</tbody>
</table>
<p><strong>F &#8211; Wind Speed</strong><br />
The wind speed is a 12 bit value.  It requires it&#8217;s endianness to be reversed.<br />
I&#8217;m unsure of the exact units, but it appears to be a factory calibrated value in units of 0.1 metre/sec.  The 3 MSB&#8217;s are always 000, so only 9 bits are used.  With a max value of 511, this relates to 51.1 metres per second, or 183.96 km/h (114.31 miles per hour).</p>
<p>From the example image above, the wind speed is read as 101010100000, then endianness reversed to 000001010101, which is decimal 85, or 8.5 metres per second.</p>
<p><strong>G &#8211; Checksum</strong><br />
The checksum is a 4 bit value.  It requires it&#8217;s endianness to be reversed.<br />
This is a 4 bit value of the four least significant bits of the SUM of the wind direction and the three nibbles of the 12 bit windspeed.<br />
The checksum in the datagram above is read as 1010, then endianness swapped to 0101.</p>
<p>For the datagram image above, the checksum would be calculated by:</p>
<table border="1">
<thead>
<th>Name</th>
<th>Bits</th>
<th>Example</th>
</thead>
<tbody>
<tr>
<td>Wind Direction</td>
<td>1 &#8211; 4</td>
<td>1011</td>
</tr>
<tr>
<td>Wind Speed</td>
<td>1 &#8211; 4</td>
<td>0000</td>
</tr>
<tr>
<td>Wind Speed</td>
<td>5 &#8211; 8</td>
<td>0101</td>
</tr>
<tr>
<td>Wind Speed</td>
<td>9 &#8211; 12</td>
<td>0101</td>
</tr>
<tr>
<td>SUM</td>
<td>4 LSBs</td>
<td>0101</td>
</tr>
</tbody>
</table>
<p>As the Checksum received matches the calculated Checksum, the received data is likely to be correct.</p>
<p><strong>H &#8211; Wind Direction (Inverted)</strong><br />
The wind direction (Inverted) is supplied as a 4 bit value.  It requires inverting and it&#8217;s endianness to be reversed.  It can then be interpreted like section &#8220;E&#8221; above.</p>
<p>In the example image above, the Wind direction is read as 0010, Inverted to 1101 and it&#8217;s endianness is reversed to 1011, which is decimal 11, WSW or 247.5 degrees.</p>
<p><strong>I &#8211; Wind Speed (Inverted)</strong><br />
The wind speed (Inverted) is a 12 bit value.  It requires inverting and it&#8217;s endianness to be reversed. It can then be interpreted like section &#8220;F&#8221; above.</p>
<p>From the example image above, the wind speed is read as 010101011111, Inverted to 101010100000 and it&#8217;s endianness is reversed to 000001010101, which is decimal 85, or 8.5 metres per second.</p>
<p><strong>Suggestions</strong><br />
The checksum calculation is very simple and could easily be prone to errors where noise in the line results in invalid data which still matches the checksum.<br />
As both the wind direction and the wind speed are sent twice, I suggest the following checks before a result is considered to be read correctly:</p>
<ul>
<li>Check that the start frame is 11011 (0x1B)</li>
<li>Check received checksum matches calculated checksum</li>
<li>Check that Wind Direction matches Wind Direction (Inverted)</li>
<li>Check that Wind Speed matches Wind Speed (Inverted)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.john.geek.nz/2012/08/la-crosse-tx23u-anemometer-communication-protocol/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>DIY Incubator Egg Turner &#8211; Video</title>
		<link>http://www.john.geek.nz/2012/08/diy-incubator-egg-turner-video/</link>
		<comments>http://www.john.geek.nz/2012/08/diy-incubator-egg-turner-video/#comments</comments>
		<pubDate>Tue, 21 Aug 2012 10:53:03 +0000</pubDate>
		<dc:creator>John Burns</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Incubator]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://www.john.geek.nz/?p=2264</guid>
		<description><![CDATA[Here&#8217;s a video of the Egg Turner running at full speed. I definitely need to slow it down!]]></description>
				<content:encoded><![CDATA[<p>Here&#8217;s a video of the Egg Turner running at full speed.</p>
<p><iframe width="640" height="360" src="https://www.youtube.com/embed/vT-phCi-BnE?feature=player_detailpage" frameborder="0" allowfullscreen></iframe></p>
<p>I definitely need to slow it down!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.john.geek.nz/2012/08/diy-incubator-egg-turner-video/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DIY Incubator Egg Turner</title>
		<link>http://www.john.geek.nz/2012/08/diy-incubator-egg-turner/</link>
		<comments>http://www.john.geek.nz/2012/08/diy-incubator-egg-turner/#comments</comments>
		<pubDate>Mon, 20 Aug 2012 09:50:03 +0000</pubDate>
		<dc:creator>John Burns</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Incubator]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://www.john.geek.nz/?p=2258</guid>
		<description><![CDATA[After a recent disaster when a broody chicken stopped being broody before the eggs hatched, I&#8217;ve decided to build a fully automated incubator. The incubator will include: Temperature Control Humidity Control Automatic Egg Turning The first step was to find a suitable enclosure so that the size of the Egg Turner could be determined. I [...]]]></description>
				<content:encoded><![CDATA[<p>After a recent disaster when a broody chicken stopped being broody before the eggs hatched, I&#8217;ve decided to build a fully automated incubator.</p>
<p>The incubator will include:</p>
<ul>
<li>Temperature Control</li>
<li>Humidity Control</li>
<li>Automatic Egg Turning</li>
</ul>
<p>The first step was to find a suitable enclosure so that the size of the Egg Turner could be determined.  I decided to use a plastic storage box as this should be easy to clean after use.  The plastic box will end up inside a plywood box for insulation.</p>
<p>I determined that based on the size of the box, I should have the space to turn 30 eggs in three rows of 5&#215;2 eggs.</p>
<p>A few quick tests of Radio Control Servos quickly proved that they had enough torque and stroke to turn the eggs so an old Hitec servo was chosen as the drive system.</p>
<p>I got hold of some aluminium corner, a rivet gun and a few other essentials and in no time (actually about 20 hours) had it working.</p>
<p>I didn&#8217;t take any photos of it prior to completion, but here are some photos of it completed.</p>
<p><a href="http://www.john.geek.nz/wp-content/uploads/2012/08/IMG_1264.jpg"><img src="http://www.john.geek.nz/wp-content/uploads/2012/08/IMG_1264-300x224.jpg" alt="" title="IMG_1264" width="300" height="224" class="alignnone size-medium wp-image-2262" /></a><br />
<span id="more-2258"></span><br />
<a href="http://www.john.geek.nz/wp-content/uploads/2012/08/IMG_1263.jpg"><img src="http://www.john.geek.nz/wp-content/uploads/2012/08/IMG_1263-300x224.jpg" alt="" title="IMG_1263" width="300" height="224" class="alignnone size-medium wp-image-2261" /></a></p>
<p>The plan is that each &#8220;rack&#8221; will hold a 5&#215;2 egg section cardboard egg carton.  These can be replaced each time the incubator is used.</p>
<p>After powering it up, it turns out it&#8217;s too fast to turn the eggs from one extreme to the other, so I&#8217;ll have to use some smarts in the microcontroller to allow it to turn them gradually.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.john.geek.nz/2012/08/diy-incubator-egg-turner/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
