Skip to main content

Softrock Ensemble VHF tuning

This post has a specific audience in mind, so unless you have, or are interested in a Softrock Ensemble VHF receiver, you'll be bored. You've been warned :) There are a few radio bands that are interesting near the ham 2meter band. NOAA weather satellites send images using APT at and around 137Mhz and there are weather broadcasts at 162.5. There was a question on the mailing list for the Softrock about whether it could be tuned to receive signals in all of these bands without re-tuning. This post is simply documenting my experimentation with the front end. I'm sampling the signal using an oscilloscope probe with the 10x setting and inserting the signal from the tracking generator connected to the antenna port. It's not really possible to measure the precise insertion loss absolutely, so I'll measure it relative to the baseline of front end tuned for 2 meters.

Tuned for 2 meters

To begin the testing, I tuned as best I can to the 2M band. The filter shape isn't as flat as I would like, but it's the best I could do.

Tuned for NOAA APT transmissions

It was a little easier to tune the front end for NOAA APT transmissions. I got a better filter shape, and about 5 dB better average insertion loss.

Tuned for weather radio

Tuning for weather radio wasn't that bad either. The average insertion loss is about equal to what I got for 2 meters.

Compromise tuning

Finally, if you're interesting in receiving signals from throughout the band, it's possible strike a compromise. You're just about always going to get a peaked response, so I placed the lower peak at 137 Mhz and the upper at 165.The 2 meter ham band is somewhere in the middle. The peaks at 137 and 165 are5-10 dB below the baseline. The 2 meter band is a little worse at about 20 dB below the baseline. So, it's possible to get a somewhat broadband response at the fronted at the expense of some signal strength. It may be possible to mitigate some of this if you use a low noise preamplifier.

SKY65116 Amplifier

Amplifier breakout board

I've finally gotten around to assembling a breakout board for the Skyworks SKY65116 UHF amplifier. It's really amazing how the state of the art in RF ICs has advanced. They can still be on the expensive side ($6 at digikey),but still relatively cheap when you consider the cost of all the support parts that it takes to build an amplifier from a RF transistor. This particular amplifier has a 50 ohm input and output, and 35dB of gain. It works from 390Mhz to 500Mhz, which means its perfect for the 70cm ham band. The breakout board is stupid simple, copied directly from the evaluation board schematic in the datasheet, but I'll include schematic and design files anyway.

Source for the amplifier test

This is the video transmitter from my first personvideoexperiments. The performance was pretty terrible, even after I tested it using different receive antennas. I've even purchased a receive-side amplifier to try, but haven't done anything with it yet. Anyway, the transmitter had a built-in antenna, so I wasn't sure how I was going to add an amplifier. I ended up assuming that the output would be roughly compatible with an 50 ohm load. I unsoldered the antenna and installed a bit of thin coax to the antenna port. I scratched off some of the solder mask on either side of the board near the antenna port to make sure I had a solid electrical and mechanical ground connection. The transmitter is pretty crappy, and the prices you can find online are COMPLETELY RIDICULOUS! I wouldn't pay more than $20 for it. I think that's about what I paid, it was on clearance.

Amplifier test configuration

Testing configuration

This image is the testing configuration I used. The camera, power board and transmitter are in the top of the image, and are exactly as I used them for first person video. The added coax can be seen going into the amplifier on the left. Coming out of the amplifier is the cable going to the oscilloscope or spectrum analyzer. The amplifier wasn't inline all the time, though. I measured the output power from the transmitter at about 25mV into 50 ohms using the oscilloscope. Using Minicircuits' handy table that comes out to be about .01 mW, or -19 dBm. A measurement from a spectrum analyzer verifies the -19 dBm measurement from the o'scope (see below for image).

NTSC modulated spectrum (click for source)

I've attached a very nice graphic from wikipedia that describes the components of modulated NTSC video. There is something happening here that isn't obvious, so I'll explain it. In the spectrum analyzer image, below, you'll notice thatI've labeled the luminance and chrominance carriers. The luminance carrier is really the main carrier for the entire signal. It comes from black and whiteTV era. There are significant DC components in NTSC video, so this carrier is very important. Notice, in the graphic above, that the luma carrier is 1.25Mhz above the lower edge of the band. This is because NTSC video uses what's called VSB, or vestigial side band, which means that the lower half of the signal is attenuated. This reduces the spectrum necessary to transmit video. The choice was made to include the carrier and 1 Mhz with of lower sideband while removing the rest. Later, when color TV was added, they needed a way to encode color. This is done by adding another carrier and encoding hue and saturation by modulating the phase and amplitude of this carrier. All this is explained at length, and probably much better, in the wikipedia article on NTSC.

Source spectrum

In the spectrum image I've included above, it's clear that the little transmitter uses AM rather than VSB. You can tell because AM modulated signals are always symmetrical with respect to the carrier. If it was VSB, the spectrum on the left side of the carrier would be suppressed. You may notice that the left and right side don't look 100% alike. This is because it takes time for the analyzer to sweep the band (it does this 30 times a second), and it will be analyzing the spectrum of a different part of the image as it scans.

Source signal through unpowered amplifier

Well, that was an unexpected tangent! Back to the amplifier… In the above image I have the amplifier in the signal path from the source to the analyzer.It's disconnected from any power. I'm a little off on the "-60 dBm" text, it's closer to -64 dBm. I was interested in seeing how much RF would leak through an unpowered amp. It appears that the amp provides a little more than 40 dB of forward isolation between the input and output when it's unpowered.

Amplifier powered on

Finally, this is the spectrum when the amplifier is powered on. I had to install 40 dB of attenuation on the analyzer to capture this image. The peak of the carrier is almost 5 dB lower than the top line, so it's about 36 dB stronger than the input. This is inline with expectation, as the amp specifies+35 dB gain. The resulting signal is +15 dBm, which is a modest 32 mW of power. The hope is that through a better antenna and some amplification I can get better performance from the video link.

