Archive for the ‘gEEk’ Category

Vibe update

So, Jane and I built the electronics for 30 of them, then I took them home and plugged one in for a test drive. It connected to the USB port, beautifully, then I go to turn up the juice. As soon as there is power going to the motor and it’s getting ready to turn, the USB connection is lost and resets/re-enumerates (Windows makes an unhappy dink-dunk…dunk-dink noise). Try another board, and the same thing happens. The first one built worked just fine (on Jane’s PS2), exact same design and components. What’s going on?

Long story short, scoping on the USB 3V regulator pin reveals a steady 3V when nothing’s happening, but an unstable mess when power is being switched to the motor. Small, almost negligible power dips on Vcc are translating to huge, yawning valleys of undervoltage on the regulator output. This on-chip regulator sucks. Beefing up the storage cap on Vusb does nothing, but another 10uF or so across the power rails seems to solve the problem. The USB specs recommend a power supply bypass cap of no more than 10uF, which is already present in the design, so increasing it further is not my first choice for a solution. Then I had a moment of smartness… I was using the front USB ports on my computer, since they were easily accessible, then I remembered those long, puny little ribbon cables that connect the front ports to the motherboard.

A quick look with the side cover off confirmed that pulling half an amp through one of those puny wires was asking for trouble. Combine that with the new longer, skinnier USB cables, and said trouble answers. Plugging into the rear ports made things much more reliable, as did adding a bit more capacitance across the power rails (reliable rear AND front port operation). But now I have to wonder, just how crappy does USB port wiring in the field come? The last thing I need is a pile of angry returns when people start plugging these things into their eMachines Celerytron craputers, with USB ports wired up using wet cat whiskers and good intentions by China’s most optimistic child labor, and wondering why their vibe doesn’t work…

So, final solution is to add the extra capacitance across Vcc, along with a big dire warning about crappy front ports. Yesterday I also made an enclosure-milling template, basically an aluminum bracket with cutouts in the appropriate spots. Sliding an enclosure into the left or right side exposes only the plastic that needs to be removed for the USB port or vibe connector, respectively. (Yeah, I’m supposed to have made a CNC milling machine for this by now, but haven’t gotten around to finishing it yet…) Now with all this hacking around for suboptimal ports, I need to throw together a long-term automated test script too.

Playing with polyurethane casting material

For a project at work I had to mold some things in this hard clear polyurethane, so my Mechie ordered a giant kit of the stuff – more than the project ever will need (and it has a very limited shelf life). So I mixed up a little more than necessary and used the leftover to pot some Blinkenlichten (intelligent LEDs).

The material used is Smooth-On brand “Clear Flex 95”. This is mainly sold as an industrial product, although smaller quantities (highly recommended! See below for why) may be availble from art supply houses. It comes in 2 separate jugs of syrupy liquid marked PART A and PART B, which are mixed together in a specific ratio by weight.


Clear Flex 95 (casting resin) and mold release spray

For every part, the general process is:

1) Make a mold (basically a pool that is the inverse shape of the part you want to make). A wide variety of shapes are possible, but the shape must be such that you can remove it from the mold again once it’s hardened. Complex shapes with convexities or overhangs might require the mold to consist of two halves that can be clamped together and later pulled apart to remove the finished piece. One good mold should be good for many, many parts. (The Smooth-On site also provides a moldmaking tutorial.)

2) Liberally spray down the mold with a “mold release” agent. This looks, feels and acts pretty much like PAM non-stick cooking spray. Same idea – it keeps the piece from sticking to the mold. (It’s possible that grease or cooking spray could work as well on some materials, but it’s disrecommended by the manufacturer and I haven’t tried it.)

3) Thoroughly but slowly mix up the liquid, being careful not to stir in air bubbles (unless that’s the effect you want – but in general air bubbles are bad news since you can’t easily control where they end up or how they are distributed). Scrape the sides of the mixing container in the process to be sure everything is getting mixed. If you want to add any colorants or other stuff (confetti, metal flake, etc.?) to the mix, now is a good time to do it.

4) Pour the mixed goo slowly, aiming for the bottom of the mold (containing any parts to be encapsulated, if any), letting the material seek its own level and chase out any trapped air. It may help to fill it partway and tilt in different directions to release any air bubbles before filling all the way.

5) (advanced stuff for perfectionists*)

6) After it hardens (see the “demold time” spec on your chosen casting material), open the mold (if applicable) and pull the piece loose. If the mold was designed smartly and mold release was applied, it should come out easily. To finish the hardening process, and clear up any remaining tackiness on the surface, it’s typically baked in a low-heat oven for several hours or left out at room temperature for several days.

Obligatory Warnings: Although you can pick this stuff up at art-supply houses, don’t let this detract from the fact that this is still a nasty industrial chemical product and should be handled with due respect. Wear gloves for mixing and handling (if you get some on your skin, you’ll know within a few minutes by the burning sensation…), and long sleeves. Use in a well ventilated area, or ideally outside. Don’t get it in your eyes, don’t mix it in your favorite beer mug, don’t bake the parts in your food oven.


Aluminum mold for USB gadget (failed unit shown, it’s the one that was handy)


USB gadget (successful unit shown)

For the USB gadget, a 2-part mold was cut from a small block of aluminum to be a bit larger than the board all around. Both pieces were sprayed with mold release. After wrapping some tape around the USB connector in case of drippage, the board was stuck into the aluminum mold block with the connector sticking out. The mix was slowly poured in until the level reached almost to the top of the main part of the mold, then the cover plate was screwed on. The complete mold was then turned upright (USB connector pointing up) and filled to just above the top of the PCB, tilting gently side to side to get the air bubbles out. After sitting like this overnight, it was removed and baked for a few hours at about 150degF in a cheap toaster oven.


Ice cube tray "mold". The first cube in the tray bears a plastic recycling logo, which now appears on one of the molded cubes (whoops!)


Single cube. Note extreme refractive index(?) resulting in multiple reflections of the hardware inside.


Cubes with power/data applied

The LED cubes were done exactly the same way, except instead of a complex aluminum mold the circuits were stuck in a plastic ice cube tray, and the cubes filled with the casting material. The first batch (2 cubes) turned out awesome! About a week later I mixed up a new batch and tried it again…


Fail!

Not sure what went wrong with this 2nd batch, but it remained about the consistency of pine sap (and flowed very slowly, e.g. over the course of a day or two), and after a few days it bubbled up like crazy and stayed that way. Once I returned from a 2-week trip (3+ weeks curing in air), they finally seemed to be hardened. Current theories are a) I mixed it wrong (confused the Part A and Part B) – although I checked and doublechecked… b) it really does go bad that fast after opening, or c) the leftover goo from the fat lip on top of the can (exposed to moist March air for some several straight days) helped poison the mixture. I hope to try it again sometime reasonably soon, but in the meantime it seems like a good idea to get this stuff in as small containers as possible and use it soon after it’s opened. Blowing some dry inert gas into the cans before closing could extend its life a bit.

