<?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>TechnoFun.org</title>
	<atom:link href="http://www.technofun.org/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.technofun.org/blog</link>
	<description>Electronics just for the fun of it</description>
	<lastBuildDate>Sat, 24 Jul 2010 01:45:38 +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>Low cost Thermal IR Sensor for AVR microcontroller</title>
		<link>http://www.technofun.org/blog/2010/05/03/low-cost-ir-sensor-for-avr-microcontroller/</link>
		<comments>http://www.technofun.org/blog/2010/05/03/low-cost-ir-sensor-for-avr-microcontroller/#comments</comments>
		<pubDate>Tue, 04 May 2010 00:53:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[IR Sensor]]></category>
		<category><![CDATA[avr]]></category>
		<category><![CDATA[bascom]]></category>
		<category><![CDATA[Inferred Sensor]]></category>

		<guid isPermaLink="false">http://www.technofun.org/blog/?p=221</guid>
		<description><![CDATA[May 1, 2010

Overview: I needed a temperature sensor to monitor battery temperatures while they were being charged.  I happened to have one of these IRTs (Infrared thermometers)  from Harbor Freight Tools sitting by my bench. They cost about $20 USD.  I thought it would be fun to use an IR sensor for this purpose. After a little probing [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">May 1, 2010</p>
<p style="text-align: left;"><img class="alignleft size-full wp-image-231" title="IR Therm" src="http://www.technofun.org/blog/wp-content/uploads/2010/04/IR-Therm3.jpg" alt="" width="175" height="175" /></p>
<p style="text-align: left;"><strong>Overview: </strong>I needed a temperature sensor to monitor battery temperatures while they were being charged.  I happened to have one of these IRTs (Infrared thermometers)  from <a title="Harbor Freight Tools" href="http://www.harborfreight.com/non-contact-pocket-thermometer-93983.html">Harbor Freight Tools</a> sitting by my bench. They cost about $20 USD.  I thought it would be fun to use an IR sensor for this purpose. After a little probing around inside I found that the device had clock and data test points that were sending out data when ever the measure button was pressed. It took a couple of days to figure out the data format but it turns out to be pretty straight forward. The device sends out the ambient and inferred temperatures at about 2Hz.  The response time of the IR output is very good. If I put my hand in front of the sensor  the numbers change immediately. So using an Atmel ATMEGA168 and a small program written using Bascom I put together this temperature monitoring solution.  I will show the  interface and code to implement an IR and ambient temperature sensor with a serial IO.</p>
<p style="text-align: left;">
<p style="text-align: left;"><strong>Infrared thermometer:</strong></p>
<p>Some of the specs:</p>
<ul>
<li>Measurement range -33 to +110 degC</li>
<li>Resolution 0.1 degC</li>
<li>Accuracy +-2 degC</li>
<li>Field of view 1:1</li>
<li>Emissivity 0.95 fixed</li>
</ul>
<p>I purchased mine at harborfreight.com but they seem to be manufacture in China by ZyTemp.com (model TN105C is my guess). So maybe you can find them elsewhere as well.</p>
<p>When power is first applied the clock must be set before it will measure temperature. So I wired the two buttons to the uC so that I can trick  the devise into thinking the clock has been set.  Once in it&#8217;s normal operating mode the device is ready to measure Inferred temperature. When the measure button is pressed (by software in this case) it sends out 40 bit packets of data containing the IR and ambient temperatures continuously until the button is released.</p>
<p>Another nice feature is that if the measure button is released for more than 15 seconds the device goes into low power mode. If the uC is also put into powerdown then the  total current of the device and uC is about 65 micro Amps.  And because the IRT wakes up every 30 seconds and sends a packet with the ambient temperature it makes a nice low power temperature logger.</p>
<p><strong>Microcontroller board: </strong>I start by building a basic microcontroller board. Most of my designs start with a ATmega88 , ATmega168 or ATmega368. I had a mega168 on hand so that&#8217;s what is used here. Most of my designs also use a prototype board as shown here. The board in the next two pictures takes less than an hour to build and cost about $6 USD to complete. The pictures show the board before the IRT connections were added. Wiring is simplified because I use the on chip oscillator and a boot loader so none of the ISP wiring is needed. You will need a way to program the the boot loader on to the chip before it can be used in this way however. I also use a separate USB to TTL serial converter for programing so that is not needed on board.</p>
<p>Before plugging in the microcontroller or making connections to the IRT the board should be tested. Apply power (3 volts in this case) and check that power at the uC socket is correct. Then install the microcontroller and test serial connections by uploading a small test program. If all checks out then  continue to connect up the IRT.</p>
<div id="attachment_233" class="wp-caption alignnone" style="width: 361px"><a href="http://www.technofun.org/blog/wp-content/uploads/2010/04/uC-board-back.jpg"><img class="size-medium wp-image-233   " style="border: 4px solid black; margin-left: 4px; margin-right: 4px;" title="uC board back" src="http://www.technofun.org/blog/wp-content/uploads/2010/04/uC-board-back-298x300.jpg" alt="" width="351" height="283" /></a><p class="wp-caption-text">It checks out. Ready to program at this point.</p></div>
<div class="wp-caption alignnone" style="width: 350px"><a href="http://www.technofun.org/blog/wp-content/uploads/2010/04/uC-board-front.jpg"><img style="border: 4px solid black;" title="uC board front" src="http://www.technofun.org/blog/wp-content/uploads/2010/04/uC-board-front-300x218.jpg" alt="" width="340" height="276" /></a><p class="wp-caption-text">Ready to add 6 wires to the IR thermometer.</p></div>
<p><strong> </strong></p>
<p style="text-align: left;"><strong> </strong> <strong>Connections to IRT: </strong>I connect to the IRT with six wires through a six contact connector salvaged from a printer.  The connection points are conveniently labeled on the PCB of the IRT.</p>
<ol>
<li>Power labeled &#8220;V&#8221; on the PCB</li>
<li>Ground labeled &#8220;G&#8221; on the PCB</li>
<li>Clock labeled &#8220;C&#8221;</li>
<li>Data labeled &#8220;D&#8221;</li>
<li>Measure button labeled &#8220;Tp1&#8243;</li>
<li>Mode button labeled &#8220;A&#8221;</li>
</ol>
<div id="attachment_230" class="wp-caption alignright" style="width: 336px"><a href="http://www.technofun.org/blog/wp-content/uploads/2010/04/IR-Wires-cropped.jpg"><img class="size-medium wp-image-230 " style="border: 2px solid black;" title="IR Wires cropped" src="http://www.technofun.org/blog/wp-content/uploads/2010/04/IR-Wires-cropped-300x223.jpg" alt="" width="326" height="254" /></a><p class="wp-caption-text">Click on image to enlarge</p></div>
<p>The IRT circuit is very low power. I powered the IRT from one of the uC output pins so it could be turned on and off from software. This is handy for resetting the device and getting it to a known state.</p>
<p style="text-align: center;">
<p><strong>Files:</strong></p>
<p>Here is the bascom code and schematic. The code is small enough to compile with the demo version of Bascom.</p>
<p><a href="http://www.technofun.org/blog/downloads/IR4.zip">IR41.zip</a></p>
<div id="attachment_323" class="wp-caption alignleft" style="width: 310px"><a title="Finished" href="http://www.technofun.org/blog/wp-content/uploads/2010/05/IR-working1.jpg"><img class="size-medium wp-image-323" style="border: 2px solid black;" title="IR-working" src="http://www.technofun.org/blog/wp-content/uploads/2010/05/IR-working1-300x198.jpg" alt="" width="300" height="198" /></a><p class="wp-caption-text">Finished</p></div>
<p><strong><br />
</strong></p>
<div id="attachment_322" class="wp-caption alignleft" style="width: 310px"><a href="http://www.technofun.org/blog/wp-content/uploads/2010/05/Screen-shot.jpg"><img class="size-medium wp-image-322 " style="border: 2px solid black;" title="Screen-shot" src="http://www.technofun.org/blog/wp-content/uploads/2010/05/Screen-shot-300x242.jpg" alt="" width="300" height="242" /></a><p class="wp-caption-text">Screen Shot - 2 Hz update rate</p></div>
<p><a href="http://www.technofun.org/blog/wp-content/uploads/2010/05/IR-working.jpg"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.technofun.org/blog/2010/05/03/low-cost-ir-sensor-for-avr-microcontroller/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>RFM12 / RFM12B Calculator</title>
		<link>http://www.technofun.org/blog/2009/01/24/rfm12-rfm12b-calculator/</link>
		<comments>http://www.technofun.org/blog/2009/01/24/rfm12-rfm12b-calculator/#comments</comments>
		<pubDate>Sat, 24 Jan 2009 22:30:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[RFM12]]></category>

		<guid isPermaLink="false">http://www.technofun.org/blog/?p=120</guid>
		<description><![CDATA[




















February 12, 2009
This is a simple calculator to assist in determining the RFM12 commands. See my first post for info about the RFM12 modules. You will still need to study the data sheet but once you understand how to use these devices this calculator will make setting one up easier.
Tested on: Windows XP, Win98
August 12, [...]]]></description>
			<content:encoded><![CDATA[<div id="gmbabelFish" style="border: 1px solid black; margin: 0px; padding: 2px; left: -100px; top: -100px; visibility: hidden; display: none; width: auto; height: auto; position: absolute; background-color: #a8ecff; font-family: arial; font-size: 12px; color: #000000; text-align: left; z-index: 1410065406;">
<div style="border-bottom: 1px dotted black; padding-bottom: 2px; padding-top: 2px;"><img id="bffishImg" style="border: medium none; margin: 0px; cursor: pointer;" title="click to translate" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAOCAYAAAA8E3wEAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH1QUUDyoqJjAqRwAAAN1JREFUOMu1lMkVwyAMBYe0JGpCNUFNVk3k4AUwxPGS+ILxkzX8jyTH/Sfu9nrmJ3cXlnMASyWRPwd2d5XlHCBZn1BthcbRAdxTZQDI8k3mQzg11rhF+QZ9jdNOcQib6GFQYJYgCFucSRf6GsLU6wEY5yubTFqF2yq1vRwr3INXdQUWG+je1pELX4ED1wDyRAR0WfuAA9gloITyvsFMIMgYInYRqF6rO9Sqz9qkO5ilyo0o3YBwJ+6vrdQonxWUQllhXeHcb/wabMPkP2n81ocAIoLZrMqn/4y2RwP8DcQ+d6rT9ATiAAAAAElFTkSuQmCC" alt="" align="middle" /></div>
</div>
<div id="gmbabelFish" style="border: 1px solid black; margin: 0px; padding: 2px; left: -100px; top: -100px; visibility: hidden; display: none; width: auto; height: auto; position: absolute; background-color: #a8ecff; font-family: arial; font-size: 12px; color: #000000; text-align: left; z-index: 1410065406;">
<div style="border-bottom: 1px dotted black; padding-bottom: 2px; padding-top: 2px;"><img id="bffishImg" style="border: medium none; margin: 0px; cursor: pointer;" title="click to translate" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAOCAYAAAA8E3wEAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH1QUUDyoqJjAqRwAAAN1JREFUOMu1lMkVwyAMBYe0JGpCNUFNVk3k4AUwxPGS+ILxkzX8jyTH/Sfu9nrmJ3cXlnMASyWRPwd2d5XlHCBZn1BthcbRAdxTZQDI8k3mQzg11rhF+QZ9jdNOcQib6GFQYJYgCFucSRf6GsLU6wEY5yubTFqF2yq1vRwr3INXdQUWG+je1pELX4ED1wDyRAR0WfuAA9gloITyvsFMIMgYInYRqF6rO9Sqz9qkO5ilyo0o3YBwJ+6vrdQonxWUQllhXeHcb/wabMPkP2n81ocAIoLZrMqn/4y2RwP8DcQ+d6rT9ATiAAAAAElFTkSuQmCC" alt="" align="middle" /></div>
</div>
<div id="gmbabelFish" style="border: 1px solid black; margin: 0px; padding: 2px; left: -100px; top: -100px; visibility: hidden; display: none; width: auto; height: auto; position: absolute; background-color: #a8ecff; font-family: arial; font-size: 12px; color: #000000; text-align: left; z-index: 1410065406;">
<div style="border-bottom: 1px dotted black; padding-bottom: 2px; padding-top: 2px;"><img id="bffishImg" style="border: medium none; margin: 0px; cursor: pointer;" title="click to translate" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAOCAYAAAA8E3wEAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH1QUUDyoqJjAqRwAAAN1JREFUOMu1lMkVwyAMBYe0JGpCNUFNVk3k4AUwxPGS+ILxkzX8jyTH/Sfu9nrmJ3cXlnMASyWRPwd2d5XlHCBZn1BthcbRAdxTZQDI8k3mQzg11rhF+QZ9jdNOcQib6GFQYJYgCFucSRf6GsLU6wEY5yubTFqF2yq1vRwr3INXdQUWG+je1pELX4ED1wDyRAR0WfuAA9gloITyvsFMIMgYInYRqF6rO9Sqz9qkO5ilyo0o3YBwJ+6vrdQonxWUQllhXeHcb/wabMPkP2n81ocAIoLZrMqn/4y2RwP8DcQ+d6rT9ATiAAAAAElFTkSuQmCC" alt="" align="middle" /></div>
</div>
<div id="gmbabelFish" style="border: 1px solid black; margin: 0px; padding: 2px; left: -100px; top: -100px; visibility: hidden; display: none; width: auto; height: auto; position: absolute; background-color: #a8ecff; font-family: arial; font-size: 12px; color: #000000; text-align: left; z-index: 1410065406;">
<div style="border-bottom: 1px dotted black; padding-bottom: 2px; padding-top: 2px;"><img id="bffishImg" style="border: medium none; margin: 0px; cursor: pointer; display: none;" title="click to translate" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAOCAYAAAA8E3wEAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH1QUUDyoqJjAqRwAAAN1JREFUOMu1lMkVwyAMBYe0JGpCNUFNVk3k4AUwxPGS+ILxkzX8jyTH/Sfu9nrmJ3cXlnMASyWRPwd2d5XlHCBZn1BthcbRAdxTZQDI8k3mQzg11rhF+QZ9jdNOcQib6GFQYJYgCFucSRf6GsLU6wEY5yubTFqF2yq1vRwr3INXdQUWG+je1pELX4ED1wDyRAR0WfuAA9gloITyvsFMIMgYInYRqF6rO9Sqz9qkO5ilyo0o3YBwJ+6vrdQonxWUQllhXeHcb/wabMPkP2n81ocAIoLZrMqn/4y2RwP8DcQ+d6rT9ATiAAAAAElFTkSuQmCC" alt="" align="middle" /></div>
</div>
<div id="gmbabelFish" style="border: 1px solid black; margin: 0px; padding: 2px; left: -100px; top: -100px; visibility: hidden; display: none; width: auto; height: auto; position: absolute; background-color: #a8ecff; font-family: arial; font-size: 12px; color: #000000; text-align: left; z-index: 1410065406;">
<div style="border-bottom: 1px dotted black; padding-bottom: 2px; padding-top: 2px;"><img id="bffishImg" style="border: medium none; margin: 0px; cursor: pointer;" title="click to translate" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAOCAYAAAA8E3wEAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH1QUUDyoqJjAqRwAAAN1JREFUOMu1lMkVwyAMBYe0JGpCNUFNVk3k4AUwxPGS+ILxkzX8jyTH/Sfu9nrmJ3cXlnMASyWRPwd2d5XlHCBZn1BthcbRAdxTZQDI8k3mQzg11rhF+QZ9jdNOcQib6GFQYJYgCFucSRf6GsLU6wEY5yubTFqF2yq1vRwr3INXdQUWG+je1pELX4ED1wDyRAR0WfuAA9gloITyvsFMIMgYInYRqF6rO9Sqz9qkO5ilyo0o3YBwJ+6vrdQonxWUQllhXeHcb/wabMPkP2n81ocAIoLZrMqn/4y2RwP8DcQ+d6rT9ATiAAAAAElFTkSuQmCC" alt="" align="middle" /></div>
</div>
<div id="gmbabelFish" style="border: 1px solid black; margin: 0px; padding: 2px; left: -100px; top: -100px; visibility: hidden; display: none; width: auto; height: auto; position: absolute; background-color: #a8ecff; font-family: arial; font-size: 12px; color: #000000; text-align: left; z-index: 1410065406;">
<div style="border-bottom: 1px dotted black; padding-bottom: 2px; padding-top: 2px;"><img id="bffishImg" style="border: medium none; margin: 0px; cursor: pointer; display: none;" title="click to translate" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAOCAYAAAA8E3wEAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH1QUUDyoqJjAqRwAAAN1JREFUOMu1lMkVwyAMBYe0JGpCNUFNVk3k4AUwxPGS+ILxkzX8jyTH/Sfu9nrmJ3cXlnMASyWRPwd2d5XlHCBZn1BthcbRAdxTZQDI8k3mQzg11rhF+QZ9jdNOcQib6GFQYJYgCFucSRf6GsLU6wEY5yubTFqF2yq1vRwr3INXdQUWG+je1pELX4ED1wDyRAR0WfuAA9gloITyvsFMIMgYInYRqF6rO9Sqz9qkO5ilyo0o3YBwJ+6vrdQonxWUQllhXeHcb/wabMPkP2n81ocAIoLZrMqn/4y2RwP8DcQ+d6rT9ATiAAAAAElFTkSuQmCC" alt="" align="middle" /></div>
</div>
<div id="gmbabelFish" style="border: 1px solid black; margin: 0px; padding: 2px; left: -100px; top: -100px; visibility: hidden; display: none; width: auto; height: auto; position: absolute; background-color: #a8ecff; font-family: arial; font-size: 12px; color: #000000; text-align: left; z-index: 1410065406;">
<div style="border-bottom: 1px dotted black; padding-bottom: 2px; padding-top: 2px;"><img id="bffishImg" style="border: medium none; margin: 0px; cursor: pointer;" title="click to translate" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAOCAYAAAA8E3wEAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH1QUUDyoqJjAqRwAAAN1JREFUOMu1lMkVwyAMBYe0JGpCNUFNVk3k4AUwxPGS+ILxkzX8jyTH/Sfu9nrmJ3cXlnMASyWRPwd2d5XlHCBZn1BthcbRAdxTZQDI8k3mQzg11rhF+QZ9jdNOcQib6GFQYJYgCFucSRf6GsLU6wEY5yubTFqF2yq1vRwr3INXdQUWG+je1pELX4ED1wDyRAR0WfuAA9gloITyvsFMIMgYInYRqF6rO9Sqz9qkO5ilyo0o3YBwJ+6vrdQonxWUQllhXeHcb/wabMPkP2n81ocAIoLZrMqn/4y2RwP8DcQ+d6rT9ATiAAAAAElFTkSuQmCC" alt="" align="middle" /></div>
</div>
<p>February 12, 2009</p>
<p>This is a simple calculator to assist in determining the RFM12 commands. See my first post for info about the<a href="http://www.technofun.org/blog/2008/07/22/rmf12b-interfaced-to-an-atmel-avr-atmega88-running-bascom-code/"> RFM12 modules</a>. You will still need to study the <a href="http://www.hoperf.com/pdf/RF12.pdf">data sheet</a> but once you understand how to use these devices this calculator will make setting one up easier.</p>
<p>Tested on: Windows XP, Win98</p>
<p><strong>August 12, 2009</strong></p>
<p><strong>NEW VERSION.</strong></p>
<p>Changes:</p>
<p>1. Added a Save and Load option. Setting can now be saved and reloaded.</p>
<p>2. Fixed a bug in the PLL command.</p>
<p>3. Fixed a bug in the 10MHz uC Clk command.</p>
<p>To install the new version uninstall the old version first.</p>
<p>Download here: <a title="RFM12Calc_install_1.1.exe" href="http://www.technofun.org/blog/downloads/RFM12Calc_install_1.1.exe">RFM12Calc_install_1.1.exe<br />
</a></p>
<p><img src="http://www.technofun.org/RFM12/calc.jpg" alt="RFM12 Command Calculator" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.technofun.org/blog/2009/01/24/rfm12-rfm12b-calculator/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
		<item>
		<title>RMF12B interfaced to an Atmel AVR ATmega88 running Bascom code</title>
		<link>http://www.technofun.org/blog/2008/07/22/rmf12b-interfaced-to-an-atmel-avr-atmega88-running-bascom-code/</link>
		<comments>http://www.technofun.org/blog/2008/07/22/rmf12b-interfaced-to-an-atmel-avr-atmega88-running-bascom-code/#comments</comments>
		<pubDate>Wed, 23 Jul 2008 00:20:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[RFM12]]></category>

		<guid isPermaLink="false">http://www.technofun.org/blog/?p=5</guid>
		<description><![CDATA[July 22, 2008
The first project I want to share was used as a learning tool to get to know how to use the HopeRF RFM12 / RFM12B wireless transceiver modules. This post will also be a learning tool for writing a post. So please excuse any short comings of this first attempt at blogging.
This picture [...]]]></description>
			<content:encoded><![CDATA[<p>July 22, 2008</p>
<p>The first project I want to share was used as a learning tool to get to know how to use the HopeRF RFM12 / RFM12B wireless transceiver modules. This post will also be a learning tool for writing a post. So please excuse any short comings of this first attempt at blogging.</p>
<p>This picture shows the RFM12 with a quarter for scale.</p>
<p><img class="alignnone" title="Front_RFM12" src="http://www.technofun.org/RFM12/RFM12_w_quarter.jpg" alt="" width="106" height="96" /></p>
<p>And the connector side looks like this.</p>
<p><img class="alignnone" title="Back of RFM12" src="http://www.technofun.org/RFM12/RFM12_back.jpg" alt="" width="118" height="68" /></p>
<p><span id="more-5"></span></p>
<p>The RFM12 modules are small, low cost(about $8.00 US), short range (150 &#8211; 200M claimed), data transceivers. They use the Serial Peripheral Interface (SPI) bus to talk to a micro controller. I’ve interfaced them to an Atmel ATmega88 micro controller programed with the MCS Bascom-avr compiler. My test boards are very simple, consisting of little more then the micro controller and an RFM12 module. Two of these test boards are needed for this project. I will not be showing complete schematics, I&#8217;m assuming that the reader can get the micro controller up and running and talking to a PC over a serial line. The challenging part for me was writing the code and its that part that I want to share. There are dozens of avr boards out there that this work could be applied to.</p>
<p>Here is a picture of one of my test boards.</p>
<p><img class="alignnone" title="Board" src="http://www.technofun.org/RFM12/RFM12-board.jpg" alt="" width="254" height="210" /></p>
<h4>The Hardware:</h4>
<p>The pin spacing on the RF modules are 2mm on center, not very convenient for connecting to the prototype boards I was using. I was able to modify a connector from an old printer to adapt the modules to my boards. You can see this in the picture above. There may be adapter boards or ribbon connectors that would do as well or better. Or you could solder to the pins directly, but if the part failed that could end up being a big headache. In the polling mode of operation that is being used here only four wires are needed. <span style="text-decoration: line-through;">I am using one additional connection, the nRES signal, which is optional. It allows for the software to reset the RFM12 modules</span>. <span style="text-decoration: line-through;">Now that the code is working well there is little need for the nRES signal</span>. Here is a link to a <a title="RFM12 sch" href="http://www.technofun.org/blog/downloads/RFM12%20Schematic" target="_self">schematic</a> showing the RFM12B connections.  Also the nSEL and nRES signals can be reassigned to any free pins in your design. Just remember to change the alias lines in the code to reflect those changes. The design uses the hardware SPI so those three pin assignments are fixed. One more thing about the hardware to note is that I&#8217;m using a boot loader to program the AVR controller not a In System Programmer (ISP). If you are using an ISP it will be connected to the same pins as the RFM12 module so it might be necessary to add jumpers to isolate the module during programming.</p>
<h4>The Software:</h4>
<p>The software is written in MCS electronics BASCOM-AVR compiler.  It was written as a test program to get the transceivers up and running. This code is not meant to be a complete RF serial link.  It is for testing and evaluating the RFM12 modules only. However with the addition of error detection and correction, I believe a reliable RF link could be relized. In future project here at TechnoFun.org I well be implementing some type of more complete serial protocol using these devices. Here is a link to the Bascom <a title="RFM12 Code" href="http://www.technofun.org/blog/downloads/RFM12%20code">RFM12 code</a>. Frequency can be set by changing the &#8220;const  Fc = 435.00&#8243; line of the code. And the Payload size (no. of data bytes transmitted) can be changed with the &#8220;const Payload_Size = 32&#8243; line. Once you get the code up and running typing any keys followed by the &lt;enter&gt; key will Transmit that data. Pressing the &lt;esc&gt; key in your terminal program will put the uC in command mode.</p>
<h4>Commands:</h4>
<ol>
<li>Type any text, up to the Payload length,  followed by &lt;enter&gt; to transmit data.</li>
<li>&lt;esc&gt; Enter command mode.</li>
<li>&lt;c&gt;  Input a HEX command WORD value to send to RFM12. For example enter: c0e0 &lt;enter&gt; will set the ouput CLK to 10MHZ.</li>
<li>&lt;e&gt;  Toggle Echo. Useful for testing the range of a set of modules. Setup one module to echo and the other to Transmit a beacon. The code will not allow both echo and beacon to be on at the same time.</li>
<li>&lt;b&gt; Toggle the Beacon. Transmit a test signal continuously and check for a reply.</li>
<li>&lt;u&gt; Upload a new program to the uC. Only works if you are using a bootloader.</li>
</ol>
<p>Good Luck and if you have any question please feel free to comment.</p>
<h4><a href="http://www.technofun.org/blog/downloads/RFM12%20Schematic">Schematic</a></h4>
<h4><a href="http://www.technofun.org/blog/downloads/RFM12%20code">Example 1 Source Code</a></h4>
<p><strong><a href="http://www.technofun.org/blog/downloads/RFM12%20Source%202">Example 2 Source Code</a></strong></p>
<h4>June 28,2010 UPDATE:</h4>
<p>I have received several emails from people who have had trouble running the above two examples of RFM12 code. So here are three more examples that are much simpler to use and debug, I hope. Try these first then if your hardware is working you can try the examples above if you like.</p>
<p><a href="http://www.technofun.org/blog/wp-content/uploads/2008/07/Simple-Tx-101.bas_.txt">Simple Tx 101.bas</a></p>
<p><a href="http://www.technofun.org/blog/wp-content/uploads/2008/07/Simple-Rx-101-using-polling.bas_.txt">Simple Rx 101 using polling.bas</a></p>
<p>The last example uses interrupts to get the Rx data. For this example connect nIRQ from the RFM12 to INT0 of your AVR.</p>
<p><a href="http://www.technofun.org/blog/wp-content/uploads/2008/07/Simple-Rx-101-using-Interrupts-.bas_.txt">Simple Rx 101 using interrupts.bas</a></p>
<h4>Data Sheets:</h4>
<p><a title="RFM12 chip data sheet" href="http://www.hoperf.com/pdf/RF12.pdf" target="_blank">RF12 chip data sheet </a>- This has the most details about the device.<br />
<a title="RFM12 Module data sheet" href="http://www.hoperf.com/pdf/RFM12.pdf" target="_blank">RFM12 Module data sheet</a></p>
<p><a title="RFM12 Programming guide" href="http://www.hoperf.com/pdf/RF12_code.pdf" target="_blank"> RFM12 code data sheet</a><a title="RFM12 chip" href="http://www.hoperf.com/pdf/RFM12B.pdf"></a></p>
<p><a title="RFM12 chip" href="http://www.hoperf.com/pdf/RFM12B.pdf" target="_blank">RFM12B chip data sheet</a></p>
<p><a title="RFM12B Module" href="http://www.hoperf.com/pdf/RFM12B.pdf" target="_blank">RFM12B Module data sheet</a></p>
<h4>Other Useful Links:</h4>
<p><a href="http://blog.everythingrobotics.com/2008/06/23/rfm12b-bit-rates-and-throughput/" target="_blank">Good info about using the RFM12 modules</a> by Stephen Eaton. Many Thanks to Stephen for his RFM12 info.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.technofun.org/blog/2008/07/22/rmf12b-interfaced-to-an-atmel-avr-atmega88-running-bascom-code/feed/</wfw:commentRss>
		<slash:comments>54</slash:comments>
		</item>
	</channel>
</rss>
