This content serves as a comprehensive guide on utilizing the W5300 TOE Shield in conjunction with the Arduino IDE. It provides step-by-step instructions for seamlessly connecting a DHT11 sensor to the shield, enabling users to effortlessly retrieve sensor readings. Furthermore, it elucidates the procedure for transmitting these obtained values to the Beebotte cloud through MQTT communication protocol. The integration with Beebotte facilitates the visualization of the sensor data, allowing users to gain valuable insights and analyze the information gathered. By following this guide, individuals will acquire a thorough understanding of how to harness the power of the W5300 TOE Shield and Arduino IDE to effectively process and share sensor data for various applications.
1. ComponentTo use the W5300 TOE Shield on Arduino IDE, you must use the STM Nucleo F429ZI board. Other boards are not yet compatible.
Hardware
- W5300 TOE Shield
- STM32 Nucleo-F429ZI Board
- DHT11: Humidity & Temperature sensor
Software
- Arduino IDE
- Beebotte Cloud
2.1. Configure Arduino IDE
1) Add additonal boards manager URLs
To access the "Additional Boards Manager URLs" in the Arduino IDE, navigate to File > Preferences
. Here, you can find the option to add a new URL by copying and pasting the link provided below.
https://github.com/stm32duino/BoardManagerFiles/raw/main/package_stmicroelectronics_index.json
2) Add libraries
Download this repository W5300-TOE-Arduino.
To copy the Ethernet and FMC folders from the repository, paste them into the following directory on your computer.
C:\\Users_YOUR_NAME_\\AppData\\Local\\Arduino15\\libraries
3) Install board manager
Install "STM32 MCU based boards" in the Board Manager of the Arduino IDE.
After going through this process, you are now ready to use the W5300 TOE Shield in the Arduino IDE.
3. Connect to Cloud3.1. Create dashboard
After connecting to Beebotte, click on the Create New
button to go to the channel creation page. Set the board name, the name and type of the resource you want to use, and create the channel.
Once the channel is created, you can check the token of the channel. Copy and save it for future use.
For each temperature and humidity resource, create a Basic Value widget and a Timeline Chart widget.
After creating the widgets, you may notice that the values are empty as shown below.
3.2. Hardware wiring
First, combine the W5300 TOE Shield with the STM32 Nucleo-F429ZI Board. The DHT11 sensor has a total of 3 pins: VCC, GND, and DATA. Connect these pins to the W5300 TOE Shield as follows:
3.3. Upload file
I referred to the code in the tutorial provided on the Beebotte github.
https://github.com/beebotte/bbt_arduino_examples/blob/master/examples/TempHumidReporting.ino
Change the DHT pin number to 13 and replace the token with the token value copied from above. Also, replace the channel name and resource name with the name you created.
#define DHTPIN 13 // Pin which is connected to the DHT sensor.
#define DHTTYPE DHT11 // DHT 11
#define TOKEN "token_r1lU01IeA5w4k9L2" // Set your channel token here
#define CHANNEL "W5300TOE" // Replace with your channel name
#define TEMP_RESOURCE "temperature" // This is where we will store temperature
#define HUMID_RESOURCE "humidity" // This is where we will store humidity
// Initialize DHT sensor.
DHT dht(DHTPIN, DHTTYPE);//
The previous code used the Domain name of Beebotte MQTT, but since the DNS was not functioning properly, it was set to connect via IP. Replace all the values, except g_target_ip, with values that correspond to your own network settings.
byte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};
byte g_target_ip[] = {54, 221, 205, 80};
IPAddress ip(192, 168, 56, 177);
IPAddress myDns(8, 8, 8, 8);
IPAddress gateway(192, 168, 56, 2);
IPAddress subnet(255, 255, 255, 0);
void setup() {
// ...
client.setServer(g_target_ip, 1883);
// client.setServer(BBT, 1883);
// ...
}
You can check the entire code on the GitHub repository. Now it's time to upload the code. Navigate to Tools > Board
and select "Nucleo-144" from the list of board options.
Next, go to Board part number
and select "Nucleo-F429ZI"
from the list. And once you select the port connected to the board, the upload preparation will be complete. Now you can upload the sketch file to the board.
Now, return to the Beebotte cloud dashboard and you should see that the sensor values are being visualized.
This content is invaluable for individuals seeking to leverage the W5300 TOE Shield and Arduino IDE to streamline the process of gathering sensor data and visualizing it through the Beebotte cloud. By following the instructions provided, users can unlock a world of possibilities for monitoring and analyzing sensor readings, enabling them to make informed decisions and develop innovative applications.
Comments
Please log in or sign up to comment.