After the unsuccessful attempt to demold them from the cube tray resulted in “melting” all over my table, the above is the mostly unsucessful attempt to get them back into the cube tray. Each step represents about 2 days’ worth of melting. This could potentially be reproduced intentionally for artistic effect, IF there is some way to force it to harden up at the desired time (such as immersion in straight Part A/B, if it resulted from a bad mix ratio). After several weeks’ exposure to open air, the stuff shown seems to have finally hardened. Comparison of the melty results to the original cubes also shows that they started out completely bubble-free; the massive amount of air bubbles present in the end result most likely formed as the result of some slow chemical process in the dud mix. Small bubbles began to appear by the day after pouring and continued growing until the material hardened. (It may even be continuing still – I’ll find out one day if one of these melty cubes suddenly explodes.)


Bubbles where there were no bubbles before


Being blinked, top side


Being blinked, bottom side


After some days of continuing to melt around in the tray, I looped them over a rod and let them just melt freely. Here is how they finally hardened.


Actually, when lit the melty ones kind of look badass!

* if you really, really don’t want air bubbles, one way to get rid of them is to build a vacuum chamber (the compressor from a discarded cube fridge or dehumidifier, etc. makes a good hobby vacuum pump and compressor). Basically any container you can place the still-liquid mold into and pull a vacuum on it, thus causing any trapped air bubbles to swell and burst (or become buoyant enough to rise to the top and escape). Then, by reversing the pump (positively pressurizing the chamber) until the mix hardens, any small remaining bubbles can be compressed to nearly invisible size :-)

Clean Pile / Dirty Pile – laundry management system and method rev2

As mentioned in a recent post, I own a dresser, which has been stocked with clothing* approximately twice in the last 3.5 years. (Eek, Boston, has it really been that long?) I don’t know who came up with dressers, but they probably didn’t have a day job. “So wait, I’m supposed to take all the clothes, sort them, fold them up, put them into the dresser arranged into rows, close the drawer, open the drawer, unrow, unsort, and unfold just to put them back on again?” As I mentioned, the dresser seems to me like a pessimal clothing management system. In my extended bachelory singleness my clothing management strategy underwent gradual stages of simplification, to the Closet/Floor system, the Basket/Floor system, and ultimately the almost-pinnacle-of-perfection, the Clean Pile / Dirty Pile system.

This system operates on the principle of minimum change in entropy, or delta-S, resulting from the removal of mutually inverse intermediate states. Operations that require energy to transition the articles of clothing from a high-entropy state to a lower entropy state knowing that they will soon be returned to the exact same high-entropy state by an inverse operation are reduced out, with the realization that the energy expended to produce the low-entropy state is not recovered in the act of returning to the high entropy state**. Upon shedding clothing flagged as ‘dirty’ due to being worn a full day, said clothing is flung onto a designated Dirty Pile at a known location on the floor. Since the clothing will be loaded into the washer in this state, there’s no reason it should transition to any intermediate state before this time. After being run through the washer and dryer cycle, the clothing emerges in a substantially similar pile form, although now flagged ‘clean’ due to the wash cycle. The pile is transferred in its native, unmodified form to a Clean Pile in a separate known location on the floor. Again, since the next state of interest is “on the body”, superfluous intermediate states (i.e. “in the dresser”) are omitted.

Application of this system results in substantial savings over the Dresser system. Over time, however, several inefficiencies in this new system have become evident. To better explain these inefficiencies, a brief recap of the generalized solution is in order. The complete laundry cycle consists of three required tasks in a specified sequence: Wash, Dry, Wear. The Wash cycle adds complexity since the mixing of certain articles of clothing is discouraged (e.g. whites vs. colors) and a complete Dirty Pile rotation may require multiple non-parallelizable cycle permutations ((machine sturdy | machine delicate | hand) wash (warm | cold) (separately | with like colors)), dictated mainly by the number of clothing articles bought for you by other people, who don’t have to wash them and therefore need not pay attention to cycle compatibility with your existing articles ;-) . The Wear cycle has special requirements too. To complete successfully, this cycle requires nominally at least 5 elements to be simultaneously present (nominally 2x socks, 1x underpants, 1x pants and 1x shirt). Therefore, the total Wear task overhead is dominated by the time required to locate all (ahem, clean) of the required articles.

The noted inefficiencies of the basic Clean Pile / Dirty Pile system can thus be summarized as follows:

  • Application of heterogeneous clothing (light, dark) to a common Dirty Pile necessitates an additional sorting step before the pile contents can be applied to the washer
  • As the number of articles of a given type (as a percentage of the total Clean Pile) decreases, the time required to fetch the next article of that type from the pile increases according to O(N/n), where n is the number of remaining articles of the required type and N is the total number of articles in the pile.
  • A priori knowledge of the number of remaining articles of a given type (socks, pants, etc.) is not available. Since the search for an article terminates as soon as one of the article has been found (regardless of the percentage of the pile actually searched), the situation where n approaches zero can be reached without warning.

A few simple modifications to the system provide substantial improvement: Since the clothes destined for the dirty pile are already semi-sorted (white socks on feet, probably colored everything else except maybe shirt), and they have to be taken off and thrown in some direction anyway, expand the Dirty Pile to three separate piles: White, Colored and Weird. (The Weird pile encompasses the typical minority of hand wash, dryclean, flat dry and similar special-needs garments. It’s estimated that at typical acquisition volumes of Weird clothing by bachelors [i.e. gifts], this pile will take up to a month to fill and require rotation, producing a further optimization by reducing the total number of Weird cycles versus a unified 1-week pile containing one or more Weird articles.) The aim is to reduce the run-time of the sorting task by exploiting naturally-occurring states of partial sortedness in the clothing’s usage cycle, preserving such sortedness as it occurs and preventing the clothing from unnecessarily transitioning to a less-sorted state upon application to the Dirty Pile. Likewise, since the white and color piles are already homogeneous upon completion of a (wash/dry) laundry cycle, there’s no sense lumping them into a single Clean Pile and losing that hard-earned sortedness, so we create two Clean Piles, one for whites and one for colors. This subdivision of piles has most likely reduced the maximum size of a single pile to the level where it can be accommodated by an average bin or laundry basket, so we may now speak of clean/dirty “buckets” instead of piles. This prevents nearby amorphous piles from merging during an extended search as mentioned above, and most importantly, reduces the runtime of all O(n/N) cases by constraining N. The total number of pre-sorted piles/buckets may be dictated by the available space, but any nPiles>1 will yield improvement over the prior system. Finally, a small “reserve” pile, containing one pair of socks, one pair of pants, one pair of boxers, and one shirt, is defined. This pile is small enough to be kept in any convenient location, e.g. under the bed. Upon removal of a white or colored pile from the dryer, the contents of the Reserve pile are polled, and for each component not present, the first of that item dequeued from the dryer is added to the reserve. This is a very efficient process which avoids non-termination of the O(n/N) case where (n/N) is infinity.

