Thursday, March 29, 2012

How I Hope to Spend the Next Six Months

Video:


I've decided that I'm going to have a go at blogging full time for six months, with no particular business plan or plan in general yet; I am absolutely going to make it up as I go, and I hope the casual observer at least finds it somewhat amusing. I got a Canon Vixia HF R21 camcorder as my graduation present to aid in these next six months, quality-wise.  I'm still trying to figure out how to work it...  It really is on a tripod; all of the movement in the video is just it trying to keep me in one place.

Of course, all of this is predicated on a swath of assumptions, most of which focus on me not having a job.  Should the opportunity arise where someone wants to pay me money to work on their projects all summer, I'm afraid it's likely they'll win...

In any case, I have a ton of projects I've been spooling up for the last few quarters, so I hope to hit the ground running after I finish having a Spring break in the wonderful Silicon Valley.  I fully solicit any suggestions as to what you'd like to see me write about, with the disclaimer that I'm soliciting nothing more than suggestions, so no guarantees on deliverables.

Wednesday, March 28, 2012

Wednesday at ESC 2012

I missed the first half of ESC on Monday and Tuesday, but I managed to get up to San Jose today to walk around and talk to vendors and see who I would run into.  It was an exhausting day, but I had a lot of fun and met a lot of interesting people.
In good conference tradition, I opened the event with donuts.  Last year I offered one to the engineer sitting next to me waiting for the keynote, who turned out to be Chris Gammell; a pretty cool guy. Just to make sure Chris feels bad for not coming back this year, I upgraded to the wonderfully over-the-top Psycho Donuts.
Today's keynote was JB Straubel from Tesla Motors. It was an interesting keynote.  I can't say it was as good as last year's keynote, but comparing any keynote to Woz is probably not fair.

The one thing that was kind of odd was that they had the keynote across the street in the Civic Auditorium. No WiFi made it entertaining watching everyone trying to get cell phone reception, and even though I was only the third person in line, the auditorium was warm when they let us in, so an hour with a couple dozen kW of people did get mildly uncomfortable. Like every year, they made a futile attempt to get everyone to stay for the Industry Address by giving away an oscilloscope, but the whole crowd got up and left after the keynote (with the added excitement of getting to play IRL Frogger on the way back to the conference hall).
First thing after the keynote was picking up the free TechTote.  It didn't have anything as good as an ST dev kit like last year, but a few interesting trinkets. Always in good form, TI gave away a reasonably useful combination screwdriver set. STEC gave away a 2GB credit-card profile USB flash drive with SSD marketing literature on it.

Softeq had a rather clever giveaway where they gave you a key chain with LEDs on it; show up at their booth and if your key chain lights up green you get a free set of Buckyballs. Of course, I know a USB connector when I see one, so I saved myself the trouble of fighting the crowd and pulled out my Kindle wall charger.  Blue. Rats... The one time I don't bring my 0603 green LEDs and a rework station to ESC...

Atmel gave me... a CD-R with Studio 6 on it. It's probably good AVRs are supported by GCC, because it's really hard to beat vim in my book.
The engineer from Intel sitting next to me at the keynote was planning on spending all day in the Freescale Tower hands-on development track, so I figured I'd check it out.  The dev platform was a neat "tower" with the controller and IO boards all plugging into a PCIe backplane.  I was most interested to see what a one hour introduction to real time operating systems would consist of.
It was about what I expected.  They did a very good job of setting up mostly-done code so we could spend the hour just writing the 12 lines of code it took to grok the concept of IPC on an embedded RTOS, but it was still a mad rush for the instructor and most students to try and finish the 15 page packet in 50 minutes. I managed to finish with about 10 minutes left, so I started playing around with the demo HVAC program and managed to add simulated weather to the imaginary room this "thermostat" was controlling, just to make sure my thermostat towered (hahaaa) over the rest.
Having decided that conference classes are about as good of a use of my time as I expected, I cut out for the expo floor to pound the pavement for the rest of the day.  Any mechanical engineer growing up in 2001 will recognize Intel's real life realization of Animusic's Pipe Dream.  A rather impressive demo of their (or really any) industrial control system.  I don't know why I was so surprised or disappointed that the audio turned out to all be MIDI synthesized... Probably prudent, because some of the ball launchers were firing a nice 30 degree spread.
FTDI was there, and they gave me the demo board for their new FT-X series FT230X basic UART. I'm super excited about using this part in my future projects, because they managed to fit just the useful parts of the FT232R USB-to-serial adapter in the much smaller 4x4 QFP and got the price down to the much more attractive $2.30 for singles.
Texas Instruments continues to impress me with how well they handle their university and developer relations.  One of the engineers started joking with me about how he wouldn't talk to me because I had a media badge, so I jokingly retorted with "well then I'll just take this BeagleBone and be off."
His "Sure, you want one?" response and pulling one out from under the counter was not what I was expecting at all.  The BeagleBone is a 720MHz ARM computer with 256MB of RAM, a microSD slot, host and slave USB, Ethernet, and 64+ GPIOs.  The fact that it runs any ARM-distro Linux you want puts it squarely closer to the PC/104 embedded computer controllers than the 8-bit Arduino you'd expect from the form factor.  Look forward to some projects built on this in the coming weeks, sponsored by Texas Instruments.

