Superprobe meets vintage multimeter

One of the first tools I built myself many, many (decades!) years ago was a logic probe. At the time things like yellow LEDs were still a bit rare and cool, but this baby had both red, yellow and green LEDs to indicate TTL logic levels. It was a true rat’s nest of wires – and everything stuffed into one of those plastic cases for one-time travel toothbrush that you (used to) get at some hotels. A stiff copper wire was glued to one end of the case. Ugly as h-ll, but it worked quite nicely.

Years have passed, and I actually found that probe a year or so ago. It still worked, but with access to things like multi-channel logic analysers and digital storage oscilloscopes, that probe was sent to rest at the place where electronics never return from.

Still, the basic concept of a logic probe IS kind of nice. And as some people have taken this concept and extended it to include a bunch of other tools in the same circuit, I thought I’d spend some time building a new probe.

It’s really just a Superprobe in a somewhat unique (probably not, but I like the concept..) case. The Superprobe exists in various flavours, the ones I’ve liked best so far are the original onethe MKII one, and the one from Dangerous Prototypes.  The one I built is a mashup of the three, dropping the voltage reg (as I feed my probe from a USB cable, which provide a stable +5V that the PIC can use. Adding programming headers á la the DP probe was a must-have. But dropping the display resistors, seems to work just fine without them.

The project really kicked off when I was cleaning out some boxes of old stuff, and found the first digital multimeter I ever bought, probably around 1985 or so. It is a total piece of junk, was probably the same back then, but still expensive at the time. Interestingly enough, the main ADC chip of the DMM was a MAX131CPL – which is still available for purchase today!!

Off to work then.
After ripping apart the DMM and stripping away all components, LCD, daughter boards etc (all through-hole components, of course. This is pre-SMD times.) I was left with some space in the DMM that should nicely handle the Superprobe circuitry. It might even be possible to squeeze a Dangerous Prototypes Part Ninja in there, and then multiplex the display between the two tools… Nah, one thing at a time, I’d rather finish the probe first.

It all comes together quite nicely, with a mini USB jack providing power to the probe, the probe’s two push buttons are hot glued to the upper left/right sides of the case, making it easy to operate them both when the meter is on a table, and when it’s held in hand (in that caseit’s actually possible to operate the whole probe with a single hand, using thumb and index finger, while the probe rests in the palm. Nice!).
The input jacks from the original DMM are re-used and soldered to the input and Gnd of the probe, with one of the original mechanical range switches wired as on/off for the probe.

Works like a charm, the pictures below show the probe while in use.
Only one small glitch, not sure what’s going on. When the probe is turned off, it needs a minute or two before it agrees to turn on again. Some capacitor that need time to discharge, I guess. Thinking about adding a reset button.. should be an easy thing to add, just hooking pin 1 to ground through a small push button.

All in all – nice little project that is likely to be quite useful up ahead.

Reverse engineering Macbook Air FaceTime camera, part 1

A severely cracked 13″ Macbook Air display came my way some time back. The LCD panel was obviously damaged, but it would be interesting to see what makes such a great display tick, and maybe parts of it could still be used? I believe the display came from a Late 2010 Macbook Air (which would indicate an A1369 type construction), but can’t be sure. Anyway – ideas included

  • Keeping the back lighting (assuming it works) and camera, mounting the whole display on a flexible arm next to the work bench. Given the high intensity of the back lighting, it could then (maybe) provide ambient lighting AND video recording of whatever was being worked on. Maybe with a LED light and camera on a separate flexible arms.
  • If the LED backlighting drivers were toast, there should still be some nice white LEDs in there for scavenging.
  • Same thing for the camera, I believe it to be a 640×480 pixel device, nothing too exiting but could still be useful.

Turns out it’s not entirely easy to disassemble these displays. They are sealed together with very strong tape. Heating the bezel helps a lot, but it’s still a fair amount of work – and given the delicate components beneath the bezel, you might want to think twice before doing this on a laptop you care about.. Some good instructions found here, btw. Results so far:

2013-02-19_10-41-22_smallPrying the bezel open…

…before applying heat with a hot-air SMD rework station (regular heat gun would probably also work, if you are careful):
2013-02-19_10-44-38_small

Voila! Bezel is free:
2013-02-19_10-56-14_small

Now the tricky part. The cable from the cable is a thin wire with some kind of textile cover, for strengths I assume. It goes through the hinges and there is no way (as far as I can tell) to get the cable through there, without cutting off the (very small) connector that normally connects to the computers Left I/O (a.k.a. LIO) board. Cut.

Now the whole camera assembly can be removed. It also includes the ambient light sensor, which communicates over I2C. Unknown protocol for that one though – one for the future to investigate..

2013-02-23_22-55-38_small
Very tiny 6-pin connector, normally going to the LIO board.
2013-02-19_13-11-34_smallCamera module exposed in the top part of the screen. Held in place with 2 small screws.


2013-02-23_22-32-08_smallCamera board. 

2013-02-19_13-17-59_smallThese things are small – fingers included for scale reference.

With six wires in the cable it’s pretty clear that 4 are for USB (+5V, Gnd, Data+, Data-) and 2 for I2C. That cable is however crazy small – it’s about 2 mm diameter. Once the outer layer is off, you see 6 even thinner cables. 2 are black, 4 transparent. Which ones are which?

Google is your friend. Turns out there are schematics to be found if you Google long enough. Turns out you need schematics for the LIO board though, in order to get the pinout of the camera/ALS cable, and it’s nowhere to be found for the A1369. Did find a schematic for the A1370 model though (same computer but 11″ screen), with a bit of luck that cable is the same between models.

The 2 black ones are prime candidates for +5V and Gnd. Cutting away the insulation revealed that the cables are shielded, with a center wire that is barely visible to the eye. It took several attempts before I had separated the wires from the sheilding, and then done the same with the other 4 wires. Soldering these onto an old USB cable was then easy (but ugly!!):

2013-02-28_14-09-48_small

Still, it doesn’t work. The camera is not recognised on an iMac with latest OSX, nor on a Windows 8 laptop. Happened to have a Raspberry Pi lying on the work bench, tried it too with same result: nothing.

But wait… doing a “tail -f /var/log/messages” on the RPi showed that it DID recognise the camera, but that the camera wanted more power than a non-powered USB hub could provide! Placing the camera into the RPi’s regular USB port made it appear nicely when doing a “lsusb” command.

Still, it didn’t work when I connected the camera to the Windows or iMac machines – strange.

Also, the RPi loose contact with the camera after a while – no idea why. Could maybe be a bad USB cable (it’s from an old mouse using USB 1.1 – maybe that’s a problem??), or is there too much noise introduced by the ugly splicing of cables that I’ve done? No idea… More investigation needed. Anyway, the camera enumerates with USB id 05ac:850a, which indeed is an Apple FaceTime camera – nice!

Smoke tester from Dangerous Prototypes

A while back I got a free PCB from Dangerous Prototype’s Free PCB program. It’s a nice little board designed to provide easy current monitoring during prototype stages of a project. Features include over-current tripping with visual indication, as well as dual 5V and 3.3V supplies.

So, a week or two ago I was about to reverse engineer a laptop camera (built with very small components…). The camera’s attaching cable has unknown pinout, but system block diagram indicate it’s a USB 2.0 device. The cable is a 6-wire variant, so it shouldn’t be too hard figuring out which wire does what. It would however be nice to have a controlled power source feeding the camera during the work.

Enter the smoke tester… I figured I would build it, to the extent possible, with parts already found in the lab, if needed maybe even scavenging some old computer or similar..

The result is pretty nice:

smoke_tester_20130227

Some comments/feedback on the design:

  • Input power screw terminals don’t have +/- marked on the board.
  • Holes for bana jacks too small for any of the jacks I’ve tried.
  • Really nice with the three parallel pads for INA 138 load resistors. They give good flexibility for selecting shunt resistors for the INA 138. For example, I used a 0.1 ohm (instead of 0.075 ohm as suggested in the schematic) shunt resistor, which means the load resistor should be 50 kohm. Easy – two 100 kohm resistors in parallel does the trick.
  • Documentation is very limited, basically just a forum thread and schematics (that don’t include all component values, e.g. R13 and R14.

A few components are missing on thew board:

  • USB out connector. I had a hard time finding an SMD connector that would work. Figured I’d mainly be using the screw terminals anyway.
  • Banana jacks. Going through the parts bins here, all the banana jacks were too big to fit in the PCB’s holes. Those wholes could be a bit larger, IMHO.
  • Input power jack. Couldn’t find a suitable SMD one, but as I will be taking power from a wall wart with USB output I will be fine.
  • R13, R14. There is no value for these in the schematics (as far as I can tell), leaving them out thus. But as the USB out connector is unpopulated anyway, it’s not a problem (right now). Edit: They should be ca 20 ohms.

Links:
Dangerous Prototype’s forum page

iTerm2 + tmux + Fish = looks great!

If you spend any time at all at the command prompt in OSX or other Linux-ish systems, tmux is a must. Basically it gives you persistent shell sessions, once using it you’ll wonder how you ever got by without it… 

For OSX the easiest way to get tmux is via (the also excellent) Homebrew. After installing Homebrew, just do a 

brew install tmux

from a OSX prompt (you ARE using iTerm2, right? …Rather than OSX’s rather horrible built-in Terminal app…?)

Add to the mix the nice Bash replacement Fish, which gives you all sorts of command line goodness (color coding, auto-completion, …). Very nice!

 

How to monitor broadband uptime

After moving to a house a few years back we ended up in a situation where ADSL was the only option (aside of mobile broadband, which is not really a realistic option if you plan to do a fair amount of computer work from home) available to us. However, the nearest phone station turned out to be close to 4 kilometers away, which according to the broadband provider is a lot, maybe even approaching the distance where ADSL is usable.

Except that they failed to mention this when we informed them about the move from hyper-connected downtown to the suburb we now live in…

After well over a year of poor broadband speeds I got them (the ISP in question is Glocalnet, subsidiary of Telenor, btw) to acknowledge the problem, and even give us a refund for the months we’ve been paying for a 24 Mbit service, even though actual speed never gets above 5 Mbit.

Fast forwarding a couple of years, we’ve been paying less per month than before, but the quality of the ADSL connection is still poor, with the connection yoyo-ing several times per day. A couple of weeks back I finally had it and told them to fix the problem or stop charging us for a service they can’t deliver. A few days later an SMS arrived stating “your technical problem has been resolved” .

So, to the point of this blog post. How can I monitor they have actually fixed the problem and now provide a stable broadband service to us?

I ended up using a two-tiered approach:

1. External monitoring service
Using a free, third party server monitoring service to ensure there is connectivity from Internet to my home network. As the broadband outages we had experienced were typically quite short (on the order of a few minutes each), I needed a service that would ping a suitable computer in my home network at frequent intervals. Turns out there are many good free monitoring services (moni.tor.us etc), but they all (?) offer 20 or 30 minutes as shortest ping interval.

I finally found Pingdom, which offer you a free account from which you can monitor ONE server, with a shortest ping interval of 1 minute. Perfect. Their web site is slick and no-nonsense, they even have a very efficient and easy-to-use iPhone app. Great.

Only caveat is that you need an always-on computer at home, in order for Pingdom to have something to check connectivity to. Assuming that’s in place, you get stats like the following:

2. Ping from internal network to Internet
In order to minimize the number of false positives I decided to also check connectivity from the home network to a suitable site on the Internet. Once again, this assumes there is an always-turned-on computer in your home network. I use a Linux virtual machine that is always running anyway, looking after various other stuff.

A small script pings www.google.com once every minute and outputs the result into a text file. If Pingdom indicate a broadband connectivity outage, I can then go into the text file to verify that this was really the case (ruling out problems with Pingdom’s servers/service). The script looks like the following, paths might need some editing in other environments.

echo —————————– >> /home/goran/pinglog_google.txt
date >> /home/goran/pinglog_google.txt
ping -D -c 2 www.google.com >> /home/goran/pinglog_google.txt

Add to this a crontab (run crontab -e) entry for running the above once every minute:

# ping Google once every minute to make sure broadband connection is up
*/1 * * * * /home/goran/ping_google.sh

…and that’s about it. Keeping fingers crossed I won’t have to use this data against the ISP – nonetheless good to have it, just in case.

tmux for bubba2

There are various replacements for the traditional screen command in Linux, Byobu and tmux being two good ones. Byobu is good, but after trying tmux on various Linux machines I really wanted it also on the bubba2.

As tmux doesn’t seems to be in the bubba2 or etch repositories, the next option is to build it from source. Below follow some ideas for doing this.

Note: you may need to install/upgrade gcc and other tools to complete the steps below, if you have a standard, out-of-the-box bubba2 system.

  1. Switch to su and create a directory for source & resulting binaries
    su
    mkdir ~/project
    cd ~/project
  2. Compile proper libevent version
    tmux needs a more recent version of libevent than installed as part of bubba2 standard setup. First remove current libevent, then compile the new one:
    apt-get remove libevent1
    mkdir ~/project/libevent
    cd ~/project/libevent
    wget http://monkey.org/~provos/libevent-1.4.14b-stable.tar.gz
    gunzip libevent-1.4.14b-stable.tar.gz
    tar xvf libevent-1.4.14b-stable.tar
    cd libevent-1.4.14b-stable
    ./configure
    make
    make install
  3. Register the new libevent
    Edit /etc/ld.so.conf.d/powerpc-linux-gnu.conf, e.g. by “vim /etc/ld.so.conf.d/powerpc-linux-gnu.conf”, add the line “/usr/local/lib/” (no quotes) at the end.
  4. Reload the new libevent
    Simply run “ldconfig”.
  5. Compile and install tmux
    mkdir ~/project/tmux
    cd ~/project/tmux
    wget http://downloads.sourceforge.net/project/tmux/tmux/tmux-1.5/tmux-1.5.tar.gz
    gunzip http://downloads.sourceforge.net/project/tmux/tmux/tmux-1.5/tmux-1.5.tar.gz
    tar xvf http://downloads.sourceforge.net/project/tmux/tmux/tmux-1.5/tmux-1.5.tar
    cd tmux-1.5
    ./configure
    make
    make install
  6. Configure tmux and start using it
    First, exit from superuser mode by typing “exit”. Then, you probably want to customize tmux, try googling “tmux config file” or similar for samples. I currently use the following:# Make it use C-a, similar to screen..
    unbind C-b
    unbind l
    set -g prefix C-a
    bind-key C-a last-window
    # key bindings for splitting
    unbind %
    bind | split-window -h
    bind h split-window -h
    unbind ‘”‘
    bind – split-window -v
    bind v split-window -v# Reload key
    bind r source-file ~/.tmux.conf#set -g default-terminal “screen-256color”
    set -g default-terminal “xterm”
    set -g history-limit 4096
    # Terminal emulator window title
    set -g set-titles on
    set -g set-titles-string ‘#S:#I.#P #W’# THEME
    set -g status-bg black
    set -g status-fg white
    set -g status-interval 60
    set -g status-left-length 30
    set -g status-left ‘#[fg=green](#S) #(whoami)@#H#[default]’
    # set -g status-right ‘#[fg=yellow]#(cut -d ” ” -f 1-3 /proc/loadavg)#[default] #[fg=blue]%H:%M#[default]’
    set -g status-right-length 75
    set -g status-right ‘#[fg=red]Up #(uptime | cut -f 4-5 -d ” ” | cut -f 1 -d “,”) #[fg=black]#[fg=yellow]#(cut -d ” ” -f 1-4 /proc/loadavg) #[fg=cyan,bold]%Y-%m-%d %H:%M:%
    S#[default]’
  7. Start using tmux
    “tmux” starts tmux. Now you can create new windows/panes, and kill the sessions whenever you want. When you reconnect to the bubba2 over ssh, just type tmux attach and you can continue where you left off.

Dell’s WinXP installer messes up OSX partitions when using Boot Camp

A few days ago I decided to install WinXP on my Intel based iMac, using Boot Camp.

Boot Camp assistant worked great, it created a new Boot Camp partition on the hard drive just as planned with a 32 GB partition. Popping in a Dell WinXP SP2 CD (from a now long gone computer) as instructed, but when prompted to select where to install XP the Boot Camp partition was gone. In fact, so was the OSX partition…
The weird thing was that the XP installer suggested I should install it to a 131 GByte partition on the disk – where did it get that from?

Luckily I have a nightly Carbon Copy Cloner job scheduled for the iMac, so restoring the OSX disk was pretty straightforward (even though it took some 5-6 hours to restore 500 GB of data).

Tried the same procedure twice more. Once with the same result, and once I the OSX partition was actually intact. But XP still suggested I’d install it to the non-existing 131 GB partition.

Fourth time I tried another XP disc, and this time also slipstreamed it with SP3 using nLite (awesome product!). And now it worked flawlessly.

After doing some research it seems that some people are having trouble using Dell XP CDs with Boot Camp. Not sure why, but using that other, generic XP CD made the problem disappear. Or if it was the SP3 slipstreaming – either way it now works. I guess you could argue that the Dell CD was intended to be used with Dell machines only, and in this case that  turns out to be true.. Anyway, with the problems sorted out, dual booting works great!

Dell XPS M1330 – end of story

Long overdue, here is the final chapter in the warranty story going on with Dell.

They indeed repaired the laptop – at least in part. The graphics now works as it should, but the computer is still unstable and hangs way too often to be useful, even with fresh installations of Vista. Loosing work because the computer hangs at random times (several times per hour) just isn’t an option… No idea what’s causing it – feels like it may be poor thermal design/overheating. But that’s just a guess.

Nice of Dell to repair the broken GPU, but too bad they didn’t make the laptop usable again.

Dell XPS M1330 NVIDIA troubles… progress!

Turns out Dell’s tech support wasn’t the way to go.
After being told the laptop was 2 months out of warranty I had a chat with the sales guy who sold us the laptop two years ago. Friday last week he promised to look into the case and get back by Tuesday this week latest. That he did, with the good news that Dell would repair the laptop without cost to me.

Now that’s good support! Let’s just hope that is the end of the story.