* Clothing, n.: Something to satisfy my legal obligation to not be naked in pubic. :-(

** yeah, and parental units never took my argument for not making the bed because it will be unmade within 24 hours as a “clever optimization” rather than “willful act of defiance”, either.

Why Windows asks you for drivers again whenever you plug a USB device into a new port!

I found this today while searching on another USB-developer-related problem: "Why does Windows not recognize my USB device as the same device if I plug it into a different port?"

For those who can’t be bothered to click the link, this occurs if the device doesn’t specify a serial number in its USB descriptors. They decided in this case to treat each (device@port) pairing as a new device rather than the same device in case you had more than one of them; otherwise they would enumerate in a seemingly random order at each boot, and whatever software that interfaced with the devices would have them swapped half the time. Unfortunately, in solving this problem they created some new ones, namely the ol’ “hunt for the driver disk” everytime the device gets unplugged and you don’t remember which physical port it was plugged into before (or something else got plugged in there in the meantime), and the semi-common case where a vendor tries to avoid the driver hunt by every device the same/dummy serial number (e.g. 000000000) causing bizarre behavior (or bluescreens under Windows).

Which brings up the question of which path to choose for the V2 trance vibe… do I…

  • leave off the serial number field, forcing five-knuckle driver shuffle for every port the device is plugged into?
  • fill in the field with the same dummy value for each device? Thinking not an option since certain crappy OSes can’t handle this if more than one is ever plugged in.
  • create a unique serial number for every unit made? Would require some exhaustive/ugly scripting to rewrite the serial number in the .hex file before programming each device myself… the more likely approach would be Serialized Quick Turn Programming (chips pre-programmed from the factory), but this involves extra work, set-up fees and volume purchase requirements. Either way would require keeping track of used/unused numbers. Not to mention the privacy implications of any given “adult” application being able to uniquely identify a user by their vibrator’s serial number…
  • Create a ‘semi-unique’ serial number for each unit? Same hassles and expense as the previous, but not caring if a number is duplicated eliminates keeping track of the last used number in subsequent SQTP orders / etc., as well as most of the privacy concern. One approach would be to just increment the last byte of the SN on each programming, reducing the odds of n devices on the same machine causing a crash.

Nintendo DS Lite power (current) consumption, part 2 (and other stuff!)

This is a continuation of this post, where I hooked up an ammeter as an afterthought while changing the fuse I blew in my DSLite. I didn’t have any games with me and hadn’t fixed it up to sleep with a SuperCard, so these additional numbers are below. Check the prior post for stuff about battery life impact of different brightness levels, DS vs. GBA mode, WiFi, etc.

All the numbers below were taken with the DSLite backlight set to the lowest brightness setting.

Sleep Mode current (DS lite “on” and flipped closed)
This was measured at 1.77mA and 2.31mA, depending whether the blinking green LED is on at the moment. There is no measurable difference between when sleep is entered at the boot screen with no cartridge, or with a cartridge in the middle of a game.

SuperCard SD users will be mildly upset to know, however, that this device is drawing a constant 35mA at minimum at all times, even when the DS is in sleep. Hardware mods, or a dummy cartridge in Slot 1 (to pull the INTerrupt line low) will prevent annoying sleep/wakeup loops, but it won’t allow your system to take long naps.

Cartridge contribution:
Basically none while the cart is not actively being accessed; e.g. sitting at the boot screen, cartridge inserted / not inserted has no measurable effect (<<1mA).
Conspumption of 54.6mA at boot screen raised to average of only 60-63mA at Super Monkey Ball title screen (2 screens + sound), with very occasional highs of about 74mA during vigorous play with both screens active, 3D, sound, touching, basically everything except wifi. Touched / not touched makes no measurable difference, in case anyone is wondering. Cartridge access is certainly a lot less power-hungry than continuous Flash/SD reads.

NDS Lite with external antenna
I got a broken “parts” DSLite cheaply on eBay for any ‘dangerous’ hardware experiments / mods (I didn’t want to risk my good one again with homebrew hardware in the cartridge slot), and the replacement screen it needed. So while it was open, I figured I’d try plugging in an external antenna. This was a pretty disappointing test.

Antenna used was Unigen partnumber UGADA0B1M1050M-IN or similar (4″ swivel w/ 50mm mini-coax tail, 2.0dBi), which was a spare I scavenged from a helicopter blade testing instrument I designed a couple years ago. Certainly no monster, but I thought it would outperform or at least not suck compared to a copper pattern etched on a 50-cent circuitboard. The DS’ builtin antenna wins by a statistically significant margin. Now a pre-amped Yagi coffeecan will certainly boost your range, but then the DS isn’t exactly such a portable hackytool anymore, and you might as well lug your laptop…

DS wifi module (Mitsumi DWM-W004, DWM-W006 or equivalent) mating connector:
I found and sampled some connectors that will mate with the DS’ mainboard wifi connector and the Mitsumi module, respectively. These part numbers are Molex 53748-0308-C (Digikey p/n WM24014-ND) for the “plug” (mates w/ DS mainboard), and Molex 52991-0308-C (Digikey p/n WM24008-ND) for the “receptacle” (mates with wifi module). I’m not sure how they decide the nomenclature of which is which; both pieces look a little gender-confused if you ask me. These may not be *exact* crosses (indeed, what’s on the official Wifi module doesn’t look like a Molex part at all, while the one on the motherboard most certainly is), but they seem to mate correctly. They are not keyed to prevent backward insertion, so take care.

Order one and you can use spare DSLite wifi transceivers (if you can get them) in your own projects; order both and you can make a daughtercard shim between the DS and the module to tap off signals to a logic analyzer. It would be nice to definitively log the communications required for init, various functions, WPA configuration, etc. The DWM-W006 is (if I remember it right) the same module as in the Wii*, which does support WPA. Wii should give a little more room for a shim board too…

* actually, based on photos of the Wii’s transceiver they’re not pin-compatible and probably use different chipsets, although they have the same FCC ID. Ok, FCC, you’re on crack.

Drmn’ Vibe netdemo at Intro.Inter.Tech

First off, there is a [Big Photo Album] with pics and videos of many of the pieces. (Audio-centric ones didn’t document well since my camera seems to assume the microphone(s) are just there for the photographer to talk to it, and any sound that occurs in front of the camera is just noise.) Also, the chat log of random strangers from the demo app is posted in case anyone is interested. Not everyone bothered to change the previous user’s screen name setting before chatting in it (or changed it later), so names may not exactly map to people.

For this piece two laptops were set up on tables facing away from each other, with a USB trance vibrator attached to each. The demo application, shown in ths post, was running on each machine, one as the client and one as the server. (Wireless was non-existent on one machine and hosed on the other, so they were connected with a hub and plenty of Cat 5.) Participants were invited to chat with us or one another and drive the vibrators. The whole setup, complete with stark black and white desktop backgrounds, was meant to be cold and anonymous (although in practice, in a 1-room space the participants can see each other if they turn around).

Results: People had fun with it, and a vibrator bullet ratting around angrily on the table is a neverending source of amusement ;-), but the general consensus was that the whole setup was a little eerie, made moreso by the fact that they were on public display with people walking by (as opposed to typing dirty in private), and that the participants could still turn around and see each other. It seemed a majority would prefer complete anonymity in their play, being able to have fun with a wholly unknown user and then disappear, without learning their partner’s identity or divulging their own.

