I'd Rather Be Building Robots

July 31, 2009

Exclusive: New HiTechnic Colour Sensor Bares All!

Filed under: Ramblings, Sensors — Xander @ 20:22

HiTechnic Colour SensorA new version of the colour sensor has been brought out by HiTechnic.  It features a number of new abilities:

  • Increased sensitivity; the sensor can determine a large object’s colour from up to 20 cm away.
  • No longer needs an RGB LED but uses a bright white LED instead.  The RGB values are determined by the very sensitive colour sensor.
  • The LED can be switched off to determine the RGB values of ambient light or a light source directed at the sensor.  Now you can really tell the difference between a fluorescent light and an incandescent light bulb.

Rather than sending me a fully assembled sensor, HiTechnic sent it to me in discrete parts, namely the PCB (Printed Circuit Board) with all the components, the grey body, the white cover and the black cap with holes.  This would allow me to take some pictures of its innards to share with you before closing it all up.

So without further ado, I present to you the new colour sensor in all its naked, exposed glory:

New HiTechnic Colour Sensor [Click to enlarge]  New HiTechnic Colour Sensor [Click to enlarge]

Extreme close up of colour sensor. [Click to enlarge]I didn’t take pictures of the underside of the PCB since there really wasn’t much there. The domed component on top of the colour sensor is a very bright LED. The colour sensor is the cylindrical shaped clear doodad at the bottom with the flat front.  When viewed from the front you can see there is a rather large square sensing area.  I took a macro picture of the colour sensor itself, which you can see here on the left.  If you look very closely, you’ll notice that the light is reflected at a 90 degree angle onto the sensor which is actually mounted on the PCB.  This is done by the black block which you can see in the above right, notice how it has that surface at a 45 degree angle?  I realised this when I saw the small vias (connections between the different PCB layers) next to the sensor area which could only be on the PCB itself.

A ROBOTC driver for this sensor and some of its new functionality will be available very shortly as part of the ROBOTC Driver Suite.  Until then you can safely use the sensor with the drivers for the older model, you just won’t have access to some of its advanced features.

July 25, 2009

All aboard the Arduino Bandwagon!

Filed under: Arduino, Experiments, Ramblings — Xander @ 07:17

Having read the countless articles, websites and hearing about it from friends, I’ve decided to jump on the Arduino bandwagon.  I bought one of the new ArduinoMega boards with a very nice shield and some other things.

 ArduinoMega Shield

The ArduinoMega is an Arduino compatible board with an ATmega1280 controller that has 128KB flash, 8KB SRAM and 4KB EEPROM.  It has 54 digital IO pins (of which 14 can provide PWM output), 16 10bit analogue inputs, I2C and a bunch of other ones.

The idea is to use the ArduinoMega as a (very) smart sensor/I2C slave for the NXT.  I am not sure what I’ll do with it, yet.  I have a Wiznet WIZ810MJ Ethernet module in a drawer somewhere, perhaps I can use that.  So far I have managed to upload a “blink” program and it works.  The only bad thing about the Arduino programming environment is that it is very, very slow on my Windows 7 64bit laptop.  I have it running on a Vista 64bit VM without any issues, though.  Perhaps they have fixed this in the upcoming 0017 release.  For now I will just use the VM-based solution.

I ordered the stuff from an online shop in Germany called Watterrot.  I was really impressed with how quickly my order was processed and shipped.  I ordered it on Wednesday lunch time, it shipped out on Thursday afternoon and by Friday afternoon I had all my items.  Their packages are traceable, so you can hit F5 (refresh) in your browser until the lettering wears off.  They also stock a very wide variety of SparkFun items (117 of them @ 25/07/09), which is great.  To top it all off, they have very good prices and only charge €10 euro for shipping and handling for orders within the EU!  That’s less than a 1/3 than what some of the shops in the Netherlands charge for a similar order.  I will definitely order from them the next time.

July 21, 2009

TwitterTattle: Big Brother Is Watching You

Filed under: Experiments, Sensors — Xander @ 22:49

Bailey, me and Pixel.  [click to enlarge] I love our dogs more than anything.  Even more than my NXTs.  I can hear you all gasp and mutter “blasphemer!”.  Now before you throw me on the fire, you must understand that I was a dog person before I was a robot person.

