Cheap USB-serial adapter neither fish nor fowl

Posted on 01 Nov 2010 01:34

You can get USB-serial adapters for absurdly low prices from ebay or Asian import stores like Deal Extreme. Needless to say these are not exactly high-quality electronics, however they can do the job for hacking purposes. USB-serial adapters are a convenient way to supply both a small amount of regulated power and simple communications to a peripheral device.

The big problem with these adapters is that they implement neither an RS232 compliant waveform, nor a TTL waveform that can be understood by the AVR's UART. Rather, they implement sort of a pseudo-RS232 that produces a clipped waveform from 0 to 5V. But as it turns out, this is simply inverted from what the UART expects.

There are a few different solutions to this problem. You can use a hardware inverter if you have one handy, like some sort of inverting logic, or just a 5 cent transistor. You can use a software serial decoder, which seems reasonable if you're already using such software instead of an integrated UART. But if you're using a chip that has a UART, it seems sort of dumb not to use it somehow.

If you have a couple of spare pins on your micro, I found another solution which uses less than 10 lines of code. This example is for an attiny2313, but the basic form will work with any AVR with a UART (or most any microcontroller for that matter):

// some cheap pl2303 usb->serial adapters use a pseudo-rs232 output with
// 0-5V levels, but with an inverted waveform relative to real TTL serial
// we can use a pin change interrupt to re-invert this input on another pin to
// feed the UART a signal that looks like normal TTL serial
    // invert pin D3 on pin A0
    PORTA = !( PIND & _BV(3) || PINA & _BV(0) );

void pl2303_init(void)
    // configure pin D3 to invert input on pin A0 for non-TTL serial links
    DDRA  = 0b01;        // pin A0 is output
    MCUCR = _BV(ISC10);    // interrupt on any pin change
    GIMSK = _BV(INT1);     // enable interrupt
    PORTA |= 1;

Comments: 0
**Blog tags: **

IV-6 VFD vacuum fluorescent tube email counter

Posted on 17 Oct 2010 23:58

The star of the show is the Soviet IV-6 vacuum fluorescent display tube, brand new from old stock. I picked it up on ebay for $1 delivered unit cost.

Digit segment switching is via 7 2N3904/3906 NPN/PNP transistor pairs. I didn't want to use a VFD driver chip because a) they are scarce/obsolescent b) they are expensive c) they are overkill for a single 7-segment tube and d) most don't have a thruhole package option anyway.

The section to the right of the tube is a boost converter circuit to generate the ~25V to drive the grid and segments. Since it is a single digit tube, it is a direct DC drive. The IRF730 power MOSFET is modulated by the PWM output of the Atmega8 on the left side of the board.

Power and communication is via an FTDI FT232R USB-serial cable, which I will replace with a cheap PL2303 cable (when it arrives from Hong Kong). I'm also gonna move this to one of those fancy new transparent breadboards, because I think that look will really complement the vacuum tube. I might rethink the layout to see if I can cut down on the tangle of wires.

Comments: 0
Blog tags: iv-6 vfd

Finished IN-16 nixie tube email counter

Posted on 17 Oct 2010 23:26


This nixie tube counter displays the count of my gmail inbox. For a sense of scale, the counter is mounted on top of a 22 inch computer monitor, attached by a velcro strip.


The top of the case is a little scratched from the build process, so I'll make another one soon (I have about ~100 such cases).


The module on the left is a $2 PL2303 USB serial adapter from ebay, which supplies both 5V power and instructions from the computer. The module on the right is the high-voltage anode driver for the nixie. The chip in front is an Atmel AVR attiny2313. The nixie tube is a Soviet IN-16, brand new from old stock. The cathode driver for the nixie is a Soviet K155ID1 (74141 clone) and is mounted underneath the tube.

Comments: 0
Blog tags: in-16 nixie tube

Nixie counter v1

Posted on 05 Sep 2010 20:35


Comments: 0
Blog tags: in-16 nixie tube

nixie counter progress

Posted on 02 Sep 2010 05:38

I returned from traveling to find all of the parts I need to complete my nixie counter project had been delivered. So, I connected the tube to my new Russian 74141 nixie driver clone, which really is a handy part, as it's hardly more than a set of high-voltage NPN transistors in a DIP package. Then, I hooked up a microcontroller, an ATtiny2313 to…control it. I picked the 2313 because of the hardware UART, and it has enough IO pins to drive the 74141, drive a couple of extra NPNs for the decimal point elements, do serial communication, and PWM the boost converter.

From here, I'll finish the project in three phases:

  1. A fully functional breadboard circuit, using the nixie power module I got from John Taylor.
  2. Same breadboard circuit, using PWM boost converter.
  3. PCB circuit and finished aluminum case.

Next up is the comms interface for (1) and the software to feed it my inbox count.

Comments: 0
**Blog tags: **

ebay bonanza

Posted on 22 Aug 2010 03:06


My Ikea rack project is coming along decently. The rack itself is finished, and I am now working on panels for my spectrum analyzer and bench power supply. These will look very cool when they are done, but it is taking time to work through the right materials and fabrication technique.


The real news today was the arrival of a batch of parts for my nixie tube counter project.

Nixie tubes use a relatively high voltage anode at ~200V. However they consume little current, so it is a simple matter to boost a more convenient voltage source up to the desired level. In this case the source will be the +5V from a USB serial adapter that will also power a microcontroller. A few days ago I got a DC converter module to do the job, which I promptly destroyed by wiring up backwards. The replacement arrived yesterday.

This was good timing, because the IN-16 nixie tube and the transistors I'll use to switch the digits on and off arrived today. There are a lot of steps to make an email counter out of all of this, but each step is pretty small. I'll be travelling next week, so it might be a couple of weeks before I can put it all together.

Comments: 0
**Blog tags: **

I need a cheap tabletop rack

Posted on 14 Aug 2010 03:20

I like these DIY Ikea-based racks. There are a few different styles, but I like these "Rast"-based builds most:

ikea rast 19" rack

Comments: 0
**Blog tags: **


Posted on 12 Aug 2010 10:24

Lots of activity in the Projects section.

I have a nice build of my animated Vacuum Fluorescent Display clock, and working build of my 2.4GHz spectrum analyzer.

Comments: 0
**Blog tags: **

Bookmark and Share