I tried to pull the same trick with one of AMD's PC/104s, but they just had security escort me from the building... (kidding)  Seriously though, AMD was talking about launching a comparable dev kit to the BeagleBone in the coming months. I missed the exact name, and can't find anything about it online.  AMD was clearly spending  most of their energy pushing the new Xi3 platform, which are impressively small cube computers for computer labs or high-density server rooms.  A neat little device, but quite possibly the most obnoxious sales person I've ever had to interact with at ESC.

Update on the Carbonation Chamber

Two months ago I wrote about my carbonation chamber, based on Ben Krasnow's, using 3" PVC fittings, a needle valve, a pressure gauge, and a deep seated lack of better judgement.  Using dry ice as the high-pressure CO2 source, any arbitrary drink or food stuff can be loaded into the chamber and carbonated.

The problem is that there really wasn't much way around admitting that I used schedule 40 pipe and PVC cement to make an incredibly robust pipe bomb.

Dry ice has some very peculiar behavior when it's pressurized while submerged in water.  The chamber will steadily pressurize up to about 30psi, and then (I'm guessing) the dry ice ices up enough (with H2O ice) that it stops sublimating, since ice is actually a relatively good insulator.  I've seen the some batches sit at 30psi, clearly with more dry ice in the chamber, for more than a minute before it continues to rise.  The problem is that the dry ice seems to shatter its ice shell all at once, causing the chamber to go from 30psi to pegged full-scale in a matter of seconds.  Handling that manually with a needle valve takes razor focus and a weak sense of self-preservation.

Clearly I needed something better.

Doing some research, I was pleasantly surprised that adjustable automatic relief valves aren't as expensive as I expected.  Grainger PN:6D915 is one such relief valve, which comes with four different springs giving you the pressure ranges 25-50, 50-100, 100-150, and 150-200.  Select the proper color-coded spring, insert it in the valve, and tighten the bushing to compress the spring until the valve pops at your desired pressure.  Once you have it calibrated, tighten the lock-nut to fix it in place, and presto!
The principle of operation of the relief valve is actually rather clever.  By tightening the bushing (not shown), you pre-compress the spring such that it applies a desired force on the piston.  As the (red) air pressure below rises, the pressure x area (pounds/inch2 * inch2 = pounds) of the feed pipe begins to apply an opposing force, until the force of the spring is overcome and the piston rises.

Where it gets clever is that, once the piston moves up, the area of the piston over which the pressure is applied greatly increases.  This causes a much larger force, which compresses the spring even farther, and gives the relief valve a very distinctive "closed - wide open - closed" action.  This is an example of hysteresis, which is desirable in these types of systems, because you usually prefer these "pops" to a slow leak as you approach the critical pressure.  Through trial-and-error, I set my carbonation relief valve to open at 80psi and vent until it reached about 55psi.  With 50g of dry ice and a typical 32oz fluid charge, I see two or three pops before the dry ice is used up and the chamber is stable.




Of course, once I had this working, this toy was the choice go-to activity whenever any of my out-of-town buddies happened to swing through Davis.  Nerds plus dry ice is seeming like less and less of a good idea every time I do it...

Video of my grape juice mishap with Jeff:

Video of Jacob helping to clean up a week later:

For all that is mighty, do not kill yourself trying this.

Tuesday, March 27, 2012

How I Store My Electronic Components

It's not an unusual question to arise in the electronics community. Piece by piece, you've been buying components and equipment, until one you turn around and find yourself knee-deep in tiny boxes and ESD bags, and you spend more time of each project looking for parts than putting them together.  Everyone goes through these growing pains in the hobby, so I figured I'd document my (partial) solution.

