TechnicalEngineer
Published © GPL3+

Making a Wireless Keyboard Using Arduino and Zigbee

How to make a wireless keyboard using Xbee with Arduino? This particular project demonstrates how to transmit the data from a PS2 keyboard.

IntermediateFull instructions provided2,684
Making a Wireless Keyboard Using Arduino and Zigbee

Story

Read more

Schematics

Project-On-Wireless-Keyboard-Using-Xbee-Arduino-Circuit

Arduino Used with XBee Technology

Code

Demonstration on How to Wirelessly send PS2Keyboard Data Using Xbee

C Header File
/*============================ EG LABS ===================================//

 Demonstration on how to wirelessly send ps2keyboard data using Xbee


 The circuit:

 LCD:

 * LCD RS pin to digital pin 12

 * LCD Enable pin to digital pin 11

 * LCD D4 pin to digital pin 7

 * LCD D5 pin to digital pin 6

 * LCD D6 pin to digital pin 5

 * LCD D7 pin to digital pin 4

 * LCD R/W pin to ground

 * 10K resistor:

 * ends to +5V and ground

 * wiper to LCD pin 3

 * LED anode attached to digital output 9

 * LED cathode attached to ground through a 1K resistor


 KEYBOARD:

 DATA PIN TO PIN NUMBER 8

 CLOCK PIN TO PIN NUMBER 3


 XBEE:

 RX PIN OF XBEE TO TX0 PIN OF ARDUINO

 SHORT THE GROUND PINS OF ARDUINO AND XBEE

============================== EG LABS ===================================*/


#include "PS2Keyboard.h"

// include the library code:

#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins

LiquidCrystal lcd(12, 11, 7, 6, 5, 4);


#define DATA_PIN 8

PS2Keyboard keyboard;


void setup() 

{

  pinMode(9, OUTPUT);     

  lcd.begin(16, 2);

  lcd.print("ENGINEERS GARAGE");

  lcd.setCursor(0, 1);

  lcd.print("KEYBOARD to XBEE");

  

  keyboard.begin(DATA_PIN);                        // initialize the PS2 keyboard


  Serial.begin(9600);

  Serial.println("ENGINEERS GARAGE");

  delay(1000);

  digitalWrite(9, HIGH);  

}


void loop()

{

  if(keyboard.available())            // check if there is any data coming from the keyboard

  {

    char dat = keyboard.read();             // read the data from the keyboard

    Serial.write(dat);

  }else;

}

Credits

TechnicalEngineer

TechnicalEngineer

4 projects • 49 followers

Comments