(These sentiments were echoed by some participants in Rebecca’s piece, which was set in the “virtual sex” scenario of many future movies past. The setup was a pair of cameras mounted in acrylic cubes, sitting on adjacent mats representing individual pods that could be physically in the same room or a world apart. After applying a Saran Wrap condom (remember kids, safe cybersex!) to their cube, the users would each use the cube in place of their partner, with the video feeds superimposed on a single projection screen. For example, by each making out with the cube surface the two would appear to make out with one another onscreen. Participants revealed how hesitant they felt engaging in this ‘intimate contact’ with a stranger sitting next to them, even if all they were really having contact with was a plastic cube.)

As a complete afterthought, the built-in Webcam on one of the laptops was enabled, with the video showing in a window on its own screen. It seemed to me to mesh well with the overall theme of anonymous cybersex with a partner you will most likely not meet up with again, since there one is probably in it mainly for oneself (as opposed to, say, pleasuring random strangers without reciprocation)… looking into the on-screen window to see the object of your pleasure, and finding your own face staring back at you.

IEEE Sez: Open Source == Terrorism!

No, that’s not a typo, and not (much) of an exaggeration*. For a limited time, you can read the full article here in IEEE Spectrum of all places (IEEE is the Institute of Electrical and Electronics Engineers). But basically, it exists to draw none-too-subtle comparisons between Iraqi insurgence and the Open Source movement, drawing heavily from essays and interviews with John Robb.

“Need a missile-guidance system? Buy yourself a Sony PlayStation 2. Need more capability? Just upgrade to a PS3. Need satellite photos? Download them from Google Earth or Microsoft’s Virtual Earth. Need to know the current thinking on IED attacks? Watch the latest videos created by insurgents and posted on any one of hundreds of Web sites or log on to chat rooms where you can exchange technical details with like-minded folks.

Robb calls this new type of conflict “open-source warfare,” because the manner in which insurgent groups are organizing themselves, sharing information, and adapting their strategies bears a strong resemblance to the open-source movement in software development. Insurgent groups, like open-source software hackers, tend to form loose and nonhierarchical networks to pursue a common vision, Robb says. United by that vision, they exchange information and work collaboratively on tasks of mutual interest.

[…]

To understand open-source warfare, it’s instructive to revisit Eric S. Raymond’s 1997 manifesto, The Cathedral and the Bazaar, in which he describes how a large community of open-source software hackers created the operating system Linux. […] Mimicking open-source developers, insurgent groups “hack at the source code of warfare,” Robb says.”

Wow. This reads like an article about Youth Culture in Reader’s Digest. (In addition to parroting that familiar old “kitchen science two-part explosives” canard.)

*Necessary qualifications: 1) “IEEE” here means IEEE’s Spectrum magazine, and contributing editor Robert N. Charette. The IEEE itself has not actually released an RFC or policy statement to this effect. 2) The article initially refers to the Bad Guys as “Iraqi insurgents”, later defining them equal to terrorists and using the terms interchangeably. (I’m a little rusty on my war, but I think you lose the ability to cleanly label your opponent “terrorists” once engaged in a formally-declared war with each other, even if they fight dirtier than you.)

intercommunicate

Quick ‘n dirty, but my demo for the intro.inter.tech show is almost finished. Powered by maraschino cherries and vodka ;-)

The show will be this weekend, Sat. 11/03/2007, 2-7pm.

ULA Cafe / The Brewery Complex
284 Amory St.
Jamaica Plain, MA
02130

It’s aaaart! Bring your friends!


Figure 1: "oh, beep me again!"

Computers Internet Blog (welcome to my access.log)

Welcome! You can probably guess what three things this entry is about. When you already know about computers, the Internet and blogs, this is of course the first thing you’d feel a desperate need to Google for, of course! Err…wait, Magic 2^16 Ball is telling me you just found this phrase in your serverlogs and got curious just WTF it is. And why all these people are searching for it (in fact, so many that a nonzero number of them are clicking through to your blog, which goes under a completely different name and may be only tangentally related to any of these topics, if at all), and yet this hotly sought-after site has somehow managed to fly under the radar of every major search engine.


Rude bot business cards
Computers internet blog
in my server logs

Many Web stats programs (including Analog, which I use) have this feature where they parse the referrer field for hits from major search engines, and list the top search queries people used to find your site. I’ve been seeing the phrase pop up in my blog’s stats semi-regularly lately, sometimes upwards of 25 hits a day. So tonight I got curious, pulled the logs and had a closer look.


    64.22.110.34 - - [10/Oct/2007:05:34:16 -0700] "GET /?p=365 HTTP/1.1" 200 26307 "http://www.google.com/search?q=computers+internet+blog" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2)"
    64.22.110.34 - - [10/Oct/2007:05:34:17 -0700] "POST /wp-comments-post.php HTTP/1.1" 200 84 "http://tim.cexx.org/?p=365" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2)"
    [...]
    75.126.132.23 - - [10/Oct/2007:13:54:26 -0700] "GET /?page_id=342 HTTP/1.1" 200 36704 "http://www.google.com/search?q=computers+internet+blog" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2)"
    75.126.132.23 - - [10/Oct/2007:13:54:27 -0700] "POST /wp-comments-post.php HTTP/1.1" 200 84 "http://tim.cexx.org/?page_id=342" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2)"
    [...]

Notice a pattern? These blog-seekers must not be happy that this isn’t the page they were looking for, because they sure seem eager to post a comment. In fact, they dive immediately for wp-comments-post.php within a second of page load, a superhuman feat if you ask me. (As I write this, WordPress cheerfully reports that it took 0.855 wall seconds on my shared server to generate one of those pages.)

