Category Archives: Electronics

The Webpage That Ate My Battery

Javascript is cool and things we only dreamed of 8 years ago are now common. However, the trends are leaning towards writing tremendous amounts of application code for web sites and web applications that run client-side in the web-browser. Sites are using more and more animation and effects. Now [people are contemplating][0] how to do cpu intensive computations in web browsers.

There is nothing bad about this, but something that needs to be pointed out is that a wide range of devices will be accessing your website. Do you test on older, slower systems? Do you test on laptops and mobile devices? I can’t tell you how often I visit websites these days and hear the fan on my laptop kick in. (It just happened now, as I write this… someone just started a chat with me in gmail)

I’ll be honest, I don’t test as well as I should, but I do tend to notice when sites are cpu intensive because my laptop’s battery suffers greatly. I just don’t hear people talking about this topic, which concerns me a little bit.

[0]: http://www.julienlecomte.net/blog/2007/10/25/running-cpu-intensive-javascript-computations-in-a-web-browser/

Linux friendly MP3 player

I recently went to Best Buy to buy a video camera but instead got an MP3/Video player. I took a chance and didn’t do any research before I bought it. It said it supported Ogg and it played videos. It was “plays for sure” compatible. I really just bought it as an oversized thumbdrive and I had a $100 gift card. However, I **love** it. Its the Insignia 4GB Video Mp3 player. As far as I can tell, you can only get it at Best Buy. But it has a very bright screen, it has excellent controls, and so far, it plays all my music except the stuff I bought at the iTunes store.

It works awesome with Ubuntu.

It comes with some free music and videos on there, so I drug one off of the player onto my desktop (it shows up as an external thumb drive), double clicked it and it played without out a hitch. I looked at the format ([see attached](http://www.bearfruit.org/files/videoproperties.png)) and it seems to be a standard xvid file. I’ve installed extra codecs, however everything I have I got using apt-get.

I just saw a coupon for the player, it only lasts for four days though. :-( But its $15 off. Even if you don’t use the coupon, its a good, nice looking player and I’m loving mine. (oh, it also has two headphone jacks, so two people can listen at once!)

$15 off Insignia® 4GB video MP3 players, plus free shipping

Apple Premium

Got an email from Dell showcasing their new Vostro 1500 laptop for $599. I was stunned at how affordable that was. The other day, I read in Kiplinger’s magazine that their first choice for a desktop computer was the Mac Book Pro at $1999. My first thought was, “wow, what do you get for the extra money?” So I took a moment to configure two laptops as similarly as I could.

Interestingly enough, every component can be duplicated giving a very comparable pair of computers. Final numbers?

* Dell Vostro 1500 15.4″ wide screen computer $1,348
* Apple Macbook Pro 15.4″ wide screen computer $1999

The Apple was not customized, the Dell was customized to give it the same 2.2Ghz Core 2 Duo cpu, 2 GB of RAM, upgraded video card, built in camera and the higher resolution screen to match the Apple. (other components already matched)

So a difference of $651. What do you get? Well, the Apple gives you a magsafe adapter and an illuminated keyboard. But for $338 you can add to the Dell a three year warranty that provides on-site service, technical support *and* accidental damage protection for those cases where the magsafe adapter would have served you well. $350 gets you a three year warranty on the mac, but there’s no accidental damage protection and no on-site service for notebooks.

This brings the prices to $1686 for the Dell and $2348 for the Apple which has an illuminated keyboard and an inferior warranty.

So with $662 in your pocket you’ve got a computer that, short of Armageddon, you can be assured will keep you productive for the next 3 years and gives you every ounce of performance that the Macbook offers.

*The catch: I won’t buy a mail-order computer unless I’ve seen the computer in person (either on demo or from someone else who’s bought one) since the single most important aspect of the computer in my opinion is the screen, and specs can’t accurately convey what you’ll really see once you turn the thing on.

Using the PICKIT 1 USB programmer under Linux

The Pickit 1 USB programmer is nice and simple. It ships with a Windows based program to operate it. Under linux, you have to use something else.

On recent versions of Ubuntu, the program needs to be tweaked to work properly. I followed the instructions outlined by Chen Xiao Fan:
You can try to patch usb_pickit.c under Linux.

if (d){
/* add the following to detach the kernel HID driver under Linux */
    int retval;
    char dname[32] = {0};
    retval = usb_get_driver_np(d, 0, dname, 31);
    if (!retval)
    usb_detach_kernel_driver_np(d, 0);
/* End of added code */

    /* This is our device-- claim it */
    byte retData[reqLen];
    if (usb_set_configuration(d,pickit_configuration)) {
        bad("Error setting USB configuration.n");
    } 

This worked perfectly for me. It’s function is to basically disconnect the pickit from the USB HID driver so that the programming software can control it.

Single sided dev board for USB PICs

nuxie1.com – Hackaday Competition Entry… he beat me to it. I laid out and etched my own boards to do precisely what he’s done here… however, since it looks like he’s already gone through the trouble of testing and revising his board, I’m just going to use his. Nice work!

Also, his website had an interesting ad linking to www.hobbylab.us/USBOscilloscope/Home.htm, which looks like a pretty interesting oscope. I wonder if there’s a linux tool like that. Note that it does 1KHz to 1MHz, but it also does i2c, uart, 1wire and spi. That could be very useful.

Flip – the upside down robot

I was at the mall and noticed that the Vex robot kits were on sale for 50% off. That puts them into the ball park of “a little pricey, but close enough.” Of course, that’s before you figure in the cost of batteries and etc (definitely get the power pack). Anyway, 6 – 7 hours afterwards we’ve completed robot #3 (#1 was the default square bot, #2 was modified squarebot for playing soccer named Dozer). Here’s a video of “flip”:

This robot is 4wd using 4 motors which is difficult using the default programming. You have to use diagonal controller movements. Also, when he’s upside down everything works opposite of what you’re used to. Still, it was fun and he’s fun to show off.

Making a miniFM Transmitter

Making a miniFM Transmitter: I’ve wanted to build an FM transmitter for a while. This looks like it is about as simple as they get.

start.jpg

There are very few parts and the technique used is extremely simple… you don’t even need to etch a circuit board. What I really want is to make a way to encode data over a narrow band rf transmission. For example, to send a message to a counter circuit in another part of the house every time the refridgerator door opens. :-)

It worked on the first try!

It worked on the first try! I created a circuit based on the PIC 16f88 μcu by microchip using a max232 chip and the Tiny PIC bootloader. To my surprise, it worked on the first try. No, I’m not kidding! I used the internal 8MHz clock and otherwise had the chip configured to emulate a 16f84a (normal MCLR, normal clkout). The software is free, and the author’s only request is that you mention the original source when distributing modified versions. What a great piece of work.

It Works! The LEDs Blink!

It Works! The LEDs Blink! – Finally, I’ve got things working. I think I’ve got the basics figured out enough that I can wire up a simple circuit and it just works. Here is my creation:
The rectangle to the right of the LEDs is a push button. Starting the circuit causes the LEDs to increment (in binary) from 0 to 1. Then, it increments each time the button is pressed. Also, it plays a short sound. If the number represented on the LEDs is divisible by 8 it’s a short high sound, divisible by 4 (but not 8) a long low sound, otherwise a middle sound (middle being about 2KHz, I think). I wrote the program in mikroBasic. I’ll try another version in mikroC, and then a final version in assembler, to compare. This is using a 16f84a and a 3.6864MHz crystal.