6

How can I run a webserver in a Arduino Uno? I want to use my Arduino to monitor things in my home such as temperature. I want to be able to access this data through the internet.

tstew
  • 729
  • 1
  • 6
  • 26

2 Answers2

2

You'll need something like the Ethernet Shield to connect your Arduino Uno to a LAN.

As for webserver functionality, the Webserver Example sketch does the bulk of what you need.

enter image description here

For the "access this data through the internet" part, assuming you want access beyond your LAN; you'll need to perform Port Forwarding on your local router (i.e. allow the "Internet" to see your Arduino).

If you need wifi, then personally I prefer the CC3300 to the Arduino Wifi shield.

Peter Bloomfield
  • 10,982
  • 9
  • 48
  • 87
akellyirl
  • 2,156
  • 1
  • 15
  • 19
2

The Arduino Yún has been made with this use case in mind. The Bridge library allows your sketch to publish data such as sensor readings: this data is available through a REST api.

Say you want to publish the temperature of your living room: you'll write something like

Bridge.put("living_room", String(19)); //celsius

You can then access the data via web with a URL like

http://arduino.local/data/get/living_room

You can get all sensor readings without specifying the key name, with

http://arduino.local/data/get

Federico Fissore
  • 1,281
  • 7
  • 10