Wiznet makers

Hannah

Published November 02, 2023 ©

33 UCC

10 WCC

1 VAR

0 Contests

0 Followers

0 Following

Original Link

Simple-IOT

Arduino JSON Server with the w5100 Ethernet Shield + a React Native App to measure temperature and turn a LED on and off

COMPONENTS Hardware components

WIZnet - W5100 ethernet shield

x 1


PROJECT DESCRIPTION

This project showcases an Arduino-based JSON server that utilizes the W5100 Ethernet Shield for network connectivity. It monitors an LM35 temperature sensor and controls an LED while providing data over HTTP requests in JSON format. Here are the key highlights and features of the project:

Components Used:

  • Arduino board with Ethernet Shield (W5100).
  • LM35 temperature sensor (analog input on A0).
  • LED (connected to digital pin 2).

Network Configuration:

  • The Arduino is assigned a unique MAC address for network identification.
  • It has a specific IP address (192.168.0.80) within the local network.
  • The gateway and subnet mask values are set to match the local network configuration.

Functionality:

  • The Arduino reads the LM35 temperature sensor to obtain temperature data.
  • It tracks the maximum and minimum temperature values observed.
  • The LED can be remotely controlled via HTTP requests. Sending "turnOn" turns the LED on, and "turnOff" turns it off.
  • The collected data, including temperature, maximum and minimum temperature, and LED status, is provided as a JSON response when accessing the server.

Web Server:

  • The Arduino runs a web server on port 80 to listen for incoming client connections.
  • It handles HTTP requests, and upon receiving a request, it provides a JSON response with temperature and LED status information.
  • The response includes HTTP headers to ensure proper communication.

Serial Monitoring:

  • The Arduino can be monitored through a serial connection to view temperature readings and LED status changes.

Temperature Tracking:

  • The project tracks the maximum and minimum temperature values observed, providing valuable data for monitoring temperature trends.

This project serves as an example of how to create a simple web server using an Arduino with Ethernet connectivity, read sensor data, and respond to client requests with JSON-formatted data. It also demonstrates how to control a peripheral (LED) remotely via HTTP requests.

Documents
Comments Write