I finally got fed up with having to move 4' piles of boxes around to be able to get into my closet and bathroom throughout the day, so I broke down and went to Ikea and bought their tallest, deepest, and cheapest bookcase, which if memory serves is the deep Billy in white.  The vast majority of this bookcase is dedicated to electronics, with only the very top shelf handling some overflow from my (extra-curricular) textbook bookshelf.
Starting at the top, the top shelf is pretty irrelevant.
  • My back-issues of Make Magazine.
  • 1800 Mechanical Movements (A great puzzle book)
  • Misc very old chemistry, metallurgy, and welding texts which I would be hard-pressed to find a copy of for you, let alone a reference to online.
The second shelf is all of my electronics texts.  I have almost as many books on programming, but they're across the room.
  • The Temperature volume of Omega's catalog.
  • AdaFruit's 0603 passives kit.
  • Texas Instrument's TTL Databook, which at one point you could buy in their eStore for $0.10.
  • Several 1940's era radio books.
  • Terman Electronic and Radio Engineering. Supposedly one of the best vacuum tube texts.
  • Design of Analog CMOS ICs.
  • Advanced Digital Communications.
  • Teach Yourself Electricity and Electronics.  This was actually my very first electronics book, which my father bought for me at Halted back when I was in middle school.  I will say that it is likely that much better books for beginners, and particularly young beginners, have become available in the last decade since I got this book.
  • TTL Cookbook - Lancaster: It is a rare EE's bookshelf that doesn't have, or at least seen, this book.  It is a classic in building pure-logic circuits. It took little more than this book and a tube full of 7400 logic for me to build my own clock.
  • Noise Reduction Techniques in Electronic Systems - Ott: This book is quite sophisticated, so I wouldn't say most people need a copy of it.  I would suggest that you at least borrow it at one point and read it through once to get an idea of what to think about and look for in sensitive systems.
  • The Art of Electronics - Horowitz: If my apartment was burning down and I could only grab one book, this is it.  A great text on electronic design.
  • The ARRL Handbook: I've always been underwhelmed by this book.  I have both the 2009 and an early 1980s edition, because they took out all the tube pinout tables in the 90s.  They release a new edition every year, but the 2009 section on computers and wireless networking still read like it was written in 2001, so I don't really understand what they're changing every year.  Incredibly, I know Hams who buy the new edition every year, so you can get a good deal on lightly-used copies that are only a few years old.
  • Technician, General, and Extra amateur radio study guides: These never ended up being as useful as I ever thought they would be.  The only thing I ever refer back to in these is the color-coded radio band charts, which guess what, you can get as a PDF online.  Borrow these from someone else, pass the test, and give them back, in my opinion.
  • My back-issues for QEX, which is an outstanding bimonthly magazine put out by the ARRL.  It's thin at only ~20-40 pages, but I find the three articles this magazine does have are always more interesting and challenging than anything I see in Make or QST.
 Now we're getting into the meat of my system.  Below my books is an empty shelf which I use as the dumping ground for projects so they don't collect on my workbench proper.  Breadboards, grab bags, etc.  With some effort, and probably female pressure to be more organized, honestly I could probably get everything on this shelf to fit in somewhere below it, but luckily I'm lazy and single, so this graveyard lives on.

In some ways, it's easier to find common parts by stripping them off the last project than putting them away and digging them out again, so I tell myself that this is still an integral part of my system.
Finally, my junk box (using the singular form of box loosely).  My collection originally fit into a single corndog box, which is really nice for the job with the locking lid and everything, but as you can clearly see, I've outgrown a single box, and am close to outgrowing this system entirely.  Whatever I do end up replacing it with is going to require numbered boxes, binders, and spreadsheets, so I'm trying to make this work as long as I can.

