Tuesday, April 26, 2011

IR Serial Communication Demo

I found a good deal on Infrared LEDs a few months ago, and have finally gotten around to starting to play with them.  This first demo is a basic low-speed serial communication system that allows up to about 2kbps communication through line of sight, though I've only tested it for 512 baud.
This is done using two MSP430G2252 microcontrollers, one bit-banging out 38kHz continuous wave modulated serial, and the other using a fixed frequency 38kHz receiver to demodulate the IR and decode it.  Both processors use a seven segment LED display to display their current state, which can range from 0-9 or an E(rror) state.

The limiting factor in the baud rate is the IR receiver, which has a 200us response delay, which means if we try and modulate information faster than that, the receiver will just ignore it.  That being said, the 512 baud rate I tested is still perfectly useful for basic telemetry information like "change channel" or "Turn on/off" like is used in television remotes.


The range is quite good, covering most of a room with 40mA into the IR LED.  The software leaves something to be desired, since it consumes almost all of the processor time bit-banging out 38kHz and trying to do anything else would likely glitch the modulation.  Error detection coding will be the next priority.

Transmitter parts list:
  • 1x MSP430G2252 (TI)
  • 1x IR LED
  • 1x 50Ω resistor
  • 1x 32kHz crystal
  • 2x push buttons
  • 1x seven segment LED display
  • 8x 100Ω resistors for LED display
Receiver parts list:
  • 1x MSP430G2252 (TI)
  • 1x 38kHz IR receiver (TSOP39338 Digikey $0.91)
  • 1x 32kHz crystal
  • 1x seven segment LED display
  • 8x 100Ω resistors for LED display
Source code:

Friday, April 22, 2011

ESC Silicon Valley May 3rd

 Just wanted to give everyone a heads up, I'm going to try and be at the ESC Silicon Valley embedded systems conference on Tuesday May 3rd, so if anyone reading this is going to be there, I'd definitely be interested in meeting up, and if anyone else is interested in coming, it's going to be May 2nd-5th, and registration to just get onto the showroom floor is FREE.

Wednesday, April 20, 2011

Single Transistor FM Transmitter

I've been following along with Mark VandeWettering, K6HX, this week playing with Tetsuo Kogawa’s 1 transistor FM transmitter, and I figured I'd post my results too, after watching Mark have so much fun with it as well [1][2][3].

I did make countless adjustments to the original circuit, since I had almost none of the exact value components called for, but picked ones that were pretty close, which might explain why mine doesn't work all that great.  Like Mark, I used a more common transistor (2N2222, he used its smaller brother 2N3904).  Everything else was little better than within 50%, so the fact that it works at all is pretty amazing.  I really need to refresh my capacitor kit...

In the video, I mentioned that I actually got much better performance when it was still in a breadboard.  I had shrugged this off as some stray capacitance doing the circuit good, but it turns out that it was mostly because my feedback capacitor happened to be laying on the ground plane, which was what was hurting the stability of the circuit.  Bending the 15pF capacitor back up means it's about as stable as Mark's ugly build now, only with rather poor bass response.
I'm running the circuit on 12V, and it's drawing about 8.9mA, which is comforting, because I don't want it putting out any more power than I have to to play with.  I'm not even entirely convinced its transmitting in the 100MHz range; it could very well be transmitting in an entirely different band below 100MHz and I'm just picking up some harmonic.

Thursday, April 14, 2011

AVR Nixie Tube Thermometer

A few months ago I was wandering around the newstand in downtown Davis looking for something to read, when I found the January issue of Elektor, which had a feature article on building a nixie tube thermometer.  It looked like an interesting project, and gave me enough pieces to roll my own using what I happen to have in my parts bins.
Nixie tubes were originally used in the 1950's and 1960's, before LED and LCD segmented displays were developed, to display numerical information from equipment such as volt meters and early computers.  Nixie tubes operate by having 10 different shaped cathodes and an anode cage in a neon atmosphere.  With a large positive voltage applied to the cage, and one of the cathodes grounded, electrons will be ejected from the cathode and ignite the neon immediately surrounding the specific cathode, which are formed in the shape of the digits 0-9.

Nixie tubes went out of use quickly once it was possible to replace them with LEDs and LCDs, due to their requirement for high voltage, their fragility, and relatively high power requirement.  The steampunk movement has brought back their use as a novelty, which has unfortunately driven up the cost of larger tubes on the second market (Obviously, production of nixie tubes halted decades ago).  The IN-16 tubes used for my thermometer are about as big as you can get them while still being affordable, being about $3 a piece on eBay.


