« now reading | Main | robot-a-day »

Some thoughts on One Word x 40:

Q17: Yes, "phenomenal cosmic power" is three words. But, it's a better wish than "more wishes" and it's a multitasker. Besides, if all I said was "power" then you all would think all I wanted was to be Emperor of Wazootystan. For starters, I also want to to bend space and time, to see the entire electromagnetic spectrum, and to launch fireballs from my behind.

Q26: Yeah, coy answer, wasn't it? It could mean a number of things, such as "maybe I will miss someone soon," or "I haven't decided whether this person is worth missing," or "do I still miss that person," or "yes, but I'm going to make you to guess who." That last one was how I'd actually meant it. But to spare us all a game of twenty questions, the answer is actually "sure, lots of people." Distant relatives, old flames, etc.

Q27. The car itself isn't expensive as cars go. In fact, at one point, it seemed to be the most popular car on the road. But I did the math and it costs almost $10 in fuel just to drive to work and back. Then there's insurance and of course the payments. And I had to get tires a few weeks ago. So it's not exactly cheap.

Q37. You're right, cilantro is an herb. I still hate it. I'm not exactly crazy about cucumbers, but those are technically fruit. Oh, I've got it, now: beets.

Posted on Saturday, June 07, 2008 at 11:55 PM
Categories: amusement, q+=a
| | Permalink

TroyBoy at Pheasantly Fascinating asks,

Which is your current all time-favorite blog entry? And no, you can't select one of your own! Post about it and let me know in my comments.

I don't think I can select just one! My true blogroll is a just a wee bit longer than the one displayed in the sidebar. I've read a lot of blog entries, and many of them are amusing and memorable, and each of the bloggers behind them is brilliant in unique ways. It's not really fair or possible to create one set of criteria with which each of them should be judged. (There's also the the fact that everyone who wasn't picked will be least a tiny bit offended. Honestly, you will be, just admit it.) So instead, I'll do a top five type of thing.

5. Surrogate Samurai at Radioactive Jam.
Why do managers get the best equipment? All I got was a Splintered Sharpened Stick.
4. How To Piss Me Off With Your Blog at dyers.org
I mentioned this one a while back. Even though the rise of OpenId may have made one or two of the annoyances less common, the rest are no less true. (And I'm sure I'm guilty of at least one of those, myself.)
3. Execution In The Kingdom Of Nouns at Steve Yegge's Blog Rants
An allegory (in the style of the Thing King ) about the shortcomings of the Java programming language, it's written in an entertaining but informative style that makes a dry subject interesting and easy to digest.
2. My Weekend at Nice To See Stevie B
A seemingly mundane "moving day" story takes a macabre twist. If I were in that situation, I probably would have jumped to the same conclusion about the crock pot.
1. Personality Disorders at Digital Heath
It's a pet peeve of mine that people occasionally make remarks about OCD that show that they don't understand it. For example, someone may blog that they deep-cleaned their home in anticipation of the in-laws' visit, and remark that OCD compelled them to clean the oven, polish all the brass, iron the curtains, and zshoosh all the magazines.
Sorry, but unless you're convinced that your mother in law will kill you for having a tchotchkie out of place, and you've cleaned the oven several times consecutively— just in case it's gotten cooties in the few minutes since you last cleaned it— then in my humble opinon, you're just a perfectionist.
The author of the above post knows the difference, too, and delivers (also in my humble opinion) a fairly accurate description of OCD. (He doesn't mention numerological obsessions, but that would be a whole blog post blog in itself.)

How about you, dear reader? What are some of your all-time favorite posts?

Posted on Saturday, March 29, 2008 at 10:50 PM
Edited on: Saturday, March 29, 2008 10:55 PM
Categories: amusement, link-o-rama, q+=a
| | Permalink

Q: I've seen a lot of the following in my DenyHosts log. What the heck is this?

ERROR    regex pattern ( User (?P<user>.*) not allowed because not listed in AllowUsers ) is missing 'host' group

A: Ah, yes, DenyHosts. This is a Python script that examines your system logs for failed SSH login attempts. It will add the IP addresses of offending systems to your system's hosts.deny file, more or less blacklisting them. While this alone probably won't stop a determined attacker, it will at least stop automated dictionary attacks from cluttering up your system log.

As for the error message, it seems to be complaining that one of the regular expressions that DenyHosts uses to analyze the system logs is missing a little something. Fortunately, you can redefine any of these regexes by appending the appropriate line to your denyhosts.cfg file. For example, to redefine the regex that's causing this message, you could add a line like this:

FAILED_ENTRY_REGEX7=User (?P<user>.*?) from (::ffff:)?(?P<host>\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}) not allowed because not listed in AllowUsers
Posted on Thursday, February 21, 2008 at 12:02 AM
Categories: q+=a
| | Permalink

