On to the next module. I had been thinking for a few weeks, what kind of wireless will I use for my remote. Some options include:

  • Xbee modules with a base station connected to computer.
  • One way transmitter connected to base station and a one way receiver connected to remote.
  • Direct Bluetooth connection.

Now, each has its pros and cons.

The Xbee modules are frikken expensive. Add onto that the price of building a base station with another Micro-controller and USART->serial converters. On the up side, I would have AMAZING range for my remote.

The one way transmitters and receivers are cheap. Really cheap. Again though, I would have to build a base station with a USART->serial converters. Also, I cannot guarantee the range or effectiveness of the cheap wireless modules.

The Bluetooth modules can be found cheaply, easy to use and have no need for a base station. The range though, can be rather small, depending on the module chosen.

Taking all this into account, I chose the Bluetooth solution. I found a nice cheap Bluetooth device on eBay, based on the CSR (Cambridge Silicon Radio) chip. It all came on a breakout board for me too! Nice and easy to incorporate into the micro-controller using a USART connection. This also means I don’t need to modify any of my code from Module #1! How good’s that?

It works!
Now pair it with the computer and create a virtual COM port! For those who get the same device, take note that the PIN for these devices is 1234.

If you noticed, it’s name is “WIDE_HK”. What a boring name. This is the name of the people who made the breakout board. Now, I want  to change this. So we need to do some AT commands. TO do this, we need to connect the Bluetooth to the computer via the serial port. Take note, this is NOT via the Bluetooth wireless protocol, but through a USART->Serial converter and into the data lines on the Bluetooth chip. We also need to drive a line on the board high. This line is Pin 11, some soldering to tack a new line on at that point of the chip is required. Drive that to 5V, power it up and connect to it using putty with a baud rate of 38400. Here, we type in the AT commands. For a full list of AT commands, check the data sheet, but to change the name use this one.

“at+name=<newnamehere>”

This should return “OK”. And you are set!

Turn off the Bluetooth module, disconnect the line on pin 11. There we go! All ready to use!

Thanks to Hack a Day, specifically this post, I discovered a good way to extend the range of my Bluetooth device! Tack an old router antenna onto the aerial onto it! It’s the same frequency, 2.4GHz, so it is the right length for a proper antenna. Using this I get range of maybe 10m through walls. Without it I was lucky to get 2-3m. Thus the disadvantages of buying cheap modules and a cheap Bluetooth dongle for my computer.

Next module is the button switch bank.

Advertisements