Tuesday, August 26, 2008


Look at what people at some Indian atomic research center are producing.
Simply put, the guy comes up with a "clever" way to measure stuff using a lot of "general purpose" chips, instead of the obvious, straightforward solution that everyone uses: a programmable microcontroller. He gives a complicated schematic that underutilizes an expensive component and needlessly employs another expensive component. It's more of a novelty, an academic curiosity (though not a particularly interesting one), than a sane product.
Table 1 below lists approximate prices for the components in the guy's design:

Component Price Link
DLP-USB245M* $25 http://www.dlpdesign.com/usb/usb245.shtml
MAX187CCPA** $14.81 https://shop.maxim-ic.com
74LS164*** $0.49 http://www.futurlec.com/IC74LS00Series.shtml
74LS90 $0.49
74LS74 $0.29
74LS132**** $0.30
R,C etc. negligible
Total $41.38

Table 1: Guy's Bill of Materials
*not an actual "general purpose" component, at least not as general purpose as a 74LS chip, and certainly less general purpose than a microcontroller; to save money, it could be replaced with just the FTDI IC, crystal and USB socket, because you don't actually need to include a prototyping module in a production device (unless you can't solder SMD).
**the weakest performance variant
***74LS parts could probably be found for cheaper, for instance $0.37 for the '164 at www.ti.com, but for 1000 units.
****implied, part number not listed on schematic

So that's 42 bucks just for the parts. Given that there are a lot of parts, the PCB is going to be big, so that's also going to cost a bit. Also, using just 8 of the 12 bits the 15-dollar ADC gives out, now that's pure waste. Nobody gives a crap about a data acquisition system that gives 8 bits (256 levels), unless it's very very fast, which this isn't. The author states that the system can be modified to make use of the full 12 bits, which is reasonable, but no schematic is given, and I have a hunch it would require at least one more 74LS chip.

Now here's the proper way to do it. A lot of manufacturers offer microcontrollers with integrated USB circuitry, as well as on-chip ADCs. So there go the two most expensive components. Plus, a microcontroller, being programmable, that is, having code, and memory, can do a lot more interesting functions such as calibration, unit translation, alarms, outputting control signals, whatever. Plus, a lot of microcontrollers have many analog inputs, so they can measure more than one thing, unlike the guy's design. And they're cheap, very cheap.
My idea would be to use an AVR microcontroller, such as the ATmega8. Using the software-only USB implementation kindly provided by obdev, and the internal ADC of the ATmega8, I can measure 8 voltages with 10 bit resolution (4 times finer than the guy). Moreover, I can increase the resolution in software by using oversampling. Well he can do that too actually, but I can do it in firmware which is nicer. And my PCB will be much smaller and cheaper, because I only use ONE integrated circuit instead of 6. Table 2 below lists my costs:

Component Price Link
ATmega8-16AU $2.23 http://nuhorizons.com
USB socket $0 - low-speed device mandates captive cable
(like in USB mice)
R,C,D etc. negligible
PCB less than the other guy's
Total $2.23

Table 2: Proper Bill of Materials

As you can see, it's much cheaper, and much simpler to manufacture (therefore even cheaper). It will be slower and it probably won't pass USB certification, but it works. Using a proper USB microcontroller would make those two problems vanish and still cost no more than about fifteen bucks.

Table 3 below summarizes the results of my analysis:

Designer Price (excl. PCB, enclosure etc.)
Atomic Guy $ 41.38
Me $ 2.23

Table 3: Comparative Wastage

There. More than 18 times cheaper, and much better specs. Waste.