Monday, September 26, 2011

Monitoring an Oven with the SerialCouple

Progress on the SerialCouple boards has been coming along.  I think I've identified all of the hardware issues, so now it's just a software problem.  I decided to have some fun with the prototype today and have it monitor my oven while I baked a batch of brownies.  The SerialCouple boards are rated for the entire K type temperature range (-200C to 1350C), so the only limiting factor as to how hot you can measure is the rating of your thermocouple.
My new roommate happened to walk in on me setting all of this up.  That was a rather amusing conversation...  Luckily, she's learning pretty quickly to tolerate my eccentric hobbies, which I appreciate.

I had a little difficulty installing the thermocouple, because some parts of my oven door are grounded, which causes the ADC to issue a fault code, but using a non-metallic sheathed thermocouple, or in my case finding a non-grounded section of the door fixed that.
I generated the graph by having PuTTY log the serial port to a file, then imported it into MATlab and plotted it to a png.  Pretty simple, but I have visions of eventually writing a proper DAQ interface for the SerialCouple, likely in Java.

Looking at the graph, you can see that I added the brownies at the 8 minute mark, checked on them at the 35 minute mark (2100 seconds), and declared them finished and turned off the oven at 38 minutes.  The oven temperature was set to 325F, so it does seem to run a little hot.  When baking, I would typically let the oven pre-soak a little more before adding the brownies, but I was in a rush for some baked chocolate deliciousness today.

Saturday, September 24, 2011

Volunteering in Rio Vista

The Western Railway Museum (not to be confused with the Western Pacific Railroad Museum which I also volunteer at) has track work weekends twice a month, where we go out and do maintenance work on the several miles of track that the museum has in service.  A typical Saturday consists of driving a few miles down the line and replacing every other tie under the track (which I have written about previously) or straighten and repair rail joints.  This was certainly not a typical weekend.

The old Sacramento Northern line that the museum runs on has a number of trestles originally built in 1939, which inevitably need to be maintained.  The project this weekend was to replace the center bent, which has been suffering from being in standing water, so we were to replace it with a shorter bent, and pour a new concrete cap on top of the old foundation to keep the wood from sitting in the water that collects underneath the bridge.  Joel had already staged the new bent to the left of the old one, the concrete frame and forms on a flat car on the bridge, and jacked up the bridge.
First thing to do was to cut out the old bent.  This was done with a sawzall powered from a diesel generator, while the top cap was held in place by the tie crane on the bridge.
 Once the legs were cut out, we lowered the top cap to the ground.
We found a few of the original 1939 date nails in the lumber we were tearing out, so we pounded them into the new bent, for "historical accuracy."  It hurt the engineer in me a little to improperly date-mark the timbers, but I've already got a 39 nail from the last time we replaced ties, so it seemed like the best thing to do with them.  They were in surprisingly good condition for 72 year old nails.
Some of the nuts were so rusted onto the bolts in the old bent, it was twisting the wrought iron bolts that finally broke, not the stuck nuts.

Once we had the old bent out, we cleaned up the old foundation.
We then took the new concrete cage and lifted it into position.
Getting a concrete contractor to come out on a Saturday was going to be an ordeal, so we only framed it all up such that we could have someone come in Monday to pour it for us.
We then used the crane to lift the new bent into position, and bolted it to the 16" stringers to hold it in place until the concrete can be poured.
Once the bent was bolted in place, we took a break for lunch, and then installed the concrete form for the new foundation cap.
Everything went extremely well, which is mostly thanks to all the hard work Joel put in beforehand staging everything.  Since the new bent is a foot and a half higher, hopefully the new lumber won't sit in water and rot out like the old one.

It was a fun day.  I keep trying to get down to Rio Vista more often, since they work every second and forth Saturday, but college keeps getting in the way.  Hopefully I'll have more time this year to work there.  If anyone in the Sacramento area would like to get involved, email me and I can put you in touch with Joel, who is in charge of the track crew work weekends.

Wednesday, September 21, 2011

MAX6818-Based Debounced Breadboard Keypad

This was a quick little project I put together while I was bored this week.  This is an eight button keypad, but uses the Maxim MAX6818 part to debounce all of the buttons.  This is important because when you connect regular buttons to TTL logic or a microcontroller, you don't realize it, but every time you press it, the button will bounce on it's contact, often several times, causing more than the single desired edge.