Q. I've set up a shiny new SSL server (Apache) but now Firefox keeps saying "could not establish an encrypted connection because the certificate presented has an invalid signature." I know my certificate hasn't expired. So what's up?

A. Check your httpd.conf. If your SSL server is configured in its own Virtual Hosts section, ensure that the ServerName parameter exactly matches the common name listed in the certificate itself. For example, if the certificate is issued to www.example.com, ensure that the line is ServerName www.example.com.

You can't, by the way, use SSL with name-based virtual hosts, only IP-based virtual hosts. This is because the SSL connection is established before the HTTP request is made, and it is the HTTP request that identifies to the server which name-based virtual host the client is attempting to contact. You can continue to serve your non-secure pages from a name-based virtual host, and begin serving your secure pages from an IP-based virtual host, but because these two hosts will need to have different IP addresses, they'll also need to have different hostnames, such as www.example.com and secure.example.com. Of course, this will only work properly if you've had the foresight to issue a certificate to secure.example.com. If not, and all you've got is a certificate issued to www.example.com, then you'll need to serve both secure and non-secure pages from the same IP-based virtual host.

Posted on Saturday, February 16, 2008 at 10:11 PM
Categories: q+=a
| | Permalink

Topncal writes:

Why did you choose your blog platform? It is not one of the top 10 or 15 systems. So how did you find it? I checked out the page for it a few weeks ago. Nothing really stood out to me as making it different. So I guess it would be interesting to hear your thoughts on why you chose it.

I don't remember exactly where I discovered Thingamablog, although I do know approximately when I did so. I uncovered a bookmark for Thingamablog in a stratum of bookmarks dating from 2004-5. I suspect that I was combing the likes of linuxlinks.com and icewalkers.com for Wiki software and happened upon Thingamablog by accident. I tried it out, thought I'd make my own template from scratch, got really bored with that, and forgot about it for a while.

A little later, an old classmate of mine started a blog of his own, which encouraged me to do the same. Sure, I could have just joined LiveJournal, etc., but to me that would have just been my account at somebody else's site. A grouchy sysop could capriciously, conceivably, delete my account-- and that would be end of my fun. Also, if I didn't like the service, it wouldn't exactly be easy to move my stuff to elsewhere, as I'm sure you may know.

Anyway, since this was going to be strictly for fun, I had no desire to involve a hosting company, and my ISP had no desire to allow me to run a public Web server in my living room. They were willing to let me upload a few old-fashioned pure-HTML pages to their Personal Web Space.

So, I needed a blogging platform that would not only run client-side and output static HTML, but that could do so on my Linux desktop. As it turned out, Thingamablog fit that requirement pretty well. It's written in Java, so the code's very portable, and since the output is ordinary HTML, that's portable, too. So if, for example, I get annoyed with my current hosting provider, I can pack up and leave in a clap of the hands. And there's no chance of anybody getting cute with stupid SQL injection tricks, PHP inclusion, or parameter fuzzing, because none of that's applicable. This isn't to say it's not possible for someone to deface this site, it's just a little less likely... and if they did, it would be overwritten the next time I published.

