Electronic – arduino – Can you turn on / off LEDs from a webpage (javascript) via a microcontroller (arduino)

arduinoledmicrocontroller

I would like to use an Arduino microcontroller (with whatever shield necessary) to control LEDs. My challenge is how to get users to interact with a javascript-driven webpage to send a signal to the microcontroller to blink an LED.

Best Answer

The software could combine the arduino examples blink with webserver.

The hardware to run the web server on the arduino would be either the Ethernet or WiFi shield. Alternatively, you may want to run the server on another machine and use the USB serial link from that machine to the arduino to control whether the led is on.

The web server could set a variable when a url is posted to, and that variable could determine whether or not the blinking occurs. Ask at stack exchange or google for the javascript side to use ajax to post a value to a url when the user does something, or use a simple form with checkboxes to start with.