Oh My! Droids Building Droids!

That was one of my favorite lines from Star Wars: Episode III when C-3 PO first enters the droid factory and sees the assembly line. I thought it was funny because just about every electronic gadget you purchase today is actually built by robots. The problem is the components are so tiny that you probably couldn’t handle them even with a pair of tweezers. It takes a precision robot to place them in solder them to the boards. Is not like the old days where you bend a couple of resistor leads, shoved them through a pair of holes, solder them in and clip the leads.

As an example here is a slideshow of photos from TechRepublic.com showing the factory where Raspberry Pi single board computers are built. This is the little $40 computer that I purchased and spoke about in a recent YouTube video. Click here to see the slideshow.

My New $40 Computer

Here is a YouTube video about my new $40 computer called a Raspberry Pi. Unfortunately I misspoke when I created a video and said it only cost $30. By the time I realized my mistake I had already deleted all of the original files and could not reenter the video without starting from scratch.
 

Capt’n! There be whales here!

In the 1986 film “Star Trek IV: The Voyage Home” Captain Kirk and his cohorts are on board a stolen Klingon warbird and they have to go back in time to capture a humpback whale in order to save the planet… You know like you do.

After building a giant water tank in the cargo hold, Scotty has to try to beam on board a pair of whales and the water to hold them of course using a Klingon transporter which he probably has never used before. When it all works Mr. Scott proudly declares in his thick Scottish brogue “Capt’n! There be whales here!” There is a hint of surprise in his voice as if he is really saying “Holy $#!+ I can’t believe this worked!”

Scotty’s line “There be whales here” has become a euphemism for “Eureka!” or any other exclamation of surprise in my household especially when working on computers or other electronic gadgets. It very succinctly expresses my combined feelings of “Oh yeah I did it, I’m cool” and “I can’t believe this worked”.

We had one of those moments here last night but it didn’t come easy. In the previous post of this blog I said I bought a new Arduino Uno single board computer for making gadgets. We tried a variety of little experiments to make an LED blink or to move a servomotor but to make the project that I really want to do work properly we need to hook up my 16 character by 2 line LCD text display. The computer board fortunately came assembled but the LCD text display came in kit form. In addition to the display module there is a data processing chip, a little variable resistor, and full of other resisters, and some pushbuttons that you can use to move a cursor up, down, left, right, and select. It didn’t take dad very long with a soldering iron to throw the thing together. There were very clear step-by-step instructions on the website where I purchased the kit. The image below shows the assembled units.

My Assembled Arduino

The circuit board on the lower right is the computer itself. The white thing up above it is a electronic breadboard that lets you plug components in and connect them together just by sticking the wires in the holes. In the display unit with the little buttons on it is on the left. I also downloaded a sample program that was posted display the text “Hello World!” on the display. Then if you pushed any of the buttons it would display the text “Up”, “Down”, “Left”, “Right”, “Select” depending on which button you push. Pretty simple right? Of course not… It never is.

We hooked it all up and I loaded the program and the backlight on the LCD blinked on briefly but nothing seemed to work. I double checked that the program was uploading correctly. We took a long look at all the wires connecting the display to the computer. And we finally concluded it had to be a bad solder joint somewhere. Dad went back and tried looking at all of his joints using an eye loop. When the opening “Hello World!” message didn’t appear, I didn’t bother trying pushing any of the buttons originally. While I was tinkering with something else, dad tried pushing one of the buttons and we realize that if you push the “Up” or “Down” buttons it would light up and display the text. But if you pushed any of the other buttons, the backlight turned off in the text disappeared. Again I concluded it had to be a bad liar somewhere and dad went back to his workbench inspecting his work yet again.

By now it was getting late in the evening. I wanted to watch the rest of the Pacer game and get caught up on the NASCAR race so we gave up for the evening. I shut down the computer, we went in the living room and I had my usual evening snack of milk and chocolate chip cookies while we watched NASCAR. I was just about to go the bed when all of a sudden I figured out what had gone wrong. Dad said “Let me guess it’s software isn’t it?” I humbly and somewhat shamefully answered “yes it is”. I finished up my snack, turn the computer back on, fixed the software, and got ready to upload it. Dad yelled in from the other room “I don’t hear any exclamations about whales in there.” I yelled back “there will be soon”. As a last step I edited out the “Hello world” text and put in “There be whales!”. It worked!

