.
Why.
50th anniversary of Glenn’s orbit aboard Friendship 7
50 years ago today, American astronaut John Glenn completed three orbits of the earth aboard Friendship 7. Glenn would later become Senator, and would return to space aboard the Space Shuttle Discovery as part of the STS-95 crew, becoming the oldest person to fly into space. These three orbits started fifty years of an American presence in space. Salutations to Senator Glenn, and to NASA.
Examining the output of a simple remote-keyless-entry transmitter…
Yesterday I was looking (sadly unsuccessfully) for some BPW32 photodiodes that I know I have somewhere, when I ran across some of 434 Mhz transmitter modules from Sparkfun (now a retired part) that I had never used. These little $4 transmitters are commonly used for remote-keyless access or similar applications. They have just four pins: power, ground, a data pin, and an antenna, so they are easy to interface. I thought that they might be useful as backup low power beacon transmitter aboard a high altitude balloon payload, but I had never unpacked them, never tried them out. It dawned on me that I might also be able to use them with my code which I had previously written to send Hellschrieber telemetry. But to start out, I just made a simple program that sent the string "BEACON" at 1 second intervals and fed it to the data pin.
But how to receive it? I fired up my FT-817 and tuned it roughly to 433.920 Mhz (the nominal frequency) and even without an antenna, I could clearly hear the buzzy signal with a 1 second period. In fact, I could still hear it over 50Khz away from the nominal frequency. The signal was very, very wide. That got me curious so I dug out my Funcube Dongle Pro, hooked up a simple wire whip antenna, and tuned it in.
Here's a picture of 96Khz surrounding 433.920:
Bleh. Really wide, really ugly, and really unpleasant sounding in the earphone. The horizontal lines coincide with the transmissions, the long harmonic laden regions in between are the "dead times".
I suppose that if you were only using these intermittently in a key fob kind of situation, I could justify using something like this, but for the kind of application I was envisioning, they just seem gratuitously poor. Still, it was fun getting my Funcube Dongle out of the box and playing with it again.
Addendum: they also don't work as a Hellschrieber transmitter. I hooked up my "Hellduino" code, but the resulting spray of noise didn't provide any useful decodes. I think that the transmitter has an upper limit on how long pulses can be, and is also sending AM modulated signals, rather that keyed CW.
A ; }
Spray-on Antennas? I say “Spray-on Bunkum”
Thanks to John, who pointed out that this post was mangled. Fixed now.
I wasn't going to mention this one, but Dave, Chris and Jeff over at The Amp Hour brought it up on their most recent podcast, but other than Jeff's somewhat enthusiastic declaration that he thought it was BS, I don't think they pulled it apart enough.
The topic is a recent video poasted under the auspices of Google's new Solve for X program. Try watching it:
If you try googling for "spray on antennas", you'll find dozens and dozens of links to this video, or what amounts to a copied press release regarding this video. If you dig a little deeper, you'll find lots of people complaining about how poor the presentation was. What is somewhat harder to find is any kind of a critical evaluation of the information (what little there is) on this antenna scheme. I'll try to confine my comments to the latter.
It's begins with a pitch, and not a modest one. We are told to imagine that we can send signals twice as far using no more power. Or the same distance with half the power. Or that we can get rid of cell towers. Or communicate from the depths of the ocean to outer space. And the key is some kind of nanotechnology. that Chamtech has developed for "spray on antennas".
Following this pitch is a story: a story how "a business partner" who asked him develop a hidden antenna for Special Operations. He was then asked by "the government" to try his antenna technology, which was then tested by "a government team", who found that this spray on antenna was "an order of magnitude better" than their best antenna.
I'm sorry, but that's just bunk. Good antennas are efficient. A given antenna has a particular radiation resistance. For instance, a typical dipole antenna such as the antennas that many radio amateurs use might have a radiation resistance of around 70 ohms or so. But, of course, there are other bits of resistance in the antenna too. There is the ohmic resistance of the antenna, so-called "ground losses", and "coil losses". The antenna efficiency is just the ratio between the radiation resistance and the total resistance of the antenna.
But here's the thing: at VHF+ frequencies, it's just not that hard to make antennas with efficiencies that are 90% or higher. And that means that there is no "head room" to make an antenna which is "an order of magnitude more efficient". It's just basic math. You can't get more energy out of an antenna than you put in, and existing antenna designs are already enormously efficient at radiating what you put in.
Beyond that, the geometry of antennas is important. You can't generate an efficient one by just stringing a random conductor (or spraying one) higglety piggly all over the place. The length of the various elements change the feedpoint impedance and that must be matched carefully to the transmitter output impedance in order to be efficient. The idea that these nanocapacitors can "hold" electrons and then release them at their "happy place" is enough to make milk shoot out of my nose.
The "test" on the iPhone was comical: inside an Faraday cage (originally he said anechoic chamber, which I thought was an odd mistake for an RF engineer to make) he claimed that their technology improved the output power of the iPhone by "20 dBm". I'm sorry, but I cry BS on this as well: dBm is the power ratio referenced to a 1mw signal. It doesn't make any sense to say that there is a 20dBm improvement. An improvement of 20dB is a hundred fold increase in output power. Just where is this power supposed to be coming from? A typical cell phone has an output power of around 27dBm, or around 500mw. A 20dB improvement would raise that to 47dBm, which is about 50 watts. Bunkum.
Honestly Google, I know you have some pretty smart guys who know about RF: why did you let this guy use your forum to sell this complete nonsense? It doesn't bode well for Solve For X if it can't distinguish between "radical solutions" and "snake oil".
More on ATtiny programming…
Last night's hacking adventure was inspired by a couple of recent posts from Roger, G3XBM having to do with light based communication. The first was his simple beacon design: it's just a keyer chip, a MOSFET, a voltage regulator, and some (beefy) current limiting resistors. Roger used this beacon to do some non-line-of-sight communications via "cloudbounce".
It's inspiring, so I've been thinking about trying some similar experiments. As it would happen, I have some reasonably high power LEDs floating around, and rigging up the transmitter really wouldn't be too hard. I don't have any of the K1EL chips that he used, but I do have a few of the Atmel ATtiny13s floating around, so I figured I'd go ahead and write up a simple beacon program to send my call via QRSS3 and (if a switch is tossed) 12wpm Morse. After my ATtiny powered Halloween Pumpkin and my ATtiny13 powered Christmas hat, I figured it would be a snap. I fetched an Arduino, programmed it with the AVRISP sketch, and then went to wire up the Arduino to program the code (did I mention I wrote some code?) to an ATtiny13 which I stuck on a breadboard.
And that's when I realized that I didn't take very good notes about how I did it last time, and refinding the necessary connections and commands was both difficult and some sources didn't even have the information correct.
So I'll remember, here's the list of connections you need:
- ATtiny pin 4 goes to ground.
- ATtiny pin 8 goes to 5V.
- ATtiny pin 1 goes to Arduino pin 10.
- ATtiny pin 5 goes to Arduino pin 11.
- ATtiny pin 6 goes to Arduino pin 12.
- ATtiny pin 7 goes to Arduino pin 13.
- Many sources say that for Unos, you must put a 10uF cap between the RESET and GROUND on the Arduino. I had one, so I did it. I've used older Arduinos (such as the NG) which have different reset circuits (you must manually reset them to program them) and for those it isn't necessary. Your mileage may vary.
Lastly, you need the right avrdude command. It took me an embarrassingly long time to come up with the right command, mostly because it appears that I needed to manually set the baud rate to 19200 (what the AVRisp sketch expects). Archived for posterity:
avrdude -v -c avrisp -p t13 -P /dev/tty.usbserial-A800eKtX -b 19200 -U flash:w:beaker.hex
I discovered a couple of things: while the previous versions of the ATtiny I used seemed to have fuses set so that the internal oscillator (nominally 9.6Mhz) would be divided by 8, this one did not. I sorted this out by defining F_CPU appropriately, but it was late and I didn't get my PWM code (which generates the 800hz sidetone) working properly. Tonight, I'll dust it off and hook it to the scope and see what's going on.
When this is done, it should be fairly simple to get the rest of the prototype transmitter together. Roger used a 4" or so lens as the collimating optic for his transmitter. As it happens, I have a dusty 6" Newtonian telescope that I purchased for a pittance, whose mirror really isn't up to the kind of standards I appreciate. I think I can mount a high power LED into a 35mm film can and insert that into the telescope eyepiece, and it should make an excellent collimator (I may need an auxillary lens if the cone from my LED is too broad, I think the telescope is around f/5 or so). Perhaps by this weekend, I'll have the transmitter setup, and I can start working on the (much harder) receiver.
Hope this article saves someone some time. I know I'll be referring back to it in the future.
Web is that they are not compatible with the Ethernet shields which are based upon the Wiznet 5100 chipsets, so you'll need different drivers and different code. I've been experimenting with the Jeelabs EtherCard drivers, which seem to work well and are well supported, although they are limited in their TCP implementation (it limits TCP responses to just a single TCP/IP packet). Nevertheless, I implemented a simple webserver to control the I/O pins of the Nanode, based upon the ideas (but not the code) of Jason Gullickson's RESTduino. I then did a short demo of how you could use it to control a strip of RGB LEDs from a simple jQuery based interface. Watch:
Here's the sketch. Feel free to swipe it and any ideas for any web enabled projects you need (nothing here is worth copyrighting or licensing at all, consider it public domain).
#include <EtherCard.h> #include <NanodeUNIO.h> // // remote by Mark VandeWettering // // a reimplementation of the "RESTduino" idea, first published at: // // // I decided to rewrite this application because: // 1. originally, it was written for the Wiznet based Ethernet Shield, but I have // mostly Nanodes, based upon the ENC28J60 // 2. It was ported to the Ethershield library by Andrew Lindsay, but Andy has decided // that he's decided not to continue development of that library, deferring to the // EtherCard library being developed by JeeLabs // 3. I thought there was a lot of cool additions that could be made! Okay, I haven't // implemented any at the moment, but I will! // #define DEBUG 1 #define BUFFER_SIZE (900) byte Ethernet::buffer[BUFFER_SIZE] ; BufferFiller bfill; char okHeader[]" "body { width: 640px ; }" "</style>" "</head>" "<body>" "<h1>webserver remote</h1>" "<p>" "This webserver is running on a <a href=\"\">Nanode</a>, an " "Arduino-compatible microcontroller with web connectivity. It uses the <a" "href=\"\">EtherCard library</a> written by " "<a href=\"\">JeeLabs</a>. " "Inspired by Jason Gullickson's <a href=\"\">RESTduino</a>." "</p>" "<hr/>" "<p style=\"text-align: right;\">Written by Mark VandeWettering</p>" "</body>" "</html>" ), okHeader) ; } #define CODE_ERROR (-1) #define CODE_WRITE (0) #define CODE_READ (1) #define CODE_ANALOG_WRITE (2) #define CODE_INDEX (3) int cmdparse(const char *cmd, int &pin, int &val) { const char *cp = cmd+4 ; if (*cp++ == '/') { if (*cp == ' ') { return CODE_INDEX ; } else if (isdigit(*cp)) { pin = atoi(cp) ; while (isdigit(*cp)) cp++ ; if (*cp == ' ') { return CODE_READ ; } else if (*cp == '/') { cp++ ; if (isdigit(*cp)) { val = atoi(cp) ; while (isdigit(*cp)) cp++ ; if (*cp == ' ') return CODE_ANALOG_WRITE ; else return CODE_ERROR ; } else if (strncmp(cp, "HIGH", 4) == 0) { cp += 4 ; if (*cp == ' ') { val = 1 ; return CODE_WRITE ; } else return CODE_ERROR ; } else if (strncmp(cp, "LOW", 3) == 0) { cp += 3 ; if (*cp == ' ') { val = 0 ; return CODE_WRITE ; } else return CODE_ERROR ; } } else return CODE_ERROR ; } else { return CODE_ERROR ; } } else { return CODE_ERROR ; } } void setup() { byte mac[6] ; Serial.begin(9600) ; Serial.println("\nbrainwagon remote webserver\n") ; NanodeUNIO unio(NANODE_MAC_DEVICE) ; unio.read(mac, NANODE_MAC_ADDRESS, 6) ; if (ether.begin(sizeof Ethernet::buffer, mac) == 0) { Serial.println("Failed to access Ethernet controller.") ; for (;;) ; } if (ether.dhcpSetup()) { ether.printIp("IP: ", ether.myip) ; ether.printIp("GW: ", ether.gwip) ; ether.printIp("DNS: ", ether.dnsip) ; } else { Serial.println("DHCP failed.\n") ; for (;;) ; } } void loop() { word len = ether.packetReceive() ; word pos = ether.packetLoop(len) ; int pin, val ; if (pos) { bfill = ether.tcpOffset() ; char *data = (char *) Ethernet::buffer + pos ; Serial.println(data) ; switch (cmdparse(data, pin, val)) { case CODE_READ: pinMode(pin, INPUT) ; bfill.emit_p(PSTR( "$F" "{\"$D\" : \"$S\"}"), responseHeader, pin, val ? "HIGH" : "LOW") ; break ; case CODE_WRITE: pinMode(pin, OUTPUT) ; digitalWrite(pin, val ? HIGH : LOW) ; bfill.emit_p(PSTR( "$F"), responseHeader) ; break ; case CODE_ANALOG_WRITE: pinMode(pin, OUTPUT) ; analogWrite(pin, val) ; bfill.emit_p(PSTR( "$F"), responseHeader) ; break ; case CODE_INDEX: homepage(bfill) ; break ; case CODE_ERROR: default: bfill.emit_p(PSTR( "HTTP/1.0 404 Not Found\r\n" "Content-Type: text/html\r\n" "\r\n" "<html><body><h1>404 Not Found</h1></body></html>")) ; break ; } ether.httpServerReply(bfill.position()) ; } }
Boring statistics re: brainwagon
Okay, today is February 6, which means that my revolvermap that you can see over in the left margin has been up one entire year. Right now, it's showing 148,950 visits since it's inception. I suspect a couple of thousand of those are actually me, but I'm pretty happy that so many people stumble their way to my blog in that time. Over that same time period, Google Analytics reports 126,340 visits, 96,891 unique visitors, and 387,172 page views. The traffic to my blog has been pretty constant: around 300 views per day, with five or six blips caused by links from hackaday or Reddit. About one in four visitors are returning: the rest are new visitors. That seems pretty cool to me: reaching nearly 100K people with something I wrote seems oddly empowering.
But here's the reality check. My most popular post: Viewing a V4L webcam with mplayer: a little throw away post I did back in 2007, giving the options that allowed me to show video from a V4L webcam using mplayer. It accounts for a little under 2.5% of all the hits to my blog. Two postings on the Fuji Real 3D W1 camera sum to actually a greater percentage (right around 3%). My Downside of Arduino is about 1.41% of all hits, mostly courtesy of a brief mention and flurry of activity from Reddit. My Hellduino project and my Arduino n' Gameduino Satellite Tracker came in virtually tied at 1.16% and 1.15%, respectively.
What am I to make of all this? Well, I'm not quitting my day job anytime soon. 🙂
Addendum: Tomorrow will be February 7, 2012. This marks the completion of twenty years of work at Pixar Animation Studios. To all those who I've worked with over the span of the last two decades, thanks for helping provide one of the most stimulating work environments I could imagine, and for letting me play a small role in the history of animated films.
maniacbug is an Arduino wizard…
Ken Boak was nice enough to gift me with a pair of Nanodes when he was out visiting last month. Much to my embarrassment, I haven't had much time to play with them, so tonight I tried to do a bit more research to figure out how I could use them in some more advanced projects. Previously I had found the Ethercard library which was developed by Jeelabs. It works okay for many things, but has a web server implementation which is too limited for many uses: all web pages must fit in a single TCP/IP packet. I was digging around trying to find a TCP/IP implementation that could handle larger ones. I knew about Adam Dunkel's uIP stack for microcontrollers which has been ported to many microcontrollers, but the first link I found to an implementation on the Nanode didn't seem to have any example web server code. But then I ran across this posting on maniacbug's blog describing a complete webserver using uIP. He's got his own github repository which seems to have a lot more complete examples fleshed out. I downloaded and tested the code, and it appears to work pretty well. I'll be digging into it over the next few days, and perhaps making my own webserver application to run on the nanode.
He's also got a huge number of other rather sophisticated postings on stuff he's done with the Arduino. Check them all out, I know I will be too.
maniacbug | AVR Microcontroller Projects