Arduino Cellular Shield

One of the few things cooler than an Arduino is an Arduino with a cellular shield. As you would suspect, this $100 shield from SparkFun gives an Arduino cellular capabilities, including the ability to send and receive text messages — and apparently the ability to place and receive voice phone calls, too. Tronixstuff has an excellent tutorial on getting started with the shield — I highly recommend it.

SparkFun's cellular shield for Arduino. (Image credit: SparkFun.com)

Here are some of my experiences getting the shield up and running with some basic, proof-of-concept sketches. I am in the Eastern US, and have had success using the AT&T network. If you are in another area and/or use another network, your mileage may vary.

First of all, in addition to an Arduino (a Duemilanove or Uno is recommended, although a Mega will work with minor tweaks) and the shield itself, you’ll need the following:

  • A cellular antenna (helpfully also sold by SparkFun)
  • A SIM card which is not locked to a particular handset (more on this below)
  • A relatively high-current 5-volt power supply (since the Arduino’s regulator isn’t rated for the amount of current — up to two amps — the shield can draw.) You can, however, backfeed the Arduino from this 5V supply quite nicely.
  • (Recommended but not technically necessary) a case to secure the shield and antenna.

The 5V power supply was easy enough, for the time being — I decided to just use a bench supply for testing. The antenna was easy, too — I picked it up from SparkFun at the same time as I bought the cell shield. Next, I needed a working SIM card. I bought the cheapest model of AT&T “Go Phone” that I could find at the local Target. $19.95 for a cell phone — a little pricey, but I might be able to repurpose it or some of its parts.

A basic, generic cell phone came with the SIM card.

I activated the Go Phone and associated SIM card easily enough, and chose the $2-per-day unlimited calling and texting plan. (I figure that on any given day, I’ll either use the network a lot or not at all.) Texting and phone calls worked fine from the included Go Phone. When I put the SIM card in to the cell shield, connected the antenna and power, and ran through the configuration, though, I hit a problem — the “+SIND 7,” or “Emergency calls only” error. A quick search later, I found out that this was due to the GoPhone SIM cards being locked to the GoPhone handset for six months.

The SIM card is inserted into the carrier lid, then tilted down into place and locked. (Click for larger.)

This was not acceptable: the whole reason I bought the Go Phone in the first place was to get a working SIM card for the shield. I made a trip to the local AT&T store and explained the situation. After some misunderstanding (the sales staff out front didn’t seem particularly tech-savvy and thought I was asking them to unlock an iPhone or something), they gave me a replacement SIM card — one not locked to a particular phone, this time. I swapped the new card in, re-tried the SMS examples in the tutorial, and it worked!

 

Posted in Arduino, Digital, Internet | 3 Comments

Bloodshed Dev-C++

Programming in C or C++ on a Linux system is fairly straightforward. Enter the code in the editor of your choice, compile with gcc and enjoy. Programming is usually an integral part of the operating system.

C or C++ programming isn’t installed on Windows right out of the box, though, which raises the question of how to find a good C/C++ programming environment for Windows? Having tried (and not really liked) Visual Studio, I was looking for an alternative. As powerful and easy-to-use as FreeBASIC is — especially using the FBIDE environment — some things (like linked lists and similar structures) are more easily done in C-like languages.

Recently, I’ve come across Bloodshed/Dev-C++. Although I can’t say I like the name much, the IDE is easy to install, and provides an easy way to write a quick console-based program in C. Best of all, it’s free / open-source.

The download link can be a bit tricky to find, since the site design is somewhat unintuitive (at least to me). Here’s a direct link to the installer download page.

 

Posted in C, Coding, Internet | Leave a comment

Robotic Jellyfish

Engineers at Virginia Tech have made a hydrogen-powered jellyfish robot that theoretically will never run out of energy.

It’s cool to live in the future.

 

Posted in Current Events, Robotics | Leave a comment

Syntonization

My new word for the day (okay, actually this week) is syntonization. I’d heard of synchronization, of course, but hadn’t heard of syntonization (setting two clocks or oscillators to the same frequency) until reading a usage guide for the Efratom LPro-101 Rubidium frequency standard units I’ve been working with.

Rubidium frequency standards work by tracking the natural frequency of an energy-level transition of Rubidium with a quartz PLL oscillator. This produces a very precise, accurate reference frequency — but one that can nonetheless be affected slightly by variations in the ambient magnetic field. For this reason, Rubidium standards typically are adjustable to some extent, and can be syntonized to other, similarly precise frequency standards.

Normally, syntonization of a Rubidium frequency standard is done in comparison with either a primary Cesium standard (too expensive for me, unfortunately) or with a precision GPS receiver (which appears a bit more affordable but which I don’t yet own.) Since the LPro units allow temporary adjustment via an input pin, though, it’s possible to syntonize one of them to another without having a primary standard available. This doesn’t guarantee absolute frequency accuracy, of course — but rather just taking Unit 1 at its word as to what the “real” value of 10MHz is, and tweaking Unit 3 to match that. For many experiments, it doesn’t really matter. Both are within a couple of parts per billion of the absolute frequency anyway, whether corrected or not.

The frequency adjustment pin on the LPro operates via a voltage-divider scheme: the pin can nominally be driven to any value between 0V and 5V, with higher voltage increasing the frequency by about 1PPB or so. This results in a rather coarse adjustment (relatively speaking), though. Instead of driving the pin directly, I decided to drive it via a 100k series resistor, effectively diluting the adjustment voltage. (The pin is internally held at 2.5V via a voltage divider with a nominal impedance of perhaps 100k ohms.)

By watching the oscilloscope and phase measurement meter, I initially guessed that a drive voltage of about 2.084V seemed to cancel out the observed phase drift (the magenta line in the graph). I then let the oscillators run overnight. It nearly worked: whereas the units would drift in and out of phase every ten to eleven minutes with no correction, they now took about nine hours to do so. (This is the blue line in the graph below.)

After a bit more experimenting, I increased the drive voltage slightly to 2.090V. This, so far, has almost exactly cancelled out the phase drift. Although a few degrees of short-term phase jitter is present, along with perhaps 70 to 90 degrees of longer-term phase noise, the overall phase drift seems to be on the order of 1.8 degrees per hour. At this rate, it would take over a week for the two units to drift in and out of phase by one cycle. Running at 10MHz, it would take over two hundred thousand years for them to disagree by one second.

Phase difference in Units 1 and 3 (Unit 3 corrected with 2.090V via a 100k resistor). (Click for larger.)

0.005 degrees phase per second is 2000 seconds per degree.

Multiplying this by 360 degrees (I never really did like radians) gives 720,000 seconds per phase.

Multiplying this by 10,000,000 (since the units run at 10MHz) gives 7,200,000,000,000 seconds per one second of difference. This is one part in 7.2 trillion, or about 138 parts per quadrillion (PPQ). This is relative accuracy, of course, since I don’t have an absolute 10MHz reference standard that’s anywhere near this accurate.

…and to think, I used to consider 100PPM TTL oscillators to be precise…!

 

Posted in Electronics, Science | 3 Comments