<?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>Chet.ie</title>
	<atom:link href="http://www.chet.ie/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.chet.ie</link>
	<description>Electonics, Projects and Ramblings - Make it, break it, hack it, mend it.</description>
	<lastBuildDate>Sun, 28 Apr 2013 21:26:31 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Heating Oil Level Gauge</title>
		<link>http://www.chet.ie/?p=204&#038;utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=heating-oil-level-gauge</link>
		<comments>http://www.chet.ie/?p=204#comments</comments>
		<pubDate>Sun, 28 Apr 2013 21:26:31 +0000</pubDate>
		<dc:creator>chett16</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Electronics]]></category>

		<guid isPermaLink="false">http://www.chet.ie/?p=204</guid>
		<description><![CDATA[It seems I can&#8217;t just leave the central heating alone. When we got the heating in (after 2 years of zero heating here, cooold) the tank was fitted with a wireless level monitor which measured the level of the tank using an ultrasonic sensor and sent the data back to a base station plugged into [...]]]></description>
				<content:encoded><![CDATA[<p>It seems I can&#8217;t just leave the central heating alone. When we got the heating in (after 2 years of zero heating here, cooold) the tank was fitted with a wireless level monitor which measured the level of the tank using an ultrasonic sensor and sent the data back to a base station plugged into a wall socket using its combined battery pack/aerial. This worked fine for a couple of months until the battery pack went dead. A new battery pack worked for a couple of days and it never worked again &#8211; exactly the same as the unit fitted to my parents tank , an absolute waste of money. I switched to dipping a stick into the tank which proved far more reliable but slightly inconvenient over the last two years.</p>
<p>A few weeks back i was browsing ebay, as i do, and found some ultrasonic distance sensors for about €4 delivered. (I have no direct link as the auction has expired but searching for SR04 will bring up any amount of similar units.) I had no plan for them immediately but I bought some just to have anyway. It was only after they came that it struck me that a way of remotely monitoring the oil level would be  a nice project.</p>
<p>The units are very simple to use. There is 4 pins: 5v, GND, Trigger and Echo. By applying a 10uS pulse to the trigger pin you activate the sensor to take a distance reading. The sensor replies on the echo pin with a pulse that is as long as the time taken for the sound wave to travel to the distant object and return to the sensor. Knowing the speed of sound we can then calculate the distance.<span id="more-204"></span></p>
<p>This is the module as it arrives with its 4 pin header soldered in.</p>
<p><a href="http://www.chet.ie/wp-content/uploads/2013/04/2013-04-27-13.46.02.jpg"><img class="alignnone size-large wp-image-206" alt="2013-04-27 13.46.02" src="http://www.chet.ie/wp-content/uploads/2013/04/2013-04-27-13.46.02-1024x768.jpg" width="520" height="390" /></a></p>
<p>&nbsp;</p>
<p>For the tank gauge i was planning on permanently installing the sensor so i desoldered the header and soldered in some of my 4 core alarm cable, this stuff is great to have around for projects!</p>
<p><a href="http://www.chet.ie/wp-content/uploads/2013/04/2013-04-27-14.12.00.jpg"><img class="alignnone size-large wp-image-207" alt="2013-04-27 14.12.00" src="http://www.chet.ie/wp-content/uploads/2013/04/2013-04-27-14.12.00-1024x768.jpg" width="520" height="390" /></a></p>
<p>The other end was passed through the side of a project box i had lying around with a knot tied to stop the wire being pulled from the board if someone got a little rough with it once assembled. To install the sensor on the tank i chose to put it on the tank cap, although it leaves it slightly vulnerable when getting the tank filled being able to install it indoors without trying to sit on the tank outside mounting it is a big advantage! With two suitably sized holes drilled the sensor was hotglued into place</p>
<p><a href="http://www.chet.ie/wp-content/uploads/2013/04/2013-04-27-14.26.58.jpg"><img class="alignnone size-large wp-image-208" alt="2013-04-27 14.26.58" src="http://www.chet.ie/wp-content/uploads/2013/04/2013-04-27-14.26.58-1024x768.jpg" width="520" height="390" /></a></p>
<p>And then the project box hotglued over that. The project box is also secured with two screws &#8211; its not going anywhere!</p>
<p><a href="http://www.chet.ie/wp-content/uploads/2013/04/2013-04-27-14.46.30.jpg"><img class="alignnone size-large wp-image-209" alt="2013-04-27 14.46.30" src="http://www.chet.ie/wp-content/uploads/2013/04/2013-04-27-14.46.30-1024x768.jpg" width="520" height="390" /></a> <a href="http://www.chet.ie/wp-content/uploads/2013/04/2013-04-27-14.46.44.jpg"><img class="alignnone size-large wp-image-210" alt="2013-04-27 14.46.44" src="http://www.chet.ie/wp-content/uploads/2013/04/2013-04-27-14.46.44-1024x768.jpg" width="520" height="390" /></a></p>
<p>And the cap refitted to the tank. The cable is ran across the follows the existing heating pipes (insulated in the background) up into the apartment.</p>
<p><a href="http://www.chet.ie/wp-content/uploads/2013/04/2013-04-28-19.17.24.jpg"><img class="alignnone size-large wp-image-211" alt="2013-04-28 19.17.24" src="http://www.chet.ie/wp-content/uploads/2013/04/2013-04-28-19.17.24-1024x768.jpg" width="520" height="390" /></a></p>
<p>My intention now is to get the sensor connected the network so i can read the data with my existing heating controller without too much trouble. I am still waiting for my ethernet modules to arrive as i&#8217;m not wasting one of my (expensive) W5100 boards on this project so for now I have made something slightly lower tech.</p>
<p>Using code i modified from the Tronixstuff site (<a href="http://tronixstuff.wordpress.com/2011/11/28/tutorial-parallax-ping-ultrasonic-sensor/">http://tronixstuff.wordpress.com/2011/11/28/tutorial-parallax-ping-ultrasonic-sensor/</a>) we can read the distance from the sensor to the oil level at display it via serial. Using my old dip stick I measured it at about 87cm so not bad at all! Also displayed is the level expressed as a percentage. Using my stick I estimated the distances for empty and full and hardcoded them.</p>
<pre class="qoate-code">int empty = 119;
int full = 19;</pre>
<p>The distance is then mapped to give the percentage</p>
<pre class="qoate-code"> level = map(distance, full, empty, 100, 0);</pre>
<p><a href="http://www.chet.ie/wp-content/uploads/2013/04/Capture.png"><img class="alignnone size-full wp-image-205" alt="Capture" src="http://www.chet.ie/wp-content/uploads/2013/04/Capture.png" width="421" height="391" /></a></p>
<p>For the display I am temporarily using a cheapo analogue 5v meter. Its driven by using a PWM pin on the arduino and getting the required output voltage  by mapping the distance variable to the PWM range of 0-255. The above serial printout shows the calculated value for the PWM.</p>
<pre class="qoate-code">gaugeVoltage = map(distance, full, empty, 255, 0);</pre>
<p><a href="http://www.chet.ie/wp-content/uploads/2013/04/2013-04-28-19.35.09.jpg"><img class="alignnone size-large wp-image-212" alt="2013-04-28 19.35.09" src="http://www.chet.ie/wp-content/uploads/2013/04/2013-04-28-19.35.09-1024x768.jpg" width="520" height="390" /></a></p>
<p>&nbsp;</p>
<p>The complete code is as follows. It&#8217;s a bit messy as I copied the code from Tronixstuff out of laziness and added to it as I needed to! For the final install the code will need to be integrated with the current code for turning the heating on and off so a single controller will be doing both.</p>
<pre class="qoate-code">

int trig = 8;
int echo = 9;
int gaugePin = 11;
int empty = 119;
int full = 19;
int distance;
int level;
int gaugeVoltage = 127;
unsigned long pulseduration=0;
void setup()
{
pinMode(trig, OUTPUT);
pinMode(gaugePin, OUTPUT);
pinMode(echo, INPUT);
Serial.begin(9600);
}
void measureDistance()
{

digitalWrite(trig, LOW);
delayMicroseconds(10);

// now send the 10uS pulse out to activate Ping)))
digitalWrite(trig, HIGH);
delayMicroseconds(10);
digitalWrite(trig, LOW);
// finally, measure the length of the incoming pulse
pulseduration=pulseIn(echo, HIGH);
}
void loop()
{
// get the raw measurement data from Ping)))
measureDistance();

// divide the pulse length by half
pulseduration=pulseduration/2;

//convert to centimetres.
distance = int(pulseduration/29);
level = map(distance, full, empty, 100, 0);
gaugeVoltage = map(distance, full, empty, 255, 0);
// Display on serial monitor
Serial.print("Distance - ");
Serial.print(distance);
Serial.print("cm. Level - ");
Serial.print(level);
Serial.print("% ");
Serial.println(gaugeVoltage);
analogWrite(gaugePin,gaugeVoltage);
delay(500);
}

</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.chet.ie/?feed=rss2&#038;p=204</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DIY Heating Timer v2.0</title>
		<link>http://www.chet.ie/?p=178&#038;utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=diy-heating-timer-v2-0</link>
		<comments>http://www.chet.ie/?p=178#comments</comments>
		<pubDate>Mon, 04 Mar 2013 02:16:43 +0000</pubDate>
		<dc:creator>chett16</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Electronics]]></category>

		<guid isPermaLink="false">http://www.chet.ie/?p=178</guid>
		<description><![CDATA[Following on from my previous post on my DIY timer I wanted to make something that I could mount to the wall and not have my wife be ashamed of it! In passing on one of the car forums I frequent I said that I could modify my original heating timer to be controlled by a [...]]]></description>
				<content:encoded><![CDATA[<p>Following on from my <a title="Heating Timer Mods -&gt; Homemade Timer" href="http://www.chet.ie/?p=118">previous post on my DIY timer</a> I wanted to make something that I could mount to the wall and not have my wife be ashamed of it! In passing on one of the car forums I frequent I said that I could modify my original heating timer to be controlled by a google calendar for less than €100. As you know that timer died while experimenting so i was left having to make one from scratch if i was to come good on my claim. Thinking about it an arduino combined with an ethernet shield and touchscreen shield could come together to make a very nice controller with a tidy looking interface. The hardware for that should come in under €100. 20 each for the shields and arduino and a further 10 for a solid state relay. It was while browsing DX.com i came across <a href="http://dx.com/p/jxd-s18-4-3-resistive-screen-android-4-0-mini-pad-tablet-pc-w-tf-wi-fi-g-sensor-black-161536" target="_blank">this</a>. A 4.3&#8243; touchscreen android tablet for less than 35 euro delivered &#8211; mind blown, I knew what i had to do.</p>
<p><a href="http://www.chet.ie/wp-content/uploads/2013/03/jxds18.jpg"><img class="alignnone size-medium wp-image-187" alt="jxds18" src="http://www.chet.ie/wp-content/uploads/2013/03/jxds18-300x200.jpg" width="300" height="200" /></a></p>
<p>&nbsp;</p>
<p>Hardware wise I needed a way of allowing the tablet to turn on the relay. I couldn&#8217;t use bluetooth as the tablet didn&#8217;t have it and it would be too unreliable anyway. The next choice for getting an output would be the vibration motor but again, the tablet didn&#8217;t have one. All that i was left with was using the speaker output to trigger the heater. To do this i had the software (detailed later) output two tones. Depending on the frequency of this tone we would know if the heating should be on or off. The speaker output is passed into an op-amp used as a comparator to give a nice 5v square wave that is input into an Attiny85 via one of the Boards.ie keyrings/dev boards i had made up. The attiny measures the incoming pulse and decides whether to turn the output on or not. The solid state relay can be directly controlled with an attiny pin. Here you can see the hardware during the prototype stage.</p>
<p><a href="http://www.chet.ie/wp-content/uploads/2013/03/2013-01-11-18.26.13.jpg"><span id="more-178"></span><img class="alignnone size-large wp-image-181" alt="2013-01-11 18.26.13" src="http://www.chet.ie/wp-content/uploads/2013/03/2013-01-11-18.26.13-1024x768.jpg" width="520" height="390" /></a></p>
<p>The 5v power adapter from the old heating setup is reused to power the attiny board and I used 4 core alarm wire to send 5v to the tablet mounted on the wall , it also has the ground and speaker output connections. The alarm wire passes through the back of the tablet and the wires soldered directly to points on the board. This means the tablet is constantly on charge, it has been live for six weeks now without any problems.</p>
<p><a href="http://www.chet.ie/wp-content/uploads/2013/03/2013-01-11-15.23.52.jpg"><img class="alignnone size-large wp-image-180" alt="2013-01-11 15.23.52" src="http://www.chet.ie/wp-content/uploads/2013/03/2013-01-11-15.23.52-1024x768.jpg" width="520" height="390" /></a></p>
<p>The user interface for the controller was made in app inventor. From the main screen we have a number of different features</p>
<ul>
<li>An indicator to show whether the heating is on or not</li>
<li>A button to manually turn the heating on</li>
<li>The current/next heating time</li>
<li>The current weather graphic</li>
<li>The current weather text (tapping will cycle between today, tonight and tomorrows weather)</li>
<li>The current temp</li>
</ul>
<p><a href="http://www.chet.ie/wp-content/uploads/2013/03/2013-03-03-23.45.17.jpg"><img class="alignnone size-large wp-image-184" alt="2013-03-03 23.45.17" src="http://www.chet.ie/wp-content/uploads/2013/03/2013-03-03-23.45.17-1024x768.jpg" width="520" height="390" /></a></p>
<p>Tapping the weather icon will bring up detailed weather information.</p>
<p><a href="http://www.chet.ie/wp-content/uploads/2013/03/2013-03-03-23.45.37.jpg"><img class="alignnone size-large wp-image-186" alt="2013-03-03 23.45.37" src="http://www.chet.ie/wp-content/uploads/2013/03/2013-03-03-23.45.37-1024x768.jpg" width="520" height="390" /></a></p>
<p><a href="http://www.chet.ie/wp-content/uploads/2013/03/2013-01-13-16.18.59.jpg"><img class="alignnone size-large wp-image-182" alt="2013-01-13 16.18.59" src="http://www.chet.ie/wp-content/uploads/2013/03/2013-01-13-16.18.59-1024x768.jpg" width="520" height="390" /></a></p>
<p>&nbsp;</p>
<p>Also on the main screen are AA and camera icons. The camera icon will bring up and image from the wifi camera mounted in our daughters bedroom, she&#8217;s 3 so needs quite a lot of  &#8221;tucking in&#8221; at night so it&#8217;d nice to be able to check on her while passing the timer.</p>
<p><a href="http://www.chet.ie/wp-content/uploads/2013/03/2013-03-03-23.46.11.jpg"><img class="alignnone size-large wp-image-179" alt="2013-03-03 23.46.11" src="http://www.chet.ie/wp-content/uploads/2013/03/2013-03-03-23.46.11-1024x768.jpg" width="520" height="390" /></a></p>
<p>&nbsp;</p>
<p>The AA button will display the traffic conditions relevant to our commutes if any are available. There wasn&#8217;t anything exciting when i had taken this pic (typically!)</p>
<p><a href="http://www.chet.ie/wp-content/uploads/2013/03/2013-01-13-16.19.32.jpg"><img class="alignnone size-large wp-image-183" alt="2013-01-13 16.19.32" src="http://www.chet.ie/wp-content/uploads/2013/03/2013-01-13-16.19.32-1024x768.jpg" width="520" height="390" /></a></p>
<p>&nbsp;</p>
<p>The weather text for the main screen is parsed from the <a href="http://www.met.ie/forecasts/regional.asp?Prov=Leinster">met eireann site</a>. The icons and detailed weather are parsed from <a href="http://www.meteo-europ.com/en/ie/wicklow/rathdrum-weather.html">Meteo Europ</a> although this is formatted and parsed by a <a href="http://www.chet.ie/heating/weather.php">script on this server</a> as it was easier than doing it from within the android. Similarly the AA report comes from the AA Roadwatch site and is parsed <a href="http://www.chet.ie/heating/aa.php">on the server</a>. These were done using PHP the same way as i <a title="Scraping HTML from Websites with PHP" href="http://www.chet.ie/?p=125">posted about before</a>.</p>
<p>This app is actually nothing more than a front end for the awesomely powerful <a href="https://play.google.com/store/apps/details?id=net.dinglisch.android.taskerm">Tasker App</a>. Tasker is used to check the google calendar and handles the downloading of the images from the camera. The heating app just checks the contents of a file written by tasker to know if the heating should be on. Tasker was also used to make the app that pops up set the heating on manually. What this app does is creates a new calendar entry for the specified amount of hours. The best thing is that by installing this app on any android phone with permissions to write to this calendar the heating can be turned on remotely from anywhere.</p>
<p><a href="http://www.chet.ie/wp-content/uploads/2013/03/2013-03-04-02.09.58.png"><img class="alignnone size-large wp-image-189" alt="2013-03-04 02.09.58" src="http://www.chet.ie/wp-content/uploads/2013/03/2013-03-04-02.09.58-576x1024.png" width="520" height="924" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.chet.ie/?feed=rss2&#038;p=178</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Work Placement Needed</title>
		<link>http://www.chet.ie/?p=175&#038;utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=work-placement-needed</link>
		<comments>http://www.chet.ie/?p=175#comments</comments>
		<pubDate>Mon, 04 Feb 2013 12:11:10 +0000</pubDate>
		<dc:creator>chett16</dc:creator>
				<category><![CDATA[Electronics]]></category>

		<guid isPermaLink="false">http://www.chet.ie/?p=175</guid>
		<description><![CDATA[Due to a mix up/mess up with my university I&#8217;m left to either find a work placement on short notice or try find some modules this semester which I should&#8217;ve started over two weeks ago &#8211; something I don&#8217;t want to do as not only does it mean missed class time, it means choosing modules I normally would not have chosen both this [...]]]></description>
				<content:encoded><![CDATA[<p>Due to a mix up/mess up with my university I&#8217;m left to either find a work placement on short notice or try find some modules this semester which I should&#8217;ve started over two weeks ago &#8211; something I don&#8217;t want to do as not only does it mean missed class time, it means choosing modules I normally would not have chosen both this year and next.</p>
<p>Ideally I&#8217;d love to get in somewhere small where I can get stuck in, and I find myself drawn to learning PCB layout and design but I am open to anything relevant and interesting. I&#8217;m based in the east, so I would be looking for Dublin/Wicklow/Wexford/Carlow area. I&#8217;m a mature student with a wife and 3 year old so moving away for 6 months currently isn&#8217;t an option.</p>
<p>I have an engineering science degree in electronics and this placement is part of my electronic and computer engineering masters.</p>
<p>If  anyone knows of any companies willing to take on someone I&#8217;d love to hear about them. I can be emailed at blog@chet.ie</p>
<p>Thanks!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chet.ie/?feed=rss2&#038;p=175</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LED Light Ready For Hacking</title>
		<link>http://www.chet.ie/?p=137&#038;utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=led-light-ready-for-hacking</link>
		<comments>http://www.chet.ie/?p=137#comments</comments>
		<pubDate>Fri, 18 Jan 2013 20:35:07 +0000</pubDate>
		<dc:creator>chett16</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Electronics]]></category>

		<guid isPermaLink="false">http://www.chet.ie/?p=137</guid>
		<description><![CDATA[I bought one of these in Argos to see if there was anything interesting that could be one with it. It turns out that the thing is ripe for hacking if you wanted. Inside theres a single sided PCB with 12 SMD RGB LED&#8217;s on. The LED&#8217;s are grouped into four groups of three LED&#8217;s [...]]]></description>
				<content:encoded><![CDATA[<p>I bought <a href="http://www.argos.ie/webapp/wcs/stores/servlet/Search?searchTerms=9060656" target="_blank">one of these</a> in Argos to see if there was anything interesting that could be one with it. It turns out that the thing is ripe for hacking if you wanted.</p>
<p><a href="http://www.chet.ie/?attachment_id=138" rel="attachment wp-att-138"><img class="alignnone  wp-image-138" alt="argos" src="http://www.chet.ie/wp-content/uploads/2013/01/argos.png" width="539" height="275" /></a></p>
<p><span id="more-137"></span>Inside theres a single sided PCB with 12 SMD RGB LED&#8217;s on. The LED&#8217;s are grouped into four groups of three LED&#8217;s in series. Each group using its own set of resistors for each colour. The 12v input passes through a diode to protect against reverse polarity. A 7805 regulator is used to provide the 5v needed for the IR receiver and the unmarked 8 pin control IC. The PWM output from the controller for each colour passes through a 2k2 resistor into a sot-23 J3Y NPN transistor which controls the 12V supply to the LED&#8217;s</p>
<p><a href="http://www.chet.ie/?attachment_id=140" rel="attachment wp-att-140"><img class="alignnone size-large wp-image-140" alt="led groupings" src="http://www.chet.ie/wp-content/uploads/2013/01/led-groupings-1024x768.jpg" width="520" height="390" /></a> <a href="http://www.chet.ie/?attachment_id=141" rel="attachment wp-att-141"><img class="alignnone  wp-image-141" alt="led pinout" src="http://www.chet.ie/wp-content/uploads/2013/01/led-pinout.jpg" width="601" height="426" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>The pinout for the IC is below, the unused pin is tied to GND so i&#8217;m not sure which is the actual ground pin. If anyone has any idea what the IC is let me know.</p>
<p><a href="http://www.chet.ie/?attachment_id=139" rel="attachment wp-att-139"><img class="alignnone size-full wp-image-139" alt="ic" src="http://www.chet.ie/wp-content/uploads/2013/01/ic.jpg" width="292" height="205" /></a></p>
<p>&nbsp;</p>
<p>To read the IR codes it used an arduino with <a href="http://www.arcfn.com/2009/08/multi-protocol-infrared-remote-library.html">Ken Shirriffs IR library</a> connected to the output of the IR receiver.</p>
<p>&nbsp;</p>
<p><a href="http://www.chet.ie/?attachment_id=143" rel="attachment wp-att-143"><img class="alignnone size-large wp-image-143" alt="2013-01-18 15.12.08" src="http://www.chet.ie/wp-content/uploads/2013/01/2013-01-18-15.12.08-1024x768.jpg" width="520" height="390" /></a></p>
<p>&nbsp;</p>
<p>The remote used the NEC protocol which is very common for these cheapo slim remote controls.</p>
<p><a href="http://www.chet.ie/?attachment_id=142" rel="attachment wp-att-142"><img class="alignnone size-large wp-image-142" alt="2013-01-18 19.24.57" src="http://www.chet.ie/wp-content/uploads/2013/01/2013-01-18-19.24.57-768x1024.jpg" width="520" height="693" /></a></p>
<p>&nbsp;</p>
<p>The codes are in the table below, matching the layout of the remote itself.</p>
<p><a href="http://www.chet.ie/?attachment_id=147" rel="attachment wp-att-147"><img class="alignnone size-full wp-image-147" alt="ircodes" src="http://www.chet.ie/wp-content/uploads/2013/01/ircodes.png" width="221" height="121" /></a></p>
<p>&nbsp;</p>
<p>So far i haven&#8217;t done anything further with it as i haven&#8217;t decided what to do. The easiest way to add control to it is to use the remote codes that we now know and send them with an arduino or similar. I think what i will probably do is replace the existing IC with an attiny85, the pinout is different but you can solder wires to the pads and put the attiny elsewhere. To keep the existing IR remote the arduino library would need modifying to work with the attiny and to match the functions it would be necessary to put an oscilloscope of the output pins and measure the PWN duty cycle to get the same colours. With the unused pin you could add bluetooth and/or USB serial control easily.</p>
<p>I&#8217;ll post if i ever decide what to do with it!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chet.ie/?feed=rss2&#038;p=137</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Heating Timer Mods -&gt; Homemade Timer</title>
		<link>http://www.chet.ie/?p=118&#038;utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=heating-timer-mods-homemade-timer</link>
		<comments>http://www.chet.ie/?p=118#comments</comments>
		<pubDate>Mon, 14 Jan 2013 11:06:43 +0000</pubDate>
		<dc:creator>chett16</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.chet.ie/?p=118</guid>
		<description><![CDATA[For years our heating timer was sitting on the wall being not particularly useful. It was so awkward to reprogram new times into it that it had come to a point where it had a basic program on it and was mostly manually controlled by switching it on for 1/2/3 hours at a time. Finally [...]]]></description>
				<content:encoded><![CDATA[<p>For years our heating timer was sitting on the wall being not particularly useful. It was so awkward to reprogram new times into it that it had come to a point where it had a basic program on it and was mostly manually controlled by switching it on for 1/2/3 hours at a time. Finally i had enough of it and with some spare time on my hands i set about adding some remote control functionality to it. The first plan was to gain control over the &#8220;+hrs&#8221; button we were used to using and then see what was possible. In preparation i ordered an arduino ethernet shield but i wasn&#8217;t sure what i was going to do with it.</p>
<p>A popular method of controlling a switch with a microcontroller is to replace it with a transistor. As i didn&#8217;t want to interfere with the normal operation of the switch i traced back the pads on the switch to two vias on the PCB which allowed me to solder some thin wires in to attach the transistor to. To test i brought out GND and the base wire and reassembled. Running some simple code to toggle the switch let me cycle through the times and turn it off as expected.<span id="more-118"></span></p>
<p><iframe width="520" height="293" src="http://www.youtube.com/embed/q1xALyXjZ5Q?feature=oembed" frameborder="0" allowfullscreen></iframe></p>
<p>While deciding what to do next i was experimenting with the controller and trying to see if there was any information being passed from the (marked) UART on the board. I think i overstressed the ribbon cable attaching the two PCB&#8217;s at this point and caused a short somewhere as the controller died on me and i couldn&#8217;t find a fault or come up with any easy solution to make it work.</p>
<p>Typically this was just coming up on the weekend and it was getting cold! As a quick fix i installed a mains switch for the heating but it quickly became clear that that was not going to work as a long term solution. The original controller was nothing more than a relay connecting the live of the mains to the heating boiler, nothing too complicated about replicating that right?</p>
<p>I knew my brother had a spare solid state relay which simplified switching the mains as i could run that directly from a 5v output. I dug into stash of bits to use and came out with an arduino nano, a bluetooth serial module, an i2c real time clock module and an i2c 16&#215;02 lcd.</p>
<p>The most awkward thing to code was a menu system for setting the heating times, so i didn&#8217;t <img src='http://www.chet.ie/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  I hardcoded the times and put in a manual override via bluetooth. I picked up a double gang box and blanker in the local hardware and mounted the LCD in it. As soon as my wife seen it she told me i wasn&#8217;t allowed &#8220;put that jumble sale of a thing on the wall&#8221; :/ I quite liked the homemade look!</p>
<p><iframe width="520" height="293" src="http://www.youtube.com/embed/m7xLLqk5CKc?feature=oembed" frameborder="0" allowfullscreen></iframe></p>
<p>To power the controller i took apart an old USB charger and mounted that in a second two gang box in the hall cupboard. I kept the usb connection as i already had the male connector from <a title="USB Boost Module Testing" href="http://www.chet.ie/?p=85" target="_blank">testing the USB boost modules</a> In this pic you can see the mains come in and go back out via the solid state relay and also the 5v power supply going out by the thin red and black wires. The white wire is from the controller to the relay.</p>
<p><a href="http://www.chet.ie/?attachment_id=121" rel="attachment wp-att-121"><img class="alignnone size-large wp-image-121" alt="2012-12-21 18.17.14" src="http://www.chet.ie/wp-content/uploads/2013/01/2012-12-21-18.17.14-1024x768.jpg" width="520" height="390" /></a></p>
<p>&nbsp;</p>
<p>The controller itself was mounted on the inside of the door for easy access but where my wife didn&#8217;t have to look at it!</p>
<p><a href="http://www.chet.ie/?attachment_id=122" rel="attachment wp-att-122"><img class="alignnone size-large wp-image-122" alt="2012-12-21 18.53.56" src="http://www.chet.ie/wp-content/uploads/2013/01/2012-12-21-18.53.56-1024x768.jpg" width="520" height="390" /></a> <a href="http://www.chet.ie/?attachment_id=120" rel="attachment wp-att-120"><img class="alignnone size-large wp-image-120" alt="2012-12-20 13.13.40" src="http://www.chet.ie/wp-content/uploads/2013/01/2012-12-20-13.13.40-1024x768.jpg" width="520" height="390" /></a> <a href="http://www.chet.ie/?attachment_id=119" rel="attachment wp-att-119"><img class="alignnone size-large wp-image-119" alt="2012-12-20 13.13.31" src="http://www.chet.ie/wp-content/uploads/2013/01/2012-12-20-13.13.31-1024x768.jpg" width="520" height="390" /></a></p>
<p>Over the next few days i tweaked the software to add extra features, the hardest to get working correctly was the +1/2/3 hour modes, especially as i had to wait around to see if it was definitely working! Here is a screenshot from the final android (app inventor) app, it uses my usual method of sending single bytes to perform each action. Along with sending serial commands the controller also outputs it current on/off status which is read by the phone and changes the state of the large power icon in the middle which allows you to quickly connect and check if the heating is on or not.</p>
<p><a href="http://www.chet.ie/?attachment_id=123" rel="attachment wp-att-123"><img class="alignnone size-large wp-image-123" alt="2012-12-22 17.10.50" src="http://www.chet.ie/wp-content/uploads/2013/01/2012-12-22-17.10.50-576x1024.png" width="520" height="924" /></a></p>
<p>&nbsp;</p>
<p>Here is the complete arduino code for the controller</p>
<pre class="qoate-code">

/*
Chet.ie Heating Controller Sketch
*/

/*
Mode codes:
a - auto (timer)
f - manual off
o - manual on
1 - on for one hour, then auto
2 - on for two hours, then auto
3 - on for 3 hours, then auto
*/
#include &lt;SoftwareSerial.h&gt;
#include "Wire.h"
#include &lt;LiquidCrystal_I2C.h&gt;

#define DS1307_I2C_ADDRESS 0x68
#define FIRSTON 4
#define FIRSTOFF 9
#define SECONDON 16
#define SECONDOFF 22

SoftwareSerial mySerial(10, 11); // RX, TX

boolean heatingOn = false;
int mode = 'a';
int ethstatus = 0;
int relayPin = 13;
int offHour, offMin = 0;
int usePlustime = 0;
int lastmode = 0;
LiquidCrystal_I2C lcd(0x27,16,2); // set the LCD address to 0x27 for a 16 chars and 2 line display
// Convert normal decimal numbers to binary coded decimal
byte decToBcd(byte val)
{
return ( (val/10*16) + (val%10) );
}

// Convert binary coded decimal to normal decimal numbers
byte bcdToDec(byte val)
{
return ( (val/16*10) + (val%16) );
}

// Gets the date and time from the ds1307
void getDateDs1307(byte *second,
byte *minute,
byte *hour,
byte *dayOfWeek,
byte *dayOfMonth,
byte *month,
byte *year)
{
// Reset the register pointer
Wire.beginTransmission(DS1307_I2C_ADDRESS);
Wire.write(0);
Wire.endTransmission();

Wire.requestFrom(DS1307_I2C_ADDRESS, 7);

// A few of these need masks because certain bits are control bits
*second = bcdToDec(Wire.read() &amp; 0x7f);
*minute = bcdToDec(Wire.read());
*hour = bcdToDec(Wire.read() &amp; 0x3f); // Need to change this if 12 hour am/pm
*dayOfWeek = bcdToDec(Wire.read());
*dayOfMonth = bcdToDec(Wire.read());
*month = bcdToDec(Wire.read());
*year = bcdToDec(Wire.read());
}

void lcdOutput(byte second,
byte minute,
byte hour,
byte dayOfWeek,
byte dayOfMonth,
byte month,
byte year)
{
lcd.setCursor(0,0);
if(mode=='o'){
lcd.print("on ");
}
else if(mode=='f'){
lcd.print("off ");
}
else if(mode=='1'){
lcd.print(" +1 ");
}
else if(mode=='2'){
lcd.print(" +2 ");
}
else if(mode=='3'){
lcd.print(" +3 ");
}
else {
lcd.print("Aut ");
}

if (hour&lt;10)
{
lcd.print(" ");
}
lcd.print(hour, DEC);
lcd.print(":");
if (minute&lt;10)
{
lcd.print("0");
}
lcd.print(minute, DEC);
lcd.print(":");
if (second&lt;10)
{
lcd.print("0");
}
lcd.print(second, DEC);
lcd.print(" ");
if(heatingOn == true)
{
lcd.print("ON ");
}
else
{
lcd.print("OFF");
}
lcd.setCursor(0,1);

if(usePlustime){
lcd.print(" ON UNTIL ");
if (offHour&lt;10)
{
lcd.print("0");
}
lcd.print(offHour, DEC);
lcd.print(":");
if (offMin&lt;10)
{
lcd.print("0");
}
lcd.print(offMin, DEC);
lcd.print(" ");
}
else{
lcd.print(" ");

switch(dayOfWeek){
case 1:
lcd.print("Sun");
break;
case 2:
lcd.print("Mon");
break;
case 3:
lcd.print("Tue");
break;
case 4:
lcd.print("Wed");
break;
case 5:
lcd.print("Thu");
break;
case 6:
lcd.print("Fri");
break;
case 7:
lcd.print("Sat");
break;
}

lcd.print(" ");
lcd.print(dayOfMonth, DEC);
lcd.print("/");
lcd.print(month, DEC);
lcd.print("/20");
lcd.print(year, DEC);
}
}

void setup()
{
pinMode(relayPin, OUTPUT);
byte second, minute, hour, dayOfWeek, dayOfMonth, month, year;
Wire.begin();
mySerial.begin(9600);
lcd.init(); // initialize the lcd
lcd.backlight();
lcd.setCursor(0,0);
lcd.print(" www.Chet.ie"); // print text and move cursor to start of next line
lcd.setCursor(0,1);
lcd.print("Heating Control");
delay(5000);
lcd.clear(); // clear LCD screen
}

void loop()
{

if (mySerial.available() &gt; 0)
{
// get incoming byte:
mode = mySerial.read();
}
byte second, minute, hour, dayOfWeek, dayOfMonth, month, year;
getDateDs1307(&amp;second, &amp;minute, &amp;hour, &amp;dayOfWeek, &amp;dayOfMonth, &amp;month, &amp;year);

if((usePlustime == 1)&amp;&amp;(hour == offHour)&amp;&amp;(minute == offMin))
{
usePlustime = 0; //not using plus time anymore
mode=lastmode; //switch back to auto mode
}

if((mode=='a')){
usePlustime = 0;
lastmode=mode;
if((hour&gt;=FIRSTON)&amp;&amp;(hour&lt;FIRSTOFF)){
heatingOn = true;
}
else if((hour&gt;=SECONDON)&amp;&amp;(hour&lt;SECONDOFF)){
heatingOn = true;
}
else{
heatingOn=false;
}
}

else if((mode=='o')){
usePlustime = 0;
heatingOn=1;
lastmode=mode;
}

else if((mode=='f')){
usePlustime = 0;
heatingOn=0;
lastmode=mode;
}

else if((mode=='1')&amp;&amp; (lastmode!='1')){
offHour = (hour+1);
offMin = minute;
usePlustime = 1;
heatingOn=1;
lastmode=mode;
}

else if((mode=='2')&amp;&amp; (lastmode!='2')){
offHour = (hour+2);
offMin = minute;
usePlustime = 1;
heatingOn = 1;
lastmode=mode;
}
else if((mode=='3')&amp;&amp; (lastmode!='3')){
offHour = (hour+3);
offMin = minute;
usePlustime = 1;
heatingOn = 1;
lastmode=mode;
}

if(offHour&gt;=24){
offHour=offHour-24;
}

lcdOutput(second, minute, hour, dayOfWeek, dayOfMonth, month, year); // print to LCD screen
mySerial.println(heatingOn);
if(heatingOn == true)
{
digitalWrite(relayPin, HIGH);
}
else if(heatingOn == false)
{
digitalWrite(relayPin, LOW);
}
delay(1000);
}

&nbsp;

</pre>
<p>The android APK can be downloaded here:</p>
<div id='wpdm_file_4' class='wpdm_file wpdm-only-button'>
<div class='cont'>
<div class='btn_outer'>
<div class='btn_outer_c' style=''><a class='btn_left  ' rel='4' title='BT Heating APK' href='http://www.chet.ie/?wpdmact=process&did=NC5ob3RsaW5r'  >Download</a><span class='btn_right'>&nbsp;</span></div>
</div>
<div class='clear'></div>
</div>
</div>
<p>This has been replaced now (v2 post coming soon) and due to my phone dying i have no pics of the internals, it was only temperarily put together on a breadboard anyway. If you have any questions on the wiring jut ask in the comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chet.ie/?feed=rss2&#038;p=118</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Scraping HTML from Websites with PHP</title>
		<link>http://www.chet.ie/?p=125&#038;utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=scraping-html-from-websites-with-php</link>
		<comments>http://www.chet.ie/?p=125#comments</comments>
		<pubDate>Sun, 13 Jan 2013 21:06:16 +0000</pubDate>
		<dc:creator>chett16</dc:creator>
				<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://www.chet.ie/?p=125</guid>
		<description><![CDATA[Here&#8217;s a simple and useful PHP script that i&#8217;ve used a number of times to pull data from an external site to use elsewhere. I first used it with my Cartell.ie android app. To minimise data use on the phone the entered reg number is sent to one of my webservers which requests the cartell.ie site, [...]]]></description>
				<content:encoded><![CDATA[<p>Here&#8217;s a simple and useful PHP script that i&#8217;ve used a number of times to pull data from an external site to use elsewhere. I first used it with my <a title="Cartell.ie" href="https://play.google.com/store/apps/details?id=appinventor.ai_chett16kelly.cartell" target="_blank">Cartell.ie</a> android app. To minimise data use on the phone the entered reg number is sent to one of my webservers which requests the cartell.ie site, submitting the given reg and returning just the vehicle information.</p>
<p>The phone requests<em> server/file.php?registration=&lt;reg number&gt; </em>Where the registration number is first read into the variable &#8216;reg&#8217;</p>
<pre class="qoate-code">

$reg = $_REQUEST['registration'];

</pre>
<p><span id="more-125"></span>The content is requested and then saved into &#8216;html&#8217; using<em> file_get_contents()</em></p>
<pre class="qoate-code">

$html = file_get_contents('https://www.cartell.ie/ssl/servlet/beginStarLookup?registration='.$reg);

</pre>
<p>At this point we have the entire HTML response from the website stored (think of it as the &#8220;view source&#8221; content that you would see) in html.</p>
<p>To extract the relevant information we need to find a string of text in the source which identifies the start of the code containing the information we want, its best to try and ensure this code is unique in the file to save on any issues. In the case of the cartell script the start of the data table is easily and uniquely identified by the use of the vehicle-description class. We mark this as our start point.</p>
<pre class="qoate-code">$start = strpos($html,'&lt;table class="vehicle-description"&gt;');</pre>
<p>The end is is simply the next closing of the table tag, <em>&lt;/table&gt; </em></p>
<pre class="qoate-code">$end = strpos($html,'&lt;/table&gt;',$start) + 8;</pre>
<p>By default we will be marking the position of the start of the searched string, if we want to also include this string we can move the position forward by adding the integer number of characters in the string, in our case this is 8, hence the &#8216;+8&#8242; in the code. This may or may not be necessary, depending on what you wish to do.</p>
<p>With the start and end positions in hand we can extract the code which we need.</p>
<pre class="qoate-code">$table = substr($html,$start,$end-$start);</pre>
<p>Finally we print out the resulting code using the echo command.</p>
<pre class="qoate-code">echo $table;</pre>
<p>The complete code for this script is:</p>
<pre class="qoate-code">

&lt;?php

$reg = $_REQUEST['registration'];

$html = file_get_contents('https://www.cartell.ie/ssl/servlet/beginStarLookup?registration='.$reg);

$start = strpos($html,'&lt;table class="vehicle-description"&gt;');

$end = strpos($html,'&lt;/table&gt;',$start) + 8;

$table = substr($html,$start,$end-$start);

echo $table;

?&gt;

</pre>
<p>Optionally we can run a find and replace on this to change anything we like by using the <em>str_replace() </em>function.</p>
<pre class="qoate-code">$table = str_replace('&lt;replace this&gt;','&lt;with this&gt;',$table);</pre>
<p>So there you have it, like i said, it&#8217;s simple but can prove very useful for extraction data for apps or other projects.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chet.ie/?feed=rss2&#038;p=125</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SolarSwitch v1.0</title>
		<link>http://www.chet.ie/?p=107&#038;utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=solarswitch-v1-0</link>
		<comments>http://www.chet.ie/?p=107#comments</comments>
		<pubDate>Mon, 24 Dec 2012 22:27:10 +0000</pubDate>
		<dc:creator>chett16</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.chet.ie/?p=107</guid>
		<description><![CDATA[&#160; My brother has a solar panel on the roof of his house which is used to charge a 12v battery which runs the equipment in his attic, the routers etc. There is a proper solar regulator/battery charger which keeps the battery topped up. The problem is that when the sun isn&#8217;t shining (which happens [...]]]></description>
				<content:encoded><![CDATA[<p>&nbsp;</p>
<p>My brother has a solar panel on the roof of his house which is used to charge a 12v battery which runs the equipment in his attic, the routers etc. There is a proper solar regulator/battery charger which keeps the battery topped up. The problem is that when the sun isn&#8217;t shining (which happens a lot here!) the battery drains and eventually the voltage drops. He had bought a switch mode power supply that would take over from the solar regulator but he wasn&#8217;t sure how to wire it up to work as he wanted, which was to have the power supply on only when it was need so there would be no power wasted.</p>
<p>This is what i came up with for him.</p>
<p><a href="http://www.chet.ie/?attachment_id=108" rel="attachment wp-att-108"><img class="alignnone size-large wp-image-108" alt="2012-07-18 19.51.40" src="http://www.chet.ie/wp-content/uploads/2012/12/2012-07-18-19.51.40-1024x768.jpg" width="520" height="390" /></a></p>
<p><span id="more-107"></span></p>
<p>At the heart of it ia an ATmel attiny85, this measures the output of the battery through a voltage divider (to keep the attiny input voltage below 5v) If it drops below a certain value, say 11.5v, it will turn on a solid state relay which controls the mains feed to the 12v power supply. Once the battery voltage reaches an acceptable level the relay is switched off and the external devices continue to be powered from the battery. The battery and power supply are isolated from one another using two diodes to prevent current from flowing backwards into the power source not being used. I used MUR1560 diodes with a voltage drop of 0.4v as they are what i had to hand. While this means the output is 0.4v lower than we need both the power supply and battery charger can be adjusted to a higher voltage so the final output will be as required. Also onboard is a 7805 voltage regulator which powers the attiny85.</p>
<p>The attiny is running the arduino bootloader and the code is posted below.</p>
<pre class="qoate-code">

int onVoltage = 11500; //define min allowed voltage (mV) - switch psu on
int offVoltage = 11800; //define voltage to turn psu off (mV)
int timeDelay = 5000; //define delay between checks (ms)

int rangeTop = 15681; //measured input when voltage divider voltage is 5000mV

int voltageinPin = 3; //attiny85 pin 2, connected to voltage divider
int relayPin = 2; //attiny85 pin 5, connected to relay

int voltagein = 0; //initialise variable to hold read voltage

void setup()
{

pinMode(relayPin, OUTPUT);

}

void loop()
{

voltagein = map(analogRead(voltageinPin),0, 1023, 0, rangeTop); //map pin value from 0 to max voltage

if(voltagein &lt;= onVoltage){

digitalWrite(relayPin, HIGH); //turn relay on

}

else if(voltagein &gt; offVoltage){

digitalWrite(relayPin, LOW); //turn relay off

}

delay(timeDelay);

}

</pre>
<p>Due to the tolerances of the resistors it is best to measure the input voltage and adjusting it until the voltage divider gives an output of 5v. You can set your voltage divider to give yourself a large margin here, for mine the largest input voltage we can take is over 15v, this keeps the actual pin input voltage well below the 5v maximum. While you might loose some precision here its not needed anyway.</p>
<p>Power comsumption was 20mW, half of which was from the voltage divider and then there is also wasted energy in the diodes so there is room to improve if needs be, in this case it was perfectly adequate!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chet.ie/?feed=rss2&#038;p=107</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>USB Boost Module Testing</title>
		<link>http://www.chet.ie/?p=85&#038;utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=usb-boost-module-testing</link>
		<comments>http://www.chet.ie/?p=85#comments</comments>
		<pubDate>Wed, 03 Oct 2012 22:49:09 +0000</pubDate>
		<dc:creator>chett16</dc:creator>
				<category><![CDATA[Electronics]]></category>

		<guid isPermaLink="false">http://www.chet.ie/?p=85</guid>
		<description><![CDATA[As you may have seen from the RC car mods posts, i had to add a voltage boost module in to get it working. While it worked perfectly for that purpose i was skeptical of the claimed specifications &#8211; as you should be when buying cheap stuff from ebay. Here is the details from the [...]]]></description>
				<content:encoded><![CDATA[<p>As you may have seen from the RC car mods posts, i had to add a voltage boost module in to get it working. While it worked perfectly for that purpose i was skeptical of the claimed specifications &#8211; as you should be when buying cheap stuff from ebay.</p>
<p>Here is the details from the ebay auction:</p>
<div>
<div>
<div>
<ul>
<li>
<p align="left">Input voltage: DC 3-4.4V</p>
</li>
<li>
<p align="left">Output voltage: DC 5.5V</p>
</li>
<li>
<p align="left">Output current: 700mA (max)</p>
</li>
</ul>
</div>
</div>
</div>
<p><span id="more-85"></span></p>
<p>To test the module i used my iTead OverLoad dummy load. This allows you to set a current and it will vary the load to maintain the current passing into it.</p>
<p>Here is the setup below. The OverLoad is powered from my Atten power supply(crocodile clips) with the output taken direct at the USB connector output. The output voltage is measured by my Philips PM2521 bench multimeter using the banana plug leads in the pic.</p>
<p><a href="http://www.chet.ie/wp-content/uploads/2012/08/2012-08-01-19.31.24.jpg"><img class="alignnone size-large wp-image-87" title="2012-08-01 19.31.24" src="http://www.chet.ie/wp-content/uploads/2012/08/2012-08-01-19.31.24-1024x768.jpg" alt="" width="520" height="390" /></a></p>
<p><a href="http://www.chet.ie/wp-content/uploads/2012/08/2012-08-01-19.32.33.jpg"><img class="alignnone size-large wp-image-86" title="2012-08-01 19.32.33" src="http://www.chet.ie/wp-content/uploads/2012/08/2012-08-01-19.32.33-1024x768.jpg" alt="" width="520" height="390" /></a></p>
<p>There was 3 things i wanted to test.</p>
<ul>
<li>How much current we could get with an outputof 5V</li>
<li>How high of a voltage we can get out at the max rated 700mA</li>
<li>The efficiency</li>
</ul>
<p>&nbsp;</p>
<p>Firstly, with no load the output voltage measured 5.5V at the max input of 4.4V. I lowered the input voltage all the way down and even at 0.2V it still showed 5.4V at the output. Only at 0.1V did it drop to 4.1V. Interesting but a bit useless with no load on it!</p>
<p><a href="http://www.chet.ie/wp-content/uploads/2012/08/2012-08-01-19.32.09.jpg"><img class="alignnone size-large wp-image-88" title="2012-08-01 19.32.09" src="http://www.chet.ie/wp-content/uploads/2012/08/2012-08-01-19.32.09-1024x768.jpg" alt="" width="520" height="390" /></a></p>
<p>To measure the current with an output of 5V it was a case of setting the input voltage and adjusting the load until we had an output of 5V for all input voltages. Did we manage to get 700mA? No, but we got close. At 4.4V input we managed 670mA at 5V. At the other end of the scale with an input of 1v we managed 30mA at 5V.</p>
<p>The data is plotted below.</p>
<p><a href="http://www.chet.ie/wp-content/uploads/2012/08/5v.png"><img class="alignnone size-full wp-image-89" title="5v" src="http://www.chet.ie/wp-content/uploads/2012/08/5v.png" alt="" width="800" height="600" /></a></p>
<p>Now i wanted to see what voltage output could be got while maintaining 700mA output. This was simply a case of setting the OverLoad to 700mA and dropping the input voltage while recording the output voltage. For the 4.4V input there was an output of 4.89 volts which is within USB specs of 5V+/- 0.25V. However once we reach an input below 4.2V we fail below USB specs. I didn&#8217;t bother going below 2.5V input which gave an output of 2.1V.</p>
<p>Again, the data is plotted below.</p>
<p><a href="http://www.chet.ie/wp-content/uploads/2012/08/700ma.png"><img class="alignnone size-full wp-image-90" title="700ma" src="http://www.chet.ie/wp-content/uploads/2012/08/700ma.png" alt="" width="800" height="600" /></a></p>
<p>The efficiency is calculated as Pout/Pin where Pin is the input power = input voltage x input current and Pout is output power = output voltage x output current.</p>
<p>The max efficiency was when the input voltage was highest which gave us a 84% efficiency rate, the lowest seen was 64%</p>
<p>&nbsp;</p>
<p>Overall then its not a bad little module provided you&#8217;re not chasing high currents from it. One thing i didn&#8217;t check at the time was how noisey the output was, i will have to do that in the future.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chet.ie/?feed=rss2&#038;p=85</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Porsche RC Car Mods Part Two</title>
		<link>http://www.chet.ie/?p=79&#038;utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=porsche-rc-car-mods-part-two</link>
		<comments>http://www.chet.ie/?p=79#comments</comments>
		<pubDate>Thu, 26 Jul 2012 14:13:23 +0000</pubDate>
		<dc:creator>chett16</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Electronics]]></category>

		<guid isPermaLink="false">http://www.chet.ie/?p=79</guid>
		<description><![CDATA[Following on from the first post where the voltage was dropping when the motors were under load causing the arduino to reset i tried a couple of things to get around the problem, first i added another cap across the arduino supply and then i added another battery in series (to give 6V total) but still [...]]]></description>
				<content:encoded><![CDATA[<p>Following on from the <a title="Porsche RC Car Mods" href="http://www.chet.ie/?p=70">first post</a> where the voltage was dropping when the motors were under load causing the arduino to reset i tried a couple of things to get around the problem, first i added another cap across the arduino supply and then i added another battery in series (to give 6V total) but still the voltage was dropping too much.</p>
<p>As i knew running an arduino from 4.5V was on the low side i went looking for a dc-dc boost to up the voltage to something more useful. What i found was a module used for charging USB devices from voltages down as far as 3V. These are rated at 700mA so more than enough for what we&#8217;re running off them. The actual output voltage is 5.5V which is in the acceptable range for the arduino.<span id="more-79"></span></p>
<p><a href="http://www.chet.ie/wp-content/uploads/2012/07/2012-07-26-13.26.52.jpg"><img class="alignnone size-large wp-image-80" title="2012-07-26 13.26.52" src="http://www.chet.ie/wp-content/uploads/2012/07/2012-07-26-13.26.52-1024x768.jpg" alt="" width="520" height="390" /></a></p>
<p>Having unsoldered the USB connector i added it to the car, powering only the arduino and i&#8217;m pleased to say it works perfectly. Even holding the motors in still (so at full load) the arduino doesn&#8217;t reset &#8211; result!</p>
<p><a href="http://www.chet.ie/wp-content/uploads/2012/07/2012-07-26-13.27.28.jpg"><img class="alignnone size-large wp-image-81" title="2012-07-26 13.27.28" src="http://www.chet.ie/wp-content/uploads/2012/07/2012-07-26-13.27.28-1024x768.jpg" alt="" width="520" height="390" /></a></p>
<p>Also to note in the above picture is the jumper on the RX line, this is because you can&#8217;t program the arduino with a serial device attached so it&#8217;s used to disconnect the bluetooth module.</p>
<p>The android app side of things still needs tweaking and i hope to get to that soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chet.ie/?feed=rss2&#038;p=79</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Porsche RC Car Mods</title>
		<link>http://www.chet.ie/?p=70&#038;utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=porsche-rc-car-mods</link>
		<comments>http://www.chet.ie/?p=70#comments</comments>
		<pubDate>Thu, 12 Jul 2012 00:46:53 +0000</pubDate>
		<dc:creator>chett16</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Electronics]]></category>

		<guid isPermaLink="false">http://www.chet.ie/?p=70</guid>
		<description><![CDATA[With the Dublin Mini Maker Faire just around the corner i treated myself to a new toy to hack in its honour, yeah i know, any excuse. Everytime i look at my 1:18 scale delta integrale (a reminder of the one i used to own thats sorely missed!) i always think that it would make a [...]]]></description>
				<content:encoded><![CDATA[<p>With the <a href="http://www.makerfairedublin.com/" target="_blank">Dublin Mini Maker Faire</a> just around the corner i treated myself to a new toy to hack in its honour, yeah i know, any excuse. Everytime i look at my 1:18 scale delta integrale (a reminder of the one i used to own thats sorely missed!) i always think that it would make a great project to add working lights to it and have them controllable. Then i remember how much the model cost and i decide not to chop it up, not yet anyway. As i was browsing the argos site to look for anything interesting and cheap i came across this <a href="http://www.argos.ie/webapp/wcs/stores/servlet/Search?storeId=10152&amp;catalogId=14051&amp;langId=111&amp;searchTerms=3882562&amp;authToken=" target="_blank">Porsche 911 GT3 RS</a> which seemed like a nice buy.</p>
<p>&nbsp;</p>
<p><a href="http://www.chet.ie/wp-content/uploads/2012/07/2012-07-09-21.38.28.jpg"><img class="alignnone size-large wp-image-59" title="2012-07-09 21.38.28" src="http://www.chet.ie/wp-content/uploads/2012/07/2012-07-09-21.38.28-1024x768.jpg" alt="" width="520" height="390" /></a></p>
<p><span id="more-70"></span>The quality of the car is actually pretty nice so i was quite happy with it, the controller is a bit crappy but that isn&#8217;t important. Inside the car the circuit board has no COB (Chip On Board, the black blob you see on cheap mass produced electronic stuff) and its all through hole components, both of which make it a lot easier for hacking!</p>
<p><a href="http://www.chet.ie/wp-content/uploads/2012/07/2012-07-09-21.39.40.jpg"><img class="alignnone size-large wp-image-60" title="2012-07-09 21.39.40" src="http://www.chet.ie/wp-content/uploads/2012/07/2012-07-09-21.39.40-1024x768.jpg" alt="" width="520" height="390" /></a></p>
<p>At the front there is a motor to control the steering, either fully on or off. At the back there is one motor driving the wheels, the rear motor has a choke to suppress rf interference, this is needed as you don&#8217;t want your controller not working as the motor spins up!</p>
<p><a href="http://www.chet.ie/wp-content/uploads/2012/07/2012-07-09-21.41.16.jpg"><img class="alignnone size-large wp-image-62" title="2012-07-09 21.41.16" src="http://www.chet.ie/wp-content/uploads/2012/07/2012-07-09-21.41.16-1024x768.jpg" alt="" width="520" height="390" /></a></p>
<p><a href="http://www.chet.ie/wp-content/uploads/2012/07/2012-07-09-21.39.54.jpg"><img class="alignnone size-large wp-image-61" title="2012-07-09 21.39.54" src="http://www.chet.ie/wp-content/uploads/2012/07/2012-07-09-21.39.54-1024x768.jpg" alt="" width="520" height="390" /></a></p>
<p>Flipping the board over we have one IC, a RX-2-G which is a reciever chip for this type of application although very little info is available on it from the usual sources. To the left of the chip is the circuity associated with the antenna. The TO-92 package transistors make up two H-bridge circuits, each using six transistors. H-bridges are used in motor control as the allow easy swapping of polarities on the motors so they can go backwards/forwards.</p>
<p>As i had no intention of keeping the controller, i didn&#8217;t need the RX-2-G but i did want to use the H-bridges so it was easies to desolder the clip and leave everything else in place. Tracing back the pins to the H-bridges i soldered wires onto the four pins the drive them. To control the motors all that is needed is to apply power to one of the pins for forwards, backwards, left and right.</p>
<p><a href="http://www.chet.ie/wp-content/uploads/2012/07/2012-07-10-17.38.58.jpg"><img class="alignnone size-large wp-image-64" title="2012-07-10 17.38.58" src="http://www.chet.ie/wp-content/uploads/2012/07/2012-07-10-17.38.58-1024x768.jpg" alt="" width="520" height="390" /></a></p>
<p>Not forgetting my original dreams of having lights i disassembled the headlights, drilled them out and put some 5mm LEDs in. As space is a bit tight i soldered the resistors in line with LED&#8217;s and covered everything in heatshrink.</p>
<p><a href="http://www.chet.ie/wp-content/uploads/2012/07/2012-07-10-17.39.30.jpg"><img class="alignnone size-large wp-image-65" title="2012-07-10 17.39.30" src="http://www.chet.ie/wp-content/uploads/2012/07/2012-07-10-17.39.30-1024x768.jpg" alt="" width="520" height="390" /></a></p>
<p>The car takes three AA batteries, giving a total of 4.5 volts. The arduino board i&#8217;m putting in is a 5 volt 16MHz nano which can work at 4.5 volts just fine. As mentioned space is tight so i had to remove all the presoldered headers from the arduino and the bluetooth module, fun! Excluding power and ground, six arduino pins are used, four for motor control, one for the lights and one for serial comms with the bluetooth module (we&#8217;re only receiving data, not sending too) Here it is with both boards in place.</p>
<p><a href="http://www.chet.ie/wp-content/uploads/2012/07/2012-07-10-17.56.14.jpg"><img class="alignnone size-large wp-image-66" title="2012-07-10 17.56.14" src="http://www.chet.ie/wp-content/uploads/2012/07/2012-07-10-17.56.14-1024x768.jpg" alt="" width="520" height="390" /></a></p>
<p>After getting the arduino coded and phone app done (these will be covered in another post) the first test proved unsuccessful. When trying to steer the wheels or move the bluetooth module was turning off. It turned out that the inrush current of the motor was causing the voltage to drop lower than the module could take, but just for a split second. To combat this i soldered a 1000uF cap (the biggest i have) across the batteries to try smooth out the voltage and it worked, the module isn&#8217;t resetting now. I found a nice little home for it beside the front motor.</p>
<p><a href="http://www.chet.ie/wp-content/uploads/2012/07/2012-07-11-15.55.45.jpg"><img class="alignnone size-large wp-image-67" title="2012-07-11 15.55.45" src="http://www.chet.ie/wp-content/uploads/2012/07/2012-07-11-15.55.45-1024x768.jpg" alt="" width="520" height="390" /></a></p>
<p>However when trying to move the forwards or backwards i.e. use the main motor the arduino is dropping out for a split second so obviously the voltage is still going that bit too low. Some further investigation is needed into just how low its dropping and what is needed to keep it up. I&#8217;ll update with any news.</p>
<p>Here is two pics showing a sneak at the app and the lights on and off.</p>
<p><a href="http://www.chet.ie/wp-content/uploads/2012/07/IMAG0227.jpg"><img class="alignnone size-large wp-image-68" title="IMAG0227" src="http://www.chet.ie/wp-content/uploads/2012/07/IMAG0227-1024x613.jpg" alt="" width="520" height="311" /></a></p>
<p>&nbsp;</p>
<p><a href="http://www.chet.ie/wp-content/uploads/2012/07/IMAG0228.jpg"><img class="alignnone size-large wp-image-69" title="IMAG0228" src="http://www.chet.ie/wp-content/uploads/2012/07/IMAG0228-1024x613.jpg" alt="" width="520" height="311" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.chet.ie/?feed=rss2&#038;p=70</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>