Is Thingamablog perfect? No. In fact, the editor in the current version has some sort of memory leak or something that causes it to become decidedly unresponsive. Also, the way it handles the category archives leaves a bit to be desired. I have to contract out commenting and site search to HaloScan and Google, respectively. I don't think I'll trade up to a server-side solution any time soon, but I think that if I did, I'd bypass WordPress and Movable Type altogether in favor of a full-fledged Content Management System such as Joomla, although I hear good things about Drupal, too.

Posted on Thursday, February 14, 2008 at 1:09 AM
Categories: q+=a
| | Permalink

Q. My boss is in the hallway singing "So Long And Thanks For All The Fish." Has he gone crazy or is this some sort of message?

A. Yes. Consider updating your resume.

Posted on Tuesday, January 29, 2008 at 11:44 PM
Categories: q+=a
| | Permalink

Q. There is this one query that I need to stop from going to the default page on my website (index.php). It doesn't do anything but I have my reasons! I have looked everywhere and no example I found has worked for me. Help me, Obi-Wan Kenobi!

A. Obi-Wan? That's a name I haven't heard in a long time. *roll eyes* As it turns out, one way that you can accomplish this is with Apache's mod_rewrite. If one wishes to entirely remove the query string "plugh=xyzzy" from queries to "http://www.example.com/index.php" this technique seems to work:

# match the forbidden query
rewriteCond %{query_string} plugh=xyzzy
# redirect without the query string
RewriteRule ^(.*) http://www.example.com/? [R,L]

Posted on Monday, December 03, 2007 at 11:27 PM
Categories: computer science, q+=a
| | Permalink

Well, it looks like November is finally over. And if I can write just one more post, I'll have made the thirty-day challenge. So today, I'll try and answer a reader-submitted question or two.

Q. What is a replicant printer?

A. You may be thinking of a rapid prototyping machine, or 3-D printer. This is a computer-controlled device that sculpts an object into existence by either cutting unwanted material away from a block of raw material, or by depositing layers of material upon one another until the desired form is obtained. Originally exotic devices that used ultraviolet lasers and tanks of photoreactive polymers, rapid prototyping machines are now commonly built by hobbyists. And there are signs that low-cost rapid prototyping machines may soon be available to the consumer. For example, one can already buy a computer-controlled woodworking mill.