Okay, so it’s some stupid comment-spam script leaving its calling card. What to do, what to do? Well, mod_rewrite is installed by default on many servers, and can be used to give different users different pages, depending on such things as their HTTP_REFERER. I recommend the output of /dev/urandom, or better yet, a redirect to a hefty Microsoft Service Pack download (assuming the bots support redirect).

(Obviously, I can’t implement it here now, because I’ve just posted about the ever-mysterious “internet blog” and drawn legitimate search traffic.)

mod_rewrite examples: Just add this to your .htaccess file (create if necessary)


# Plonk this stupid bot with a 403 Forbidden:

RewriteEngine on
RewriteCond %{HTTP_REFERER} search\?q=computers\+internet\+blog$
RewriteRule (.*) - [F]

Or, if you prefer dickhead A to go and waste the bandwidth of dickhead B…


RewriteEngine on
RewriteCond %{HTTP_REFERER} search\?q\=computers\+internet\+blog$
RewriteRule (.*)$ http://www.example.com/rubbish.iso [R,L]

In both cases, the RewriteCond line checks for the fairly malformed Google URL used by the spammer script (a real Google search query will have other junk before the “q=…”, so we let them slide), and the RewriteRule sends it packing.

Have fun!

The answer to the question

The flag for my house is done and installed! Actually, Kr* did most of the work. I had to relearn how to use a sewing machine and did a few of the easy parts. The house number is 42, so the Hitchhiker’s Guide theme was a no-brainer. :-)


Also, the clear-bubbly knob on the end will eventually be lit internally by blinkenlichten (the flagpole is hollow to accommodate power and data wires), foretelling tomorrow’s weather by slowly changing colors.

Landmark navigation

Random thought of the day… for places like Boston, where street name signs are considered a luxury that should be cherished for their scarcity, Google Maps /etc. should perform an experiment wherein directions are given relative to landmarks instead of street names.

E.g.:

  • Turn right (90°) at the Shaw’s onto Walnut St. (0.4mi)
  • Turn hard left (140°) at the first street after the third traffic light, Elm St. (0.6mi)
  • Pass over 2 bridges, under 1 bridge, and a large graveyard on the right.
  • Turn right (45°) onto Undefined St., one street after the I-93 overpass and across from a Kappy’s liquor.

Then solicit feedback later on how many times the person got lost while following it, overall frustration level, etc. I think the results would be pretty interesting. (Or…predictable. I think addition of landmarks would blow the pants off the current system of street names and mile counts alone.) Not sure how much of an undertaking this would be (I don’t think the USGS/GIS has a database of sculptures and coordinates of big-box stores and local businesses), but counting streets and (possibly) stoplights ought to be fairly straightforward. (Calculating intersection angles should also be trivial using existing data.)

On a somewhat unrelated note, with thoughts of fun with Nintendo DS and a GPS receiver, today I came across this. Now everyone with a GPS capable of logging its position over time can upload this data after a drive to contribute to a free, publicly available and open-source street map database (i.e. Navteq without all the cost and licensing restrictions.) Currently you have to type in all the street names yourself, but I could see even the raw GPS results (hey, there is definitely a street here!) being useful for some applications.

Das Blinkenlichten

[Clicky here for big photo album]

Heh, yeah, a little late writing this one. I was meaning to write this up…like, a couple months ago, right after the “public beta”, but didn’t get around to it.

So some friends and I had tickets to the Boston leg of the VNV Nation Judgment tour, April 18. Of course no electronica concert is complete without things that blink and blue LEDs, handheld spinny balls, etc. So my friend JR and I hacked together a wearable demo of Das Blinkenlichten, triggered by a microphone and envelope detector, which she wanted to wear at the show.

At probably midnight the night before, assembly was finished. I only had a handful of working nodes (or ones I thought were working…); she made wrist and neck bands out of some flexible clear rubbery sheeting we found in the lab, mounted LED nodes into each piece, and ran a long wire for each terminating in a 3-pin header. Two on each wristband and 3 on the neck; they looked good. The controller was stuffed into an acrylic folding case that once housed some free electronics samples, but was just the right depth (with some coaxing) to accommodate a 9V battery.

Next question…how are we getting a package of nearly naked electronics…with a microphone…through security at a concert where they’re confiscating recording devices…in Boston. It doesn’t even have somebody on it giving the finger.

Sure enough, at the doors security pulls me aside and wants to know what this electronics package is. One asks (jokingly), “That’s not a bomb, is it?” …the other, maybe not getting the joke, replies straight faced that it’s too small to be a bomb. I was eventually let through with my hoax device bag intact, though the mini-screwdriver set (for adjusting the gain pots) was confiscated as Sharp Objects. (Had to track down a security guy and got them back upon leaving.)

Read on, and on and on and on…

Wicked Smaht idea of the day – re: sucky office suites

AutoCrossreference

So I’m at the office writing up some BS in MS Word and I’ve just typed “(blah blah blah) as shown in Figure…”, because I’m about to refer to a figure. Now to make a crossreference. I select crossreference, the window pops up and defaults to “Table”. WTF? With a modern computer’s gigahertz of processing at its disposal, is it really so hard to recognize that the last six letters I typed were F-I-G-U-R-E, and do something remotely smart with this information?

Beyond that, I should be able to define, and store in my template, a list of standard crossreference-able items (Figure, Table, Section, Task, Claim, etc.). Then, every time I type something in a paragraph that matches one of these patterns ( e.g. “Figure 1”), it should turn gray and (if it exists) automatically become a cross-reference to that item. Alternatively, I should be able to right-click on the “Figure 1” I just typed and select ‘AutoCrossreference’. Or simply type Figure, right-click on it and have a popup box of Figures (and of course, NOT Tables, Claims, etc.) appear.

YflTczrDRsinGERKKFSbb6E

Looks like I have a new project for next week, once this weeks messy proposals nastiness is out of the way. A staffer at a Russian ISP tipped me off to an old malware company learning a new trick, with essentially a distributed, keyboard-watching spy network turning your typos into gold in the form of misspelled domain registrations leading to portal-potties full of ad-trash. First step is figuring out their program’s nuisance-grade request obfuscation (calling it “encryption” would be like calling a McDonald’s trainee a chef, but I haven’t gotten around to decoding it yet); next step is flooding it with statistically significant bogus requests and seeing if they take the bait. Third step, as you know, is profit! publishing the findings for peer-review, and retaining a lawyer*.

PS. VMWare Player kicks ass. This is free (as in beer) virtual machine software that runs on Windoze, Linux and probably a couple others. Free as in catch did you say? Of course there is a catch: it won’t let you create your own virtual machine images (officially…), only download and run pre-made ones. However, here is also a great article on creating your own custom images using QEmu, an open-source virtualization program that can write image files in VMWare player’s format. The easiest way to set up a dodgy-software sandbox is create a blank IDE (or SCSI, etc.) drive image using Qemu, start it inside VMWare Player, pop in your favorite** OS install CD, and close VMWare & make a copy of the image files when the OS finishes installing. Viola, you now have a perpetually clean OS copy to run dangerous crap on! When finished, simply close VMWare again and overwrite the now dirty copy with your saved clean one.

