Sometimes there are just too many choices.
Recently I was looking for USB based temperature sensors. This seems pretty straight forward. And well, it could have been. The problem is that I needed them in a couple of different roles, and was looking at about half a dozen to 10 of them. I needed sensors inside of cases, and again in the top of the attic. At my disposal I've got programming skills, a soldering iron, and my AMEX card.
So, lets see if we can get a quick solution: buy.
Lots of vendors were willing to sell me solutions starting at around $129 that met my requirements. Well, most of my requirements. This would have way blown my budget. If I didn't see a need for more than 3... well, this post wouldn't be happening, and I'd instead be hitting reload on the shipment tracking page.
How expensive can this gear possibly be? Second solution: build.
Sensor, $1.50
USB/Serial, $4.00
Misc discrete components + cable: $5.00 tops
Packaging is limited, and with the discrete components, a circuit board is probably required, so, lets add another $10 for a schmartboard to make our lives easier. (Could have gotten one for $5, but then could have wasted a lot of time trying to fab my own to only save a couple of $ more. The goal was to have something working, not to spend a leisurely Sunday afternoon.)
Ok, this is not sounding too bad. Except that this solution requires that we bit-bang through the serial to the sensor. Doable, but lots of annoying programming. And lots of overhead on the host system. For each sensor.
There has to be a middle ground somewhere. And there is. www.raphnet.net handles a decent chunk of a middle ground, but still not perfect for all situations.
Raphnet has a couple of solutions. They use a Amtel microcontroller to drive the sensor chip and provide USB. It's an open source design, and they provide the firmware loads. Or Amtel's loaded with the firmware. Or an entire board with Amtel, connectors, logic. They even provide a USB to temperature sensor cable.
This is looking pretty good. This gives me the option of being able to buy cables that just plug in, or enough components when I have to build out a board anyway for the in-case sensors. (The project there requires buffer logic, connectors, and a 4-port USB hub chip anyway.) $35 a pop for the cables isn't too bad either.
Still, I poke around. Cheaper/Better?
Another build/buy option are the 1-wire devices. A little more expensive than if I was just buying one, it opens up some more options. The advantage here is that 1-wire is a bus technology. You buy a master, and then start adding sensors. A master can support anywhere from 100 devices to thousands, with up to a a couple thousand feet of cable connecting them.
www.embeddeddatasystems.com has a few products along this line. There are other vendors as well.
What really caught my eye was the ASCII based 1-wire interface. No bit banging, just send text to the serial port, and read text back. As a bonus, this is available as either a fully built external box, serial on one end, 1-wire on the other for $40. If I need to add it as part of a built board, they sell the core component on its own board for under $20. Temperature sensors start at $15 connected to a decent length of cable and neatly wrapped.
End result: some flexibility of solutions for putting sensors inside of cases, and for monitoring a full environment.
Buying the preloaded microcontroller, and other discrete components, for when I have to build a custom board anyway, is an obvious advantage. There is not much incremental cost when building out multiple boards. (Honestly, if it was just a in case one-off, I'd get a retail 4 port usb hub and just get creative with the cabling.)
Hooking up a half a dozen sensors wouldn't be fatal in either direction, but could potentially be cleaner with the 1-wire, especially since I need to make some long cable runs. The particular 1-wire interfaces lose their advantage when trying to make all the sensors appear as if they were system sensors. More traditional interfaces are available for a slight savings.
Having two, close solutions is a win. It means the focus can move on from "will it even work", to what will work best for this situation. It's time for me to order some hardware and start playing around.
Tuesday, September 11, 2007
Subscribe to:
Comments (Atom)