My repository for my prototype Home Lab using an Arduino R4 as the server. Just experimenting with connecting to the device and having it manipulate LEDs and display messages on an LCD.
Note: The two main .ino scripts in this repo (WiFi_LCD_Prototype.ino and WiFi_WebServer_LED_Blink.ino) were not written by me; they are based on example code provided by Arduino and other open-source resources. My main contributions are in adapting the code for my hardware setup, handling the wiring, and integrating the different components into a working prototype.
Wiring Diagram: Diagram NOT MINE
Sets up the Arduino R4 as a Wi-Fi Access Point that hosts a simple web server. Users can connect to the access point and use a browser to control the onboard LED (turn it on/off).
-
Upload the Code:
- Ensure your Wi-Fi credentials (
SECRET_SSIDandSECRET_PASS) are in thearduino_secrets.hfile. - Upload the code to your Arduino R4 using the Arduino IDE.
- Ensure your Wi-Fi credentials (
-
Connect to the Access Point:
- Find the SSID you set in the
arduino_secrets.hfile. - Connect using the password from
SECRET_PASS.
- Find the SSID you set in the
-
Access the Web Interface:
- Open a browser and go to the IP address shown in the Serial Monitor (default:
192.168.4.1). - Use the provided links to turn the LED ON or OFF.
- Open a browser and go to the IP address shown in the Serial Monitor (default:
-
Upload the UDP Code:
- Upload the UDP code to your Arduino R4. Ensure your Wi-Fi credentials are correctly configured in the
arduino_secrets.hfile.
- Upload the UDP code to your Arduino R4. Ensure your Wi-Fi credentials are correctly configured in the
-
Run the Python Script:
- Use the provided Python script to send messages to the Arduino R4.
- Example script:
import socket import time server_ip = "192.168.4.1" # Replace with your Arduino's IP server_port = 2390 messages = ["Hello Arduino!", "Testing this out!", "Pretty cool!"] sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) for message in messages: sock.sendto(message.encode(), (server_ip, server_port)) print(f"SENT MESSAGE TO: {server_ip} - {message}") time.sleep(2) # Wait for 2 seconds before sending the next message
-
View Messages on the LCD:
- The messages sent from the Python script will appear on the Arduino's connected LCD screen.


