Pages

Wednesday, 10 June 2015

XBEE

Xbee Series 2 Point To Point Communication

XBee is very easy and popular wireless device. It is a transceiver, it can transmit data wirelessly and it can also receive data wirelessly. There are several types of XBee module and it might be confusing. The very popular XBee is Series 1 (802.15.4), comes with the firmware to create connection for point to point or star network. But bear in mind, many people actually thought it is using ZigBee protocol, but it is not compliance to ZigBee because it uses the low layer of ZigBee protocol only. Therefore XBee Series 1 (S1) cannot communicate with ZigBee device in the market. Anyway I don think many care because they just want to communicate among XBee, or wanted to have simple wireless communication. The XBee or XBee PRO is basically the same protocol, just PRO module have better transmit power and better receiver sensitivity. So I will be talking about XBee only, not the PRO. XBee Series 2 (ZB) does not offer any 802.15.4-only firmware; it is always running ZigBee mesh firmware. It is the new XBee module that we are carrying now. XBee S2 have better performance when you talk about mesh networking where it involve quite a lot of nodes: Coordinators, Routers and End Devices. You can read the datasheet if you want to, but I am going to talk about point to point only, Bear in mind, XBee S2 cannot communicate with XBee S1, it is not compatible in term of wireless communication.



Working 

Assuming you have done installing USB driver and X-CTU, and the USB of SKXBee is plug in properly, you should see the POWER LED on SKXBee ON. There are two XBee S2 modules needed to be setup. I will show the 1st XBee S2 module setup, which I named it Coordinator 1. 2nd XBee S2 module will be Router 1.

Coordinator

You can choose either one of the XBee S2 to configure as coordinator. At the end, the host do not know which is which as XBee will become transparent once it is setup correctly.

Launch X-CTU



Choose the COM Port, normally is the largest number. Easily you will see it because it is label as USB Serial Port (COM X). In this example is COM10. Your COM port might be different than mine, just choose those that being label as USB Serial port and click “Test/Query”.



If the baudrate and COM port number is correct, the X-CTU will display simple information such as modem type, firmware version and serial number. If there is no response, choose the other COM port and ensure the baudrate is 9600 (default).



Proceed to the right tab on X-CTU, Modem Configuration. Click “Always Update Firmware” and click “Read” to grab data from XBee S2 module. Choose “ZIGBEE COORDINATOR AT” under Function Set, Set a preferable PAN ID, I simply set “1234”. You can also set the Node ID, I set “COORDINATOR1” as node ID, this is not critical. Record the SH and SL ID on this XBee S2 module, you will need it to set Router module. In my case, the SH is 13A200, SL is408C1470. This is Coordinator Source Address. Click “Write” and X-CTU will start loading the parameter you just set.



It will take around 30 seconds to 1 minute to complete the loading.




We will need to configure Coordinator again when you get the SH and SL of router . For the time being, we are done for Coordinator. You can close X-CTU now.

Router

 If you have another SKXBee, connect it to your computer with another XBee S2 plug in. I will be using the same SKXBee, so I actually exchange the XBee 2S on it.
Launch X-CTU
Choose the COM Port, should be different number than the earlier SKXBee. Your COM port might be different than mine, just choose those that being label as USB Serial port and click “Test/Query”.


If the baudrate and COM port number is correct, the X-CTU will display simple information such as modem type, firmware version and serial number. If there is no response, choose the other COM port and ensure the baudrate is 9600 (default). Proceed to the right tab on X-CTU, Modem Configuration. Click “Always Update Firmware” and click “Read” to grab data from XBee S2 module.


Choose “ZIGBEE ROUTER AT” under Function Set, Set a preferable PAN ID, I simply set “1234”. You can also set the Node ID, I set “ROUTER1” as node ID. This is not critical. Record the SH and SL ID on this XBee S2 module, you will need it to set Coordinator module. In my case, the SH is 13A200, SL is4086A429. Key in the DH and DL address using the SH and SL from Coordinator module. My case is DH: 13A200, DL: 408C1470. Click “Write” and X-CTU will start loading the parameter you just set. It will take around 30 seconds to 1 minute to complete the loading. OK, we are done with Router module. If you like to check, you can go to Terminal tab and key in this command.

