Monday, 29 October 2012

Windows 8 Media Center for FREE!


At this moment I'm considering an upgrade to Windows 8. It will cost me €29.99 for Windows 8 Pro, but I'm mainly concerned about how well the upgrade process works. I've noticed that the Windows 8 Media Center Plugin is for a temporary time free available, so I already filled in the form. You can do this too. The only thing you have to do is to enter your email-adress on this web page in order to receive the product key within 24 hours.



Thursday, 25 October 2012

Installing and testing the JY-MCU BT chip (Arduino/Windows)

Today I started with connecting my JY-MCU Bluetooth chip to my Arduino UNO.
You can order these chips really cheap at ebay or DX.com.

I've bought mine at DX.com for only $8.60. They offer a serial Bluetooth (BT) connection within a small range. This is mostly enough for our basic connectivity projects.
Link to DX.com

Connecting to the Arduino and uploading the test sketch:

As you can see it offers limited pins: VCC, GND, TXD and RXD.

If you want to connect it to an Arduino you can do it like this:

5v Arduino -> VCC
GND Arduino-> GND
TX(1) Arduino -> RXD
RX(0) Arduino -> TXD




If you want to test the Bluetooth chip, you can upload this sketch to your Arduino:

char val; // variable to receive data from the serial port
int ledpin = 13; // Onboard LED

void setup() {

  pinMode(ledpin, OUTPUT);  // Onboard LED as OUTPUT
  Serial.begin(9600);       // start serial communication at 9600bps
}

void loop() {

  if( Serial.available() )       // if data is available to read
  {
    val = Serial.read();         // read it and store it in 'val'
  }
  if( val == 'H' )               // if 'H' was received
  {
    digitalWrite(ledpin, HIGH);  // turn ON the LED
  } else { 
    digitalWrite(ledpin, LOW);   // otherwise turn it OFF
  }
  delay(100);                    // wait 100ms for next reading
}


It's inspired on the blog from roboToSH, but with a small change.
It will trigger LED pin 13 to high when you send the character "H" with use of the serial line. If you use another character or value it will turn off.

Pair the BT chip with your PC:

For pairing your JY-MCU to your PC you need to have a Bluetooth USB stick or an embedded BT chip in your laptop or desktop to set up a connection. Pairing is pretty simple in Windows. Just enter the window of the Bluetooth devices and search for a new device. You can enter this Window by clicking the BT logo in your taskbar.


Note: If you're having problems with trying the following up solution. Scroll down and try the different solution! It seems that Windows sometimes has problems with pairing and setting up a com port. Before you start with the different solution you have to remove the existing "linvor"device from the system by right clicking the device.

If it works well you can now find the BT device "linvor". Click on this device and use the code 1234 to get access. Now you can find "linvor" in the devices window.



Testing the BT serial connection:

Testing the BT serial connection is very simple once you paired with "linvor". You can find out the right COM port when you right-click the "linvor" device in the window. Go to properties and search for the COM port number in the hardware tab.

Once you know the COM port number you have to start the Arduino IDE. After that you select the right COM port and you enter the serial monitor. Enter H in the command line. If everything works well you can see the LED near the "L" character on your Arduino turn on.

If the Arduino IDE is not able to find the right COM port you can follow solution 2 in order to set up the connection correctly or you can try to use PuTTY for the serial view. (See solution 2)



Solution 2:

In my case the first solution worked for about 20 seconds. After that the Arduino IDE finds only the wrong serial port and the connection becomes unstable. I think this has something to do with the way how Windows organizes setting up different serial ports. I invested over 5 hours to find this solution, that's why I want to share it with you. :)

First steps:
Hook up your Arduino like in the first solution. Upload the sketch and go to the add bluetooth device screen of windows.

Pairing:
Pairing is different in this solution. You have to pair without telling the password!

Okay, now is your device paired without the code. Good job! 

Viewing the serial monitor:
Even in this way it's still impossible to use the Arduino Serial Monitor. In this case you should try Putty. It was the only free program that did the job correctly for me.


You can download Putty here if you didn't already have it on your computer:

Now it's time to start Putty. You will get a login screen.

  • Select serial, enter the right COM port. (You can find it in the hardware tab of the properties of "linvor" in the device window of Windows)
  • Set the Boud rate to 115200
  • Click Open

If it works correctly a balloon in the corner of your screen will pop up and ask for the code that you didn't enter when pairing. Enter "1234". 

After this the "Putty terminal" will pop-up and you're able to send in commands. Press "H". You won't see anything happening on the screen. But the light of your UNO will turn on. If you press "L" the light will turn off.

Note:
  • Putty is also able to receive values like for instance from a sensor. You will see them correctly. Because the Putty terminal only displays what you get back over serial and not what you send. If you need to send a big message to the Arduino. Copy/paste it in the window.
  • In case of a connection your "linvor" LED will become a solid red colour, if there is no connection it will blink.