## iGate Part Deux

Some time ago I built an Internet gateway (iGate) for monitoringÂ APRS packets and sending them to APRS-IS. Â It never made it to the blog partly because it was built out of Direwolf, so it was mostly software configuration.

Since then, I've had trouble keeping soundcards running in the same configuration and the iGate was offline for some time.

Last summer (or the one before it, I don't remember), I bought the components to a packet station: an AEA PK-232 TNC, a Kenwood Mobile, and a broken power supply. Â The broken power supply is still broken, but the rest is up and running.

The setup for the PK-232 is courtesy of LA6YIA on Google Groups:

XFLOW OFF
AWLEN 8
PARITY 0
RESTART
CONMODE TRANS
TRACE OFF
HID OFF
BEACON EVERY 0
PACKET
RAWHDLC ON
HPOLL OFF
PPERSIST ON
KISS ON
HOST ON

The APRX setup is not groundbreaking, but it's below, too, since it may help someone...

Then, since the ultimate test is to make it work, I wrote a simple Arduino Sketch using the Argent Data APRS Arduino shield and my trusty IC-T90A...

Obviously, this only transmits once, and it is using manually-entered location, but it does the job.

Look! It's here!

And of course, I could find some repeats in the log:

I'm in the log!

So at this point there should be better coverage in the far east of Cincinnati.

73!

Category: Equipment

## RFduino and the Physical Web

I happened to stumble on an advertisement for a cool looking device that would work with a phone via Bluetooth. Â It was ideally something that would be used for things like movie times, bus waiting times, or something else small and URL based... kinda like a QR code without the annoying camera part.

So I got a pair of RFduinos to play with it. Â Programming it is quite simple, you just need Arduino 1.5 or later (which you would need for programming a Yun, Due, and possibly a few other Arduinos) and the RFduino libraries (see this). Â The library comes with an example program accessible under File-Examples-RFduinoBLE-AdvertisementContinuous.

The only somewhat difficultÂ part is dealing with the URIBeacon, and Adafruit publishes a tool to help with that, and Google has a more detailed explanation.

The top is the RFduino, the bottom is the USB shield, which is the easiest way to load it.

Of course it does nothing unless you have a device setup to receive it. Â In the Play Store, there is a Physical Web app that can be used to receive the messages (until these become part of Android... and hopefullyÂ iOS, too).

The app is fairly simple, but it works!

# Where This Is Going

Rather than beacon a web URL, I imagine with the proper programming (on both the RFduino side and the Android app side), it could be used to pass a variety of messages. Â In fact, since the app looks up the description information, that could probably be used for simple messages (e.g. "the plant needs water").

This has some pretty cool IoT and alerting uses. Â Stay tuned!

-73-

Category: Arduino

## Arduino Yun!

On the way back from a meeting, I dropped by the Columbus Micro Center Mall. Â I really didn't know what I was looking for, but I figured I'd want to look at something for a project in the works (that involves an accelerometer or two), myÂ Hack A Day Trinket Project, and anything else that looked good.

It was a good trip.

## Mechanical

Mechanical rotary encoders are common in selector switches. Â They have mechanical rings inside (I couldn't find a good explanation of how this works). Â They are inexpensive and common, but I'm not sure of their use within an antenna rotator. Â Truthfully, the amount of torque needed to turn a selector switch is so much that I'm not sure this is really an option.

# Next Step

As the only picture on this post indicates, I have a motor with a sensor. Â I am going to build that into some sort of rotator that can be mounted on top of a fiberglass pole that I can use to turn the antenna. Â I don't know if I can have it done by August, but I'm going to try... presuming I get the 706 fixed first!

Category: Arduino

Last week (on a post that proved that even an evil genius can sometimes mess up simple math and set a post to fire 4 days early) was the introduction, today is some new findings.

# Memory

If you follow the directions and treat this like an "Arduino Pro or Pro Mini (3.3 v, 8 MHz) w/ATMega 328", the Arduino compiler will tell you that there is a 30,780 byte maximum. Â In my experience, the maximum is around 26,000 bytes. Â Wyolum knew about this, and this is why they included a micro-SD card slot and card. Â At one point, I tried creating a program that would tell the temperature and lines from the Zero Wing intro ("All Your Base Are Belong To Us!"). Â It didn't go well.

# Temperature Sensing

The temperature sensor is very simple to use. Â Recall in the last post, the sensor itself is populated, but a 0.1 uF capacitor (C8) is not. Â The sensor might work without the capacitor, but it likely works better with it (at least I hope so, I populated the cap without testing and I have zero interest in removing it).

To read the analog pin and get it to a voltage, the following code works for me:

int ar=analogRead(7); float vref=3.3; float temp=ar*vref/1024.0;

Even though the Pro and Mini do not have 7 analog pins, the Arduino IDE and compiler not only do not complain about not having the pin, they compile it correctly without modifying any of the libraries (Good on ya, Arduino!).

Looking at the data sheet, there is a simple equation for the temperature:

$V_{out}=T_{C}*T_{A}+V_{0}$

Where:

$V_{out}$ is the output voltage

$T_{C}$ is the temperature coefficient

$T_{A}$ is the Ambient Temperature

$V_{0}$ is the voltage at 0Â°C

Per the documentation, I used $V_{0}=0.5v$ and $T_{C}=0.01V/°C$. Â Using algebra (who says you'll never need it?), I used:

$T_{A}=\frac{V_{out}-V_{0}}{T_{C}}$

Which would give me the temperature in Centigrade, and after that,

$T_{F}=\frac{9*T_{C}}{5}+32$

In Arduino, that wen't like this:

temp=temp-0.5; temp=temp/0.01; // C to F temp=(9*temp)/5+32;

And it seemed to work correctly. Â I was getting temperature readings of around 74 in my office, and it seems like that is correct. Â The final code is below.

...and of course, I can't show all this code without the finished product:

It's a warm 75 in here today... and it does feel kinda warm in my office.

By the time this post fires, I will have just returned from a transportation conference. Â I hoped initially that I'd have more with this post, but it'll have to wait for next week's post.

-73-

Category: Arduino

Ever since seeing the name badges from the Open Hardware Summit 2013, I wanted one. Â I tend to make it to 2-4 transportation conferences a year, plus 3-5 hamfests, so having a cool looking badge is... well, just a want.

The front. Five buttons and an e-ink screen.

The back. Coin cell, on-off switch, microSD card, serial headers, and components.

First off, the e-ink screen idea is pretty awesome. Â It maintains an image with the power off, which is a great feature (especially since there are only around 100 page turns on that coin cell).

The powerplant of this is an Atmega 328p. Â The same Atmel processor used in the Uno, Pro, Nano, Fio, and some Lilypads.

Per the website, there are two unpopulated items - a realtime clock and a temperature sensor. Â However, looking at the schematic and the board, I see the unpopulated realtime clock area in the upper left area of the board, but in looking just to the left of the 328, there is a temperature sensor - the only unpopulated area is for a 0.1 uF capacitor!

I didn't even program the thing before fixing those little omissions. Â I had to make a little change to the realtime clock I had is an NXP, and the doc calls for a TI chip. Â The only difference - pin #3 is a backup power input on the TI chip, and on the NXP chip it is an interrupt output. Â I clipped the pin prior to soldering. Â I also soldered the ICSP and I2C connections, since I think I may end up using those at some point.

The first thing I did with the BADGEr is get a copy of the firmware that is on it. Â After trying to use avrdude with an FTDI board, I did what I should have done the first time - used the Bus Pirate. Â Using the connection instructions on Dangerous Prototypes' website, I used the following avrdude command:

avrdude -c buspirate -C"..\etc\avrdude.conf" -P COM9 -p m328p -U flash:r:"C:/badgr.bin":r -b115200

** CASE SENSITIVE **

The -c option tells avrdude what programmer avrdude is using.

The -C option tells avrdude the configuration file. Â In my case, I'm running this from somewhere down in the Arduino IDE folder, and relatively speaking, backup one and then into the etc folder.

The -P option is the port number (in my case, COM9)

The -p option is the part number, in the case of the BADGEr, it is an ATMega 328p and per this page, that is the correct string to use.

-U is the operation. Â 'flash' is the part of memory to work with, r means to read, the next part is (obviously) the file path, and the final r is for 'raw binary'.

-b115200 is the connection speed. Â My Bus Pirate is setup for 115200 bps, so I used this. Â It will not work if incorrect.

Once I ran this (well, twice because I forgot the final r option in the -U portion), I got a raw file with the code on the device.

It takes a while...

It took 1,048 seconds, or about 17.5 minutes. Â For a 32 KB file. Â There's some fixes for that HERE. Â Use them well.

# Initial Programming Experience

After screwing around for several days trying to load the BADGEr from SPI, I fixed one of my FTDI boards and got it to work. Â My advice here: don't even mess with trying to load sketches via the SPI interface. Â It won't work (and I'm not sure that was ever intended).

# Thoughts

The battery included died very quickly. Â I think my next improvement will be a better battery! Â This DOES need a good power source when programming. Â I initially used my Bus Pirate to power it while programming it from the FTDI cable.

-73-

Category: Arduino

## HAPPY ARDUINO DAY!!!

Yes, I shouted that. Â And for very good reason - Arduino started me down the road of playing with micro-controllers (you can tell I haven't made a red cent on any of this - I call it "playing" :-)). Â I guess you could consider Arduinos to be my gateway drug into Raspberry Pis, Beaglebones, and PICs.

In celebration of Arduino Day, I decided that I should list a few of my favorite Arduino Projects (some are still in progress).

The Filter Sweeper

This is probably the coolest thing I started to write. Â It is also the most useful, as it would have it's uses with any receiver setup, whether it is a home-built radio, an RTL-SDR, or even an off-the-shelf radio).

The Bus Pirate Arduino Shield

I didn't do very much with this, and what I really learned wasn't even discussed in the post- I really learned how to 'break out' of the Arduino IDE and load an Arduino from the command line. Â With Linux.

The Arduino Easy Logger Button

This is the start of what ended up netting me a ChipKit WF32. Â I want (and still need to finish) a setup that makes it easy to log my radio contacts while mobile. Â The Arduino version is around 90% done, but with several things taking my time it hasn't been finished. Â And the ChipKit version has got a longer road.

-...-

I thought I'd have more of these, but I guess I don't. I do have a few "in the queue", though, so hopefully when I write some for AD15, I'll have a few more. Â Either way, I've learned A LOT and I know I have several more posts coming that use my Mega 2560 and Due (and maybe even that Leonardo I picked up a few weeks ago).

-73-

Category: Arduino
Tags: ,

## Arduino Filter Sweeper Update

I'm not going to call it a spectrum analyzer anymore - the way I've designed this, it isn't going to do the same things as a spectrum analyzer.

The main difference is that a spectrum analyzer can operate without a signal generator, this won't because the signal generator is what is going to tell the Arduino what the frequency is.

I built another shield to stack onto the shield in last week's post.

There is currently no connection from the DDS to this yet, but that's one of the only few things left to do on the hardware side.

I also built a filter that will ultimately be the first filter to test. This is for my Softrock 20/30/40 and should pass 7 MHz while filtering 14 MHz.

This will fit in a Radio Shack small plastic enclosure - the plate was leftover from a small dummy load that I glued into the enclosure.

-73-

Category: Arduino, Equipment