The system is based on starting with your first box, which you simply dump everything into.  Each little ESD bag must be well-labeled, with not just the part number, but also a short description of the part's function, quantity, package, etc. Once all of these bags stop fitting in one box (which happens quickly), you get a second box, define a new category, and resort everything until you outgrow another box and have to split things again.  In rough chronological order of how I split my junk box:
  • Passives: through-hole resistors, capacitors, inductors, diodes, etc.  I also have some small spools of magnet and wire-wrap wire in this box.
  • ICs: Through-hole integrated circuits.  This includes shift registers, 555s, EEPROMs, and some assorted 7400 logic which doesn't fit in the several 3' tubes which I store most of my pure logic ICs in.
  • Analog: Through-hole analog ICs.  Voltage regulators, op-amps, maybe ADCs and DACs if you like them in here more than in ICs, audio amplifiers, etc. 
  • Modules: All of the large pre-built modules.  LCD displays, GPS receivers, RFID readers, segmented and matrix LED displays, etc.  Use lots of small bubble-wrap baggies in here to prevent scratching screens.
  • SMT: The surface-mount equivalents to the IC box.  In addition to these, I include all of the breakout boards I've collected over the years in this box (i.e. Electroboards).
  • SMT-PASS: The bulk spools of surface mount passives, which I only need to refill my AdaFruit book when I deplete a strip.  When you're buying individual SMD passives, it almost always makes sense to buy them in quantities of 1,000+; pricing is usually logarithmic, and you often find 2,500 count spools at swap meets for $2 a piece.  Trying to get parts off the spools is a pain, so cut off a few strips of 25, label the back, and put the spools in deep storage.
  • Connectors: Male and female board-to-board header, DB-9/25, crimp spade lugs, thermocouple jacks, IEC jacks, terminal blocks, solder tabs. If I didn't have a toolbox dedicated to nuts and bolts, those would probably end up here too.
  • Packaging: Project boxes, perf board, ESD foam, other misc cases and packing material I've collected.  I also keep about 20% of the expanded paper I get from Digikey, but I use it to pad behind all of the boxes to keep them towards the front of the shelves where I don't have a second row of boxes.
  • Microcontrollers: Nothing but microcontrollers, both SMD and THR.  Between AVR, MSP430, PIC, ARM, and 8052, I've got enough different microcontroller chips floating around I could build a beowulf cluster powerful enough to crack the Enigma. Each architecture gets their own sub-bag inside of this box to make digging easier.
  • Mechatronics: motors, encoders, servos, switches, strain gauges. If it moves and has to do with electricity, I put it in here.
  • Batteries: AA, AAA, and CR2032 blister packs and various geometries of battery clips. It's nice to have a variety of configurations of clips (2 in a row vs next to each other, integrated power switch, etc) when you're working on a project and need to find some way to fit a battery in what little space happens to be left.
  • Project Specifics: Some projects require some very strange parts that I never stand the chance of using in anything else, or I plan to be building so many of the project that having everything in one place will save time.  The GoodFET, Bus Pirate, and SerialCouple all get their own homes.  I also have a few boxes which are parts not for me, but which someone I know has asked me to order; it's much easier to not lose their stuff when it's taped up back in a box with their name written on it.
Really, the entire system comes down to trying to keep boxes below ~30-40 parts so it's easy to root around in a single box and find a specific part, and when you're later deciding which box to put a part in, ask yourself "which box will I expect myself to have put this in next month?"  If I want a voltage regulator, I know to look in the analog box, and when I want a motor, I look in the mechatronics box.

The one problem that my system doesn't solve is inventory tracking.  I can find parts pretty quickly if I know I have them (and actually do have them), but I have no good way to track if I own a part, or how many I've bought or used.  I have double-ordered parts I'd forgotten I had before, which in the 3-5 quantities I usually order isn't a big deal, but double-ordering a 5,000 spool of 330 ohm resistors would hurt my dignity.  At some point, I will probably need to put together a spreadsheet tracking inventory, but as it is, this system is fast and easy enough that I actually use it.

Sound off in the comments with your own organization schemes.  Internet points to be awarded to the first person who can produce pictures of their entire (non-trivial) electronics inventory in a single giant refrigerator box with "junk box" scrawled across the side.

Saturday, March 24, 2012

LOTO (Lock-Out Tag-Out) - Linux Command Line Mutex

I've been doing quite a bit of shell programming in a variety of Linux environments lately, and have for various reasons needed some way to control access to specific files or resources.  For example, I like to have a very aggressive backup system between my computers, so I have a backup script that runs on my laptop every five minutes to rsync my entire /home directory back to my file server and save a snapshot.  Rsync is a very intelligent differential copy system, and the majority of the time my laptop is on my apartment LAN, so it usually finishes in a matter of seconds.

Unfortunately, usually is such a sticky word in computer science.  All it takes is downloading one video file from my camera, or trying to get online in a 300 person lecture hall, and suddenly my speedy rsync script gets hung up and can take several minutes.  If it takes more than five minutes, suddenly the next copy of the same script starts running and slows down the first.  Five more minutes, and a third starts.  This is somewhat analogous to the Sorcerer's Apprentice Syndrome bug in TFTP, in that each copy slows down all the previous copies to the point where nothing useful is being accomplished by anyone.  I wanted a way to easily check if the previous copy of rsync (or even any other network-intensive job) happens to be running, and if so give up.

