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
Or 1 x Arduino PHPoC WiFi Shield 2 x LINK_MAIN_PHPOC_WIFI_SHIELD
Or you can buy the following sensor kits:
1 | × | DIYables Sensor Kit (30 sensors/displays) | |
1 | × | DIYables Sensor Kit (18 sensors/displays) |
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
- Declare other objects depending on your application.
- Initialize PHPoC [WiFi] Shield:
The complete skeleton code
Upload the above code to Arduino. If succeeded, Serial Monitor shows something like below:
- If using WiFi
- If using Ethernet
※ 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.