New Year : New Products

January 6th, 2012

There are some fantastic new products to talk about, all fresh for the new year! First up – the new mbed.

It uses NXP’s Cortex-M0 LPC11U24 chip and is expressly designed to get you up and running *quickly* with USB and low power applications. It’s cheaper than the original mbed, and comes in a natty shade of yellow (!!). The online compiler used to write the mbed code has been updated as well to work with the new processor.

You may have seen the Fez Spider ‘.Net Gadgeteer’ kit – now say hello to the Spider’s big sister, the Hydra. It’s a 100% open-source (hardware and software) .NET Gadgeteer compatible mainboard running .NET Micro Framework. It incorporates a 240Mhz AT91SAMRL ARM9 processor. With 16MB of SDRAM an 4MB of FLASH. Whoooaa!

Arduino have released some new goodies – first up, the Uno has been reworked and released as ‘Revision 3′. There’s really not much difference, but a couple of extra signals are broken out to new pins. All of the old shields are still compatible. We’re now *only* selling revision 3 Unos.

Also released from Arduino, their official motor driver shield. Capable of driving two DC motors at varying speed and directions, the shield uses the L298P chip and can cope with 4 Amps per channel!

Finally, lets talk displays! The uLCD43 is a lovely, glossy touch screen from those folk at 4D Systems. It’s 4.3″ in size, 480 x 272 QVGA resolution, RGB 65,000 colours, with a touch overlay. Like most of 4D systems displays, this screen uses the ’4DGL’ display language to draw primitives and display images and video. As an added extra, the board also has an onboard sound output with built in amplifier! And that’s just the tip of the features iceberg!

Christmas Buying Guide

December 14th, 2011

So your son, daughter, partner or friend is interested in electronics? Many of the products we sell would make amazing Christmas gifts – and this buying guide will help you choose a great gift for that special person. Guides like this are pretty hard to write – quite often people have different levels of knowledge, or maybe want to do specific things with the kit that we sell. Recommending just a handful of products isn’t easy, but read on – we’ve tried to be as simple and considerate as possible.

Arduino

Okay – first up. ‘Arduino‘ is the name (it’s Italian) for a whole range of mini-computers. Arduino users need to program their unit with a computer language, which is easy to learn but relatively powerful. The Arduino system is an ideal starting block for younger folk, but also for seasoned professionals. You can be up and running with an Arduino in minutes, and you need nothing but your computer (a PC or a Mac is fine) a USB cable, and (of course) an Arduino. Programming software is free, and downloadable from the internet.

Arduino Uno

The most basic Arduino is called the ‘Uno‘ and is about the size of a pack of cards. We sell it singly, and as part of a starter kit – which has a range of bits and bobs that will make learning faster and more enjoyable. Nothing in the starter kit requires the use of a soldering iron. By the way Arduino is *huge* – there are millions of people using the technology around the world. Some of our customers have even taken Arduinos to the Antarctic.

If you want to do more stuff, there are things called ‘shields‘. These are simply add-on boards that fit on top of your Arduino. Their function ranges from a shield that allows your Arduino to connect to the internet via WiFi, to something that will allow your Arduino to control a couple of motors. There are also shields that allow you to send SMS text messages and make mobile phone calls!

We also have a great book for beginners called Getting Started with Arduino!

The ‘Fez’ range and the Netduino