*for when theirs inevitably find out that said findings have been published, and raises a hissy. Or, move to Finland and simply thumb nose at malware vendor…

** as measured by the remaining thickness of the install CD (you reinstalled Windows HOW many times? Gosh, you must love it!).

A peek inside the Trancevibe “factory”

…mostly in photo album form. Click on the thumbnails for a larger image with description…

Trance Vibe Assembly pics

Not pictured: us Fluxing-off our actual panels, or screwing the depaneled boards into the finished product, or QA testing (with a pluggable test jig and motor…get yer minds out of the gutter). It turns out these vibe motors vary in strength somewhat from one to the next… any that scores particularly weak on the vibe-o-meter gets binned (only a couple so far). Luckily, a 2-bullet unit is only a couple bucks more than a single-bullet unit when procuring the raw materials, so there are some extras to substitute as necessary.

(And no, I had no idea that (electrically and mechanically identical) vibrators came packaged as separate gay and straight versions.)

(And I definitely had no idea that stripping USB cables took so stinkin’ long :-P )

09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0

Scenes a faire, or, the first digits of pi as expressed in various non-integer radices and rounded to the nearest integer. Any real or perceived resemblance to certain secret codes (yeah, yeah, generate your own damn volume key) are purely coincidental.

09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0

^^^ The WEP key to Jack Valenti’s wireless. I’m told it’s fast enough to download an entire HD-DVD ;-)

Yeah, any excuse to build a new machine…

Today’s entry, involving cool things that blink at VNV concerts, will not be seen at this time, because all the pictures are on the computer that just bit the dust.

Ok, the computer’s fine (or as well as it was for the last several years), but one of the drives took to making this loud sharp metallic WHIIIINNNNNE that means it’s time to start praying to the data recovery deities of my choosing*. The machine has two drives, and they’re too close together to determine by ear which is failing, so I decided to turn the machine off and leave it off** until I have a replacement ready.

Anyway, this is the kick in the pants I’ve been needing to justify the purchase of an obscenely fast new machine to myself, and fix all of the issues in the backup rant. Hey, if I’m going to buy a new drive, it might as well be SATA because the old IDE are fast going obsolete, and motherboards are stopping supporting them. So if I have a SATA drive, I need a new motherboard. And if I have a new motherboard, it needs this sexy dual-core Athlon X2….

* Long diversion to talk about backups here:
As a (long ago, far away) IT-person, I know the importance of keeping backups religiously. So to prove how religious I was, I bought a shiny new DVD+-(*&^%etc.)RW (and RMA’d it after it didn’t work) (and RMA’d the replacement too) (and returned it and got another brand at Bestbuy) to back up all my data on a regular basis. By now you’re noticing that didn’t work so well. After three non-working drives (all burned coasters), I can only guess some weird issue between my motherboard / BIOS / hacks to BIOS to fix unexplained missing IDE channels and broken ATA100 support (long rant here, scroll down) and DVD writers was to blame***. So I said ‘yeah, I mean to fix that…’ and took to periodically copying the important stuff of drive 1 to drive 2 and vice versa, up until the point where both run out of space (yeah, I’ve been meaning to fix that…). This backup is a series of big WinRAR archives, not just for the compression, but mainly because every Windows version to date has been fscking BRAINDEAD in any kind of file copying****, while WinRAR, upon finding one file it can’t copy out of 1000, will actually copy the other perfectly copyable 999. But now, WinRAR has been having this issue where it will no longer backup a specific set of data (being most of a drive) to the other drive. Maybe it does something stupid like create a temp file on the C drive, which only has a few hundred megs free, then barf quietly with a Windows ‘ding’ and NO error message even though the destination drive has 50GB free. (Yeah, I’ve been meaning to look into that…) So yeah, at this moment I have a bunch of data on at least one of the drives that has no reliable or recent backup. But it’s not my fault, I tellya. I’m an ECE, I can design these things at the gate level, I’m a former IT-person, I know what IRQ, DMA and PCI stand for, I’m A+ certified, dammit, I know my shit. It was THEM. Them being everybody who isn’t me. Not my fault, I tellya. I was defeated by cumulative creeping idiocy on the part of others. Not my fault. Not my fau…

** Technically, turning off a drive with a mechanical/bearing issue–especially one not used to being turned off–is a no-no…the drive may not spin back up again, at least without a night in the freezer or some “percussive maintenance” (smacking it around) to unstick the spindle, also big no-nos. But leaving it to grind itself up for a few days waiting on a replacement is a big no-no too.

*** It could be some underperformance or latency somewhere in the chain was causing buffer underruns (even though the computer exceeded all ‘minimum’ specs by the drive manufacturer), which, because DVD burners seem to all have some “underrun safe” technology (all of which work in some necessarily unreliable way, like cutting power to the laser and trying to sync back to ‘within a few frames’ of where it left off when restarting, or worse methods like simply writing zeroes there but not stopping the burn), mask any underrun errors that may have occurred. Again, ‘coaster-proof’ anti-underrun features work by relying on the statistics deities to smile upon you for one or two small errors on the disk, and with hundreds or thousands of such errors scattered across the surface, their generosity is pretty well exhausted.

**** If you try to e.g. grab your entire C drive’s contents and copy them to a backup folder, you are sooner or later guaranteed to run into a file that can’t be copied because it’s “in use” (often by another program simply READING it, because a programmer didn’t specifically tell Windows the program is reading a file in read-only mode). So, it just skips that file and continues copying all the rest of them, right? BZZZT! Wrong. It throws up an error message, making you click OK, and then completely aborts the copy. Good luck dragging a huge folder somewhere and letting it copy overnight while you’re sleeping instead of babysitting it. But you can at least remember that filename, and just re-select all the ones after it and try to copy it again, secure in the knowledge that at least all the files before that one have copied, right? BZZZT! Wrong. The order in which the files are copied is completely arbitrary (in fact, a longstanding Windows bug often causes the LAST file selected to be copied first, followed by the first file selected, and then who knows…), so there’s no guarantee that if it dies on a file starting with ‘G’, all the files starting with A-F have been copied.

One step closer to my own robot army…

  • Councillor Hamann: Have you ever been to the engineering level? I love to walk there at night, it’s quite amazing. Would you like to see it?
  • Neo: Sure.
  • Councillor Hamann: Almost no one comes down here, unless, of course, there’s a problem. That’s how it is with people – nobody cares how it works as long as it works. I like it down here. I like to be reminded this city survives because of these machines. … Of course… that’s it. You hit it! That’s control, isn’t it? If we wanted, we could smash them to bits. Although if we did, we’d have to consider what would happen to our lights, our heat, our air. … There is so much in this world that I do not understand. See that machine? It has something to do with recycling our water supply. I have absolutely no idea how it works.