Source code.

I decided to solve this by writing a program in C which uses the sys/file.h flock() system call to gain an exclusive lock on some magic resource file to signify "owning" the file.  I named this tool "loto," after the OSHA "Lock-Out Tag-Out" policies which are used around dangerous equipment to ensure everyone knows who's working on what (I thought it was a clever analogy).  By using the flock() call instead of trying to warrant access based on just the existence of the lock file, I prevent the possibility of stale locks from scripts which create the lock, start running, then either die or get killed before getting a chance to release the lock.  By tying the lock to an open file descriptor, it becomes the operating system's job to clean up after loto regardless of how it exits.

Now, every shell script I write which starts a large upload has loto get a lock on /var/lock/loto.net, and every computationally expensive script or simulation I spin off into the background locks /var/lock/loto.cpu so my computers don't go catatonic on me.  Further usage details can be gained from the README included in the source code repository:
$ git clone git://github.com/PhirePhly/loto.git

The basic usage is to call loto with a lock file and optional verbosity and wait behavior flags, and then a "--" and a single command to run and wait to finish:
$ loto -L /path/to/lockfile -- echo I have a lock on this situation
$ loto -L cpu -- echo You also get shorthand macros for cpu and net

To have loto wait for the lock instead of give up right away, add the -w flag for unlimited patience or -t #OfSeconds for a limited timeout wait on the lock.

The experienced Unix guru will ask why I didn't just use the flock command line tool.  The honest answer is half that I didn't manage to find it until I was already mostly done with loto.  The other half is that flock isn't part of any Busybox environment I've seen, so I found it easier to write my own little single-file tool than try and get all the build dependencies for flock.  Flock does allow for some fancy shell-fu which loto doesn't support, and it is likely already installed on your system, but I figured I'd release my code on the off chance someone wants a simple version of flock to tweak its behavior.

Depending on how you look at it, loto walks precariously close to being a direct copy of a tool I found online called lockrun, but I changed his style a bit and have started adding some features.  In any case, credit where credit is due.

One thing I am a little stuck on is that I have been trying to come up with any use case where you would want the ability to get non-exclusive locks on a resource.  Can anyone think of a reason to implement a -l (little L) flag to complement the -L exclusive lock?  Anything I come up with just seems contrived...

Thursday, March 22, 2012

My Tower is Famous

It's not even April yet, and I'm already getting excited about Maker Faire Bay Area in May.  Maker Faire is an amazing event where everyone I regularly interact with online all make the annual pilgrimage to the Silicon Valley and spend a weekend checking out the best of the best of the maker community.

Last year was the first year I was able to make it, and I was just blown away.  Really, I was pretty much overwhelmed. I'm not a huge fan of dealing with large crowds, and this thing was packed to the fair grounds limits from the moment the gates opened at 10am.  After fighting crowds for two hours, I needed to take a break, so I managed to find a booth that was empty except for a bunch of Jenga-sized building blocks and lots of small children.  I'm bigger than small children, so I could deal with that for an hour or so.

Turns out, the tower I built at 1pm never got knocked down on Saturday. Ever.  It just stood there for six hours as a testament to the utter respect maker's have for each other's creations.  Make Magazine's blog just posted a picture from last year's faire with my tower in the background.  This was well past when I was still there working on it, but it's kind of neat to at least see my tower make the big time.

If you happen to be at all remotely close to NorCal, or even just have the ability to make it to the Bay Area, I can't urge you enough to come out for Maker Faire Bay Area on May 19/20.

Prowl Push Notifications from Bash

After Matt Richardson finally convinced me to buy the Prowl app for iOS, which allows you to send Push notifications to iOS devices using nothing but their simple http API, I've started trying to build it into everything.  I have all sorts of bash scripts running on my computers which rotate logs, check system health, run backup scripts, etc, and why just have them send me emails to my user account, when I can have them send text messages to my iPod?

Of course, the thing is, I very quickly got tired of having to copy-paste the same magic curl command into every script where I wanted to use it, so I wrote this quick little wrapper script around it to make it a little easier to use Prowl on my computer, and make my bash scripts a little easier to read.