However, the printing is only half the job. If one wishes to replicate an object (in size and shape, since this isn't Star Trek-- yet) then one must first enter these parameters into the controlling computer. This is an easy task if the object to be replicated is a cube, but the task grows more daunting as the object grows more complex. Enter the 3-D scanner. As with the 3-D printer, some hobbyists have already been experimenting with low-cost methods using milk and laser levels.

Q. Do cassette players have relays I can scavenge?

A. Generally not. However, it's a fairly good bet that a modem or fax machine will give up at least one relay.

Posted on Friday, November 30, 2007 at 9:30 PM
Edited on: Friday, November 30, 2007 10:01 PM
Categories: q+=a
| | Permalink

I discovered that if you are running Thingamablog 1.1b on Ubuntu, and it won't launch Konqueror or Firefox when you click on a link in the RSS pane, that could be due to your Java environment. Launch Thingamablog from a shell:

$ java -jar thingamablog.jar

If it says something like this when you click on a link:

Exception in thread libjdic.so: Can't load IA 32-bit .so on a IA 32-bit platform.

Then you should find out if you're using the free Java clone:

$ ls -la `which java`

If that shows a symbolic link to somewhere like /etc/alternates, then this is indeed the case. When I removed the free (as in speech) Java clone and replaced it with Sun's (free as in beer) Java, clicking on links produced the desired result. The linked pages open in Firefox, rather than Konqueror, but I can live with that.

Posted on Wednesday, November 14, 2007 at 11:30 PM
Edited on: Monday, November 19, 2007 12:41 AM
Categories: computer science, q+=a
| | Permalink

Gentle Reader writes:

Q: Are there christmas lights that clip individually and are self- contained? no wires!

A: There can be, if you don't mind a little bit of gluing or taping. You can make a variation of throwies that have clips instead of magnets. You will need:

  1. Light-Emitting Diodes. Any color you like. If you're not picky, you can get an LED assortment. If you're feeling adventurous, you can get the self-blinking variety.
  2. Watch Batteries: The original article suggests the CR2032 battery, although I suspect that any three volt watch battery will work just as well, but it may not last as long.
  3. Tape: Any strong, non-conductive tape. It will hold the LED to the battery, and the battery to the clip.
  4. Clips: Since trees generally aren't magnetic, you'll need some way to hold your throwie to the tree. You can use clothespins, binder clips, Twist-Em's, ornament hooks, or whatever else you may like.

Now, the only tricky part is to attach the long lead of the LED to the positive (+) side of the battery. Use the tape to secure the LED to the battery, and then to the fastening device thusly. (Click to enlarge.)


tree-throwie-01   tree-throwie-02  tree-throwies-03

My examples are a little crude-looking, but they are only meant to demonstrate the principle. One could get quite crafty and employ ribbons, styrofoam, glitter, pipe cleaners, pine cones, spraypaint and anything else that may spring to mind.

The advantages of these over traditional lights are of course that there are no wires to tangle (although winding your traditional string of lights around a piece of cardboard at the end of the season can help with that.) They are also very low-current and should put off very little heat, much less than the typical incandescent bulb. Thus is is very unlikely that they will melt anything.

Posted on Friday, October 12, 2007 at 10:02 PM
Edited on: Friday, October 12, 2007 11:20 PM
Categories: q+=a
| | Permalink

Q. How can I make an android out of spare parts?

A. Well, that all depends on a few things. First of all, what do you mean by android? Most people consider an android to be any robot made to resemble a human, but others consider an android only to be a robot made to resemble a male human. The term for a robot built specifically to resemble a human female is gynoid. A robot that is made to otherwise resemble a human, but that is genderless, would be an androgynoid. The opposite of an androgynoid-- a robot made to resemble both man and woman-- would, of course, be a hermaphrodroid.

Ahem. But back to androids. Some would stretch the definition of android to encompass any artificial human, even classifying Frankenstein's monster as an android. By this definition, then, building an android from spare parts is as easy as a midnight visit to the neighborhood morgue. The proper application of 1.21 gigawatts to the android-to-be is left as an exercise for the reader. Should thunderstorms be rare in your area, or if your stomach gets queasy over the thought of desecrating corpses, you may be advised to consider building a purely mechanical android. (You may also wish to consider hiring a hunchbacked minion to do your desecration for you.)

Anyway, the important question is what spare parts are available. I assume you have stiff wire, bicycle cable, scrap wood, screws, springs, hinges, motors or solenoids of some sort, sculpting clay, polystyrene for vacuum-forming, a vacuum-forming rig, and silicone, urethane, or something similar to mold into the android's features. I suppose you could just substitute papier-mache for the last few items, but the resulting android won't fool anybody except the birds. So, having gathered your materials, follow these easy steps to build your own electronic replicant.

  1. Build a skeleton from the scrap wood, springs and hinges.
  2. Attach the motors and bicycle cables in such a way as to animate the skeleton to your liking.
  3. Use the sculpting clay to artistically make models of the android's desired facial features, hands, feet, etc.
  4. Use the vacuum-forming rig to make a polystyrene mold of each clay model.
  5. Mold each android part in silicone, urethane, gelatin or whatever medium you have chosen. Try and save the molds in case you decide to begin mass production.
  6. Attach the molded parts to the android. The stiff wire may be useful to lend support to the molded material.
  7. Throw the switch.
  8. Either blame your hunchbacked minion for yet another failure, or gloat and cackle maniacally.
Posted on Monday, August 27, 2007 at 11:16 PM
Categories: q+=a, robotics
| | Permalink

Here's something we haven't done for a while, but someone did submit a good question, and it deserves a good answer.

Q. Where do you find the best parts to scavenge for robotics?

A. Just as the best food for fish is fish, the best parts for robots are robot parts. However, finding a dead robot from which to scavenge parts can be difficult under normal circumstances. So I have prepared this list, based on my own experience, of things one is likely to find in normal circumstances, and of what useful things one might find inside those things.

Computers

Power Supply
Not worth scavenging parts from as it contains large capacitors which can be quite dangerous. However, AT/ATX power supplies are quite useful to the experimenter as they deliver a useful range of voltages: +12, +5, -5, -12, and 3.3 volts. If you're using an AT power supply, ensure that the switch is adequately insulated to avoid an electrocution hazard. You will also need to supply a load for the power supply to work properly, such as a large resistor. Perhaps you might consider building an enclosure for the switch, load, and power supply with spring-loaded terminals for each voltage. Although I do not recommend opening the power supply, this page is still helpful. And here are some other ways to get power from a PC.
Motherboard
Very old motherboards are treasure troves of 7400-series chips, kilobytes of memory, and some specialty chips like UARTs and processors. However, unless the board is bad, first consider whether it might serve you better as the brain of your robot.
Expansion cards
As with motherboards, very old expansion cards are even bigger troves of 7400-series chips. People are usually happy enough to get rid of their old modem cards, and these usually have relays, which are useful for controlling motors, especially larger ones.
Floppy disk
I don't get too excited about 3.5" floppy disk drives as the stepper motors are pretty small and haven't proven that useful when removed. On the other hand, 5.25" drives, if you can still find them, have much larger steppers. You may find a stepper motor driver on the board if you're extremely lucky, but in my experience, the steppers are driven by the drive's CPU either directly or via a transistor array. You might also, with some research, be able to get the pancake motor (that spins the disk) to work. On the oldest 5.25" drives, the flashing of an infrared beam shining through a hole punched in the disk was used as a timing signal to keep the motor spinning at 300 RPM. Other pancake motors use magnets instead of a beam of light to accomplish this.
CD-ROM
You can usually find two to three DC motors in a CD-ROM drive: one to spin the disk, one to move the laser, and one to move the tray. You'll also find some gearing assemblies in conjunction with the tray that may or may not be useful in making a linear actuator. If you look on the board, you could find a few audio amplifiers, a DC motor controller, or a microcontroller.
Hard disk
Unless it's very old, there won't be a lot of useful parts except for the neodymium magnets. These have all sorts of uses, particularly in attaching heavy objects (like bulletin boards) to metal objects (like your refrigerator.)
Mouse
You'll find a few microswitches, and either a pair of rotary encoders with infrared emitters and phototransistors, or a tiny camera.
Printers, fax machines, copiers*
Here's where you'll find a few motors and loads of gears, cams, rods, springs, and pulleys. In inkjet and dot-matrix printers, you'll also find a screw or belt that drives the print head back and forth. There will probably also be an encoder disc or even a strip that the printer's CPU uses to ensure that the print head is in the right horizontal position.

Entertainment

Stereo*
Loads of analog components. If it's got a CD player, see CD-ROM. If it's got a tape player, there will be at least one DC motor and perhaps a belt system. You may also find a DC motor controller.
VCR*
You'll probably find at least one DC motor and motor driver. You'll also find a few gears and belts, and an infrared detector.
Televisions (and monitors)*
Not much besides a few analog components such as resistors and capacitors. In fact, old televisions often have especially large capacitors inside, which can be dangerous if not properly discharged. I would avoid these entirely.

* Take care when opening such devices. Unlike your friendly neighborhood PC, the power supply in one of these devices is unlikely to be shielded, and even if the device has been turned off and unplugged, large capacitors can store a hazardous amount of voltage for a surprising amount of time.

Posted on Saturday, July 21, 2007 at 12:21 AM
Edited on: Saturday, July 21, 2007 12:23 AM
Categories: electronics, q+=a
| | Permalink

After hearing this tale of a drowned keyboard, I thought back to my many colorful coworkers' not entirely efficient (or effective) schemes for dealing with finger grime and other keyboard cooties. I knew one girl who went through canned air as though it were soda pop. I knew another woman who swabbed daintily at the edges of her keys with rubbing alcohol. Although these methods dealt with some of the dirt, they couldn't deal with all of it.

So, as a public service announcement, and since I've nothing better to post about, I'll answer the question nobody seems to ask but everybody needs to know: how do I clean my keyboard?

The first step is to gently pry off your key caps with a butter knife, flat-blade screwdriver, or similar implement. Give your tool a twist and your key caps should pop right out of their holders with no harm done.
pop  see

Be careful with the larger keys, such as shift, enter, and the spacebar. Usually, large keys will have a bracing wire clipped to the keycap that fits beneath a set of tabs on the keyboard. It is all too easy to break the tabs on the keyboard or the clips on the key. Doing so won't necessarily render your keyboard inoperative, but it might just make these keys a wee bit wobbly.

Throw all the keys into a bucket, bowl, or other such vessel, along with a generous helping of the detergent of your choice. Add enough warm water to submerge the caps, then stir briskly for a few minutes, or until the keys look clean or the water looks dirty. Then rinse. Repeat as needed.

grody  swirl  rinse

Pat the keys dry in a towel, then set them aside to dry completely. Meanwhile, using a nice stiff brush, sweep away whatever crumbs or other debris may be left on the keyboard. Then, use a rag dampened slightly with all-purpose cleaner to remove any remaining dirt. Avoid getting any solution into the key holes, as this can corrode or short the contacts therein. And then last, but not least, reattach your keycaps.

better  keys_clean

Posted on Tuesday, March 27, 2007 at 11:06 PM
Edited on: Tuesday, March 27, 2007 11:09 PM
Categories: q+=a
| | Permalink

Q. I am a beginner. How can I build a working robot out of things found around the house?

A. Well. That all depends on three factors.

1. How much of a beginner are you?

If you know next-to-nothing about mechanical engineering, electronics, soldering, wiring, programming, or any of the other skills needed to build a robot, then you may want to start by visiting your nearest library and finding yourself a copy of something like Robot Building for Beginners, Absolute Beginner's Guide to Building Robots, or 123 Robotics Experiments for the Evil Genius. All these books will talk you through the construction of a simple robot, although quite a bit of shopping may be involved, depending on...

2. What sorts of things can be found around your house?

You can build robots from just about anything, depending on what you expect them to do. Your imagination's the limit. Well, the laws of physics are really the limit. But you don't need to use stainless steel or brushed aluminum if you can't find any. You can make perfectly nice robots from wood, various kinds of plastic, stiff wire, old lunchboxes, even papier-mâché. Motorized toys in particular often make good bases for robots. Of course, it also depends on...

3. What's your definition of a robot?

Everybody has a favorite definition of robot, be it worker, mechanical man, programmable mobile machine, electronic gladiator, humanoid automaton, or kinetic sculpture. Sirius Cybernetics even defines a robot as "your plastic pal that's fun to be with." Fun being in the eye of the beholder, that definition could even encompass a doll or action figure. You probably envision something that moves on its own, such as this draw bot. I consider it to be more of a kinetic sculpture than a true robot. However, it can quickly be made from common household items-- if you can steal a motor from something that won't be missed, such as an old toy car.

If you're feeling a bit more ambitious, are comfortable with a soldering iron, and have access to a good supply of spare parts-- from a broken cassette player, say-- you might be interested in building a BEAM robot, such as a solaroller. The philosophy of BEAM-- Biology, Electronics, Aesthertics and Mechanics-- is to build simple robots from simple components that exhbit complex behaviours. Rather than trying unsuccessfully to build artificial humans-- or even artificial chipmunks-- BEAM builders successfully produce what might be thought of as artificial plankton.

Happy roboting!
Posted on Monday, March 19, 2007 at 11:21 PM
Categories: q+=a, robotics
| | Permalink

Today's question is from Jared in San Diego.

Q. My boss wanted me to also ask you if there was something particular that we have to do to make the clock on the server and on our individual computers to update to the time change. I tried to update but it will change back to the hour before.

Just so you know we have a Windows 2000 domain controller and Windows XP workstations.

A. Ah yes, the after-effects of the Energy Policy Act of 2005. Will it save lots of energy? I don't know! Will it get people to buy new appliances-- answering machines, time card clocks, sprinker timers, video recorders, etc? Probably!

Anyway, you are not the only person who has had to deal with this issue. You'll be happy to know that Microsoft has rolled out an update for Windows Server 2003 and XP, but unfortunately, Windows 2000 is too old to be bothered with. You'll just have to pay your licensing fees and step onto the upgrade treadmill with the rest of us.

Okay, okay, there are a couple of things you can try first. If your XP workstations are current on their updates, it may be that your sever is feeding them the wrong time, as all systems in a domain need to be synchronized for numerous boring reasons.

So to update the server, see the following link and look at "Method 2, Update The Time On A Single Computer" at about 3/4 of the way from the bottom. Basically, you will run the tzedit program on the server, and change the beginning and ending dates of Pacific Daylight Time. Once you have done that, temporarily change to another time zone to cause the server's clock to update.

Unfortunately, that may not solve all of your problems, as computers often compare time in terms of UTC rather than in terms of the local time zone. So your workstations may still display the local time incorrectly. In that case, try downloading the Update For Windows XP and applying it to the workstations.

Posted on Thursday, March 15, 2007 at 11:34 PM
Categories: computer science, q+=a
| | Permalink

Q. I've asked my friends to give me their broken appliances so that I could scavenge parts from them. Now I have so many circuit boards lying around that it takes me longer to look for a chip than it does to remove it from the board. How can I get more organized?

A. I had this same problem. The answer is to create a database. With the work of an hour or two, you'll soon have all your parts at your fingertips. And if you're a Windows user, chances are you may already have all the tools you need on your computer. I'm talking about MS Access. Sure, professional DBAs may scoff at this program, but it will be sufficient for cataloging a few hundred components. On the other hand, if you're an ambitious Linux user, you might be well-served to look into a Linux-Apache-MySQL-PHP (LAMP) solution. Whichever route you take, plenty of books and Web tutorials are available.

When I set up my database, I created tables for each sort of component I wished to track. For example, the IC table looks something like this:

ID Part_Number Description Style Container Datasheet
1 L272M Dual Op-Amp 8 Pin DIP 1 L272M.PDF

The Container field points to a record in the Container table, which represents either a circuit board or other container (such as a drawer of loose components):

ID Description Location
1 Brownish board marked LP1-CD MBD 1

The Location field points to a record in the Location table, which represents the various boxes and drawers used for storing Containers:

ID Description
1 Cardboard box #1

Now if I ever need an L272M, or an Op-Amp in general, I can query the database, which will tell me that there's one on Brownish board marked LP1-CD MBD in Cardboard Box #1 .

Posted on Sunday, February 25, 2007 at 7:55 PM
Categories: computer science, electronics, q+=a
| | Permalink

Welcome to the second installment of q+=a, The Electronic Replicant's new question-and-answer feature. As nobody has actually submitted a question yet, I'm going to consult my referral logs again.

Q. How can I control a 120VAC motor with a BASIC stamp?

A . This should not be too difficult if all you need to do is turn the motor on and off. Now, it is important to remember that I am not an electronic engineer, nor do I play one on television. I am also not an electrician, with which one really ought to consider consulting before trying to build anything that interfaces directly with wall current. The following ought to work, but it could just as easily electrocute you, catch fire, or otherwise malfunction. You're probably better off buying an X-10 module.

Still there? You are obviously an individual of unswayable fortitude, or perhaps you have simply fallen asleep at the keyboard. In either case, what you'll need is something along these lines:

This is quite similar to the motor controllers I mentioned last time. A pulse from the BASIC Stamp (or other microcontroller, or your PC, or whatever else) causes the LED side of the optocoupler to emit light and thus trigger the phototransistor side of the optocoupler. The transistor energizes the relay coil, creating a magnetic field which closes the contacts, allowing AC to flow from the plug to the socket, thus powering your motor, Christmas lights, fan, pump, or whatever.

A nice thing about this circuit is that the optocoupler will protect the Stamp or PC from destruction by high voltage if the relay happens to short, which is not likely, but it could happen if the current flowing through the contacts is much higher than what the relay is rated for. That could also lead to the relay melting and/or bursting into flame, which is just not a good thing. Of course, the optocoupler is really effective only if the PC and relay are on separate power supplies.

That concludes this installment of q+=a. If you've got a question you'd like answered, or if you think my answers are utterly and completely useless, or both, or neither, please leave a comment at the prompt.

Posted on Wednesday, February 21, 2007 at 12:57 AM
Categories: electronics, q+=a
| | Permalink

Rather than posting another Robot Update that says nothing of importance except that it's been a while since the last Robot Update, we're going to try a something new, a question-and-answer column! Now, since nobody's actually asked me anything directly yet, I'll instead respond to a hot(ish) search topic.

Q. Control cordless drill motor with basic stamp

A. Although your query was phrased less than elegantly, I'll attempt to answer what I assume is a question. A pair of cordless drills or electric screwdrivers may be the ideal propulsion system for a combat robot. Consider the advantages: built-in gearbox, adjustable speed and torque, and modular, self-contained rechargeable battery packs. They can also be obtained for a relatively low cost, especially when compared to buying and/or fabricating the components separately. They can also be considered to be easily replaceable, another advantage to a combat robot.

Before we begin the interesting part of this article, I'd like to point out that I am not a professional electronic engineer, nor do I play one on television. This is also not a step-by-step tutorial on hacking your rechargeable drill. This is just me telling you very generally how I would go about doing it. It could work, but then again, it could explode in your face, set your house on fire, frighten your children, or just plain not work. I haven't actually tried it, so I don't know.

Still there? Good. Let's take a look at the guts of a cordless drill.

Drill Motor

You'll notice that the on/off switch and the speed-controlling rheostat have been removed. That's fine, as I wouldn't be using them. You'll also notice that the battery jack and the case are missing. This is so that I can make a point. Below, you'll see the equivalent assembly from a remote-controlled dune buggy.

Car Motor

Notice anything? That's right, they're not all that different. So at least one way of controlling these motors should have just occurred to you. If you're building a remote-controlled combat robot, off-the-shelf RC controllers will probably fit the bill.

But since you also asked about BASIC Stamps, I assume you're going to want to program your robot, rather than just puppeteer it by remote control. That's fine, too. In that case, I'd build my favorite motor controller, the old-fashioned electromechanical H-bridge. I'd choose this over a transistorized or solid-state controller mainly because I don't know what voltage the drills will be using. Relays can typically handle 120V AC, so handling 12V-36V DC shouldn't be a problem. Also, the brushes of the motors can introduce a lot of noise into the power supply, and this method will physically isolate this noise from the control circuitry. And finally, listening for the clicking of the relays can be a valuable troubleshooting tool.

Here's the schematic.

Typical parts are 1K resistors, 2N2222 transistors, and 1N4003 diodes. I try to use 5V relays in order to avoid the need for a 6V or 12V power supply. However, if the design of your bot means that you already have a 6V or 12V bus, then by all means use it.

The finished product might look something like this.

Relay Board

There are, of course, some drawbacks to this circuit. The main drawback is that the motors will always run at a constant speed, as determined by the supply voltage. This may be what you want. However, a robot that can only go full speed ahead could be difficult to maneuver. I would suggest the following modification if you want speed control.

 

This version will use a big fat power transistor in place of the SPST relay. You could then feed a PWM signal from the BASIC Stamp to the transistor to control the motor's speed. I'm told the diode across the pins of the transistor is necessary to protect it from backlash voltage when the motor shuts off. Hopefully I've got it in the right place. Values of these parts depend on your motor.

The finished product might look something like this:

Rover

This concludes our first installment of q+=a. If you have a question you'd like answered, go ahead and leave it as a comment. Also, if you don't like my answer, go ahead and leave that as a comment. See you next time!

Posted on Sunday, February 11, 2007 at 10:09 PM
Categories: electronics, q+=a, robotics
| | Permalink

« now reading | Main | robot-a-day »