Anyway, as I was saying, as much as I love my dogs, they have a tendency to bark.  When we’re home, we can (and do) tell them to shut up, sometimes combined with the (in)appropriate expletives, depending on volume and time duration of said barking spree. However, when we’re not there, we obviously can’t keep an eye and ear on them.  Luck would have it that Mindsensors have a new sensor, the NXTHID.  It’s a sensor that can act as a Human Interface Device (HID), like a keyboard.  Using I2C commands, you can, for example, send data to a program on your computer via a USB cable as if *you* were typing it.  You can also make it start a program using the “run command” by sending the “Windows Key” modifier and the letter “r” and entering the command line in the text box followed by an newline and return carriage. 

TwitterTattle [click to enlarge] That gave me an idea. How cool would it be to know how much the dogs had barked and for how long?  Everyone (and their dog) is using Twitter nowadays, so why not my NXT as well?  I did some Google’ing for a command line Twitter client for Windows and bumped into a very handy little script that uses wget to send a message.  It’s really very simple.  Put the batch file and wget program in a directory in your PATH (like C:\Windows or another directory you added to the PATH variable yourself).  Make sure you edit the twitter.bat file to set the username and password of your Twitter account. 

I created a small program that uses a test release of the NXTHID driver I made.  It will be part of the next release of the ROBOTC Driver Suite.  You can download the zip file with the program and all the necessary drivers here: [LINK].  The program is quite simple.  First we check if the dog is barking, this is done by checking if the sound sensor is registering a loud noise.  Usually our house is pretty quiet, so if the sensor reads “100”, we can be pretty sure that it’s a bark.  If we’re not already running a total bark time timer, we reset it now and start counting.  Another timer to check how long it’s been since the last bark is also reset.  If there hasn’t been any barking for 30 seconds and our total barking time has been less than 90 seconds (that’s 60 seconds of barking time + the 30 seconds since the last bark), we’ll ignore it.  However, if the total barking time is more than 90 seconds, we’ll start up the twitter script to alert us.  After the tweet is sent, the whole process starts anew.

It is important to set your NXT to not switch itself off after 10 minutes or you’ll never know how bad your dog has been.  You can view my NXT’s Twitter page here: [LINK].

July 8, 2009

Moar Powah!

Filed under: Ramblings, Robots — Xander @ 07:17

Did you just buy a Wii-mote for a robotics project and you can’t wait to use it?  If you have a 15-tonne hydraulic grappling arm at your disposal, you could do what these guys did.

I am sure this beats the crap out of whatever you had in mind of controlling with that Wii-mote.  Feeling inadequate yet? [Source: Entity Crisis via Gizmodo]

July 2, 2009

Release your inner evil scientist

Filed under: Experiments, Sensors — Xander @ 08:49

This could be *you*Are you a budding evil scientist but lack the electronics skills to build your own sharks with laser beams?  Well, you no longer need to outsource your plans for world domination to second rate henchmen.  Now you can learn the skills needed to do this kind of thing yourself. HiTechnic have brought out the Experimenter’s Kit A, which consists of the solderless version of the Protoboard, a solderless breadboard, a whole bunch of electronic components, jumper wires and, of course, a handbook with quite a number of experiments.  Sample programs in NXT-G, LabView, NXC and RobotC (written by yours truly) are available for each experiment.  They’re easy to modify and expand on so the only limit is your imagination.

The experimenter's kit A

The kit allows you learn how to interface your NXT with more than just the pre-made sensors that are available on the market.  It includes push buttons, a temperature sensor, a magnetic sensor (plus magnet) and much more.  You can even build your own ambient cancelling light sensor!  That’ll give you a good idea of how the EOPD sensor works.  The handbook has plenty of drawings, photos and diagram, so you won’t be left in any doubt as to which components to place where.

When you’re done with the experiments in this kit, you’ll be well acquainted with interfacing non-Lego electronics with your brick and programming it to access their data.  How to make your own NXT controlled Death Star will be covered in the second edition of the handbook.

Blog at WordPress.com.