To install this on your computer, make sure that you have curl installed (or rewrite this for wget, which is more likely to be installed by default), and then paste this code into a file somewhere in your shell's PATH list (which is where your shell looks for commands when you type one in).  If this is your personal computer, you could get away with putting this in /usr/bin, but I append ~/bin/ to my PATH so I can keep my personal scripts there.  chmod +x filename to make it executable, and replace my censored API key with your own from prowl's website.

Source code:

Two things that this script uses which is a little squirrely is the $# built-in variable and the /dev/fd/2 device.

$# is a special variable in bash which is the number of arguments passed to a script, so in this case I am using it to see if the user is calling prowlpost with two or three arguments to decide if they're trying to change the priority of the message from the default, or otherwise try and explain to them again how to use this tool if they don't manage to give either two or three arguments.

The reference to /dev/fd/2 around line 32 is part of the VFS which exposes the three standard streams (standard in, standard out, and standard error) as path names in your devtmpfs.  Since it is traditional for usage problems with a script to be printed to standard error instead of the default standard out that echo uses (so the user is more likely to see them from commands in the middle of pipe chains), we redirect the output of echo to /dev/fd/2, which is a file descriptor for wherever stderr happens to go to for this script's shell as a whole.  It's a nice trick if you need to explicitly pipe things into stderr or stdout, or pipe stdin into something.

Wednesday, March 21, 2012

atac - ASCII to ASCII Converter

atac source code repository.