A word about the legal implications. Ham radio people are notoriously concerned with the rules of everything they do, so I feel obligated to mention them. In the U.S., at least, 434 Mhz is a commonly used ATV (amateur T.V., or "fast scan TV") frequency. There is some concern due to the proximity to the "satellite only" frequency band of 435 Mhz to 438 Mhz. This means that the carrier is sometimes shifted to 433.92 Mhz, as this transmitter is. Some of the sidebands still end up in the satellite only band, but with much lower power. Because this amplifier only outputs +15 dBm I'm very unlikely to upset anyone with its use, though I should think about adding an overlay with my call sign to the video at this power level. Maybe I'll have a new 8-bit microcontroller project…

[eagle files] [gerber files]

QFN Reflow Soldering

My, my… Than's TINY

I decided to try my hand at QFN soldering yesterday. I was really nervous about it, it just seemed like the kind of thing only a robot or an expert can really pull-off. I've seen it done many places online and everyone said that it was doable. Well, here's another voice in the chorus: It is possible with hobby-grade equipment. I've written aboutreflow soldering before, so I'm not going to re-hash that discussion, but that is the technique that I used. As you can see in the image above, I used a professionally manufactured PCB of a design of mine. This is a breakout/prototype adapter for a Skyworks RF switch.The circuit is remarkably simple, there are two control lines that select which inputs are routed to the common (RFC on the silkscreen). There are a fewDC blocking caps on each of the RF lines, and that's it!

Solder paste quantity

In this image, I'm showing how much solder paste I used. As you can probably see, I made no attempt to keep it contained to any particular location. I assumed that surface tension and the solder mask would help out in this regard. This is the first board I did, I used somewhat less solder on the second one.

Solder bridges

Here is the result of the first board. You can see some serious solder bridges on the chip there. They were easily removed with solder wick.

Near perfect solder

This is the second board I tried. This time I used a little less solder. You can see that there aren't any bridges (you'll have to take me at my word that there aren't any on the other side). I used some solder wick to clean up the solder anyway, as I don't like that they're bulging out a little. As a final note about this image, you should be able to see a very small solder ball on the left side of the chip. This is very common with reflow. The extra solder paste under the IC was squeezed out by surface tension. I usually remove these with a razor blade.

Trying another kind of QFN package

I had another board and IC that I'm working on, also a QFN, that I thought I'd try. In this case, it's a 3x3 package with huge spacing between pads. This one was much easier to handle. You can see that I still have some solder overflow.The solder ball on the right was removed with the razor blade, and the near one was removed with solder wick.

Soldering QFN is actually kinda fun!

Now that I've tried it a few times, I can say that soldering QFN isn't nearly as scary as I thought it would be. A steady hand and some method of soldering other than an iron is all that's really necessary. I imagine this would work with the skillet or any hot air method.

The last image is a skyworks 1.2W RF power amplifier breakout/prototype board.This will be the subject of a future post. Stay tuned!

Resurrected LED panels

I just finished building a frame for some resurrected LED panels from a decommissioned super computer. The computer was a CM-5 by Thinking Machines. It has been used at the College of Oceanography and Atmospheric Science at Oregon State for a fairly long while. A few weeks ago, its time came, and we surplussed it. I was able to get the light panels and built a frame for them at my house. This post describes a little about the process and includes some trivia about the CM-5and the panels themselves.

The CM-5 in name alone probably doesn't resonate with many people, but hopefully you can recognize it in the background of this photo from JurassicPark:

Now, I don't want to slide my glasses up my nose an snort, but the way they're setup in this image is not at all like how would they be setup in real life.The installation engineer that setup ours had to leave half-way through to setup the Jurassic Park set. These are simply the empty chassises with the light panels. The CM-5 was also 3rd in this list of Top Ten Coolest and MostPowerful Supercomputers. The previous link has an image that shows how it would actually be setup. On top of the machine there are huge bundles of wires.

Anyway, I'm not writing this post to discuss the history of the CM-5, at least not that much, so I'll get on with the LED panel build. It's a really simple idea; I laid them out on the floor and measured the dimensions of their perimeter. Using these measurements, I built a simple wooden frame out of 1x2″maple. The width of the panel is considerably less than the width between studs in my wall, so I had to secure it to a single stud on the top and bottom of the frame.

Bottom of frame and backside of one module

The location I chose for the frame covered an outlet; This not only made it easier to route the cord (I didn't have to make a cutout), but it also looks much cleaner. Of course, I would need a way to turn it on and off. To do this,I chose an X10 transciever/switch. I covered the antenna with shrink-wrap to avoid shorting anything out. Also, I had to turn the outlet in the wall upside down because the X10 module has the plug coming out on the bottom.

X10 module installed in a reversed outlet

The next challenge was securing the power supplies into the frame. The frame was just thick enough to accommodate the supplies, but it left me little room to attach it.

Power supply against frame

There were mounting holes and a small recess in the heat sink, but the holes were far too large to thread to the hardware I was using. I tried to drill and tap new holes for 4-40 hardware.

It broke my tap!

Unfortunately, the heat sink is made of some bizarre metal that really doesn't like to be tapped (turns out it's aluminum). It felt very gummy, if that makes any sense. When I tried to unscrew the tap it broke right off. I tried a few different things, including sharpening the other, broken, end of the tap into a new tip. Really none of these things worked. I was practicing on a bad supply, and I decided to just take it apart and see if there was anything elseI could do. When I did, I discovered that they used some strange self-tapping4-40 screws.

Self-tapping 4-40 screws

These screws mostly did the trick.

Mounted power supplies

Once the power supplies were mounted, I attached the frame to the wall, and began wiring. Notice, in the image above, that the output ends of both supplies are near each other. This is because I wanted to use the factory wiring harnesses from the CM-5.

Low voltage DC wiring

Everything on that machine was overbuilt. Each of those supplies can source 30Amps at 5 Volts. Each panel requires in the neighborhood 5-7 Amps, so there is almost 3x over provisioning. Not only are the supplies overbuilt, but the cabling is also a little over-the-top. It's really a testament to the scale of the whole machine. While talking about it to those that used it, I often heard"when something costs $20 million, you expect a certain level of quality."

