Instructables
Picture of Introduce

Last time we have achieved “Interact AT command between pcDuino and Spyder” via USB port of pcDuino, today we are going to use the UART(GPIO 0, GPIO 1) on pcDuino to achieve powerline communication for pcDuino.

 
Remove these adsRemove these ads by Signing Up

Step 1: Diagram

Picture of Diagram
Power2.jpg

1. Connect Spyder’s pin 2 to GPIO 1 on pcDuino, spyder’s pin 3 to GPIO 0 on pcDuino, pin 10 to GND of pcDuino.

2.Connect the powerline interfaces of these two spyder and power them up( DC5-12V).

3.Power up pcDuino.

Step 2: Part list

  1. pcduino V2 x 1
  2. pcduino lite Wifi x 1 (Two pcDuino V2 would also be acceptable.) s
  3. pyder x 2
  4. jumper wires

Step 3: Sample Code

/*************

…. **************/ The code in above structure can achieve interacting AT command between pcDuino and Spyder, but this time we use UART of pcDuino instead of USB port. You can cancel the comments to see how it goes if you want, but do not forget to add these comments to the original code without comments. Code for pcDuino Lite wifi:

#include 
/*********************
static unsigned char i = 0;
void setup(){Serial.begin(9600);}
void loop(){if(i == 0)
{Serial.print(“+++”);
printf(“+++ have send!\n”);}
else if (i == 1)
{Serial.print(“ATSN”);Serial.print(‘\n’);
printf(“ATSN have send!\n”);}
else if (i == 2)
{Serial.println(“ATEX”);
printf(“ATEX have send!\n”);}
while(Serial.available() > 0)
{printf(“%c”,Serial.read());}i++;delay(3000);}
************************/void setup()
{Serial.begin(9600);}
void loop(){Serial.println(“Lite Wifi:520linksprite!”);
delay(1000);
while(Serial.available() > 0)
{char c = Serial.read();
printf(“%c”,c);}}
Code for pcDuino V2:
#include 
/********************* 
static unsigned char i = 0;
void setup(){Serial.begin(9600);
} 
void loop()
{ 
if(i == 0)
{Serial.print(“+++”);
printf(“+++ have send!\n”);
}
else if (i == 1)
{
Serial.print(“ATSN”);
Serial.print(‘\n’);
printf(“ATSN have send!\n”);}
else if (i == 2){Serial.println(“ATEX”);
printf(“ATEX have send!\n”);}
while(Serial.available() > 0)
{
printf(“%c”,Serial.read());
}
i++;delay(3000);}************************/
void setup(){Serial.begin(9600);} 
void loop()
{Serial.println(“Pcduino V2:520linksprite!”);
delay(1000);
while(Serial.available() > 0)
{char c = Serial.read();printf(“%c”,c);}}

Step 4: Result

Picture of Result
powerline3.jpg

You may search useful information online about how to get Arduino-ish API and compile it on pcDuino.

Screen shot on pcDuino Lite Wifi :

Screen shot on pcDuino V2:

pcDuino Lite wifi sends “Lite Wifi: 520linksprite” to spyder via UART from the code, the message shows up on pcDuino V2. Similarly, pcDuino V2 sends “pcDuinov2: 520linsprite” to Spyder via UART, the message shows up on pcDuino Lite wifi.

Step 5:

Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!