Arduino - PHPoC Shield

Using PHPoC Shield 2 is the easiest way to connect Arduino Uno/Mega to the Internet via Ethernet or WiFi. Except for the price, this shield has huge great features.

Hardware Required

1×Arduino UNO or Genuino UNO
1×USB 2.0 cable type A/B
1×Ethernet Cable
1×Arduino PHPoC Shield 2
1×(Optional) 9V Power Adapter for Arduino
1×(Recommended) Screw Terminal Block Shield for Arduino Uno
1×(Optional) Transparent Acrylic Enclosure For Arduino Uno

Or 1 x Arduino PHPoC WiFi Shield 2 x LINK_MAIN_PHPOC_WIFI_SHIELD

Or you can buy the following sensor kit:

1×DIYables Sensor Kit 30 types, 69 units
Please note: These are Amazon affiliate links. If you buy the components through these links, We will get a commission at no extra cost to you. We appreciate it.

About PHPoC Shield

PHPoC Shield is the name of a product line and also is the name of a product in that product line.

PHPoC Shield product line has two products:

  • PHPoC Shield (P4S-348): supports both Ethernet and WiFi. It is also called PHPoC WiFi/Ethernet Shield.
  • PHPoC WiFi Shield (P4S-347): supports WiFi only.

The code for both shields is there same. It does NOT depend on WiFi or Ethernet.

The revision 2 of these shields are PHPoC Shield 2 (P4S-348 R2) and PHPoC WiFi Shield 2 (P4S-347 R2) with some more advanced features.

The code for revision 1 is compatible with revision 2.

Revision 2 is a little bit more expensive than revision 1.

There is no difference between revision 1 and 2 in term of how to use.

In this tutorial:

  • The term "PHPoC Shields" is used for all products: P4S-347, P4S-348, P4S-347 R2 and P4S-348 R2.
  • The term "PHPoC Shield" is used for both P4S-348 and P4S-348 R2.
  • The term "PHPoC WiFi Shield" is used for both P4S-347 and P4S-347 R2.
  • Anything related to PHPoC Shield (P4S-348) is also applied for PHPoC Shield 2 (P4S-348 R2)
  • Anything related to PHPoC WiFi Shield (P4S-347) is also applied for PHPoC WiFi Shield 2 (P4S-347 R2)

Arduino communicates with PHPoC Shields via the SPI interface.

In the case of PHPoC Shield, which has both WiFi and Ethernet:

  • If you plug Ethernet cable to the Shield, the shield automatically detects and uses Ethernet.
  • If you do NOT plug Ethernet cable but plug USB WiFI Dongle to the Shield, the shield automatically detects and uses WiFi.

In terms of code, We do NOT need to distinguish between PHPoC Shield (P4S-348) and PHPoC WiFi Shield (P4S-347). The code is the same for both.

In terms of how to use, We do NOT need to distinguish between PHPoC Shield (P4S-348) and PHPoC WiFi Shield (P4S-347). We just need to distinguish how to use Ethernet or WiFi

PHPoC Shields Features

The following are features for all Shields on the PHPoC Shield product line.

  • Very easy to use
  • Supports both Ethernet and WiFi
  • Can switch between Ethernet and WiFi WITHOUT changing Arduino Code
  • Network setting (IP, WiFi SSID, password ...) is done via Web WITHOUT changing Arduino Code
  • Have an embedded web server. You can upload HTML, CSS, Javascript and image files to this shield.
  • Supports WebSocket: Data can be dynamically exchanged between Arduino and Web browser in real-time WITHOUT reloading the web page
  • Some built-in web apps are available: Allow controlling/monitoring Arduino via a Web browser WITHOUT programming web app.
  • Real-time Clock: Arduino can read date and time information from this shield
  • Supports IPv6
  • Supports TLS 1.2, TLS client certificate: allows connecting to the high-secure server such as AWS IoT Core

How to use PHPoC Shields

Ethernet

  • Stack PHPoC Shields on Arduino Uno or Mega
  • Connect PC to Arduino Uno/Mega via USB cable
  • Connect PHPoC Shields to router/access point via Ethernet cable
  • Open Arduino IDE and install the library
  • Write code and upload the code to Arduino Uno/Mega

WiFi

  • Stack PHPoC Shields on Arduino Uno or Mega
  • Connect PC to Arduino Uno/Mega via USB cable
  • Plug USB WiFi Dongle to the Shield
  • Configure WiFi SSID and password via Web according to this instruction
  • Open Arduino IDE and install the library
  • Write code and upload the code to Arduino Uno/Mega

Skeleton Arduino code for PHPoC Shield

How to program step by step

  • Include the library
#include <Phpoc.h>
  • Declare other objects depending on your application.
  • Initialize PHPoC [WiFi] Shield:
Phpoc.begin(PF_LOG_SPI | PF_LOG_NET);

The complete skeleton code

#include <Phpoc.h> void setup() { Serial.begin(9600); // initialize PHPoC [WiFi] Shield: Phpoc.begin(PF_LOG_SPI | PF_LOG_NET); } void loop() { }

Upload the above code to Arduino. If succeeded, Serial Monitor shows something like below:

  • If using WiFi
COM6
Send
log> sppc_begin: phpoc wifi shield 2, firmware 2.3.0 log> sppc_begin: package 1.5.0 log> sppc_begin: WiFi INFRA my_wifi ch9 log> sppc_begin: IPv4 192.168.0.234 255.255.255.0 192.168.0.1 8.8.8.8
Autoscroll Show timestamp
Clear output
9600 baud  
Newline  
  • If using Ethernet
COM6
Send
log> sppc_begin: phpoc shield 2, firmware 2.1.0 log> sppc_begin: package 1.5.0 log> sppc_begin: Ethernet 10BASET log> sppc_begin: IPv4 192.168.0.180 255.255.255.0 192.168.0.1 8.8.8.8
Autoscroll Show timestamp
Clear output
9600 baud  
Newline  

※ NOTE THAT:

By default, the PHPoC Shields use the dynamic IP address (via DHCP). If you want to use the static IP address, just do the setting via web.

Now you can use this shields to connect Arduino to Internet. See other example on See Also part.

WARNING

Note that this tutorial is incomplete. We will post on our Facebook Page when the tutorial is complete. Like it to get updated.

The Best Arduino Starter Kit

※ OUR MESSAGES