Testing

Here I am testing the final wiring for a single LED module. The bottom rows are dark, not because they aren't on, but because they're painted black. When it's installed in the computer, you can't see these rows because they're covered up, so for some reason they just painted them black. If you look close, you can see though the paint a bit at and see the lights.

Narrow margins

Here, you can see just how tight the fit of everything in the frame really is.There is barely enough room for the power connectors and cables, let alone the power supplies and X10 module.

installing modules

The modules install simply and cover up all the wiring and electronics.

All finished!

Finally, we're all done!! The whole system looks amazing. One factoid that I find pretty interesting is that the "random and pleasing mode #7″ produces exactly the same "random" pattern on every module! Next on the docket:reverse-engineering them to display messages and designs! Also, make sure to see my gallery of the process of surplussing the computer.

Update:

Someone asked about the details of the silkscreen on the LED panel. Hopefully this image clearly displays how it was made.

20130719-210028.jpg

Update 2:

I found some video at work of the CM5 (really, a CM500, but that's another story) being installed. I cut it down a bit, it was about an hour long. I think that it was installed in 1995, but I'm not sure of the date more precisely than that.

At 4:29, you can see the edges of the CPU board. They each have 8 banks of 4LEDs. I took a picture of the edge of the board for those that are curious.

Edge of theCM5 CPU board

Edge of the CM5 CPU board

Transceiver enclosures

Transciever enclosure

It has been a while since I finished the transceiver modules, and I how now used them in an actual application. But, before I talk about that, I'd like to show some pictures of the process I used to put them into enclosures. I had some of these cast aluminum enclosures lying around, so I thought I'd use them. They're a little on the heavy side, as the completed weight is around half a pound, but it's well within the carrying capacity of myKadet.Before diving into the process of cutting the holes, I want to show some images of the transceiver board with the RFI fence installation process.

Cutting copper sheet

For use with the spectrum analyzer project, I found some sheet copper at the craft store. It was sold at a local crafts store, and I think it was for etching. I chose the thickest one they had. So far, the best way I've found to cut it is using an exact and straight edge. I tried scissors, and it didn't really work.

RFI Fence

Once I had a strip of copper cut, I cut openings for the power and control traces and soldered it onto the PCB. I also soldered it onto the SMA connector. Once all that was finished, I soldered on a lid. Lots of solder flux helps here.

Once the board was prepared, both by soldering on a fence and replacing the pin header with a right-angle one, I began to prepare the enclosure. I was intending to drill a hole for the SMA connector, then cut a hole for the digital connection. The SMA connector hole was trivial to make, though the connector I soldered onto the board was a little short. I ended up having to use an O-Ring from the hardware store (look in the plumbing section) to hold it in. When an antenna or cable is screwed on the O-Ring compresses, having the nice side-effect of sealing it.

DB-9 template

For the digital connection, I decided on using a DB-9 connector. I figured it was a prolific connector, so I should have lots of connectors laying around.That didn't turn out to be as helpful as I had hoped, but I'll get into that later. To create nice holes for the DB-9 connectors I decided that I could use an old PCI bracket as a template. I lined the bracket up against the side of the enclosure and traced it. On the black box, I traced it using a knife, and on the grey box I used sharpie.

DB-9 template using sharpie

Once the outline was traced onto the box, I drilled holes for the retention screws. Then, I drilled out as much as I could of the trapezoid shaped interior. I most used the drill press, then the dremel with a router/cutter bit. I made sure to leave a margin inside the perimeter to remove with the files. I had avoided purchasing a set of jewelers files for a while, I think I assumed that they were expensive. They're not, you should get a set.

Finished penetration

In the photo above, you can see the finished penetration for the DB-9. I beveled the inside edge to make room for the fillet on the connector that I had. The black box got a male DB-9, and the grey box got a female one. The oles need to be about the same size, as the male shroud always has to fit over the female connector body.

DB-9 connector installed

In addition to the RF and digital connectors, I needed a way to securely mount the internal circuit boards. The way I chose to do this was first to drill holes in the bottom of the box, then "countersink" some screws into it. I have countersink in quotes because I don't have a countersink bit, so I used a larger drill bit. You can see the results of this in the headline picture of this post. Though I think it looks pretty good, I still decided to buy a drill& tap for 4-40 screws after building the black box. For the grey box, I used the tap and screwed directly into the box. This requires slightly less hardware and looks pretty good, I think.

]

Breadboard transceiver circuit

For whatever reason, the board I built for the black box using some veroboard-style construction didn't work the same as the breadboard. Because I was under time constraint (I was planning on flying one of the transceivers over the weekend. I decided to put it back on the breadboard and use it as the basestation. This version uses an FTDI cable to connect to my computer.

]

Flyable transceiver module

For the grey box, I used an extra ATMega48 breakout board I had. This one worked just fine in the enclosure, so I flew it. I also built a power regulation/distribution board, seen on the right of the photo. This concludes this article. Now that I've got at least one flight worthy transceiver I can test them in flight. That'll be detailed on a future post.

Brushless Mud Bug

Mud Bug flying

Mud Bug flying

I maiden'd my new plane, the Mud Bug, last weekend! I was a ton of fun. Now,I'll tell you all about building it, and converting it to use brushless motors.

laser cut precision

Laser cut parts are a joy to use

All the parts in the kit are laser cut, and fit perfectly. The design of the plane is such that the shape of the wing is created almost exclusively by bending the wing's top skin into shape. There are only a few ribs, and no bottom skin at all. It's remarkably light.

Motor stick mount

Motor stick mount

