Drill Bits Of Unusual Smallness

One of the fun things about technology is that there are so many diverse subfields that nobody can stay current with all of them. Occasionally, you come across a tool or process commonly used in another field that seems amazing to those not used to it.

One of the students where I work recently brought in a set of micro-sized drill bits. These are a fraction of a millimeter in diameter; the smallest chuck for my Dremel tool wouldn’t hold them. Even the drill bits for the LPKF PC board milling machine that we use are larger.

I don’t know what they’re generally used for (pilot holes for micro-sized screws?), but whatever it is, it involves extraordinary precision!

The set of micro-size drill bits. (Click for larger.)

A detail view of one of the smaller bits. (Click for larger.)

Thanks for sharing, Mike!

 

Posted in Metalworking, Tools | 1 Comment

A Confusion of COM Ports

I like serial-port communications, but this is ridiculous.

Whenever a new USB serial device is connected to a Windows computer (and/or apparently whenever an existing USB serial device is moved to a new USB port), Windows assigns it a new COM port number. Back in the good old days, there was generally COM1 and COM2 — typically for a mouse and modem — and the addresses were set in hardware with jumpers or DIP switches.

Fast-forward to today’s environment, including Arduinos, Bluetooth serial devices, USB-to-serial cables, and others. I’m up to COM29 with no end in sight. Most of these are the ghosts of various devices plugged in to various USB ports. The drivers are all still installed, and they’ll be redetected when plugged back in.

Deleting unused COM ports in Windows isn’t as straightforward as perhaps it should be, since Device Manager doesn’t list non-present COM ports by default. Fortunately, an article on Microsoft’s Knowledge Base shows how to change this. Here’s how:

  • Open a command prompt
  • Type      set devmgr_show_nonpresent_devices=1    <enter>
  • Type      start devmgmt.msc  <enter> to start Device Manager
  • Click     View –> Show Hidden Devices.
  • The COM ports are listed under “Ports (COM & LPT).” Have at ’em!

Incidentally, this solved the mysterious   “avrdude: stk500_getsync(): not in sync: resp=0x86” error message I was getting when uploading an Arduino sketch. Apparently even the Arduino IDE had had enough.

 

Posted in Arduino, HOW-TO, System Administration | Leave a comment

Electoral College Reckoner

The US Presidential election system is not the most straightforward thing in the world. The President is not directly elected by popular vote, but is instead elected by the members of the Electoral College. These members are chosen by the individual states, with each state receiving as many electors as it has members of Congress. Most states select their electors on a winner-takes-all basis. Maine and Nebraska use a split system whereby some electors are determined by popular vote and others are determined by the popular vote winner in specific electoral districts.

Since there are five hundred thirty eight members in the Electoral College and a clear majority is needed, two hundred seventy electoral votes are needed for a victory. This has various effects on the Presidential campaigns — mostly involving candidates spending a lot of time and money courting votes in large “swing states” (states with a large number of electors where the outcome is uncertain.)

Various pollsters and pundits have tried to predict the outcome of the election. Nate Silver’s “Five thirty eight” blog has come up with an estimate of the odds of each candidate winning each state’s electoral votes (including Congressional districts in Maine and Nebraska.) From this, it’s possible to predict the outcome of the election, using Monte Carlo analysis.

Using Five Thirty Eight’s data (text file contains district abbreviation, odds of a Democratic victory in that district, and its number of electors for this year), I ran the simulated 2012 Presidential election (FreeBASIC code) one billion times. (Hey, if it’s worth doing, it’s worth overdoing!)

The results are encouraging for a secular, liberal/libertarian geek like me:

Runs: 1,000,000,000
Democratic victories: 960,093,075
Electoral College ties: 2,608,646
Republican victories: 37,298,279

Democratic victory %: 96.01%
Electoral College tie %: 0.26%
Republican victory %: 3.73%

Here’s a histogram of the relative probability of each number of electoral college votes for President Obama. (Anything 270 or greater is a Democratic victory.)

A histogram of the projected probabilities of the Electoral College outcomes, according to the simulation. (Click for larger.)

I hope Mr. Silver’s analysis is correct. We really don’t need another four years of corporate cronyism and Bible-thumping anti-intellectualism.

Posted in BASIC, Coding, Current Events, Digital Citizenship, Math, Science | Leave a comment

PIC I2C Library

Having spent the better part of the day writing I2C routines for the PIC16F887 from scratch (because the supplied Hi-Tech libraries didn’t seem to work), I figured I might as well package them up into a library for future use, available here.  (These were written for a PIC16F887 using Hi-Tech C, but they should be fairly easy to port to any other platform with a standard C compiler.)

Usage is fairly straightforward:

I2C_ReadRegister(char deviceAddress, char registerAddress);

I2C_WriteRegister(char deviceAddress, char registerAddress, char Data);

The routines are simple and straightforward: single-master-only and single-byte-transaction-only. I may get ambitious enough to update them later on…

I consider these routines to be either late alpha or early beta at this point (meaning that they seem quite reliable so far, and most of the major bugs appear to have been squashed.) Specifically, they have been tested with Sparkfun’s MMA8452Q Triple-Axis Accelerometer. If you notice any bugs or have suggestions for improvements, I’d appreciate a heads-up.

“Share and enjoy!”*

Posted in C, Coding, Digital, PIC Microcontrollers, Resources | Tagged , , , , | Leave a comment