Next up is another range of tiny micro-computer boards similar in size and shape to the Arduino Uno. Unlike the Uno, these use more powerful processors and are programmed using a different computer language (called C sharp or C#). One of the good things about this language is that it can be very fast to develop quite complicated applications (involving for example cameras, touch screens, USB devices)

NetDuino & Fez

We’d recommend something like the FEZ Panda II or the Netduino as starter items. Again, to program them you’ll need a computer. As with the Arduino, there are lots of free tutorials available on the internet.

If you’d like to spend a bit more money, the ‘FEZ Spider‘ kit is great – this is a central board, with lots of ‘offshoot‘ boards that plug into the central board. This means no soldering, and very fast development of complex projects.

The .Net systems are great for people who’ve had a little bit (or a lot) of programming experience, and are looking to experiment with hardware.

The mbed and the m3pi robot

Another system is the mbed. Again, it uses another programming language (this time called C++). The mbed has lots of onboard features including a flash memory disk and LEDs. Programmed with the right instructions, the mbed can become the brain of a robot called the m3pi. This robot has two small motors, and a few sensors, but can whizz around the floor at a good speed. After you have mastered the mbed, and the robot, you can add on a range of sensors to give it more ability to navigate around obstacles.

mbed & m3pi Robot

If you don’t fancy the idea of a robot, the mbed is great on its own. It doesn’t use shields like the Arduino system, but it does have a very useful board called the ‘mbed workshop breakout board‘ that gives users access to the mbed through a series of different connectors and also has an SD card slot.

Other Things

So all the things we’ve talk about so far have been fully fledged micro-processor board systems, and whilst they will all make great gifts, you may be looking for something else a little less complicated.

So what about a book? – we stock a good range of interesting titles coving a range of different areas. Sometimes books are a fantastic gift for people who’re looking to learn a new skill or area of expertise.

Other Things

Another popular gift range is tools – we stock a nice range. At the ‘Rolls Royce’ end are these lovely digital storage oscilloscopes. These are the size of an ipod and allow electrical waveforms to be measured and shown on the colour screen. When you’re trying to find a fault in a project, these units can be very helpful.

At the budget end of the tool range, we have lovely things like ‘vernier calipers‘. These are one of the tools we use the most here at Cool Components and allow use to very quickly and accurately measure tiny things. With a digital scale you can show the measurement as inches or millimeters. They come in a plastic case, but the tool itself is made from precision, acid-etched steel.

Even cheaper – what about some wire cutters, wire strippers or tweezers for handling tiny components. All of these are some of the best tools that we’ve worked with at this price, so quality is very high.

So that’s it – we hope you’ve got a few ideas about some cheap or not so cheap gift ideas. If you need more help, please feel free to give us a call an talk through the type of item that you’re considering. We’ve done this for years – so our guys have a good knowledge about what the best type of item would be for a given type of person.

.Net Gadgeteer, the PhoneDrone and More!

October 27th, 2011

*Loads* of you have been asking for it – and finally, the Fez Spider ‘Net Gadgeteer’ system has arrived. The kit boasts a powerful board that runs .NET micro framework with code written in C#. The top side of the main CPU board is filled with connector sockets, so that complex peripheral components can be easily attached and detached without soldering.

Fez Spider Kit

We’re initially selling the Fez Spider board as part of a kit including a display, a camera, and lots of other cool peripherals, however over time, you’ll start to see more and more of the components being listed on their own. We’re already listing the camera, serial USB module and mainboards separately.

Gameduino

New from the US, this fantastic Arduino shield. The Gameduino is based around a powerful chip that can handle basic, but high quality 2D sprite based computer graphics. The chip can also pump out good quality stereo sound effects. To top it all there’s a full size VGA monitor connector so you can hook up your 152″ plasma. All of this means that it’s easy to create very cool computer games.

Manic Miner on the Gameduino Sprite action on the Gameduino

Already the Gameduino’s creator has ported Manic Miner, Asteroids, and many others…

RN-XV

Next – if you’re using kit with an Xbee socket on it, why not make the move to WiFi? We’re now selling these impressive modules from Roving Networks. They’re a standard RN131 WiFly module in an Xbee form factor. The pins and power supplies are similar, so you can pull out your Xbee and plop in one of these.

Phone Drone for Android

Finally, for the UAV or RC fanatics out there a new board that allows you to control your aircraft from your Android enabled phone. The ‘phoneDrone’ board gives the phone a number of essential hardware resources including 8 servo channels and 3 serial ports. On the phone, software to control the board can be quickly written using Google’s ADK (Accessory Development Kit).

Propeller pair

Last but not least, if you’re flying a quad (or hex or octo) copter, we now stock 10″ and 12″ propeller blades. They come in matched push/pull pairs with hub rings to match to your favourite brushless motor.

Current Vacancies

August 14th, 2011

E-Commerce Manager

This is a fantastic opportunity to work within the heart of a growing and dynamic business. We’re looking for someone who can make a difference dealing with the lions share of operational issues :

Top of the list is customer service, but you’ll also be involved in sales, product selection and buying, import and dispatch, advertising and marketing as well as other key business areas.

You’ll be passionate about what we do, and about helping us expand and streamline our operations. In return we’ll give you high levels of responsibility and decision making in a rewarding environment.

You’ll ideally come from a customer service background, but will have a good technical understanding of our product range or the ability to get it quickly. Graduates are welcome to apply but will need to demonstrate clear ability and experience in summer job roles and a level-headed ability in business.

We love passionate, interested people who have crazy ideas that can help turn our business around. We’re not IBM, so your input can and will make a real difference.

The position is full time, based at our London (SW11) offices. Salary is negotiable and will depend on experience and how awesome you are. Applications by email to info at coolcomponents dot co dot uk. No agents please!

PHP / MySQL / Javascript Developer

We’re looking for a developer to work on our website and possibly some other projects. You’ll be a seasoned PHP programmer, with an in depth knowledge of MySQL. You’ll consume computer languages like smarties, but your other areas of expertise will include javscript, jQuery and Git.

The successful applicant will work in-house at our London (SW11) offices as part of our small and dynamic core business team. Your programming assignments will revolve around making our website faster, stronger and sleeker as we implement AJAX features and external API functions.

We love passionate, interested people who have crazy ideas that can help turn our business around. We’re not IBM, so your input can and will make a real difference.

This position is a 3 month contract to start with with a possibility to extend. Salary is negotiable and will depend on experience and how awesome you are. Applications by email to info at coolcomponents dot co dot uk. No agents please!

Arduino Release New Boards

August 8th, 2011

New from Arduino, a couple of boards that could really have a big impact on your projects!

Arduino Ethernet with PoE Module

First up, the Arduino Ethernet. It’s worth saying that this is actually a board with a processor on it, rather than a shield. The Arduino Ethernet effectively combines onto one PCB, the Arduino Uno and the Arduino Ethernet shield. Also – the version we’re selling has an additional PoE module. ‘PoE’ stands for ‘Power Over Ethernet’ and means that DC power can be provided down your LAN cable.

So why do we care about the Arduino Ethernet being PoE enabled? Really it’s because now, there’s an affordable, compact, network portable device that can be plonked (the posh word is ‘deployed’) onto your home/work/university network anywhere where there’s a PoE enabled LAN cable. In business and lots of educational institutions, that’s most places these days. Your Arduino can then sit quietly, reporting sensor readings to a central server, or maybe turn things on and off by remote request.

One final note on PoE – be careful, not all LAN cables have power running through them – this very much depends on your router. If your router doesn’t supplier PoE power into your LAN, you can buy add on modules that will do roughly the same thing. We supply several types.

Next up is the new Mega ADK for Android.

Arduino Mega ADK

This board has been designed with the world of Android enabled phones / tablets in mind. It’s essentially the same Mega 2560 board but with a hardware interface that can be written to directly and easily by a new add-on to the Android programming language. There’s a USB host chip that talks to the phone, and a power supply that is able to recharge the phone. Because of the way that ADK software is written, it’s possible to plug in a few sensors, and have your phone run a complex, ‘real world’ application with just a few minutes worth of programming. Crazy!

Android ADK

Forgetting the ADK software side of things – because this board has a USB host interface all sorts of possibilities open up – just like the mbed, the board theoretically should be able to talk to various USB dongles – flash drives, GPRS dongles – all sorts!

New Products

May 12th, 2011

It’s been a bit of time since our last new product post, and there’s loads and loads and loads of really exciting new stuff.

First up – these 1 metre long strips of RGB leds. Each led can be controlled individually via a 2 wire bus, and separate strips can be daisy chained together to form message displays or even basic ‘jumbo’ sized TV screens. Interfacing is pretty simple and can easily be handled by an Arduino, mbed, or Fez.

Olimex has been busy recently! They’ve updated their range of PIC based web servers to cover the PIC32 family of microprocessors. Most impressive is the PIC32-MAXI-WEB, with a lovely on-board 320×240 colour touch screen, 3 axis accelerometer, 2 relays, CAN drivers and a whole lot more!

Also new from Olimex is an updated range of MP3 players. The MOD-MP3-X appears to your PC as a mass storage device, but can play and record stereo audio in a variety of formats. Power is supplied from just one AA battery due to an on-board voltage converter.

On the RF side of things, we’re stocking these neat WiFi / MCU ‘all in one’ modules. The FlyPort is a WiFi module, PIC microcontroller and antenna on one board. The device has its own dedicated IDE that allows fast tracked code creation and deployment to the device. Have a look at our getting started tutorial to get an idea of how quickly you can be up and running.

Finally – don’t forget the .NET side of things – ideal if you’re a software guy looking to move into embedded hardware because you can write all of your embedded code in C# using Visual Studio. New on the block is the Fez Panda II – an enhanced and bang up-to-date version of its little brother the Fez Panda. What’s cool about this board (and many other .NET boards) is that it offers real time, on-device debugging, all from within your normal VS IDE. Nice….

Getting Data from the OpenPICUS Flyport

March 28th, 2011

If you’re new to the Flyport, one of the key questions you’ll be asking is ‘how can I read data from the device’. At first glance the answer looks complicated, and at the time of writing no clear documentation has been provided which lays out a basic explanation – so here goes.

Let’s say that we’ve attached a thermometer or other sensor to the FlyPort and we want to display that data on a simple webpage. First we’ll connect the sensor between 3.3V, Ground and with the signal pin going to A1_in – A1 is one of the 2 available analogue to digital converter pins. Once this is done, we’ll assume that our sensor is outputting a voltage between 0V and 3.3V into A1_in.

Now to the web page. Luckily the guys at OpenPICUS have already written a example. You can find this in the ‘Webpages’ folder inside the IDE. The files inside of this folder are very useful and we’ll base this tutorial on them. Best to copy this folder to your desktop – we’ll actually only be changing the ‘index.htm’ file, but it’s good to have a complete separate copy in an easy to access place.

To avoid confusion, we’re actually going to completely overwrite index.htm and replace it with our own. Before we do that, a little bit about how the web page will work.

status.xml

An xml file is a simple way to store data. For the FlyPort, it’s the place where the device writes the values of the different on-board resources, like the LEDs, the buttons and the ADC channels. The FlyPort is constantly updating this file and it does it automatically, without any intervention from us. You can see the values in the file, by simply pointing your browser at “http://192.168.0.1/status.xml” (or whatever your device address is)

You’ll see a list of zeros, ones, numbers and text saying ‘up’ or ‘down’. If you refresh your browser a few times, you’ll see some of these values change, most probably the ADC channels, as they jump around a little with electronic noise.

So this is great news! There’s a file with values in it – we know where it is, and all we need to do is to read it!

mchp.js

This is a javascript file provided by Microchip (the chip and wifi module manufacturer). You shouldn’t need to change it at first. Crucially, the file contains the javascript functions that will retrieve information from the status.xml file and allow us to display it.

Actually, extracting just one value out of the xml file is a bit of a pain, but the OpenPICUS guys have written a few bits of Javascript that will do this without any fuss. Most of the clever code is contained in a file called mchp.js – again, this is included in your ‘Webfiles’ folder already. We just need to make sure that this file is ‘included’ in our final index.htm file.

stylesheet.css

Like any normal CSS stylesheet, this contains styles which we’ll use in the main index.htm file. Actually, most of these styles are now redundant and can be deleted

header.inc and footer.inc

In the original example, these files go at the top and bottom of index.htm. For clarity, we’ve got rid of them from this example. All they contained anyway was some opening html stuff, and some closing divs. Basically – these files aren’t needed for this example, although you may wish to use them later as your code gets more complex.

Let’s write index.htm

So just to restate – the job of index.htm is to display the reading coming from the ADC_1 input on a webpage.

We’ll start by writing some simple HTML header code

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Cool Components FlyPort Test Page#1</title>

Nothing complicated here – all we’re doing it telling the browser what kind of document we’re serving, and setting the title of the page.

<link href="/style.css" rel="stylesheet" type="text/css" />
<script src="/mchp.js" type="text/javascript"></script>

The next section includes a couple of the previously mentioned files – firstly, the stylesheet (“style.css”) and secondly the clever javascript (“mchp.js”). Next – the crucial (simplified) javascript section that grabs the value of the ADC from status.xml and displays it…

<script type="text/javascript">
<!--
// Parses the xmlResponse from status.xml and updates the status box
function updateStatus(xmlData) 
{
	// Check if a timeout occurred
	if(!xmlData) {return;}

	document.getElementById('pot0').innerHTML = getXMLValue(xmlData, 'pot0');
}

setTimeout("newAJAXCommand('status.xml', updateStatus, true)",500);
//-->
</script>

updateStatus is a javascript function that is confusingly called from the code within mchs.js. Leaving this stumbling block aside, the code is very simple.

Firstly we check to see whether there’s any data (xmldata) worth processing. If there’s none, we exit the function.

The

document.getElementById('pot0').innerHTML = getXMLValue(xmlData, 'pot0');

line is critical. Here we’re using javascript to get the value called ‘pot0′ from status.xml and write it to the ‘div’ section that’s called by the identifier ‘pot0′. The “document.getElementById(‘name’) just returned a handle to an element on the webpage. By using the ‘innnerHTML’ method we can set the text of that element to be what we want. In this case, we’re setting the text to become the value of the ADC channel.

We’re grabbing the value of the ADC channel with “getXMLValue(xmlData, ‘pot0′)”. the ‘getXMLValue’ function is the way we get data from status.xml. It’s pretty simple, and we’re just passing it two arguments : the place to store the data (a variable called xmlData) and the name of the resource inside of status.xml that we want to get the value for.

So that’s the main task completed – we’ve grabbed the data and displayed it to the web page. There’s just one more very cool function that will transform your page from a dull, static page to an exciting, dynamic, automatically updating page.

The key to getting this working is

setTimeout("newAJAXCommand('status.xml', updateStatus, true)",500);

If you notice – in the entire index.htm so far, we haven’t yet called our crucial ‘updateStatus’ function once. So this is where we finally call it. We’re actually calling a function hidden in mchp.js which in turn calls updateStatus.

The function within mchp.js is called “newAJAXCommand” and it takes the following arguments – the url of the resource (status.xml), the function that the resulting data gets sent to (updateStatus), and whether it’s a request that will be repeated ad infinitum (true).

So going back to our code line in index.htm that calls newAJAXCommand, we can see that the function call itself is sitting as a parameter inside another function called setTimeout. This is quite usual in javascript, although it can look a bit confusing to beginnners.

What we’re saying with the setTimeout call is that we want to wait a certain amount of time before calling the newAJAXCommand function. In this case it’s 500 milliseconds (half a second). It’s actually possible to get away with not using setTimeout, but we’ll leave it in for completeness.

Where is the data actually displayed?

All we need now is a little bit of normal html code that can be modified ‘on the fly’ by updateStatus. So here it is :

</head>

<body>
	<p>The temperature is : <span id="pot0" style="font-weight:normal">?</span></p>
</body>

</html>

Just a little house-keeping : In this code section we’re closing off the ‘head’ section of the html code where the javascript code goes, and right at the bottom, we’re closing the whole html section with a </html>.

But the crucial bit of this code section is:

The temperature is : <span id="pot0">?</span>

We’re declaring a section called “pot0″ and putting a little bit of initial text in. The ‘?’ will appear for the first 500mS until our javascript ‘setTimeout’ kicks in and starts the whole process running.

Now compile the webpages and run!

Check all of your code – Javascript is fussy about case, and html needs proper closing tags to match any opening tags. Once you’re happy, save your code.

Now open up your OpenPICUS IDE and open a project that you have already proven connects to your wireless network. Click on the ‘Webpages Import’ button on the toolbar, and navigate to the folder where all of your code has been saved. Note that we’re choosing a folder not a selection of files. Click the botton marked ‘Generate’ and you’ll get a message saying OK. Note that every time you change your web code, you need to re-include the folder where it’s stored using this process.

Now, as usual, compile the whole project and download (or upload!) it to your Flyport.

Once your Flyport is reset and connects to your network, you’ll be able to navigate to your index.htm just by typing the IP address of your Flyport (192.168.0.101 in our case). You should see something like this.

Note that the ‘temperature’ or whatever it is, is constantly being updated. This is because of code inside of mchp.js which is calling the getXMLData function once every 500mS

Next Steps

That’s pretty much it – but if you want to further extend your code, you could try reading some of the other ‘resources’ within status.xml. Here’s handy list of what they’re called.

  • LED 0 – “led0″
  • LED 1 – “led1″
  • LED 2 – “led2″
  • LED 3 – “led3″
  • LED 4 – “led4″
  • LED 5 – “led5″
  • Button 0 – “btn0″
  • Button 1 – “btn1″
  • Button 2 – “btn2″
  • Button 3 – “btn3″
  • Button 4 – “btn4″
  • ADC Channel 0 – “pot0″
  • ADC Channel 1 – “pot1″

First Steps with the OpenPICUS Flyport

February 24th, 2011

The OpenPICUS FlyPort is a stand-alone WiFi module, with an onboard PIC processor. The FlyPort can do a huge range of exciting things, all without external ‘intelligence’. This tutorial is a walk through the most basic process – setting the Flyport up as a web-server, and accessing it through your local LAN network

Hardware Set-up

To start using the FlyPort you’ll need the module itself, a USB to TTL Cable, and some female to male jumper wires. Power (5V) will come directly from the USB to TTL cable, which in turn comes from your PC. The FlyPort doesn’t need an aerial, or any other external circuitry. Indeed, once the module has been programmed, you can get rid of the USB to TTL cable completely and power if from, say, a battery.

Using the male to female jumper leads, we’ll connect (in this order) from the TTL cable to the FlyPort :

  • GND -> pin 22 (GND)
  • RTS -> pin 24 (RESET)
  • TDX -> pin 13 (uRX_in)
  • RDX -> pin 15 (uTX_out)
  • VCC -> pin 16 (+5V)
  • RTS -> pin 26 (RESET)

As soon as you connect the +5V a green LED should come on on the module. This stays on whenever power is connected and never goes off.

We’re using RTS as a reset signal, but in order to make that work properly, we need to change a setting in your COM port.

First, plug the USB end of your USB to TTL serial cable into your PC. If it’s the first time you’ve done this, Windows will muck around for a while loading the correct drivers. Eventually everything should stop.

Now go to the Windows Control Panel and choose the ‘System’ option. Inside it, we need to choose the ‘Device Manager’ tab, then navigate to ‘PORTS (COM & LPT)’. When you expand this section, you should see that there’s a new COM port, possibly called ‘USB Serial Port’.

Double click on this and go to the ‘Port Settings’ tab. Choose ‘Advanced’ (the button at the bottom) and a new window will open up.

Look at the ‘Miscellaneous Options’ on the right hand side, and check the box that says ‘Set RTS On Close’. Now OK to leave this window, OK to leave the next window and then close any part of the Control Panel left open.

At this point we have a Flyport module powered up and connected to your PC ready for programming. Better get writing some code!

Software Installation

First, you’ll need to download and install the OpenPICUS IDE. Bear in mind that the sofware won’t install unless you have .NET 4 already installed. If you don’t have it installed, the install process will shunt you off to Microsoft’s download page to get .NET installed.

When the IDE opens up, you’ll need to create a new project. The project we’re aiming at for this tutorial will do the following things :

  • Connect to your wireless network.
  • Connect with a static IP address – in this case 192.168.0.101
  • Serve a dynamic web page when you use your browser to connect to the FlyPort

First – click on ‘New’ at the top left of the window. By default – the IDE’s about to take us through a wizard which will do the most complicated WiFi setup steps all for us.

Okay so here goes – The first window lets you specify what exactly your module is going to be – a server, a client, or whatever. We just want our module to serve a web page, so we’ll just tick the ‘Webserver’ box.

The next window asks us some pretty important numbers – don’t worry – if you make a mistake here, it’s possible to re-run the wizard by clicking on the TCP/IP Setup button on the toolbar.

For hostname – choose anything you like – We’ve put PICUS. Leave the MAC address as it is, and move onto the blue box on the right. ‘IP Address’ is the address that we want the module to become when it’s turned on. By failing to tick the ‘DHCP’ boxes in the previous window, we’ve opted to have what’s called a ‘static’ IP address – ie one that never changes. The reason for this is that we always know where to find our device, and we’re not in the position where the IP address changes every time the module is turned on – that sucks.

So our static IP address is ’192.168.0.101′. Be a little careful here. You need to choose an address that isn’t in use, but is also inside the IP range that your router will be comfortable with. There are generally two types of router –

  • Those with a router address 192.168.0.1 (they give out a range from 192.168.0.2 -> 192.168.0.255)
  • Those with a router address 192.168.1.1 (they give out a range from 192.168.1.2 -> 192.168.1.255)

We’ve chose our module’s IP address to be 192,168.0.101 because we have a router whose address is 192.168.0.1. In technical parlance, we’re on the same subnet. We’re guessing that no one’s using IP address 101, so that’s why we’ve chosen that.

Now we’re on to the ‘Subnet Mask’ setting. This all ties on to which subnet we’re sitting on. Essentially

  • If your router has address 192.168.0.1, subnet mask will be 255.255.255.0
  • If your router has address 192.168.1.1, subnet mask will be 255.255.254.0

Okay – now ‘Gateway’. This is just a posh term for the address of your router. We filled in 192.168.0.1

Primary DNS Server – If you ask your Flyport to download a webpage at ‘www.coolcomponents.co.uk’ how does it know which IP address to use? The answer is that it contacts a ‘ DNS Server ‘ which will tell it. Generally – a bit like an electronic Yellow Pages. In this case, our router will act as the DNS Server, so we filled in 192.168.0.1.

There is also a ‘Secondary DNS Server’ setting – this is just in case the primary explodes, but we won’t bother filling this in for now.

Okay – press ‘Next’ and on we go to the next page – Wireless Configuration.

‘Default SSID Name’ is the name of your wireless network as shown by windows in the network list. Our is called ‘COOLCOMPONENTS’ so that’s what we’ve filled in here. Be careful to make sure that you’ve got the right uppercase and lowercase characters here.

‘Default Network Type’ is almost always ‘Infrastructure’. Only change it to Ad-Hoc if you’re 100% sure that you have an Ad-Hoc network.

We’re going to skip through the next few :

  • Default PS Poll -> Enabled
  • Scan Type -> Active
  • Retry Count -> 10 (up to you)
  • Scan Channels -> Tick all that are legal in your country

On the next window we need to choose our WiFi security settings.

It’s pretty rare for people not to have WiFi security enabled these days. So you need to find out from your router set-up which kind your network has and what the password is.

We’ve chosen WPA WPA2 Auto Select and filled in the PSK phrase box with our password. We left the Key Data boxes well alone.

The final setup screen is for TCP sockets. None of the settings here should be changed unless you have a specific requirement and know clearly what you’re doing.

So that’s it. Press ‘Next’ and then ‘Finish’. OpenPICUS will whir a bit and compile all of your settings and the code it needs into your new project. Eventually a success window will appear and your project skeleton will appear.

For the purpose of this tutorial we’ll only be changing code in the ‘FlyPort Task’ tab. This tab will contain most of your code as your project gets more advanced. The other tabs should be left alone for now.

To get the Flyport to connect to the wifi network, all we need to do is issue a command that says ‘Connect!’. Remember, the Flyport already has your settings, so you don’t need to specify these again.

Under the code comment // PUT YOUR INITIALIZATION CODE HERE we’ll insert the following command :

WFConnect(WF_DEFAULT);

We’re just telling the FlyPort to connect to a WiFi network using the default profile that you’ve already setup in the wizard.

That’s all the code we need! Before sending it to the module, we need to compile it. To do this press the button that says ‘Compile Project’ up on the toolbar. Again, OpenPICUS will whirr around a bit and eventually should report success. If there’s a problem, check that you’ve included a semi-colon at the end of the command that you’ve just inserted.

Now to upload the code to the Flyport itself. The IDE calls it ‘Downloading’, so go ahead and press that button. You’ll be asked to choose a COM port – obviously choose the one that your USB to TTL cable is sitting on (you can find this out from the Device Manager).

As soon as you press ‘Download’ you should see that the device has been found, and that the progress bar is moving. If the operation times out, chances are that your reset connector isn’t properly attached, the device isn’t powered on (Green LED) or that you have checked the RTS box in the COM port settings as described earlier.

So assuming the download’s worked, that pretty much it! One final thing to do. The module won’t run unless you remove the reset lead from pin 26.

After removing the reset, you’ll need to wait for about 30 seconds. After this, a red LED (D1) should come on to indicate that the FlyPort is connected to your network. Note that this LED is not an implicit indication of connection success, it’s just the default software going into action. The LED can be turned on and off from the webpage you’re about to see.

Now open up your favourite brower and type the IP address of your Flyport (our is 192,168.0.101) directly into the address bar.

You should see something like this. The web page is being served directly from your Flyport. To prove this, with your fingers, touch pins 23 or 25 on the Flyport and you’ll see the bar graphs on the webpage move. Cool huh!

To be fair, this web page is pretty complex – it uses AJAX functions which mean that the page doesn’t need to be refreshed to show new data. If you’re writing your own web page, you may like to start with a more simple web page – we’ll talk about this in the next tutorial. Until then – happy Flyporting!

A Technology to Change the World

February 15th, 2011

The Economist magazine this month calls 3D printing (or rapid prototyping) a technology that “will change the world”. 3D printers work by laying down layer after layer of a given material until a real, 3 dimensional object has been created. Printers differ in the materials that they use, and the methods that they use to print, but all share the same concept. The Economist talks about the technology’s ability to “undermine economies of scale”. In short this means that you can have a machine on your desktop churning out widgets and gizmos, without having to make thousands of them. It means that anyone can make physical, real, solid things without sinking their life savings into having plastic moulds created and tooling carried out.

3D Printer

3D printing is a dream come true for students, academics, product designers, hobbyists, engineers, architects, teachers, or anyone who has a brilliant idea that they need to be able to see and touch.

So all of this is important for us (and hopefully you!) because we’re thrilled to be bringing a fantastic, affordable 3D printer to the market. It’s not a kit (lots of people have told us about their frustration with 3D printer kits) and takes about 15 minutes to assemble from box to 1st print. It uses ABS plastic filament but can be adapted to use other materials. Don’t get us wrong – our printer won’t be able to create Stradivarius violins, but it can make some pretty complex and exciting parts. We’ve been using the free and amazing Google Sketchup to make our parts, but any 3D package that can produce standard STL files is good.

We’ve seen people make working water pumps, produce anatomic prints from real medical topography data or even just produce a custom enclosure for their latest Arduino project. Using the printer is very easy – similar to printing a 2D print!

Xbee Modules – Reprogramming a series 2.5 to a series ZB

January 21st, 2011

Introduction

Xbee modules are wonderful things, but the communication standard they use differs. Series 2.5 (or Series 2), as it’s sometime called, is currently the most popular version that we sell, but a newer version is series ZB.

Series ZB has a number of very small advantages over series 2.5 including that they’re often more compatible with Zigbee modules from other manufacturers.

The good news is that excluding the antenna type, which doesn’t really matter, the hardware of a series 2.5 module is exactly the same as the hardware for a series ZB module. This means that anyone can easily reprogram the firmware on one to become the other. It takes about 5 minutes (or less) and is pretty easy. The following tutorial shows you how.

What You’ll Need

  • A copy of the X-CTU software from the manufacturers, Digi.
  • A series 2.5 or series ZB Xbee module that you’d like to change over
  • A Xbee USB Explorer
  • A USB A to mini B cable
  • A PC (not MAC)

Let’s Do It.

  1. The first thing to do is to install X-CTU.

    This is a doddle on most computers and you shouldn’t have a problem with it. Accept all of the default directory choices and tick any agreement boxes. Once the software has been installed it may say that some of its profiles are out of date and that it needs to connect to the internet to update them. Allow it to do this – if you don’t it may not recognise certain Xbee module types. Once you’re up to date, close X-CTU down.

  2. Now plug the Xbee module into your Xbee USB Explorer. Plug the USB cable into the mini connector on the end of the board, and plug the other end of the USB cable into a spare USB port on your PC. Your PC needs to load some drivers to get the Xbee Explorer board to work. The first time you plug your board into the PC, this will take 1-2 minutes. If you see an error message, unplug your USB cable, download the drivers from FDTI here, and try again.
  3. Now start up X-CTU. On the very first screen you’ll see a choice of COM ports to chose from. Your Xbee Explorer board would probably have been installed to the COM port with the highest number, so try that one first. Any easy way to check that everything is okay, is to press the ‘Test/Query’ button. If you’ve connected to the correct COM port and your module is working okay, then you’ll see a box pop up to say that communications were successful.
  4. One further thing to try is to switch to the ‘Modem Configuration’ tab (where we’ll be doing most of the work) and press the ‘Read’ button at the top left. This will do a full read of all module parameters stored. Once you’ve pressed the ‘Read’ button you’ll see the lights on your Xbee Explorer flickering and the settings in the main window should become populated with data.
  5. Now we’re in business! Your Xbee module is connected, you’re talking to it with you PC, and everything is good!
  6. Finally, we’ll carry out the operation that will transform your Xbee module from one series to another. We need to change 2 drop down box settings, tick a box and press ‘Write’ – that’s it!
  7. Okay – so lets assume we’re changing a series 2 module into a Series ZB module. At the top left of the ‘Modem Configuration’ Screen there’s a drop-down box with the title ‘Modem’. Let’s change this from XB24 to XB24-ZB. On the drop-down box marked ‘Function Set’ choose ‘Zigbee End Device AT’ or ‘Zigbee Coordinator AT’. DO NOT mistakenly or otherwise chose any of the settings with ‘API’ at the end.
  8. Finally, tick the box that says ‘Always Update Firmware’ and press ‘Write’.
  9. The ensuing process takes about a minute, but at the end X-CTU should report success, and that’s it!

Problems

Unfortunately, life sometimes isn’t that simple. X-CTU is not a particularly well written piece of software and there are bugs and little issues that can drive you mad. In addition, XBee modules themselves can sometimes be quite temperamental if they’re not factory fresh, or even sometimes if they are. When we carry out this process at Cool Components, we generally have ‘issues’ with about one module in 10.

Most of these issues can be solved by doing the standard – restarting X-CTU, unplugging and replugging the XBee USB Explorer board, even restarting your computer. All can quite often solve the perplexing problems you’re having.

One of the most common problems is that somehow, X-CTU finds it impossible to talk to the Xbee module at the correct baud rate. This can lead to the program being unable to reset the module. When this happens, a box will pop-up telling you about this problem and requesting you to restart the module itself. But how to do this when there isn’t a reset button on the Xbee Explorer? Simple – turn the Xbee Explorer board over. On the back you’ll see two rows of labelled holes. With a wire, briefly connect GND to RST (not RES or RTS). By briefly, we mean for less than half a second – it’s not crucial, but you really shouldn’t need to connect for longer.

There are many other problems that can happen, but if you’re using a factory fresh module and you follow our instructions **in the order** that we’ve written them, there shouldn’t be any major issues.