Typing “+++” will ask XBee module to enter command mode and will response with “OK”. ATVR request for firmware version, and XBee will reply, my is 22A7 ATID request for PAN ID ATNI request for Node ID, which is ROUTER1 that I just set ATDL request for Destination Low Address ATSL request for Source Low Address ATCN force XBee module to exit command mode. Is fine if you don enter ATCN, after 5 seconds if there is no UART activity, XBee module automatic exit

command mode

Again, Coordinator Do not forget, we need to set the DH and DL on Coordinator XBee S2 module. Again, plug in Coordinator XBee S2 module, open X-CTU, read the information,  and set the DH and DL that you grab from router’s SH and SL. Click write to load the parameters into XBee module.


Done OK, now both this XBee S2 modules are setup and linked together, once they are powered, they are paired. sending data via UART to one of the XBee module will automatically being transmitted wirelessly to the other XBee module and further transmit out from the UART, and this apply for both way. Here I have install two SKXBee with Coordinator and Router that we setup. Connected to COM10 and COM25.

If you notice, the DL and SL is paired up. I enter command mode to grab the information we configured and exit the command mode with ATCN. the following text after ATCN and OK is actually happening in transparent mode. The text you type in Router1 XBee will transmit to Coordinator1 XBee and display on terminal and vise versa. Now, you can use this pair of XBee S2 as wireless point to point communication. It has become same as the XBee S1 if you configure the DL and SL correctly.

Tuesday, 9 June 2015

XBee

ABOUT XBee

XBee is very easy and popular wireless device. It is a transceiver, it can transmit and it receive
data wirelessly. There are several types of XBee module. The very popular XBee is Series 1
(802.15.4), comes with the firmware to create connection for point to point or star network. But
bear in mind, many people actually thought it is using ZigBee protocol, but it is not compliance
to ZigBee because it uses the low layer of ZigBee protocol only

SOFTWARE
XCTU V6.1.0.


Click on add devices



Choose your corresponding comport



Click on finish





Click on update firmware

























In order to make sure the Soft AP mode working on the Xbee WiFi module. First, I search
the WiFi with “RDL WIFI” SSID using my Android phone, and connect to it.



Click on connect

Tuesday, 2 June 2015

REGULATED POWER SUPPLY

OVERVIEW


INTRODUCTION



The regulated power supply accepts unregulated inputs from 9V to 15V AC or DC and gives regulated output of 3.3V, 5V and 12V suitable for projects which needs precise voltage to work. The input can come from step down transformer. Since board has Diode Bridge input polarity does not matter.All outputs are brought to screw terminal. There is also an unregulated output voltage to drive high current loads like relays and motors.


FEATURES

  • Input Voltage AC/DC 0-12.
  • Output Voltages +3.3V +5V, +12V.
  • Inputs and output connected to terminal blocks.
  • Maximum Load 1 Amps.
  • LED Indicator.
  • All outputs to Screw Terminal.

APPLICATIONS

  • Mobile Phone power adaptors
  • Regulated power supplies in appliances
  • Various amplifiers and oscillators


RELATED PRODUCTS


BREAD BOARD POWER SUPPLY                     XBEE USB POWER SUPPLY BOARD


3-AXIS ACCELEROMETER









8 RELAY INTERFACING BOARD

               12V

OVERVIEW



The board has eight relays driven by ULN2803 IC. The board works on 12V but the input signal can come directly from microcontroller output working at 5V to control relays. Each relay can switch variety of AC or DC high voltage, high current loads working at 110V or 220V AC mains like lights, fans, motors and such. The status of relay is indicated by individual LEDs.

FEATURES

  • LED indication for relay & power supply. 
  • Design based on highly proven IC ULN2803 as driver. 
  • Direct input 5V microcontroller for relay control.
  • High Current (8A) Capability.
  • AC or DC Operating Voltages.
  • No Leakage Current.
  • Input Pin connected to Burg stick
  • High quality PCB FR4 Grade with FPT Certified.