This is usually solved by implementing some sort of low-pass filter, to convert the multiple fast edges into a single, slightly slower edge.  This can be done in software, or even just using a simple RC filter with a Schmitt trigger to clean up the slow rise time.  That being said, it's always a pain for every project to have to wire up a bunch of capacitors and resistors, or copy-paste in the exact debounce software every time I want a button, so I designed this button module which can plug into a breadboard and have eight debounced buttons right away.

The MAX6818 is quite nice, in that it implements a 40ms low-pass filter on eight button inputs, has internal pull-up resistors, has an open-collector pin-change interrupt, and even tri-state outputs so you can share the buttons with other devices on an 8-bit bus.  I brought everything out to a 0.1" edge connector, which when populated with male header can plug straight into a breadboard.  I also added a solder jumper, such that you can hard-wire enable the outputs if you aren't interested in tri-state capabilities.

Unfortunately, I didn't bother checking component costs until after I finished the design.  The Maxim debouncer chip is more than $8!  Considering this can be implemented with a 50 cent 74HC14 chip, this thing really is just a waste of money, unless you're only planning on using it yourself, in which case you can sample the part from Maxim.
So, I'm not going to bother having this fabricated, but I will release the design files CC BY-SA, so if anyone else wants to actually order these and test it, do with the files as you will.

Design Files.

If you do order them from someplace like Dorkbot or ITead and end up with spares, I would be interested in buying one or two of the copies off you, just to have something to do with my MAX6818 samples.

Saturday, September 17, 2011

SerialCouple V1 Demo

I've written about this project a little before, but I figured I would give an overview of it's capabilities all in one place.  The SerialCouple line of boards are simple, easy to use single-channel thermocouple adapters, meant to be an interface between a thermocouple and a computer or other embedded system.  Shown in the pictures are the model one boards, which are meant to be plugged into FTDI-like USB-to-Serial adapters, but a second model based on RS-232 is in the works.

I've been doing all of my testing with the most standard K type thermocouple, but the MAX31855 part I'm using also supports J, N, T, E, S, and R junctions, which differ in their rated accuracies and temperature ranges.  K thermocouples are rated for measuring temperatures between -200C and 1350C, so for most hobbyist projects, they're perfectly sufficient.  With thermocouples, you can typically expect precision on the order of 2C or 0.75%, and the SerialCouple board supports 2 bits of resolution below the decimal point (so temperatures are read in steps of a quarter degree).  If you're interested in higher resolution than that, I'd suggest you take a look at my analog K thermocouple amplifier, which must be connected to your own ADC, but can give much higher resolution readings.