The problem was that the program was originally written for an LCD display with a multicolor backlight consisting of red, blue, green LEDs. The one that I had installed was only a single color backlight in so it only used one of the three backlight driving pins. The sample program was set up so that every time you pushed a button, the background color would change in addition to displaying the text corresponding to the various buttons. The background color that it tried to use for the opening message must use the red or green LEDs and I was connected to the pin for the blue LED. (Or some other combination). When you push the up or down buttons, they were displaying a color that works with my monochrome display. All I had to do was edit the program so that it always used full white background and that nature that my display always worked.

After editing the text so that it would display on 2 lines I replaced “Hello world” with this following more complete message.

Whales

I spent the rest of today reading programming manuals and learning how to use various built-in functions. The programming language is pretty much plain vanilla C/C++ but of course there are all sorts of libraries of code available to use various features of the device. I still got a small handful of parts in route from RadioShack before I can start working on the infrared emitter and detector portion of the circuit. Once I get those, I can start programming my customized remote control. Stay tuned for further updates.

My New Computer

Here is a photo of my newest computer…

My New Computer

My New Computer

It’s called an Arduino Uno and it sells for $29.95. I purchased it from a company called http://www.adafruit.com/ However you can get it from a variety of distributors. It’s got 32 KB flash memory which is used to store programs, 2 KB SRAM memory that stores data that the program uses, 1 KB EEPROM memory which is sort of like a hard drive for storing data only as part of the chip and not really a disk drive. It runs at 16 MHz which for example is four times the speed of the first computer I ever owned.

Across the top of the little black thing is a set of 14 digital pins that you can do input or output from. The lower right corner has six pins that you can use analog output. It has a USB port that powers it and connected to your computer. You write programs in a special little language on your PC and tell it to transmit them to the device through the USB cable. It then does whatever you’ve programmed to do.

Experimenters Kit

Experimenters Kit

I went ahead and bought it as part of experimenters Kit that cost $85 which includes the $30 computer. It’s basically a bag of parts that say prototyping board, jumper wires, bunches of transistors, LEDs, resistors, switches, motors, temperature and pressure sensors etc. and a booklet that shows you what you can do with all of it.

So far I’ve made it blink an LED off and on at one second intervals. I’ve hooked up a pushbutton and it sends a signal to my computer telling me whether or not the button is pressed. And the coolest thing I’ve done with it so far is hooked up a little servomotor like the motors that my dad used in his radio controlled model airplanes to work the rudder and flaps. I programmed the computer to make the servomotor wiggle back-and-forth. I could connect up to nine of these motors and position each of them at any angle I want depending on how I programmed it. People use them to build home robots. For another $24 I bought an LCD text display with a LED backlight. It displays 16 characters by 2 lines of text. They have these displays with multicolored backlights but I got a simple white text on blue background version .

LCD Display Board

16x2 CharacterLCD Display Board

I’ve also ordered some infrared LEDs and infrared detectors. My plan is to turn the whole thing into a programmable custom TV remote control that I will be able to control multiple devices with only four or five pushbuttons. Currently I have a remote control in my bedroom that has a total of 14 buttons and of course I have to remember what each of those buttons do. This way I can cut it down to just some up, down, left, right, select buttons and it will display a mini menu on the character display and transmit it to my TV or cable box or whatever using the IR LED.

There’s 1 million different things you can do with one of these. There are websites all over the place describing different projects that people have built most of them homemade robots. I have to wonder if there’s some sort of a little board similar to this inside toys like “Tickle Me Elmo” that drive the whole thing. Hell with time and patience in a few extra servos I could build a Tickle Me Elmo using this thing.

I will probably eventually buy another one for $30 to be used permanently in whatever gadget that I build and then keep this one for tinkering with different projects.

Touch Panel Display

Touch Panel Display

They’ve got all sorts of add-on circuit boards that will connect to a computer network, you can hook up a speaker and play music. They’ve got a voice synthesizer chip you can add. They even have a touchscreen display like this. It’s 2.8 inches diagonal and only costs $59.

Videogame Adapter

Videogame Adapter

Another really cool add-on for $23 is a videogame interface. It’s a little board that you attach that has red/white/yellow video output jacks and two places to plug in Nintendo Wii controllers. Click here to see a video on YouTubethat shows a videogame created using this computer and the video add-on board.

There are 1 million different things you could do with this gadget. I can’t wait to try them all.

Computing Pioneer Alan M. Turing Honored with New Exhibit

