Bluetooth Incorrect Character Mapping

I am using an RN-42 bluetooth module with my Arduino UNO. I have it set up now so that I can send characters from a PC terminal to the bluetooth module, and then read them back from the microcontroller via the Serial Monitor. The problem is that the characters I receive back are not the characters I type in originally. I have mapped each input character to the corresponding output character.

For example: if I type ‘A’, I get back ‘_’. If I type ‘B’’, I get back ‘/’ and so on. I have attached an excel file of the input to output map. I have the bluetooth modules, arduino, and terminals all set to a 9600 8N1 configuration.

Any help would be very appreciated.

ascii.xls (26.5 KB)

I have mapped each input character to the corresponding output character.

I'd rather see your code.

Thank you for taking a look. I am just using a simple example from the arduino playground here:

In short, it's:

char val; // variable to receive data from the serial port
int ledpin = 8; // LED connected to pin 48 (on-board LED)
void setup() {
  pinMode(ledpin, OUTPUT);  // pin 48 (on-board LED) as OUTPUT
  Serial.begin(9600);       // start serial communication at 9600bps
void loop() {
  if( Serial.available() )       // if data is available to read
    val =;         // 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

So, for the LED to light up I have to send an 'o' character to the bluetooth module because it's the one that gets interpreted as an 'H' at the microcontroller.

Turns out I was using the RS232 pins instead of the UART pins.