Video.
Here is a closeup of the board populated with an Omega MPJ thermocouple jack.  I did make one routing error on the boards, which can be seen by the blue wire between the ATTiny2313 and the MAX31855.  This is the one downside of AVR ICSP being on the SPI bus, in that if any other SPI device doesn't want to stay in reset during programming, they'll keep you from being able to reflash the AVR.  (Fun side note: I didn't solder most of this board.  It was done by one of my friends as his first time doing surface mount.)

The design was done in Eagle, and I am working on making everything for it available on a Google Code page.

I have been having some problems with my USB adapter.  The ADC works fine, except when I'm receiving anything from the USB adapters.  Initializing the adapter (an MCP2200 in my case) adds a very high frequency broadband 200mV P-P noise on the 5V rail to the SerialCouple board, which manages to get through the regulator and by-pass caps, and causes the ADC to read 3-10 degrees low.

I've solved the incorrect readings issue. Maxim's claim that the MAX31855 chips require no input filtering is incorrect; two 10nF caps resolved all of the noise issues for the model one boards.

There has been some interest in people buying the board, so once I get some more bugs worked out and spin another revision, I'll be open to the possibility of selling the blank PCBs and possibly completed boards.  Sound off in the comments with any interest or questions.

Thursday, September 15, 2011

FastPort Model 3100CXPlus Printer Server

 After trying out the 86BT in my parent's house as their network printer solution, we were a little underwhelmed with the build quality of it.  The BT86 is certainly functional, but its build quality is pretty unimpressive and didn't instill much confidence in the parents.  All the well, because it means I get to keep playing with it, but it means I still needed to find an Ethernet solution for the parallel port printer.
I managed to get a good deal on this beautiful piece of work, a Milan FastPort Model 3100CXPlus print server.  This thing is built like a tank, and taking numbers.  The case is made from heavy extruded aluminum, and is about the most solid thing piece of electronics I've ever played with.  It was originally made for corporate networks back in the late 90s.  This specific device has a firmware build date from 1997, so it's OLD, but still working.

It's a very simple device; an Ethernet jack to plug into your network (10bT, amusingly enough), then a DB-9 serial port and a DE-25 parallel port to plug printers into.  What is a little squirrely about it is that it has two DIP switches on the front to switch it between a couple modes, and of course the user guide for it off-handedly mentions that specific switch settings can be referenced from the installation manual, which is nowhere to be found online.  It then exposes these two printer ports as TCP sockets, which can be set up as RAW TCP/IP printers on any operating system.
Turning on D1 sets the device into configuration mode, where D2 then switches between printing a test page (D2 off) and setting the device into serial configuration mode (D2 on).
So, for example, setting the switches to on and on, and then plugging a null serial cable into the serial port to your computer, and opening a hyperterminal at 9600 baud brings up a menu system to configure the device.

Setting D2 to off and power cycling the device causes it to try and print a test page on any printers plugged into it (using what looks like basic PostScript, but having never looked at PS before I am only guessing).  Of course, our Laserjet 2300 is a PCL printer, so the test page mode did nothing.

To then set the device into standard print mode, turn off D1 and turn on D2.  I never figured out what off-off did.  In addition to exposing the two printers on ports 2000 and 2001, you can connect to it through telnet on 2002, and either monitor status or remotely configure it exactly as done through the serial port in configuration mode.

So of course, while I was playing with this, I had to open it up and check out some good 1997 circuit board action.
There were a few things distinctive about this board.  First of all, it's the first PCB I've ever seen designed to slide straight into an Aluminum extrusion case.  Second of all, it actually has two banked EEPROMs for the firmware, which are the two PLCC ROMs at top center.  This means flashing new firmware actually requires booting off one bank, flashing the second, then rebooting off the second bank to flash the first.  Talk about a robust system!  You'd have to really work at it to brick this thing.
Third feature of note is the 16 pin edge connector inside for a daughter network card, which can replace the blank-off cap seen to the right of the Ethernet jack in the second picture from the top.  This allows you to buy additional network cards to allow this thing to support any of the dizzying array of network solutions eventually beat out by twisted pair Ethernet, including coax Ethernet, token ring, and AppleTalk.  Again, impressive.
On top of everything else amusing about this thing, the microcontroller running the show easily takes the cake.  This thing runs on a freakin 80C186, which was one of the stepping stones between the classic Intel 8086, and the 80386, which defined the entire PC revolution.  Not only is this a classic controller, but back in the 90s it was common practice to license your ICs to other companies as "second sources" such that manufactures would be willing to use your part (since they can buy it from either you or your licensee).  The 80C186 was developed by Intel, but this one happened to have been manufactured by AMD, which can be seen by the (M) AMD (C) INTEL silkscreen, which is quite rare now.

So, all being said, this is an amazing device if you still happen to be using a parallel port printer that you want to put on the network.  The 10bT Ethernet isn't much of a limitation, since parallel ports are slower than that anyways, and it handled multiple computers simultaneously trying to print to it no problem.  If you happen upon one of these things at any kind of salvage shop, or on eBay selling for a lot less than the $100 they seem to be going for these days, grab it.

Edit (7/1/2013): I did eventually manage to find a user's guide for the Milan FastPort series on their website.

Wednesday, September 14, 2011

ZAP-LN-86BT Review

Trawling through Reddit last month, I saw a link to the ZAP-LN-86BT standalone BitTorrent / NAS device.  The claims are rather intriguing; Transmission bittorrent client, Samba/FTP/HTTP NAS, network printer sharing, and all for only $30 shipped.  Of course, it took them WEEKS to get it to me, but for $30, I figured I'd give it a shot.


Long story short, I was unimpressed, but I may still be able to find some usefulness for it.


 The box does a decently good job of covering for it being a cheapie made-in-Asia device.
And has your expected fare for the lot.  Power supply, CAT5 cable, useless manual in English and Chinese.


Of course, once you fire it up, it doesn't take long to realize the firmware is pretty much useless.  Of course, since it runs Linux, there is a more decent third-party image for it; SnakeOS, so this review is based on that.


The device only has one USB port, which is particularly inconvenient, because the device only has 32MB of RAM, so to do anything, you need to plug in a flash drive so it can create a 256MB swap file.  Of course, this "anything" includes mounting larger file systems, so even if you have a 500GB hard drive attached to it, it seems you still need a smaller flash drive to bootstrap it.


The original documentation mentions it can't handle drives larger than 500GB, and SnakeOS is real vague about what it does about it.  They're for real, and SnakeOS is just as bad!  This isn't a performance issue, or that's as big as drives were when they wrote the documentation, it really can only handle 500GB drives.  It's compiled into the userspace.  fdisk wigged the heck out on my 3TB USB drive when I plugged it in.


The Transmission client was perfectly usable.  The network printer sharing worked perfectly.  The SD card reader on the front is painfully slow.  The web server seemed pretty brain dead, but samba was at least fast enough to saturate my WiFi, if not my 100bT Ethernet (others report topping out around 5MBps).  I was able to stream 350MB TV shows off of it no problem.


So the software features all work, but not particularly well.  I will probably end up plugging my apartment printer into it and using that as the share between all of my computers, and maybe try and find a 300GB USB hard drive in my box-o-junk to at least get some NAS action out of it.


I'll just make this observation here;  It does have a ~30k serial port on the motherboard, which others have reported success dealing with as far as talking to U-Boot and the OS.  Some potential is here, but compared to a WRT54GL off eBay, this device isn't much to get excited about in this department either...

Wednesday, September 7, 2011

SerialCouple V2.0 PCBs are in

At some point, I will stop getting so excited every time one of my designs comes back...  just not yet.  This whole custom fabrication thing is still really exciting to me.

This is based on the previous SerialCouple board, but instead of coming out to an FTDI serial port, it comes out to a DE-9 RS-232 port.  You might call this a legacy SerialCouple board, for interfacing with devices stuff in the last century peripheral-wise *coughiPodcough*.  Like always, ITead did a meh-decent job on the PCBs, and the two freebie boards were amusing:

 The first thing that jumps out about this board (other than it surprisingly being red and larger than 5cm), is the ever popular Arduino shield pattern that I hate so much.  I found some documentation on the project (ppt warning), and after an email with the designer, this is a breakout board for toy boats used for a master course in mechatronics for maritime engineering.  You control azipods to position the boat, which is an understandablely difficult problem.  Interesting, but useless to me without the boats.
The function of this one is pretty clear; a capacitive water level sensor.  The bottom layer has "Calmar 2011" etched in the copper, but nothing meaningful was found online, and I don't think I can quite infer the BOM from the silkscreen...

So in short, please please please people, use URLs in your silk when swapping stuff on ITead. 

Thursday, September 1, 2011

MMA7455 - Free PCB Build

The Dangerous Prototypes' free PCB builds continue.  The latest, of the few, is a breakout board for the MMA7455 MEMS accelerometer.

These things are HARD to solder.  Or more accurately, these things are very non-intuitive to solder, but go together like me and chocolate once you figure out the trick.  The problem is that the chip has FOURTEEN freakin pads under that innocuous 3x5mm package.  The 0.8mm pitch isn't the worst that I've soldered, but not being able to get at the pins is a little problematic.

So here's the trick.  Flux and thinly tin both the PCB and chip.  Then drop the PCB on a hot plate, and watch for the pads to reflow really fast.  Like, 2-3 seconds fast.  Then place the chip on the flowing pads, and remove from heat.

Luckily, Ian is wise enough to send these in sets of two, which is nice since I managed to badly damage the first one.  My mistake was that I tinned one of the 1206 pads and used it to watch for the board getting hot enough.  Of course, by the time the 1206 pad reflowed, the LGA pads had already flowed, reflowed, re-reflowed, and the chip had gone up in smoke.  I've gained a new respect for designers of reflow manufactured PCBs.

Of course, you have to ask yourself: If Kenneth is stuck in Sunnyvale all summer without access to a soldering iron, how did he manage to solder something as crazy as an LGA-14?  The answer is quite simple:  One of my EE friends and I took a nerd-fest trip up to Davis for the weekend.  He toured some grad labs at UC Davis, I taught him how to SMT solder and caught up on some projects, and we figured out what an AMF is the hard way downtown.  The projects included the MMA7455 breakouts, the latest rev of the SerialCouple project (STILL has some freakin problems; PCBs are hard), and a couple copies of this neat little board.  Until I actually get them running, I'll limit my coverage to these continuing coy hints I keep dropping.  The TSSOP chip is an MSP430G2, and those are IR LEDs and IR 38kHz receivers on the right side of the board.