The kit calls for a stick-mount geared, brushed motor. These are getting pretty out-dated, and aren't very efficient. I really like working with brushless motors, so I had to devise a way to mount it. I chose the E-flight park 250 motor because it was pretty inexpensive and only a few dollars and grams more than the park 180. It's possible to mount it inside of a carbon fiber tube (using glue), but you need to use their tube, and it wasn't in stock. I just decided to use the cross-mount adapter and make a plywood plate that mounts on the stick. Where the stick mounts, I added another, smaller, piece of ply to help support it. It ended up working perfectly.

Front scab plate

I cut a pair of sheets of 1/64″ ply to use as scab plates on the balsa firewall and fuselage parts. I had read online that those pieces of the original kit were somewhat weak.

back scabplate

back scab plate

This is the scab plate on the back of the fuselage portion of the motor mounting. These are only there to spread out the loads transmitted from the stick to these parts.

Park 250mounted

Park250 mounted

The motor mounting process went beautifully. At first everything fit so tightly that I didn't need any glue. Half way through the first flight it had vibrated enough to polish the wood parts that they could slip. I just put a few drops of thin CA, and it was fine.

Inflight

Inflight

The flights went great. That park 250 has waaaaay more power than you need with a 7x6 APC Slo-fly prop (which is the only prop I've tried). The plane flies easily at 1/4 throttle. At full throttle it gets very small very fast.When flying slowly, it's also very agile. It's possible to complete an entire circuit in 1/3 the length of the runway.

first landing

first landing

Even though it sports GIANT tires, it's still easy to nose-over during landing in even short grass. Given that it has almost no mass, no damage was sustained.

I give it 2 thumbs up!

Reverse Geocache

]

Finished puzzle box

This project was inspired by the "Reverse Geocache PuzzleBox", an idea that has been duplicated a few times. For Christmas this year, I drew my brother-in-law,Scott. I know that he appreciates hand-made gifts, and my idea of hand make is almost always electronics related. I thought for a while about a gift I could give that was hand-made, but appropriate to his interests. While I wouldn't say he's interested in Geocaching, per se, but I know he will appreciate the destination.

That said, I began by designing the electronics. In the original puzzle box, the designer used a commercial Pololu "soft" switch and an Arduino. I decided to make everything custom, including a custom soft power switch. When I say soft power switch, I mean a button you press to turn the system on. When it's time shut the system down, the controller can turn the power off. The circuit I found was listed on this forum. It was an O.K.start, but left something to be desired. The given resistor values were all wrong for my application. I think it was intended for a lower current applications, and the servo powering the latch draws a lot of power, relatively speaking. Also, I'm not sure whether it it was an error on my part, but when the PIC shuts down, the output pins go into "high impedance" mode, as if they're disconnected. I had to add another resistor from the control wire to ground to hold it low while the system is off, otherwise it would never shut down. In the future, I think I'll approach it another way.

Reverse Geocache schematic

The remainder of the circuit is pretty straightforward. There is a connector for the GPS, servo, programming header, and LCD. I decided to use the 4-bit interface to the LCD to save some pins. I designed a PCB from the schematic with home fabrication in mind. While I don't think the through-hole construction is necessary for homebuilding, it's easier for some people. I caution you that the sparkfun outline for the 16x2 LCD isn't quite right. The mounting holes didn't line up. Also, I didn't have the pins for the servo correct, I had to move them around on the connector (5v and Ground are reversed). Finally, another error in the design was that I didn't notice until after I made the PCB that the 4-bit interface to the LCD is on pins D3-D7, notD0-D1. I used a few wires to bridge over to those pins to fix it.

Reverse Geocache PCB

Once the design was complete, I made the board using the toner transfer method and etched it using ferric chloride. I've refined my toner transfer technique recently, and I've been having really good luck. I'll write a post about it soon. Drilling and assembling the PCB was otherwise unremarkable.

Prototyping and programming

It took a few days to program the microcontroller and test the electronics.There was one significant stumbling block that wasted an entire day. Hopefully google indexes this so other people don't have the same pain I did. Here it is: If you're having trouble with the USART on a PIC microcontroller, whether you're using PICC, Microchip C, or Assembler, the Overrun flag stops the USART dead in it's tracks. I recommend that every time you poll the port, check the flag and reset it. This is likely the problem if you can receive 2 bytes, then nothing. Also, the transmitter will continue working.

Latitude/Longitude distance equation (r means radians)

This was the first time I used floating point math on a microcontroller, and I have to say I was a little impressed. I use the distance equations from theaviation formulary. I think it is an interesting equation because it accepts latitude and longitude in the form of radians, does a little trigonometry magic, and away you go!

Clasp design

With the code finished, I focused on the enclosure. I started with a weird suitcase-looking wooden box from the crafts store. Then, I measured it carefully and designed the clasp. The main idea is that there is a rotating disk with a notch cut in it. The screw fits within this notch and holds the lid closed.

Clasp

With the measurements derived from the dimensional drawing, I drew a few circles. The inner one is the diameter of the servo control arm shaft, the next circle out is the location of the screw. The last circle is the desired maximum outside diameter. Using these circles as a guide I drew the clasp. The tongue has a little bulge to make sure you can't wiggle it open. I drew it over until it was nice and dark, then traced it onto a notepad sheet. I cut this out and traced it to light-ply. My Dremel with an end-mill made short work of cutting it out.

Completed clasp and pin

Clasp tolerances

As you can see, the final tolerances are really tight. I'm very happy with this mechanism. In fact, later in the process, I accidentally locked the box with bad software. Luckily, the hinge is screwed on from the back and I could remove them. However, the clasp was so tight, I still took several minutes to open it.

Measuring the LCD

With the clasp done, I moved on to the LCD. In this case, I measured it and traced it onto the lid. There are two rectangles. One is the location of the mounting holes, and the inner is the outline of the black LCD frame.

LCD Module test fitting

Here you can see the LCD module installed in the case. It was a tight fit. In addition to cutting and drilling the case, I cut some acrylic to use as a window. I've been trying to figure out how to hide that ugly black bezel for a while, now.

Acrylic window

I traced the outline of the display part of the LCD module. I used this to mask out the clear part.

LCD Window

