Thursday, March 11, 2010

My New Arduino

To my horror I recently turned 30. The experience was sweetened significantly by some great and thoughtful gifts, one of these being an Arduino Starter Kit.

It literally took me fifteen minutes from opening the box to playing a touch sensitive musical instrument that I built using a Softpot in a resistive divider and a magnetic buzzer. I was able to reuse the code from an example that comes with the Arduino environment, just modifying the frequency range I wanted the buzzer to work in. The code from the example Arduino sketch shown below is C and uses some very user friendly libraries for Arduino specific functions.

/*
  Pitch follower
Plays a pitch that changes based on a changing analog input circuit:
* 8-ohm speaker on digital pin 8
* photoresistor on analog 0 to 5V
* 4.7K resistor on analog 0 to ground
created 21 Jan 2010
by Tom Igoe
http://arduino.cc/en/Tutorial/Tone2
*/

void setup() {
  // initialize serial communications (for debugging only):
  Serial.begin(9600);
}

void loop() {
  // read the sensor:
  int sensorReading = analogRead(0);
  // print the sensor reading so you know its range
  Serial.println(sensorReading);
  // map the pitch to the range of the analog input.
  // change the minimum and maximum input numbers below
  // depending on the range your sensor's giving:
  int thisPitch = map(sensorReading, 0, 1000, 50, 3000);

  // play the pitch:
  tone(8, thisPitch, 10);

}

The open source nature of the Arduino hardware and software allows amazingly rapid realisation of a project. The hard work done by others previously can be used as customisable building blocks, which can then be shared for use as the building blocks of the next project.

We live in exciting times!

Wednesday, March 10, 2010

BabelFish

A colleague recently recommended using BabelFish as a data historian after viewing it in action on an oil and gas site.

I’ve only had a quick look at the website but based on the features listed here and described to me by the colleague I think BabelFish bears a detailed review, which I will post here if time and trial versions permit.

Tuesday, March 9, 2010

Pathping Command

I’ve just discovered a new windows command line utility called pathping today. I’m a bit of a purist and hate installing extra utilities to use from the command line so I was happy to see that this one was included with my Windows 7 Professional installation.

This command produces something similar to the output from both the ping and tracert commands but if you are prepared to wait for the data collection period it provides statistics of each node based on data collected over that time.

This is the output from pathping google.com:

Tracing route to google.com [66.102.11.104]
over a maximum of 30 hops:
  0  ######### [192.168.0.5]
  1  192.168.0.1
  2  nexthop.wa.iinet.net.au [203.59.14.16]
  3  te7-1.per-qv1-bdr1.iinet.net.au [203.215.4.18]
  4  gi15-1-1.syd-ult-core1.iinet.net.au [203.215.20.4]
  5  as15169.sydney.pipenetworks.com [218.100.2.97]
  6  66.249.95.232
  7  64.233.174.242
  8  syd01s01-in-f104.1e100.net [66.102.11.104]

Computing statistics for 200 seconds...
            Source to Here   This Node/Link
Hop  RTT    Lost/Sent = Pct  Lost/Sent = Pct  Address
  0                                           ######### [192.168.0.5]

                                0/ 100 =  0%   |
  1    5ms     0/ 100 =  0%     0/ 100 =  0%  192.168.0.1
                                0/ 100 =  0%   |
  2   22ms     0/ 100 =  0%     0/ 100 =  0%  nexthop.wa.iinet.net.au [203.59.14
.16]
                                0/ 100 =  0%   |
  3   20ms     0/ 100 =  0%     0/ 100 =  0%  te7-1.per-qv1-bdr1.iinet.net.au [2
03.215.4.18]
                                0/ 100 =  0%   |
  4   81ms     1/ 100 =  1%     1/ 100 =  1%  gi15-1-1.syd-ult-core1.iinet.net.a
u [203.215.20.4]
                                0/ 100 =  0%   |
  5   81ms     0/ 100 =  0%     0/ 100 =  0%  as15169.sydney.pipenetworks.com [2
18.100.2.97]
                                0/ 100 =  0%   |
  6   76ms     0/ 100 =  0%     0/ 100 =  0%  66.249.95.232
                                0/ 100 =  0%   |
  7   79ms     0/ 100 =  0%     0/ 100 =  0%  64.233.174.242
                                0/ 100 =  0%   |
  8   82ms     0/ 100 =  0%     0/ 100 =  0%  syd01s01-in-f104.1e100.net [66.102
.11.104]