Beering after work yesterday, someone mentioned the guts of an oldie-but-goodie Ozo router (company no longer exists) sitting in the lab, and how nice it would be to get this up and running again. (For our propellerheads out there, I’m not talking about e.g. a Linksys box for computery things. This type of router is a big industrial CNC machine consisting of a high-RPM drill spindle and Z stepper, and a big motorized table that can move in the X and Y directions. Feed it a block of plastic/wood/metal and a design file, and it turns out a complex machined part.)

Anyway, pretty much every project I’m currently involved with at work is stalled for one reason or another, including vendor douches who won’t return my calls*, fights with everyone’s favorite circuit board house (PCB Nazi Express–to be documented soon), TPOCs who only check their voicemail every six months, etc.–and let’s be honest, the idea of having a huge part-making machine at my disposal is really nifty–so today I got curious and started researching. Venturing into the dark and cobweb-infested corners of our storage area, I find we have THREE of these defunct machines, all missing the same critical component** (and then some). Turns out the production lab, who has two such routers (both working), have been slowly scavenging parts from these to keep theirs running. That works great, say, the first three times you need to replace a funky driver board (or six limit switches, whichever comes first).

It did kind of surprise me a little that the one pair of machines necessary to manufacture the only product the company sells in quantity (i.e. what brings in the $)…have no hot spares. Okay, forget a hot spare (these are large machines, after all), but not even the necessary parts to fix one if it goes. As CC explained, if one of these breaks down we’re kinda fucked.

(Expect a detailed HOWTO if I ever get around to hacking one of these things back to workingness. Plan so far is to gut most of the onboard electronics and command the steppers directly from a standard parallel port using EMC2.)

* “You’re from a 20-person SBIR company that hasn’t had a commercially produced electronic product in over a decade, and you want to buy ONE lousy part? Yeah, I’ll get right on that.”

** The missing piece is a funky old discontinued ISA card for old IBM XTs between about 8MHz to an upper limit of about 33MHz. This card actually has a jumper wire to tie into the PC SPEAKER pin on the motherboard; the DOS program that runs the router does some interrupt twiddling and uses the speaker frequency to control the spindle speed. I swear I heard “…in the ghett-o!…” upon discovering this. (More) sadly, since it looks exactly like an old ISA printer port card, they and the dusty old 286es housing them have been doubtless thrown away years ago in some routine lab / storage room cleaning.

RezVibe l’arnins, pt. 1

Ok, so I now have a Dildonics tag for all the trancevibe stuff. It’s an exciting informative journey through the no-man’s land of small volume electronics production.

I’m going forward with this project (and documenting it) mostly for my own personal edification. I’ve never developed and commercialized something before (unless you count my childhood four-leaf-clover stand, which, incidentally, had comparable sales volumes), and it’s probably not going to happen without getting my own sweat involved.

How it usually works (or I’d like to think so) for gadget geeks is, you work by day as an engineer at a respectable technology company–you develop cool gadgets… you see your babies through from conception to mass production (and occasionally help your landlady carry out her garbage). By night, you use the vast product-development knowledge and connections you’ve acquired to fuel your own pet projects, which will of course revolutionize the free world and put sliced bread back in its place. However, I work at an R&D company that does mainly SBIR contracts, so there we develop technology and run experiments; we don’t mass-produce things.

Since the last vibe-related update I have done a couple “production runs” of 3-8 units at a time (since that’s how many I had parts on-hand for), and thrown in a Digikey order for parts enough for a mind-boggling 25 more. Did I say Digikey? YES, I SAID DIGIKEY. For those not in the know, think of Digikey as sort of a really big Radio Shack store online. Except that they still sell discrete electronic components (not cell phones), albeit at an often substantial markup. It would be funny if you went to the Verizon Store to buy a phone, and when you made your purchase, the guy behind the counter sprang up, ran to the Radio Shack next door and bought the requested model retail, then came running back to stuff it in a Verizon Store box and resell it to you.

Some things discovered lately:

Mailing Stuff
First class mail (letter post) isn’t just for letters; you can mail up to 4 lbs of stuff (in a bulky padded envelope, or even a tube or a box) for a few bucks.

There is a class of mail called “media mail” specifically for media, which can be big and heavy but mailed ridiculously cheap. This applies ONLY to media however, which specifically means records, CD/DVDs, videotapes, sheet music, and bound printed matter which does not contain advertising. The USPS is actually pretty strict about it (according to research), and will occasionally open up media mail packages for inspection if they think someone’s cheating.

You can mail stuff across the pond for just over $5. 7-day Air Mail. However, these shipments involve a green Customs Form, PS Form 2976 (items under $400), which requires a duplicate writing of the sender AND receiver’s full name and address; description, weight and value of goods (2x), and two dated signatures. This makes one sore hand if you ship a large batch of stuff overseas. I still have no idea whether “value” equals “price paid”, “Bill Of Materials cost”, “BOM + labor”, or “retail, but there’s an implicit understanding that shippers mark the goods as a gift, or substantially undervalue them to avoid socking the recipient with a huge tax”. Anyone? (Ahem, trying to be legal, mainly to avoid fines / jail / siezed packages.)

You can’t ship adult materials to Uzbekistan.

You can’t ship “obscene articles” to the UK.

Actually, there are a fuckton of countries with restrictions on spicy materials. (Not to mention a zillion other things such as alcohol, money, pork, live bees, and “All foodstuffs if the time left until the “use-by” date is less than 70% (calculated from the date of manufacture)”.)

Don’t ship a damned thing to countries ending in “-stan”.

Manufacturing

“Bad boards” do exist, and can’t reliably be detected by visual inspection (by the board house or otherwise). As I found out recently in a project at work too, even expensive houses (Bobby, I’m looking at *you*) release severely fscked-up boards now and then. For that one, about half the vias (small metallized drill holes that pass a signal from the top side to bottom side, or vice versa, manufactured by drilling the hole out of the fiberglass board and letting metal grow inside it) didn’t connect. A couple of the DrmnVibe boards had either shorts or open traces (where the metal of the trace was etched all the way off/through; the opens were cleverly hiding under white silk screening). I now have a simple test jig to verify DTV boards with a real ‘bullet’, even if one is never soldered to it.

