<?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>Randomly Designless &#187; MQTT</title>
	<atom:link href="http://www.cminion.com/wordpress/category/mqtt/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cminion.com/wordpress</link>
	<description>A series of accidental projects</description>
	<lastBuildDate>Wed, 12 May 2010 11:35:28 +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>Power Duck to the financial rescue</title>
		<link>http://www.cminion.com/wordpress/2009/04/27/power-duck-to-the-financial-rescue/</link>
		<comments>http://www.cminion.com/wordpress/2009/04/27/power-duck-to-the-financial-rescue/#comments</comments>
		<pubDate>Mon, 27 Apr 2009 23:36:42 +0000</pubDate>
		<dc:creator>cminion</dc:creator>
				<category><![CDATA[MQTT]]></category>
		<category><![CDATA[Project]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[CurrentCost]]></category>
		<category><![CDATA[Duck]]></category>
		<category><![CDATA[Power Orb]]></category>
		<category><![CDATA[RSMB]]></category>

		<guid isPermaLink="false">http://www.cminion.com/wordpress/?p=66</guid>
		<description><![CDATA[Like many people know I am bothered about the electricity consumption of my flat.
For a while now people have been talking about ambient orbs to help monitor their power usage. There are one or two very good guides for producing these on the interent. I decided to go from scratch with an Arduino. Yesterday I [...]]]></description>
			<content:encoded><![CDATA[<p>Like many people know I am bothered about the electricity consumption of my flat.</p>
<p>For a while now people have been talking about ambient orbs to help monitor their power usage. There are one or two very good guides for producing these on the interent. I decided to go from scratch with an Arduino. Yesterday I finally bought an RGB Full Colour LED for £2.99 from <a href="http://www.maplin.co.uk/Module.aspx?ModuleNo=35893">Maplin</a>. I am fairly sure it would have been cheaper at RS but they were closed. This was to be paired with my arduino I have had since Xmas.</p>
<p>This evening I prototyped some code on my Arduino(See at the end) and wired up the Red and Green pins. Blue wasnt required for my intended range. Pin 9  is green and pin 10 is red.</p>
<p>I have linked this into my own RSMB and it reads the live feed from my <a href="http://www.currentcost.com">currentcost</a> device. The number is then echoed down the serial connection with the colour of the light being determin with the following formula.</p>
<p>Red:           Current Power Usage /1500 * 255</p>
<p>Green:      255- (Current Power Usage/1500*255)</p>
<p>Though this doesnt change in nice clear cut stages I liked the idea of a constant natural progression.</p>
<p>I still am fine tunning this so watch this space.</p>
<p>Code for the arduino</p>
<blockquote><p>float value = 400; //initial value<br />
float maxBoundary = 1500; //Value at which PURE red is shown<br />
char incomingByte;<br />
int count = 0;<br />
char genValue[5] = &#8220;&#8221;;<br />
void setup() {<br />
Serial.begin(9600);           // set up Serial library at 9600 bps<br />
Serial.println(&#8220;Starting Orb&#8221;);<br />
analogWrite(11, 0); //Blue is always 0<br />
}<br />
void loop() {<br />
// send data only when you receive data:<br />
if (Serial.available() &gt; 0) {<br />
// read the incoming byte:<br />
incomingByte = Serial.read();<br />
//  if ((incomingByte &gt;=0)&amp;&amp;(incomingByte &lt;10)) {<br />
genValue[count] = incomingByte;<br />
count++;<br />
if (count == 5){<br />
count =0;<br />
Serial.println(genValue);<br />
value = atof(genValue)-100; //take off a 100 because realistically at the moment it wont go below 350<br />
if (value&lt;0) value=0;<br />
}<br />
}<br />
}<br />
float displayValue = value/maxBoundary;<br />
float displayValue255 = displayValue*255;<br />
if (displayValue255 &gt; 254 ) displayValue255 = 255;<br />
analogWrite(10, displayValue255); //red //This is a Analgoue output from a digital pin on the arduino<br />
analogWrite(9,255-displayValue255); //green<br />
delay(500);<br />
}</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.cminion.com/wordpress/2009/04/27/power-duck-to-the-financial-rescue/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>MQTT Flashing Ducks</title>
		<link>http://www.cminion.com/wordpress/2009/01/19/mqtt-flashing-ducks/</link>
		<comments>http://www.cminion.com/wordpress/2009/01/19/mqtt-flashing-ducks/#comments</comments>
		<pubDate>Mon, 19 Jan 2009 23:48:28 +0000</pubDate>
		<dc:creator>cminion</dc:creator>
				<category><![CDATA[MQTT]]></category>
		<category><![CDATA[Project]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[ducks]]></category>
		<category><![CDATA[output]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://cminion.com/wordpress/?p=9</guid>
		<description><![CDATA[
Well First project was working, got a string of ducks to listen for a MQTT subscription.
However as soon as I took the picture it broke. It seems to be a linux thing. Will fix it soon.
Just need to work out what to do with them when they work.
This works with an  Arduino that takes a [...]]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-medium wp-image-10" title="Flashing Duck" src="http://cminion.com/wordpress/wp-content/uploads/2009/01/flashyduck-300x225.jpg" alt="Flashing Duck" width="300" height="225" /></p>
<p>Well First project was working, got a string of ducks to listen for a MQTT subscription.</p>
<p>However as soon as I took the picture it broke. It seems to be a linux thing. Will fix it soon.</p>
<p>Just need to work out what to do with them when they work.</p>
<p>This works with an  Arduino that takes a serial hex code that triggers the LEDs on or OFF.  I have a perl script that works on my server and listens for MQTT subscriptions on Ducks.  I got the Arduino code from &#8220;Making things talk&#8221; (<a title="link" href="http://www.amazon.co.uk/Making-Things-Talk-Practical-Connecting/dp/0596510519/ref=sr_1_1?ie=UTF8&amp;qid=1232408587&amp;sr=8-1" target="_blank">link</a>) it is a great book on the basics of Arduinos and networking with them.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cminion.com/wordpress/2009/01/19/mqtt-flashing-ducks/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