Computing pioneer Alan M. Turing

This June marks the 100th anniversary of the birth of Alan M. Turing. Those of you who are not students of computing history may have never heard of Turing however if not for his work you wouldn’t be reading this article or doing anything with a computer. Turing was a British mathematician whose most famous accomplishment was breaking the German Enigma code during World War II. As an example of how important this code breaking was to the war effort, when he had broken the German naval code, sinking of British ships decreased by 72%.

If his code breaking efforts were his only accomplishments, he would be an important historical figure. But the fundamental principles underlying the computer you are using right now were created by Turing in the 1940s and 1950s.

A new exhibition celebrating the life of Turing was launched at Bletchley Park in Buckinghamshire, UK. During World War II, Turing was based at Bletchley and played a crucial role in cracking ciphers used to scramble German communications, including designing an electromechanical machine called the bombe, which partially automated the code-breaking. The exhibition covers Turing’s personal life and professional achievements, ranging from his school reports to academic papers where he set out his model for the universal machine.

Here is an article from TechRepublic with a slideshow of various items in the exhibit and explanations of his work depicted there. I also recommend the Wikipedia article on Turing which gives more details about his life.

In the world of computing, Turing is known for inventing something he called “The Universal Machine”. Basically this machine was the first description of what is now known as a stored program computer. Previously any computing machines such as calculators were engineered to solve only one problem. If you wanted to solve some other problem build a different machine. Turing envisioned this universal machine is having its program written in some coded form and stored in the memory of the computer along with the data which it was computing. All you have to do to make machine do something different was to change what was stored in its memory. The essentially load a different program into memory and the computer could do something completely different. That is the founding principal of all computers today. Even the little pocket calculator you may have is essentially a stored program computer. If you could take it apart, replace its program memory with a different program, it would do something completely different.

Turing was also interested in artificial intelligence. In an attempt to answer the question “Can computers think?” developed what came to be known as the Turing test. He suggested that you interview a human being and a computer via teletype machine or some other means of communication that the computer might be able to understand. If the interviewer could not discern which of the two subjects was a human being and which was a computer then you had come pretty damn close to having a machine that could “think”. The recent exhibition in which it IBM supercomputer named Watson competed against human opponents on the TV show Jeopardy was a kind of Turing test.

While Turing should’ve been a great hero in Britain during his own lifetime, sadly he was convicted of indecency because he admitted to homosexual relationship with a colleague in 1952. In those days really being homosexual in Great Britain was a crime. Various honors and awards which had been created to him for his efforts during the war were withdrawn. In June 1954 he was found dead of an apparent suicide.

In August 2009 British government issued official statements apologizing for the treatment of Turing. Numerous tributes including the Association for Computing Machinery annual Turing Award have been created in honor of him. The new exhibit described above is part of an overall celebration of the 100th anniversary of his birth.

I’ve often wondered if the “Turing test” was more than just about artificial intelligence and computing. Turing test was designed to test whether or not someone was “human”. If you couldn’t tell the difference between a questionable human and a “real human” than there really wasn’t any difference. I wonder if perhaps that test was really a metaphor for how he wanted to be treated in regard to his homosexuality. You have to wonder what further computer advances he might’ve developed had he not taken his own life at a relatively young age. And what accomplishments are lost to the world by people today and take the lives because the world judges them as failing Turing test.

Machines making machines! C-3PO’s worst fear realized

To quote C-3PO in Star Wars III “My Lord! Machines making machines!”

Here is an article from CNET.com that describes how engineers have made a tiny robotic bee by sandwiching together 18 layers of different materials, cutting them out with lasers, pushing a little pin into them to make them fold themselves into position, dipping them into solder to glue everything together, and then cutting them loose from their base using a laser. The end is a little self assembling machine that when you apply voltage to it, it flaps its wings.

Here is the article from CNET.com

or here is a YouTube video from the article explaining in more detail.

The Day I (Almost) Crashed a Web Server

Mark your calendars friends with the date February 9, 2012. I’ve been writing computer programs since high school and I’ve been designing webpages since the early days of the Internet but on that date February 9, 2012 was the first time I ever came really close to bringing down an entire Web server.