Stripping USB cables by hand takes a long damned time. The “USB-A to bare wires” Digikey part went out of stock, so I searched for a replacement and found it was cheaper to get a ‘real’ cable (USB-A to mini-B) and just cut the B end off. I think manufacturing-wise I’m going to either stick to pre-stripped cables from now on or add a B connector to the board. Otherwise it’s cut the end off, strip back insulation, strip 4 tiny signal wires, then deal with the ground shield consisting of braided metal (like the stuff in steel wool) that’s a bitch to cut off cleanly, and leaves bits of fine metal wire everywhere to short things out and/or embed themselves in your thumb.

Manufacturing PITAs, in decreasing order:
Soldering boards
Reassembly of COTS vibe, aligning 3 screws at once while holding a board in between
Stripping USB cables
Packaging and shipping
Drilling holes for cable (PITA factor doubles on discovering someone lost the chuck key…)
Disassembling COTS vibe, removing guts
Batch programming with PIC programming jig
Final testing with Tezt.exe and bullet jig

Nintendo DS current consumption – hahd numbahs

Background story
So I was busy homebrewing on my NDS, even bought myself a DSerial board to use it as an ultraportable serial/debug console. I had a few ideas for the much faster, native parallel interface too, so when we were sending out boards at work, I threw my own “DParallel” onto the layout. The boards came back, and we had to cut them apart…note to self: DO NOT let your machinist saw apart your boards on a huge gritty band saw. As is semi-common practice (and just like on the DSerial) I laid out a big VDD (main system power) plane on the bottom of the board and a big GND plane on top. Before inserting the board, I peered down the sides of the card slot to be sure they weren’t metal that would short against the sides of the board, and even performed some quick “due diligence” checks with an ohmmeter to be sure I didn’t do anything stupid (such as somehow shorting VDD and GND together) that would result in frying my DS.

Satisfied that all was well, I popped the board in, hit the power switch…and proceeded to fry my DS :-(

Turns out that the top and sides of the card slot are plastic, but the back surface (hard to see in an all-black DS) is METAL, and it’s connected directly to ground. Combine this with a big VDD plane in direct contact with it, and some rough board-sawing leaving some exposed copper on said plane, and a heap o’ trouble ensues.

Anyway, due to some smart engineering by the big N, I am spared from my own stupidity (it just blew an internal fuse). Googling for Nintendo DS power consumption specs to figure out what replacement fuse I needed, I saw just forum posts with educated guesses ranging from ~ 300mA to upwards of 1.5A. So while I had it under the knife, I decided I’d settle the question once and for all.



Current Consumption Numbers:

All measurements taken on a DS Lite “revision as of Jan. 07” at 3.70VDC, the nominal voltage of the battery pack.

Quiescent (power OFF, just running the realtime clock)…1.3uA! (This is Sweet F-All.)
NDS Boot screen, no cartridges installed…
Screen brightness 1 (lowest) : 54mA
Screen brightness 2 : 81mA
Screen brightness 3 (default) : 128mA
Screen brightness 4 (brighest) : 180mA

All the following measurements taken at Brightness level 3 (default) unless otherwise noted.

DS Download Play (Wi-Fi module active/scanning) : 177mA
Pictochat (Wi-Fi active) : 140-184mA

With Supercard SD installed….
NDS Boot screen (Pictochat / Download Play selection screen) : 159mA
GBA mode (bottom screen off, probably ARM9, 3D engine and a couple other things powered down too) : 98mA
SuperCard home screen: 165mA
Playing a movie using Moonshell (bottom screen off, 2D) : 118mA
Moonshell ‘idle’ (both screens off) : 67mA
Metroid Prime Hunters (both screens active, 3D, heavy Flash seeking) : up to 190mA
Running “WiFi_Example1” (both screens and WiFi active) : 228mA
WFC “Search for access points” : 228mA
“Almost Worst Case”: Running Wifi_Example1 at full brightness: 278mA

Worst case seen: ~ 290mA

Breakdown
Base… 36mA?
1st brightness level: add 18mA to base
2nd brightness level: add 24mA to 1st brightness
3rd brightness level: add another 47mA…
4th brightness level: add another 52mA to all of the above

(Total power savings by keeping lowest brightness: 126mA)

SuperCard SD: add 31-37mA while idle…a bit more while reading/writing the SD.

Bottom screen @ default brightness: save 47mA by turning it off

WiFi enabled (“new” 1/2007 DS Lite wifi chipset) : add 49 ~ 63mA, varies based on what it’s doing.
Around the tail end of 2006, Nintendo switched to a different WiFi chipset (sorry, can’t find any more info online from DS forums, etc…only the code changes in libdswifi CVS to accommodate it). This is the one I have. Power draw results for the previous chipset could vary from this.

Fictional (best case) playing times:
Numbers obtained by dividing battery capacity (1000 mAh) by actual current consumption. The “mAh” (milliamp-hour) rating means the battery can in theory supply 1,000mA for 1 hour (or 100mA for 10 hours, etc.).

These are rough ballparks that assume 100% conversion efficiency, extracting 100% of the power out of the battery, and all kinds of other things which do not reflect reality. Your real numbers will be lower.

Brightness 1 (min), no cartridge: 18.5 hrs
Brightness 2, no cartridge: 12.3 hrs
Brightness 3 (default), no cartridge: 7.8 hrs
Brightness 4 (max), no cartridge: 5.5 hrs

As you can see, backlight setting has a large impact on total run time!

Let’s assume default brightness for now…

Pictochat / Wifi download play: 5.6 hrs
Running SuperCard SD: 6.1 hrs
Running SuperCard SD with intensive game: 5.3 hrs
Running SuperCard SD in GBA mode: 10.2 hrs
Running Wifi app/game from Supercard SD: 4.4 hrs

Miscellaneous
“Low Battery” threshold: about 3.70V
Low battery automatic shutdown: about 3.44V

Startup current profile, no cartridges:
Initial phase: 20mA (screens off, power indicator dimmed)
Second phase: 85mA (screen backlights on, still initializing things)
Fully initialized: 128mA (default brightness)

Fuse sizing (for everyone else who did something dumb and blew F2): I had some 500mA 0603 surface mount fuses laying around (Rezu project represent!), so I used one of these. I think it’s a good number given the above. Worst-case power usage I could produce was just a hair under 300mA, but some other DS slot 1/2 cards (games, flashcarts, rumble paks, specialty cards like the Opera Browser cart with onboard RAM) may draw more juice (still, I doubt it would bring the total over 500mA). Even if you’re sticking your own Pentium 4 accelerator card in there, I wouldn’t advise sizing the fuse above about 750mA, absolute max. It’s there in part to keep the Li-Ion battery pack from going all Sony Vaio on you and melting your pocket into hot slag if something in the DS shorts.

Text on the new Mitsumi wifi module:
DWM-W006
IC: 4250A-DWMW006
FCC ID: EW4DWMW006
(“R” symbol) 007NTCUL0121
Made In Philippines

Mitsumi’s web site provides no evidence that this module actually exists, of course.