When programming, it is not uncommon to want to make some sort of nice big separation between sections to make it easier to scroll through the source code and find what you're looking for.  This is usually done with big blocks of whatever the language's comment character happens to be (so in C it is done with long lines of /////////), but my father and I wanted to be able to create headers a little more meaningful than that.

ASCII art is where the monospaced font typically used in source code and on the terminal is used to draw diagrams, pictures, or larger version of symbols than in available from the font alone, using the ASCII character set commonly used in early (and even often modern) computers.  This was originally most useful when computer printers were little more than electric typewriters, so if you wanted any font other than the one in the printing dies, you had to get somewhat creative.  If you wanted headers to be a larger font, or even just bold, you were just out of luck*.

Building this enlarged "banner" text by hand can be tedious, so inevitably several programs were written that would convert requested text into a much larger version of itself.  Examples include the sys V banner and BSD FIGlet tools.

Both of these are perfectly good tools for the job, but my father and I wanted a simple and portable tool that did a little more than banner, but not anywhere near all FIGlet does (kerning in source code seems ridiculous).  The main thing we wanted was a single source file with no dependencies so it could be compiled in any of the several Unix environments we typically interact with nothing more than a standards-compliant cc, and have it be able to build the banner text with an optional comment prefix (such that banners in C would have each line start with //, bash scripts with #, etc).

So I wrote atac - the ASCII to ASCII Converter, which I'm finally releasing as open source after having it sitting around in my src and bin directories for several years now.  The public repo for it can be found on github, and can be checked out and installed from the command line by:

$ git clone https://github.com/PhirePhly/atac
$ cd atac; make install

This will compile it and copy it to your /home/user/bin/ directory, assuming you have one.  If you have root-like powers and would like to have this available system-wide, copy it to /usr/bin instead.  My father, always the pragmatist, renamed atac to the slightly more mnemonic BIG_WORD, and installed it through his company's unix systems, which I find highly amusing when I hear stories of other engineers finding this tool in their PATH and start using it in code that my father eventually sees.

The single feature currently separating this program from banner (other than a different font) is the -c prefix option, to have atac prefix each line with an arbitrary symbol or string to comment out the line in source code.

We most typically use atac by invoking it from within vim in a shell, and then have vim dump the result back into the file currently being edited (this is done by dropping into command mode (esc) and typing ":r!atac title" enter enter), but it has found several other uses, including breaking up long batch logs into each stage or flagging problems.

Several examples of atac's behavior can be seen in its README.

* - This wasn't really true.  Using tricks involving printing backspaces and printing over characters repeatedly allowed users to generate bold or underlined fonts at the expense of longer printing times.

Tuesday, March 20, 2012

How to Correctly Advertise in Social Media

It's hard to deny that the buzz-word for marketing for the last few years has been social media and networking.  If a company or organization doesn't have a Facebook, Twitter, et al., you'd get the feeling people think they just aren't trying hard enough and may as well not exist.  The problem is that once a company gets a Twitter account, what the heck do you do with it? This is a pet-peeve that's been bothering me, as I have been barraged by friend requests and tweets from companies that just don't understand how to use 21st century communication channels and how to not be annoying about it.  (I've also apparently managed to pick a company name for my twitter handle, which they weren't so happy about)

There are countless examples of what NOT to do with social media; companies that literally treat their twitter stream as a place to regularly dump advertising copy.  Commercials work because they jump out at you in the small spaces between scenes of a TV show or between songs on the radio.  I am not going to start following a company on Twitter just so I can mix their tweetvertisements between my friend's, actually interesting, tweets.

Social media advertising doesn't come for free. 

The rest of us get to have Facebooks and Twitter accounts for free because we are (to some fraction of the rest of humanity) interesting and engaging human beings.  Just because you're a corporation doesn't mean you get a free pass on that requirement.  I give people a reason to follow me on twitter by using it to give sneak peaks on future projects, post one-off pictures of projects that don't warrant full blog posts, and by generally being a person teetering somewhere between interesting and amusing.

As a company, you're inherently neither interesting nor a person.  Some companies do enjoy some success working around this by recruiting internal personnel to become very visible on social media, or they may just keep employee moral so high that they willingly create strongly-branded personal accounts supporting the company; an example being Tektronix's @JoelAtTek.  I couldn't tell you whether Joel's account was specifically prompted for by "the company" or if Joel just decided that he likes working at Tektronix so much that he'd put it in his user name, but in either case, 800+ people follow him on Twitter and see "Tektronix" in their twitter steam every day.

Of course, presenting a specific personality as the face of the company can have risks.  For every Steve Jobs, there's a dozen scandals where employees post strong opinions or inappropriate statements which hurts the company.  If Joel were to stop working for Tek, at best their social media presence disappears, and at worst becomes disingenuous, which can hurt even more when it comes to light that some intern has been running the @HappyEmployeeAtCompany twitter account for the last six months.

Give us a reason to follow you. 

So what if you aren't comfortable presenting individual people, and instead want to keep your corporate image, well, corporate?  Simply, it all comes down to incentives.  You need to give your customers a reason to follow you, and despite what you want to think about social media, it usually isn't free.

The obvious first incentive is giveaways.  People online love free stuff, and will flock to it like Methodists to coffee and donuts.  This works best when you're able to target the desired demographic by selecting giveaways that your customers would find of value.  This is unbelievably easy in electronics; there are countless books, development boards, equipment, consumables, etc, that you can give away, and which quite possibly can prompt the recipients to post reviews or messages of gratitude online once they get it, which helps to multiply your message.

But even giveaways can be seen as too shallow of an interact with your customers.  The true key to success in the social media sphere comes down to putting serious time and effort into producing content and make following you informative and worth while.  The internet has leveled the publishing playing field, and content is king.  The traditional press release worked when your were sending dittos of it to journalists who desperately needed to fill X number of column-inches by tomorrow, but the contemporary content consumer has no problem will filling their front page with pictures of cats, so you need to make your press releases accessible, engaging, and interesting.  If your company has exciting news, make it sound exciting.  If it doesn't, make it at least sound exciting, or get your employees to start making better news.
  • If you're releasing a new product which outperforms the competition, write an interesting article about how much better your widget is, what problem that solves, and how you did it.  Don't be afraid to get into the nitty gritty about how this product is new and what it can do.  Show performance statistics, make (hopefully not as cheesy as) side-by-side comparisons like paper towel commercials do, or anything else you can come up with that you think the consumer would find interesting.
  • Target your news at how people consume content.  Pictures are worth 20 lines of scrolled-past text, and videos are king.  SparkFun posts a weekly new-products announcement, and they always have plenty  of high-quality pictures and a video.  Mixed media ensures you can get your message across to everyone, and lets you say the same thing a couple times anyways.
  • Give users ideas for how to creatively use your product.  If you watch SparkFun's product announcement videos, you'll notice that after they talk about that week's new products, they then show you an interesting project idea that their engineers put together using the company's products.  This may seem to be targeted exclusively at hobbyists, and maybe your product doesn't beget projects as exciting as SparkFun's.  This doesn't have to stop you.  
    • 1% of hobbyists are current, or future, passionate employees in disguise. It may seem silly to make a video showing how to use a $3,000 oscilloscope to measure your heart rate, or how to print a chess set using your rapid-prototyping service, but that's not the point.  For every 100 hobbyists which watch your video or win your giveaway or buy a single sample of your product, chances are at least one of them is only a "hobbyist" during his free time.  He may come back a month later, not during his free time, and ask for another million units, but not if you made it hard or impossible for him to get the first one as some schmuck in a garage with a credit card.
    •  Just because your product isn't exciting doesn't mean you can't make it at least interesting.  SparkFun's weekly project after their product announcement model may not work so well if your company operates in such a dynamic industry like reselling aggregate...  Then again, there might be at least something at your company that people could find interesting.  Maybe you can put together a couple videos on how to use your aggregate to design proper drainage around a building ("How to install a french drain in five easy steps"), or what could go horribly awry when incorrect or insufficient aggregate is used ("Watch this house sink into its owner's new garden").  Your videos don't even need to be application-based.  Producing a 60-second YouTube video showing how your company turns a rock the size of a car into pebbles for a customer with your company logo at the end is likely to prove to be louder in social media than any text-only press release.

Social media advertising still has a cost. 

If you are now thinking to yourself "gosh, all of these giveaways and all of these pictures and videos are going to cost a lot of money and employee time," then you've probably gotten my point.  Social advertising is not free; anyone who tells you that is either lying or doesn't know what they're talking about.

It's not only going to cost money, but requires a creatively and charisma that throwing advertising dollars at ad agencies doesn't.  If your company already happens to have some kind of "Application Engineering Department" which already works with customers to help them use your product, make sure that they have a good video camera and managerial support to start building and documenting these novel and interesting applications, not just for current customers, but as part of your company's press releases.  If you don't have a department like this, start looking for individual employees that can come up with ideas for what to do with your product, and give them the time and resources to execute on them.  Social advertising can't start from a company's marketing department.  The marketing department will absolutely still be involved with social advertising, but they need to start getting to know your technicians and engineers much better, and are going to be spending more time polishing content produced by other departments than writing optimistic sales copy based on technical specs.

Marketing departments can only sell content.  
They don't create novel or interesting content relevant to your product, they can only sell it.
And remember, on the internet... 
Content is king. 


@Digikey is one of my favorite case studies in exactly how to utilize social media to get your company name and message out, and how to use Twitter to leave customers with a warm personally-served feeling, even when you're a mail-order company on the other side of the country or world.

First, they have several regular weekly giveaways. Most of them are trivial swag like branded water bottles, pocket knifes, and sweatshirts, but then again, I love my Digikey sweatshirt and wear it all the time.  They also have much more targeted giveaways where they give away Kindles or Beagleboards, or even let you pick any part out of their catalog to win.  Sure, giving away a Kindle may seem like a lot for social advertising, but you have to realize that Digikey bought a genuine company shout-out from the guy they sent it to.  The playing field has been leveled, and you will be surprised how loud someone can thank you when they happen to write for a website with several hundred or thousand subscribers.  Sure, most of your giveaways will quietly disappear, but so does most of your traditional ad impressions.  On the other hand, you get to roll for that 0.1% chance that someone will write about how great a company you are, and you just got a couple thousand organic ad impressions without even knowing about it.

You can do better than just throwing money at the problem.

What puts Digikey in a class of their own isn't that they have regular giveaways.  Even I have giveaways, and it's not like this site is particularly sales-focused.  What Digikey does that is so phenomenal is that they clearly invest not only money, but engineering manpower, in their social media presence.  Take for example, the following typical exchange between myself and Digikey on Twitter:
I'm working on a project and drilling down through Digikey's online parametric search engine to try and find a connector so I can build an IEEE-488 adapter.  Of course, IEEE has all the detailed documentation on the standard online behind their paywall, but I'm not particularly in the mood to leave my apartment to get on campus or log into the UC Davis VPN to try and get at it, so I'm trying to find the right connector based on a crude outline on Wikipedia and some sketchy references to IEEE-488 on websites like AllDatasheet.

I didn't even direct the question directly to Digikey's account.  I found something I thought looked right, and figured I'd throw it out to my Twitter friends, most of whom stand a chance of knowing this, and see what I get back.  The fact that Digikey responded and not only answering my question, but also provided the non-EOLed part and a mating connector, is... awesome.

Sure, it probably isn't a big deal that they managed to sell me a $4 part, and if you look at it like that, you'll never justify the man power needed to maintain this.  Then again, it may be a big deal that they put a $4 part in some engineer's parts box with a Digikey part number printed on the bag.  What happens when your customer finishes the prototype and needs to buy another 100k of their whole BOM?




This was a rant I've had kicking around for some time now.  I'm pretty much done with school right now, so I know that at the very least I am looking forward to many more blog posts in the coming months, unless some company comes in and ruins the party by offering me a job...