I did it while trying to set up the outline for this system of blogs. Normally when a person wants to blog on a variety of topics, they create one big blog and they attach tags or keywords (sometimes called categories) to each of the entries. Then if you want to read only the blog entries that do with the particular category you can go to a page that gives you just those entries. But I decided I wanted to have six different and distinct blogs. Even though they all look exactly alike right now, my goal is to redesign each of them with different graphics and color schemes and overall themes to fit the topic. To try to bring all this together, the homepage of this website collects the five most recent posts from each blog in one place. That way you can go to one webpage and see which if any of the blogs have been updated. You can then click on the individual articles to read them.

The implementation uses a Internet feature called “RSS” which stands for “Really Simple Syndication”. RSS is a feature of many websites and nearly every blog you will find that allows you to collect together articles from a variety of sources. If you set up your browsers home page to a customized Yahoo page or a customized iGoogle page for example, you can tell that webpage to go out and collect headlines of news stories from a variety of other websites. All this is done with RSS. And if you know what you’re doing, you can set up these Yahoo or iGoogle pages with RSS feeds from websites of your own choosing. If you see this little orange symbol it means that the website has an RSS capability. You can usually click on that icon or some sort of link next to it to get the feed address. The image below shows my iGoogle page which includes not only news items they supply but recent articles from my video blog Good News on Tap in from my church website.

This entire cyborg5.com website is managed using blog software called WordPress. All WordPress blogs create RSS feeds so that they can be included in other websites. They also have facilities for showing you RSS feeds. The ability to show these little groups of headlines in a sidebar widget is built-in. I recently found a special WordPress plug-in that allows you to put RSS feeds into individual pages and posts of a WordPress blog. That’s how I do the bottom part of the main webpage here that aggregates together the most recent posts of all six blogs.

If you’ve ever done any programming or even wordprocessing you know that if you got to do six of something, the easy way to do is create one, make five more copies, and then edit it to those copies to reflect the difference. That’s what I did when I initially designed this homepage. I created an RSS link to the first blog and then copied it. But somewhere along the way I made a mistake in editing. Rather than have the homepage give me a summary of what was on each of those six blogs, the homepage tried to give me a summary of itself. In order to do that it had to go get a copy of my homepage. But to get a copy of my homepage it had to go get a copy of my homepage. And to get that copy of my homepage it had to go get a copy of my homepage. It’s like those little Russian dolls where when you look inside one there is another one and inside another one. Programmers call this process “recursion” and it can be a very useful tool for designing programs as long as you put some sort of mechanism to tell it when to stop.

When I was in college we had a programmer’s joke book that defined various programming terms. For example under the words “infinite loop” it said “see: loop, infinite”. And of course we when you looked up “loop, infinite” it said “see: infinite loop”. More to the point one of the programmers jokes in this book said “Recursion… see recursion”.

My webpage was basically stuck in an infinite recursion of trying to fetch itself. Fortunately whoever designed the Web server put in safeguards that if you try to use up too much of the server computer’s resources it would shut you down. It also sends a warning message to the server’s administrator and then they send you a nasty e-mail saying “what the hell do you think you’re doing?” Fortunately my guys from whom I buy my web hosting services are a lot nicer than that. But they were pretty adamant that I had a problem that needed to be fixed. By the time they warned me about it, I had already edited the page to be the way it was supposed to be. I really had no idea that anything had gone wrong for the few minutes I was experimenting with it. I explained to them what I was doing and perhaps something had glitched along the way. I promised them I would try to be more careful.

Still I had no idea what had gone wrong until 1:32 AM this morning while laying in bed all of a sudden I realized what I had really done wrong. When I display the information from the RSS feed, I’m only displaying the title of the message or the page. So when you look at the page, it didn’t look like an infinitely nested bunch of references to the same article. But inside it was busily trying to fetch the entire page even though I wasn’t displaying the whole thing. It was merrily eating up resources while I was goofing off. Once I got up and dressed this morning I sent an e-mail off to the tech support people that begin with the words “Mystery solved! I’m an idiot…”And then I explained what had gone wrong. They got a big kick out of it.

Of course this is not the first time I had never created an infinite recursion. But in the past it has always been some program I was writing on my own computer and when the computer locked up I realized what I’d done. But yesterday… February 9, 2012… The day that will live in infamy. The day I almost crashed someone else’s Web server with my coding mistake.

I’m a Technology Geek

Featured

I love technology. I’m a total geek when it comes to gadgets. Even if I wasn’t severely handicapped and dependent on technology to help me do everyday things I would still be the biggest, nerdiest, technology geek you ever saw.

In this blog I will share some stories about how I use technology and I will link to articles about the kinds of technology I like.