As you can see the bezel is hidden. Unfortunately, some of the red paint leaked behind the masking tape.

Controller assembly

This is an image nearing final assembly. I use 4-40 hardware through the front of the lid. On the back side of the LCD I installed a nylon and steel washer, then a standoff. On the Standoff threads, there is a nut on the top and bottom of the mainboard. These are to set the spacing of the LCD and mainboard and hold the package securely.

Mainboard installation

With the mainboard installed, the GPS was installed. I just used double-sided foam tape. It is behind the lid, and the satellite signal simply travels through the lid. It looks nice and still works great. The wood is so thin, in fact, that the light from the LEDs shines through it.

Arm switch

Going back to the problems I was having with the soft power switch, I noticed that when I left the battery plugged in over night it drained somewhat. It's kinda cheap, but I had to hack-on a power switch in addition to the pushbutton. I use an ancient RC airplane trick where you stick a control rod through the wall to access a switch on the inside.

Power switch outside

Now, you can hook a fingernail onto the wire. Pull to enable, push to disable.This also prevents from attempts being wasted during shipping.

Final programming

This is an image of the final time I programmed the controller. Complete with the puzzle coordinates! It was important to remember to not let the lid close unintentionally, as the target almost 1000 miles from here!

A note about the provided code. It isn't high quality. It's a little embarrassing, but I did it in a hurry.

Resources

code.zip

Eagle files

RF Transceiver using the MRF49XA

Transceiver breakout boards

I'm just finishing up my last class ever!!! (for credit, anyway.) It was a really fun, mostly because I decided to have fun with my last class, and make it a 4/5 (undergrad/graduate). This meant that it was much easier and less theory-heavy than those that I'm used to. Anyway, as a grad student, I was expected to do something extra, and I decided to make a RF transceiver module. I looked around for a little while, and I settled on the Microchip MRF49XA. In general, it's a nice chip. It has about the same capability as the Micrel MICRF6xx modules that I've used in the past. The Micrel modules cost $20/ea. and the Microchip IC is around $3. I was able to make the whole breakout board for the MRF49XA for less than the Micrel module alone.One of these days, I should dig out my notes from the Micrel project and post them, but I digress. I noticed a distinct lack of programming information using the MRF49XA, so I'm posting not only my schematic and PCB, but the software library I wrote for the Atmel AVRmega.

Breakout board schematic

The schematic I created for the breakout board is, in large part, copied from the reference schematic from the datasheet. There are a few parts that make up the complete schematic, including power regulation, microcontroller interface,RF balun, and the IC. Everything but the balun is really easy to understand, the power input can be +5 volts or more (probably up to about 14 volts) while using the LM317, or if the LM317 is omitted, +3.3 volts. The MRF49XA is really a 3.3 volt part, and expects 3.3 volt I/0. Originally, and on the PCB I had made, I had 2 ground pins. Since then I realized it would be useful to output regulated 3.3 volt output, so I changed one of the grounds for that. The only other major portion of the circuit is the balun. This is used to transform the balanced RF input/output from the IC to the unbalanced antenna connector. Thiscircuit also provides power to the RF power amplifier inside the IC.

Breakout board top

Breakout board top

The PCB designed from the schematic is also fairly straight-forward. A few things are worth noting, however. I've added some silkscreen between 2 of the pins on the LM317. These are to indicate where you could jumper if the breakout board is supplied with regulated power. I used a 0805 0-ohm resistor(see the image below). The voltage output of the LM317 is selected with R1 andR2. I decided not to include the "stop" layer on this image so as to not clutter it, but near the word "Fence" there is a strip without solder mask over the vias. If you wanted to isolate the RF from the outside, you could build a fence out of copper foil (or something). The Antenna connector is an end-launch SMA, though it could also be raw coax if you want to save some money.

Close up

The only pins necessary for complete functioning of the device are the standard SPI set (MOSI, MISO, SCK, !CS), and IRO (interrupt request out). TheIRO pin is not strictly necessary, but HIGHLY recommended. The MRF module uses the IRO pin to notify the microcontroller of a few time-sensitive events, such as FIFO full/empty conditions.

MCU interface while transmitting

The diagram included above (from the MRF49XA datasheet) provides a useful overview for the transmitting process. The take-away message is that you first send the "Transmit data enable" (TXDEN) command, which loads0xAAAA into the transmit FIFO. You can either leave this in there, as a preamble, or replace it with data of your choice. Then, you send the "Transmit carrier enable" (TXCEN) command. At this point, the PLL starts, and the PA turns on, then transmission starts. When the first full byte leaves the FIFO the IRO asserts. Hopefully this forces the MCU to jump to your interrupt service routine. Once there, if the CS pin is held low, the MRF will bring SDO(MISO) high. This is a clear signal that the FIFO needs attention. You can continue this process for as long as you have data. Once you're done, you need to load a "dummy byte" into the FIFO so your last data byte makes it out.Finally, on the next interrupt, shut down the transmitter by sending TXCEN andTXDEN = 0.

Receiving FIFO usage

This diagram illustrates another detail of the interface to the MRF. Also borrowed from the datasheet, it describes the way to access the receive FIFO using SPI. Typically, SPI interfaces don't have a notion of registers quite like I2C does, but the MRF does. To get access to the receive FIFO you initiate an SPI transfer to the MRF module with the contents equal to the address of the receive FIFO. In this case it's 0xA000. Once the first byte of the transfer is complete, the MRF begins outputting the FIFO value on the SDO pin. It is also possible to gain access to the receive FIFO using FSEL (FIFOSelect, called "Data" on the schematic) pin.

Baseband Bandwidth calculation

Before going into some details on the implementation of the library, I'd like to talk briefly about the RF frequency, deviation, and bit rate determination.I've attached another snippet from the datasheet (hopefully the last one), andI'm going to go through the math quickly with numbers for my application. I'musing 434 Mhz band, with 9600 baud, using a 10ppm crystal. This means that fxerror = 10 * (434000/1000000) = 4.34 Khz. Then, our deviation must be 9.6 +2*fxerror + 10 = 28.28; the closest modulation is 30 Khz. Therefore, BBBW =30*2 - 10 = 50 Khz. The closest BBBW is 67 Khz.