Trace complete.

I had to wait 200 seconds for these results but they are pretty comprehensive. The link looks pretty good – only one packet lost on the hop between Perth and Sydney.

Thursday, February 11, 2010

Flood Gates

Things have been crazy busy at work for the last few weeks. My phone has been ringing non stop and there is often a line of people standing next to me with requests.

When I am in this situation my natural tendency is to hurry to try and get through everything that needs to be done and satisfy the queue of people. My observation this week has been that this is absolutely counterproductive. Hurrying has caused some stupid mistakes on my behalf that I would normally not make. In fact when relating one experience to a good friend who is close enough to be brutally honest he chastised me with “you should know better”.

So what is the answer? For the next week I will be making a conscious effort to improve my “flood gates”. When work piles up and everyone wants something from me, rather than scramble to compress the time that everything takes to please everyone I need to take a moment to prioritise then let a manageable trickle through the flood gates.

Engineering is a tricky thing that requires concentration and time, it is not something that should be done when in a rush. I have a queue of people at my desk because people are happy with my work, I can’t then let the pressure of that queue cause the quality of my work to drop.

Tuesday, January 5, 2010

Finished Longboard Repair

By the way, that longboard repair I was working on earlier turned out quite well. Here is a quick follow up for Brenden, so far the only confirmed reader of this blog…

2009-08-09 11.58.19

Once the divinycell repair was cured and sanded back to a smooth uniform surface I masked off the board with newspaper, found some (sort of) matching spray paint from the Repco shop down the road and went to town.

After a few previous failures painting surfboards I decided to spray the paint directly onto the foam then glass over the top. I had some concerns that a layer of paint between the foam and the glass would weaken the bond and the end result would have less strength, but it does  looks as though this is what is typically done in surfboard construction. This might be a good argument for buying unpainted boards though….

After spraying a number of very thin coats of paint, in fact heaps of white coats of paint to cover up the dark coloured divinycell, I applied resin and a couple of layers of glass. After squeegeeing out the excess resin I left what looked like a very neat repair to cure. But when I came back to my horror there was a large air bubble. It seems that there was a small void somewhere in the divinycell which heated up during curing and blew a bubble under my glass. Arggghhh!

2009-09-18 16.10.27So, next step was to drill a couple of small holes in and around the bubble then syringe in a brilliant two part expanding urethane foam I have in the shed. About 20ml of mixed foam completely filled the hole plus about 2 litres of whatever buckets I could find to contain it! After curing, I sanded back and applied another glass and resin patch to my glass and resin patch.

So after sanding this final patch back with increasingly fine grades of wet and dry sandpaper I have the fairly pleasing result shown here. Not as neat as I would have liked, but not too bad considering!

Tuesday, December 15, 2009

DIY Null Modem

I know serial ports are heading  towards obsolescence but I still need to use them occasionally. One piece of hardware often required for serial connections is a null modem. The following describes how I made a DB9 null modem.

I started off by purchasing two cheap plastic DB9 shells, a DB9 plug and a DB9 socket. DSC_0177
Next I screwed the shells together and hacksawed through the cable side of the screw holes on one shell and the plug side of the screw holes on the other shell. DSC_0178
After gluing the two cut down shells together I had a shell with a space for installing a DB9 connector in both ends.

DSC_0179

From here it was a simple soldering job following the null modem pinouts from nullmodem.com and I had a compact DB9 null modem to put in my toolkit!

 

 

 

Transfer Drivers When Rebuilding a PC

A colleague of mine was recently rebuilding a pc for a remote site with no internet access. He had installed pretty much all the required software he could think of in the office before taking the new pc to site and we were talking through the job when he realised he would need a driver for an obscure serial PCI card.

Without any precise details of the card he was unable to find a driver to download before heading to site. And with no internet access on site he couldn’t rely on windows to find a driver online.

The card in question was still installed in the existing pc which could be run for 15 minutes or so without blue screening so I suggested that it may be possible to extract the driver for the card from the existing pc and transfer it to the new one. A quick Google showed up a couple of excellent driver backup utilities that will find all installed drivers on a pc and back them up to a folder.

I tested a few of these applications. My favourite is Driver Backup which is a tiny c# application that doesn’t require an install. Just beware that because this is a c# application the .net framework needs to be installed on the pc you are grabbing drivers from