Embedded D-RATS

For a while now, I’ve wanted to see what interesting things I could do with a microcontroller by teaching it how to send and receive D-RATS packets.  I bought an Arduino Diecimila a while ago and played with it a little bit.  It’s a really cool device and makes quick work of getting a working microcontroller programmed and functional.  I highly recommend it.

When I first got it almost six months ago, I got stuck on level conversion to RS232, which I needed in order to interface with a D-STAR radio.  I had a MAX232 chip and four properly-sized capacitors hooked up according to the spec sheet but it just wasn’t happening.  I got frustrated and put it on the shelf.

Recently I decided to give it another go, and sought some advice from someone with more hardware skills than I.  Eric boosted my confidence by sanity checking my plan and suggested that perhaps I had a bad capacitor from Radio Shack.  I was a little skeptical, but ordered some new ones from a more reputable source.  The new ones arrived a couple days ago and I’m pleased to report that they fixed me right up.  Wahoo.

Along with the new caps, I also ordered some additional components I needed to create a semi-permanent setup.  While shopping around, I found the Arduino Pro Mini, which is an unbelievably small unit with nothing but labled solder tabs.  The size was just too attractive to pass up, so I got one of those too.

After getting the MAX232 prototyped on a breadboard with the new caps and proving that it worked, I set out to make a little board that had the Arduino on it (using headers so I could remove it for reprogramming), the MAX232 and associated capacitors, and a substantial 5V regulator so I could power it off of 15V (the Pro Mini has an upper limit of 12V which is too low for operation in a vehicle with a good alternator).  Below is what I ended up with:

 

 

 

 

It’s a little hard to see, but the Arduino is in the foreground sitting atop the headers.  Under it is the 5V regulator and in the background is the MAX232.  The wires off to the left go to a male DB9, suitable for attaching to a D-STAR radio’s data cable.  In all, there is less than $30 on the board.  For a size reference, here is the unit next to a normal SD card:

 

 

 

 

It’s extremely small so it should be easy to mount in an enclosure and tuck in the car near my radio.

Right now the firmware has just a ring buffer large enough to capture a D-RATS ping request.  It will reply to KK7DS E or a CQCQCQ ping.  Even in this basic form, it’s pretty neat to be able to ping a moving vehicle and get a response without requiring a running PC in the car.  However, I have a lot of ideas for neat things to add:

  • I have a serial 16×2 LCD display that could be used to display chat and status messages
  • A keyboard or keypad could be added to allow two-way messaging with a very small device
  • Adding a GPS would allow the unit to respond to postition report requests as well as replace the ability to do GPS beaconing
  • Creating some new D-RATS RPC commands would allow a remote station to control the DIO pins to illuminate LEDs, throw relays, or control just about anything
  • Adding a temperature (or other type of) sensor could provide status readings from a remote station with minimal hardware

So, there’s a lot of room for cool stuff to add!

 

Category(s): Hardware
Tags:

6 Responses to Embedded D-RATS

  1. What sketch did you use on the Arduino to get it to respond to the D-RATS packets?

    • I wrote it all myself. And no, I don’t have the code anymore Smilie: :)

      • Do you still remember how you sent the serial data to D-RATS in order to get D-RATS to recognize it? I’m trying to use an Arduino to send the GPS data like the broadcast location function in the D-RATS map. I got to the point where I do $GPGGA,15231.3417,N,11835.034,W,1,2,0,0,M,0,M,,*44 NAT51768. However, I think that the *44 is a checksum type of thing where it needs to be correct in order for D-RATS to recognize the entire data packet as valid map data. Do you know how this *44 thing works? Thanks in advance for your help.

        • It would really be best to discuss this on the drats_users mailing list. If you have further questions, please send them there and I can help out.

          The *XX at the end is a standard NMEA checksum for the sentence. Any document about the NMEA spec will explain how to calculate it. D-RATS is open-source, so you can look at the parsing code and/or add debug statements to it to figure out why it’s not parsing something.

Leave a Reply

Your email address will not be published. Required fields are marked *

 

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>