Spectrum plot from alternating 1s and0s

I recently gained access to a spectrum analyzer courtesy of the OSU RoboticsClub. This is a spectrum plot of 0xAA, or alternating 1′s and 0′s. It's a little strange that the distance between peaks is about 90 Khz, as it should be more like 60 Khz. The comb-like appearance on the flanks is probably from the transceiver switching from 1 to0 across the scan.

Transmitting '1′

This plot is while transmitting all 1′s. It's obvious this is much cleaner, but very little information is actually being transmitted here.

With respect to the Atmel AVR library that I wrote, it includes a header file devoted entirely to defining the registers and bits as defined in the datasheet. Each section includes a comment block description, and in the cases where some bit values need to be calculated, the equations used. On the occasions where a bitfield is used for some integer value, I include a mask to ensure that if the derived values overrun the width of the bitfield they don't pollute unrelated settings. Below, I've included an example.

/*******************************************************************************   
 * Convenience definitions for band setting   
 *   
 * These defines are provided for use configuring the MRF49XA module.   
 * Select the frequency band for the given hardware by uncommenting the   
 * appropriate line.  Set the crystal load capacitance using the MRF_XTAL_LD_CAP   
 * value.   
 *   
 * The load capacitance is given by the following equation:   
 *   
 * Cap pF = 8.5 + (LCS / 2)   
 * LCS = (10 - 8.5) * 2   
 *   
 * For 10pF: LCS = (10 - 8.5) * 2 = 1.5 * 2 = 3   
 *     ******************************************************************************/
#pragma mark General Configuration Register
#define MRF_GENCREG    0x8000       // General config. register
#define MRF_TXDEN      0x0080       // TX Data Register enable bit
#define MRF_FIFOEN     0x0040       // FIFO enable bit
#define MRF_FBS_MASK   0x0030       // Mask for the band selection
#define MRF_LCS_MASK   0x000F       // Load capacitance mask
// 10pF Crystal load capacitance
#define MRF_LCS        3             // Crystal Load capacitance
// Frequency band settings
#define MRF_FBS_434    0x0010       // 434 mHz band
#define MRF_FBS_868    0x0020       // 868 mHz band
#define MRF_FBS_915    0x0030       // 915 mHz band

All of the files in the library depend on a "hardware.h" file that defines the qualities of the hardware. The hope is that this file is the only place that implementation-specific code lives. There are some holes still, however.Finally, the mrf49xa.c and mrf49xa.h files behave the way you would expect.The module requires a total of 5 pins and one interrupt. Some of those pins may be shared with other SPI devices.

void MRF_init(void);
uint8_t MRF_is_idle();
uint16_t MRF_statusRead(void);
// Packet structures

// the maximum payload size
#define MRF_PAYLOAD_LEN 40

// Space for preamble, sync, length and dummy
#define MRF_TX_PACKET_LEN   MRF_PAYLOAD_LEN + 5

typedef struct {
        uint8_t length;
        char        payload[MRF_PAYLOAD_LEN];
} MRF_packet_t;

// Packet based functions
void MRF_transmit_packet(MRF_packet_t *packet);
MRF_packet_t* MRF_receive_packet();

I've included a snippet of the header file above so I could mention the basic process for using the MRF module. The MRF_init function expects the SPI bus to be configured, and it performs the basic initialization of the device. Once it's started, the interrupts on the AVR must be enabled. In the main loop (or at least as often as a packet can be transmitted) you should callMRF_receive_packet. This function will return NULL if no packet was received, and a pointer to a packet structure if it was. MRF_transmit_packet takes a packet structure and transmits it. This is an asynchronous operation, and you may use the packet structure (or its memory) once it returns. This is useful if you want to use a packet structure created on the stack. It is possible to get yourself into trouble with MRF_packet_transmit, as it spin-loops on a lockset in the ISR. If for whatever reason that lock isn't unlocked at some point you can hard lock. I've done my best to ensure that it doesn't happen, but beware.

And, finally, links to the files. If there seems to be sufficient interest,I'll open up a SVN (maybe Google Code, who knows) with these files and a main program useful for telemetry and the like. Post in the comments if you're interested, or send me a line.

hardware.h

MRF49XA_definitions.h

MRF49XA.c

MRF49XA.h

spi.h

spi.c

Also, the PCB is available as a public design from BatchPCB. I'll include a bill of materials if necessary, though the components are clearly printed on the silkscreen.

Oh! before you ask: No, I don't know what the range is. The longest I've tried is about 20 feet, and there weren't any errors, but it was only about 100bytes. The chip is rated to 7dBm, I think, so go from there. :)

Update:

Here is a simple bill of materials, I used the Eagle export feature, and attempted to place digikey part numbers for each part. I'm not saying they're all right, you may want to make sure you're getting what you think is correct.

partlist.txt

Also, here are the eagle files. They aren't necessarily finalized

eagle_files.zip

Asteroid 2010 RF12

]

Well, I've been investigating how one goes about finding the azimuth and elevation of an asteroid pass. It isn't easy, but the JPL Horizons system has the answers. It isn't an easy program to understand, and you access it by telnet (how 1992), but it's also pretty cool. I ran the system for the asteroid that will pass within 1/5 of the distance to the moon to us. I've posted the system output below. This data is for 122º W Longitude and 45º North Latitude. The columns you probably want to use are the Azimuth and Elevation. I've cut the portions of model output that have less than 0 elevation. (Click "Read More" for the data)

Update: Guh. I hate Matlab. Anyway, I added an image of the trajectory as seen from Oregon. North is to the right, west is on the top. I know, it sucks… I don't know enough about Matlab to fix it. Also, 90º overhead is 0, and 0º is 90.

