Any AVR microcontroller based board which follows the standard Arduino schematic and is flashed with the Arduino bootloader can be called an arduino board. The arduino boot-loader enables different Arduino boards to be connected and programmed with the Arduino IDE. The Arduino board used in this project is the Arduino pro-mini board and the IDE version of the arduino is 1.0.3 for windows.
The image of the Arduino pro-mini board and the Arduino IDE are shown below:
Since the Arduino pro-mini board has no circuitary for interfacing it with the serial port or the USB port of the PC, an external USB to TTL converter board is required to connect it with the PC. This hardware helps in programming the Arduino board and also helps in the serial communication with the USB port of the PC.
It is assumed that the reader has gone through the project how to get started with the Arduino and tried out all the things discussed there.
The GSM module used in this project is a SIM900 based module which can communicate with other devices using RS232 serial communication port. It works on 9V power supply and the image of the same is given below:
The keyboard always has 6 pin mini-DIN male connector for PS2 interface and the host device always has the corresponding female pin. The images and the pin-outs of the PS2 male and female connectors are shown in the following image, the only difference between the PS2 keyboard and mouse connectors are in their color.
The image of the PS2 male pin
The image of the PS2 female pin
The pin-out of the PS2 male and female connectors
When it comes to connecting the female connector with the circuit board one should be able to identify the pins at the bottom of the PS2 connector and the following image will be helpful.
The implementation of the project which can receive the data from the PS2 keyboard and use them to make a call using the GSM module is represented using the following block diagram:
The code written for this project reads the data from the PS2 keyboard using the custom PS2 library file called “PS2Keyboard.h” which has all the necessary routines for accessing a PS2 keyboard. There are basically three functions which the user can directly make use in their code and are namely “keyboard.begin()”,keyboard.available() and “keyboard.read()”. The details of how to use these functions to interface a PS2 keyboard is already discussed in a previous project on how to interface the PS2 keyboard with the Arduino.
The Arduino is able to communicate with the GSM module using AT commands. The AT commands are send or received from the module using the serial communication functions provided by the Arduino library. The functions like Serial.begin() which helps to initialize the serial port with a given baud rate, Serial.write() to send a data to the serial port, Serial.available() and Serial.read() functions to read data from the serial port are used in this project and they are already discussed in previous projects on how to do serial communication with the Arduino, how to send and receive serial data using arduino and how to do serial debugging with the Arduino.
GSM modules respond “OK” when it receives the command “AT” and it is the best way of check communication between the module and the microcontroller. The command for making a call to a number is “ATD”;
SYNTAX: ATD<Phone number>;(Enter)
The code is written in such a way that it sends the string “ATD” first and then waits till the user enters the required phone number and presses enter. As the user press each key the same number is read from the Keyboard and send them to the GSM module serially until the user press the ENTER key. Once the user press the enter key the rest of the command for making a call ie. “;” the semicolon and carriage return “;’\r” are send to make a call.
Try to send the command using the PC with the help of any serial monitoring software and make sure that the module is making a call to the specified number. Then one can verify and upload the code which can send the same commands to the Arduino board as explained in the project how to get started with the Arduino. Make sure that the GSM module has been turned on at least 2 minutes before the Arduino board starts sending the commands so that the GSM can establish a communication with the cellular network corresponding to the SIM card inserted in it.