The circuit is composed of two major parts: The digital control on the front of the circuit board, and the high voltage power supply behind the tubes.
The digital control is driven by an ATTiny2313 AVR, which reads the current temperature from a DS1631 temperature sensor, optionally converts the Celsius reading into Fahrenheit, and then decodes it into  three digits of BCD, output to the nixie driver chips, which decode the BCD to 1-of-10 while being able to handle the high voltages from the nixie tubes.

The jumper next to the AVR controls whether the temperature is displayed in Celsius or Fehrenheit.

The Nixie tubes have a junction voltage of about 120V, meaning the current through the display is determined by the remainder of the voltage across the current limiting resistors: (180V-120V) / 22k = 2.7mA.

Parts list for control circuitry:
  • 1x ATTiny2313 AVR
  • 1x DS1631
  • 3x IN-16 Nixie tubes
  • 3x K155 or 74141 Nixie decoder
  • 3x 22kΩ resistor
  • 3x 4.7kΩ resistor
  • 1x MPSA42 300V NPN signal transistor (Digikey)

The power supply was where the magazine article was most valuable.  The MC34063 is a Texas Instruments boost convert, which means it uses an inductor to step low-voltage high-current to high-voltage low-current.  I have done this open loop before, where the on and off times of the grounding switch on the right of the inductor are fixed and you just hope it happens to be the right voltage.  The MC34063 on the other hand is able to run this circuit closed loop, meaning it samples the output of the circuit and uses that to adjust how it controls the boost circuitry to maintain a fixed voltage, regardless of load.  This is done by the voltage divider, which divides the desired voltage down to 1.25V to be compared with the voltage reference inside the chip.

The 330pF capacitor controls the speed the boost converter runs at, and is mostly a function of how big the power inductor and voltage ratio are.  I just used a value close to that in the schematic, but ideally you would calculate this using the tables from the datasheet.

Not shown in the schematic is the very standard 7805 linear regulator used to step the 12V down to the 5V required for all of the digital control.

Parts list for power supply:
  • 1x MC34063 boost converter (I managed to smoke the first one with 180V pretty quickly, so having it in a socket and having spares is a good idea) (Digikey)
  • 1x 7805 5V linear regulator
  • 1x IRF820 MOSFET
  • 1x 500μH power inductor (Digikey)
  • 1x 1N4937 600V fast-recovery diode
  • 2x 100μF 100V capacitors (or a single cap rated for >200V)
  • 1x 820k resistor
  • 1x 5.6k resistor
  • 1x 150Ω resistor
  • 2x 47μF capacitor (25V)
  • >2x 0.1μF capacitors (25V) - Apply liberally throughout the circuit
Source code:

Tuesday, April 12, 2011

Reprogramming the eZ430-Chronos RF Dongle

The eZ430-Chronos is a development kit released by TI last year that consists of a watch, a programmer, and an RF dongle, allowing the watch to wirelessly communicate with a computer over an ISM band of your model choice.  I bought one when they were first released, and started to do some interesting things with it.  Unfortunately, it was somehow misplaced over the summer, and that was the end of my experiments with it.

Of course, I didn't lose the USB dongles that come with the kit, so I still had those, and no watch to use them with.  The programmer is probably useful as a standard eZ430 FET, but the real value is most likely in the RF dongle.  It's a CC1111-based radio, meaning that it can quite easily be built into any kind of ISM to USB adapter, with the right firmware.  The first trick is, of course, being able to reprogram it.

The first application that comes to mind is talking to IM-MEs, which use the very similar CC1110 SoC radio...

Conveniently enough, the RF dongle exposes all of the programming points on a 2mm 2x3 grid on the bottom of the board.  Solder tacking some 32 gauge wire to the required pads allows them to be plugged into any CC programmer, one of which is the GoodFET, which I happen to be selling assembled boards for.  I wrapped the other end of the 32 gauge wire around pieces of 20 gauge wire and soldered them there to allow them to plug into the female header on my GoodFET.
 The required wiring is:
RF Dongle (Source pg 59)





Reprogramming is then just a matter of using the GoodFET client to back up the old program, erase, and flash whatever hex file you want on it.

$ goodfet.cc status
$ goodfet.cc dumpcode rfdongle.backup.hex
$ goodfet.cc erase
$ goodfet.cc flash newprogram.hex

If you forget to backup the RF dongle code for the watch, and don't want to bother recompiling it, here is the original hex file, which doesn't support the new RF BSL feature, but will get you the standard communications system.