*******************************************************************************
Ephemeris / PORT_LOGIN Wed Sep  8 09:40:43 2010  Pasadena, USA   / Horizons    
*******************************************************************************
Target body name: (2010 RF12)                     {source: JPL#6}
Center body name: Earth (399)                     {source: DE405}
Center-site name: (user defined site below)
*******************************************************************************
Start time      : A.D. 2010-Sep-07 00:00:00.0000 UT-07:00
Stop  time      : A.D. 2010-Sep-09 00:00:00.0000 UT-07:00
Step-size       : 10 minutes
*******************************************************************************
Target pole/equ : No model available
Target radii    : (unavailable)                                                
Center geodetic : 238.000000,45.0000478,-0.000347 {E-lon(deg),Lat(deg),Alt(km)}
Center cylindric: 238.000000,4517.59088,4487.3484 {E-lon(deg),Dxy(km),Dz(km)}
Center pole/equ : High-precision EOP model        {East-longitude +}
Center radii    : 6378.1 x 6378.1 x 6356.8 km     {Equator, meridian, pole}    
Target primary  : Sun                             {source: DE405}
Interfering body: MOON (Req= 1737.400) km         {source: DE405}
Deflecting body : Sun, EARTH                      {source: DE405}
Deflecting GMs  : 1.3271E+11, 3.9860E+05 km^3/s^2                              
Small perturbers: Ceres, Pallas, Vesta            {source: SB405-CPV-2}
Small body GMs  : 6.32E+01, 1.43E+01, 1.78E+01 km^3/s^2                        
Atmos refraction: YES (Earth refraction model)
RA format       : DEG
Time format     : CAL 
Time zone       : UT-07:00
RTS-only print  : NO       
EOP file        : eop.100907.p101129                                           
EOP coverage    : DATA-BASED 1962-JAN-20 TO 2010-SEP-07. PREDICTS-> 2010-NOV-28
Units conversion: 1 AU= 149597870.691 km, c= 299792.458 km/s, 1 day= 86400.0 s 
Table cut-offs 1: Elevation (-90.0deg=NO ),Airmass (>38.000=NO), Daylight (NO )
Table cut-offs 2: Solar Elongation (  0.0,180.0=NO )                           
*******************************************************************************
Initial FK5/J2000.0 heliocentric ecliptic osculating elements (AU, DAYS, DEG):
 EPOCH=  2455446.5 ! 2010-Sep-07.00 (CT)         Residual RMS= .51054         
 EC= .1790426100393394  QR= .8185988097139194  TP= 2455532.390114616        
 OM= 165.5596199702477  W= 284.0221727285949   IN= 3.599336147379268        
Asteroid physical parameters (KM, SEC, rotational period in hours):
 GM= n.a.               RAD= n.a.              ROTPER= n.a.                 
 H= 28.298              G= .150                B-V= n.a.                    
 ALBEDO= n.a.           STYP= n.a.                   
*******************************************************************************
Date_(ZONE)_HR:MN     Azi_(r-appr)_Elev  r-ObsEcLon  r-ObsEcLat
****************************************************************
$SOE
2010-Sep-07 18:50 *r   88.0837   1.2209 345.2093905   8.7187668
2010-Sep-07 19:00 *    89.9485   2.7959 345.1984220   8.5009369
2010-Sep-07 19:10 *    91.8184   4.4307 345.1623414   8.3374745
2010-Sep-07 19:20 *    93.6971   6.0909 345.1133871   8.1983984
2010-Sep-07 19:30 *    95.5881   7.7611 345.0566579   8.0711552
2010-Sep-07 19:40 C    97.4951   9.4329 344.9944504   7.9500074
2010-Sep-07 19:50 C    99.4218  11.1011 344.9278998   7.8320371
2010-Sep-07 20:00 C   101.3720  12.7617 344.8576092   7.7156172
2010-Sep-07 20:10 N   103.3495  14.4114 344.7839147   7.5997670
2010-Sep-07 20:20 N   105.3582  16.0471 344.7070087   7.4838547
2010-Sep-07 20:30 N   107.4022  17.6657 344.6270009   7.3674481
2010-Sep-07 20:40 A   109.4855  19.2644 344.5439515   7.2502357
2010-Sep-07 20:50 A   111.6122  20.8400 344.4578897   7.1319808
2010-Sep-07 21:00 A   113.7864  22.3893 344.3688247   7.0124955
2010-Sep-07 21:10 A   116.0124  23.9090 344.2767525   6.8916239
2010-Sep-07 21:20     118.2942  25.3957 344.1816604   6.7692317
2010-Sep-07 21:30     120.6361  26.8455 344.0835297   6.6451990
2010-Sep-07 21:40     123.0418  28.2546 343.9823378   6.5194157
2010-Sep-07 21:50     125.5153  29.6189 343.8780594   6.3917785
2010-Sep-07 22:00     128.0600  30.9340 343.7706675   6.2621879
2010-Sep-07 22:10     130.6790  32.1954 343.6601341   6.1305470
2010-Sep-07 22:20     133.3748  33.3983 343.5464307   5.9967602
2010-Sep-07 22:30     136.1495  34.5378 343.4295284   5.8607319
2010-Sep-07 22:40     139.0041  35.6087 343.3093985   5.7223661
2010-Sep-07 22:50     141.9390  36.6059 343.1860127   5.5815653
2010-Sep-07 23:00     144.9532  37.5240 343.0593427   5.4382308
2010-Sep-07 23:10     148.0445  38.3579 342.9293609   5.2922613
2010-Sep-07 23:20     151.2093  39.1023 342.7960402   5.1435535
2010-Sep-07 23:30     154.4428  39.7524 342.6593537   4.9920011
2010-Sep-07 23:40     157.7382  40.3033 342.5192754   4.8374948
2010-Sep-07 23:50     161.0876  40.7509 342.3757795   4.6799221
2010-Sep-08 00:00     164.4813  41.0914 342.2288406   4.5191669
2010-Sep-08 00:10     167.9087  41.3217 342.0784338   4.3551094
2010-Sep-08 00:20     171.3578  41.4393 341.9245343   4.1876259
2010-Sep-08 00:30  t  174.8162  41.4425 341.7671175   4.0165884
2010-Sep-08 00:40     178.2708  41.3306 341.6061590   3.8418648
2010-Sep-08 00:50     181.7088  41.1035 341.4416343   3.6633181
2010-Sep-08 01:00     185.1175  40.7621 341.2735185   3.4808067
2010-Sep-08 01:10     188.4850  40.3080 341.1017867   3.2941841
2010-Sep-08 01:20     191.8006  39.7435 340.9264134   3.1032984
2010-Sep-08 01:30     195.0545  39.0718 340.7473726   2.9079923
2010-Sep-08 01:40     198.2387  38.2962 340.5646376   2.7081031
2010-Sep-08 01:50     201.3463  37.4208 340.3781809   2.5034621
2010-Sep-08 02:00     204.3724  36.4499 340.1879742   2.2938945
2010-Sep-08 02:10     207.3130  35.3880 339.9939882   2.0792195
2010-Sep-08 02:20     210.1660  34.2399 339.7961928   1.8592497
2010-Sep-08 02:30     212.9301  33.0101 339.5945573   1.6337915
2010-Sep-08 02:40     215.6053  31.7035 339.3890504   1.4026444
2010-Sep-08 02:50     218.1925  30.3245 339.1796409   1.1656015
2010-Sep-08 03:00     220.6934  28.8777 338.9662985   0.9224495
2010-Sep-08 03:10     223.1103  27.3674 338.7489949   0.6729691
2010-Sep-08 03:20     225.4459  25.7977 338.5277061   0.4169354
2010-Sep-08 03:30     227.7033  24.1724 338.3024153   0.1541195
2010-Sep-08 03:40     229.8858  22.4953 338.0731180  -0.1157099
2010-Sep-08 03:50     231.9970  20.7700 337.8398293  -0.3927832
2010-Sep-08 04:00     234.0404  18.9996 337.6025971  -0.6773244
2010-Sep-08 04:10     236.0198  17.1875 337.3615226  -0.9695419
2010-Sep-08 04:20     237.9386  15.3366 337.1167965  -1.2696129
2010-Sep-08 04:30     239.8004  13.4500 336.8687648  -1.5776535
2010-Sep-08 04:40     241.6087  11.5309 336.6180543  -1.8936630
2010-Sep-08 04:50     243.3668   9.5829 336.3658318  -2.2174072
2010-Sep-08 05:00 A   245.0779   7.6106 336.1143867  -2.5481574
2010-Sep-08 05:10 A   246.7451   5.6213 335.8686046  -2.8840315
2010-Sep-08 05:20 A   248.3714   3.6299 335.6402501  -3.2200863
2010-Sep-08 05:30 A   249.9595   1.6739 335.4622419  -3.5420167
$EOE
*******************************************************************************
Column meaning:

TIME

 Prior to 1962, times are UT1. Dates thereafter are UTC. Any 'b' symbol in
the 1st-column denotes a B.C. date. First-column blank (" ") denotes an A.D.
date. Calendar dates prior to 1582-Oct-15 are in the Julian calendar system.
Later calendar dates are in the Gregorian system.

 The uniform Coordinate Time scale is used internally. Conversion between
CT and the selected non-uniform UT output scale has not been determined for
UTC times after the next July or January 1st.  The last known leap-second
is used over any future interval.

 NOTE: A time-zone correction has been requested. See header.

 NOTE: "n.a." in output means quantity "not available" at the print-time.

SOLAR PRESENCE (OBSERVING SITE)
 Time tag is followed by a blank, then a solar-presence symbol:

 '*'  Daylight (refracted solar upper-limb on or above apparent horizon)
 'C'  Civil twilight/dawn
 'N'  Nautical twilight/dawn
 'A'  Astronomical twilight/dawn
 ' '  Night OR geocentric ephemeris

LUNAR PRESENCE WITH TARGET RISE/TRANSIT/SET MARKER (OBSERVING SITE)
 The solar-presence symbol is immediately followed by another marker symbol:

 'm'  Refracted upper-limb of Moon on or above apparent horizon
 ' '  Refracted upper-limb of Moon below apparent horizon OR geocentric
 'r'  Rise    (target body on or above cut-off RTS elevation)
 't'  Transit (target body at or past local maximum RTS elevation)
 's'  Set     (target body on or below cut-off RTS elevation)

RTS MARKERS (TVH)
 Rise and set are with respect to the reference ellipsoid true visual horizon
defined by the elevation cut-off angle. Horizon dip and yellow-light refraction
(Earth only) are considered. Accuracy is < or = to twice the requested search
step-size.

Azi_(r-appr)_Elev =
 Refracted apparent azimuth and elevation of target center. Corrected for
light-time, the gravitational deflection of light, stellar aberration,
precession, nutation and approximate atmospheric refraction. Azimuth measured
North(0) -> East(90)-> South(180) -> West(270) -> North (360). Elevation is
with respect to plane perpendicular to local zenith direction. TOPOCENTRIC
ONLY.  Units: DEGREES

r-ObsEcLon r-ObsEcLat =
 Observer-centered ecliptic-of-date longitude and latitude of the target
center's apparent position, corrected for light-time, the gravitational
deflection of light, stellar aberration and atmospheric refraction. The
ecliptic plane is the Earth's orbital plane at print time.  Units: DEGREES

Computations by ...
 Solar System Dynamics Group, Horizons On-Line Ephemeris System
 4800 Oak Grove Drive, Jet Propulsion Laboratory
 Pasadena, CA  91109   USA
 Information: http://ssd.jpl.nasa.gov/
 Connect    : telnet://ssd.jpl.nasa.gov:6775 (via browser)
 telnet ssd.jpl.nasa.gov 6775    (via command-line)
 Author     : Jon.Giorgini@jpl.nasa.gov

*******************************************************************************