CIRCUIT DIAGRAM


PIN DIAGRAM


CONNECTION DIAGRAM


1.     ATMEL


CODE:
http://forum.researchdesignlab.com/8%20RELAY%20BOARD/ATMEL/8%20RELAY.c


2.     PIC



CODE:
http://forum.researchdesignlab.com/8%20RELAY%20BOARD/PIC/8%20RELAY.c






8 KEYS KEYPAD

OVERVIEW

INTRODUCTION





It has 8 keys which can be connected to any microcontroller or any interfacing kit directly. KEY is a small key pad designed to data entries for microcontroller board.The board has 10-pin header for 10-wire ribbon cable. By default the switch status would be pulled up, every time you press a key the corresponding switch header changes its state to the common header in the board.



FEATURES



  • 8 keys.
  • Connect to microcontroller's pin directly.
  • 10-pin header.
  • Input pins conneceted to Burg-stick
  • On board pull-up resistors
  • High quality PCB FR4 Grade with FPT Certified.



ARUDUINO CODE
#include <LiquidCrystal.h>
LiquidCrystallcd(12, 11, 5, 4, 3, 2);

constintsw1 = 0 ;    
constintsw2 = 1;
constintsw3 = 2;
constintsw4= 3 ;
constintsw5= 4 ;
constintsw6= 5 ;
constintsw7= 6 ;
constintsw8= 7;


void setup() {

lcd.begin(16, 2);
pinMode(sw1, OUTPUT);
pinMode(sw2, OUTPUT);
pinMode(sw3, OUTPUT);
pinMode(sw4, OUTPUT);
pinMode(sw5, OUTPUT);
pinMode(sw6, OUTPUT);
pinMode(sw7, OUTPUT);
pinMode(sw8, OUTPUT);
}

void loop()
{
  if(sw1==HIGH)
  {
lcd.print("switch 1 is pressed");
  }
  else if(sw2==HIGH)
  {
lcd.print("switch 2 is pressed");
  }
  else if(sw3==HIGH)
  {

lcd.print("switch 3 is pressed");
  }
  else if(sw4==HIGH)
  {
lcd.print("switch 4 is pressed");
  }
  else if(sw5==HIGH)
  {
lcd.print("switch 5 is pressed");
  }
  else if(sw6==HIGH)
  {
lcd.print("switch 6 is pressed");
  }
  else if(sw7==HIGH)
  {
lcd.print("switch 7 is pressed");
  }
  else if(sw8==HIGH)
  {
lcd.print("switch 8 is pressed");
  }
}



2 KEYS KEYPAD                                                               4 KEYS KEYPAD





2 KEYS KEYPAD

OVERVIEW


2 Keys Keypad can be connected to any microcontroller or any interfacing kit directly. KEY is a small keypad designed to data entries for microcontroller board. The board has 4-pin header for 4-wire ribbon cable. By default the switch status would be pulled up, every time you press a key the corresponding switch header changes its state to the common header in the board.


FEATURES



ARUDUINO CODE


#include <LiquidCrystal.h>
LiquidCrystallcd(12, 11, 5, 4, 3, 2);

constintsw1 = 0 ;    
constintsw2 = 1;



void setup() {

lcd.begin(16, 2);
pinMode(sw1, OUTPUT);
pinMode(sw2, OUTPUT);

}

void loop()
{
  if(sw1==HIGH)
  {
lcd.print("switch 1 is pressed");
  }

  else if(sw2==HIGH)
  {
lcd.print("switch 2 is pressed");
  }


}

2 RELAY BOARD

   12V

OVERVIEW


The board has two relay driven by TTL circuit . The board works on 12V but the input signal can come directly from microcontroller output working at 5V to control relays. Each relay can switch variety of AC or DC high voltage, high current loads working at 110V or 220V AC mains like lights, fans, motors and such. The status of relay is indicated by individual LEDs.


FEATURES

  • LED indication of relay on & power 
  • Design based on highly proven TTL  as driver
  • Direct input  5V microcontroller for relay control
  • High Current (8A) Capability.
  • AC or DC Operating Voltages.
  • No Leakage Current.
  • Eliminates costly isolation relays and wiring.
  • High quality PCB FR4 Grade with FPT Certified.

CIRCUIT DIAGRAM

SCHEMATIC



CONNECTION DIAGRAM


CODE:

1.     ATMEL


#include<reg51.h>

#define LCD_PORTP2
sbitrs=P3^5;
sbit en=P3^7;
sbitD7=P2^7;
sbitrw=P3^6;

#define RELAY P1

void busy();
void CMD_WRT(unsigned char);
void LCD_WRT(unsigned char *);
void DATA_WRT(unsigned char);
void DELAY();
void main()
 {
 unsigned char CMD[]={0x38,0x0f,0x01,0x06,0x80},TEMP,i;
 for(i=0;i<=2;i++)
   {
    TEMP=CMD[i];
CMD_WRT(TEMP);
   }

  RELAY=0x00;
  while(1)
  {
CMD_WRT(0X01);
CMD_WRT(0X80);
LCD_WRT("2 RELAY BOARD");
  DELAY();
  DELAY();
  RELAY=0x01;
CMD_WRT(0X01);
CMD_WRT(0X80);
LCD_WRT("1st RELAY ON");
  DELAY();
  DELAY();
  DELAY();
  DELAY();
  RELAY=0x00;
  RELAY=0x02;
CMD_WRT(0X01);
CMD_WRT(0X80);
LCD_WRT("2nd RELAY ON");
}
 }
void busy()
{
D7=1;
rs=0;
rw=1;
        while(D7!=0)
        {
                en=0;
                en=1;
        }
}

void CMD_WRT(unsigned char val)
{
        busy();
LCD_PORT=val;
rs=0;
rw=0;
        en=1;
        en=0;
}

void LCD_WRT(unsigned char *string)
{
        while(*string)
DATA_WRT(*string++);
}
void DATA_WRT(unsigned char ch)
{
        busy();
LCD_PORT = ch;
rs=1;
rw=0;
        en=1;
        en=0;
}
void DELAY()
{
        unsigned int X=600000,Y=600000;
        while(X--);
        while(Y--);
}


2.     PIC

sbitLCD_RS at RB4_bit;
sbitLCD_EN at RB5_bit;
sbitLCD_D4 at RB0_bit;
sbitLCD_D5 at RB1_bit;
sbitLCD_D6 at RB2_bit;
sbitLCD_D7 at RB3_bit;

sbitLCD_RS_Direction at TRISB4_bit;
sbitLCD_EN_Direction at TRISB5_bit;
sbitLCD_D4_Direction at TRISB0_bit;
sbitLCD_D5_Direction at TRISB1_bit;
sbitLCD_D6_Direction at TRISB2_bit;
sbitLCD_D7_Direction at TRISB3_bit;

char RELAY at PORTD;

void main() {
PORTD=0x00;
Lcd_Init();                        // Initialize LCD
Lcd_Cmd(_LCD_CLEAR);               // Clear display
Lcd_Cmd(_LCD_CURSOR_OFF);          // Cursor off
Lcd_Out_Cp("2 RELAY BOARD");
RELAY=0x00;
  while(1)
  {
  RELAY=0x01;
Lcd_Cmd(_LCD_CLEAR);               // Clear display
Lcd_Cmd(_LCD_CURSOR_OFF);          // Cursor off
Lcd_Out_Cp("1st RELAY ON");
Delay_ms(1000);                     // You can change the moving speed here
  RELAY=0x00;
  RELAY=0x02;
Lcd_Cmd(_LCD_CLEAR);               // Clear display
Lcd_Cmd(_LCD_CURSOR_OFF);          // Cursor off
Lcd_Out_Cp("2nd RELAY ON");
Delay_ms(1000);                     // You can change the moving speed here
  RELAY=0x00;
  }

}