Introduction: Remote Monitor Arduino With IPhone Via 3G/4G/Wifi

Picture of Remote Monitor Arduino With IPhone Via 3G/4G/Wifi

This instructable describes how to set up Arduino to use MeasView app. In the app it is possible to name the sensors and units which are used, so you'll have nice monitoring view with the sensor names and units. Measurements can be updated just once or continuously with 10 second interval.

With the code and port forwarding you can monitor your Arduino where ever you are, you just need internet access to your iPhone (3G/4G/Wifi). Another code is given for local Wifi use only in case you don't prefer port forwarding. General description of router's configuration is given to get port forwarding to work.

Basically all analog sensors which are meant to be used with Arduino can easily be used in this system. Digital sensors can be used as well, but it requires little bit more work to get them work. However, at least one example code with digital sensors is attached, so you'll get the idea. Later i'll release app which allows you to use more than two sensors.

Download the app from:

App for 6 sensors:

www.appstore.com/MeasView

References:

http://www.raywenderlich.com/5492/working-with-jso...

Step 1: Arduino Code

The Arduino code you'll need is attached. There is few things you must change in the code to get it work with your router and sensors.

In the very beginning you can define the input ports you want to use

int sensorPin1 = A0; //<--- you can change the channel if you prefer to use another channel
int sensorPin2 = A1; //<--- you can change the channel if you prefer to use another channel

Next thing you have to set is your local ip and your public ip

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};
byte ip[] = {192, 168, 0, 177}; //<--- set your local ip which you must forward from your router's settings

byte gateway[] = {xx, xx, xx, xx}; // <-- set your public ip address,

// you can check it from e.g www.whatismyip.com

byte subnet[] = {255, 255, 255, 0}; // <--- set your submask. Default is quite commonly used

EthernetServer server(2255); //<--- set the port you want to use. 80 is default,

// but it is recommended to use another port.

// Notice that this is the port number you have to forward.

Step 2: Needed Hardware and Connecting the Sensors

Picture of Needed Hardware and Connecting the Sensors

Building this system is easy and not much HW is needed. You'll need Arduino Uno or Mega + ethernet shield, internet router and sensors you want to use.

Any wirings diagrams aren't added because, wirings depends on the sensors used. By default A0 and A1 analog ports are used so those should be used. By modifying the code ports used can be modified. If you want to use digital channel(s) that won't be a problem.

There is plenty of instructions how to connect different analog sensors. Here is few for example:

https://www.instructables.com/id/Soil-Moisture-Sens...

https://www.instructables.com/id/Temperature-Sensor...

http://playground.arduino.cc/Learning/PhotoResisto...

If you are building the system according to the digital sensor example code check DHT111 wiring from google it's easy to find. As said in the code you have to connect DHT111 data pin to Arduino's digital pin 8. Just remember to add 4.7 K resistor between data pin and +5V pin. All libraries you'll need are attached.

Step 3: Port Forwarding

Picture of Port Forwarding

Port forwarding should be doable with most of the routers. It is done by connecting to router and opening settings. In simplest case you can get connection to your router by typing 192.168.0.1 to your browsers address row. The ip may vary and you should check it from your router's manual. Once you have established connection successfully search settings. Usually in settings there is something like Gaming & applications. Try to look for that and if you manage to find it go there, otherwise, try to look something that seems similar. Then go to port forwarding range or similar and set the ip and port you are defined in the code. In the example the ip is 192.168.0.177 and port 2255. Remember to enable the ip and port. Save settings and you are done.

Now you should be able to monitor your Arduino from everywhere. Just remember to use your public ip which is different than the one you just set to your port forwarding settings and don't forget to use the port. The port is the one you defined in port forwarding settings. Hopefully that was clear enough.

Comments

SergeD13 (author)2016-12-27

HI,

I'm Really interrested in ur iphone application and i installed it already.
In fact i have a Recently bought a Arduino Mega card with a ES8266 shild made on " https://fr.aliexpress.com/item/Mega-WiFi-R3-ATmeg... "

and i would like be able to use directly on WIFI with ur application.

My "little" problem is ur ino are writen to work with ethernet. I'm not that good to be able to do the modification directly.

I will like u can help me to do.

This kind of boards is new and it is not easy to find exemple or help online.

I just know how to communicate and check the two boards, on AT commands.

Thank you a lot in advance.

Serge

PS If u are ok we can exchange Mail Adress

siNpez (author)SergeD132016-12-28

I'm not familiar with that board, but I've played with ESP8266 itself and the app works fine with it. So it should definitely be doable with your board as well. You could check this tutorial and see how to the Wifi part is done http://www.elec-cafe.com/esp8266-temperature-humid...

Remove all DHT11 related stuff if you don't have one and use analog sensor connected to A0 instead. You may use normal analogRead to read the value. You should replace the html part by the example code of this instructable.

irinak1 (author)2015-08-04

Hi,

I’m irinakim and I’m work in the Wiznet.

Thank you for using our product.

We are collecting so much data using our product.

And I will post the this project on our Web site.( http://wiznetmuseum.com)

Can I post your product on our Web site?

siNpez (author)irinak12015-08-05

Sure, no problem.

seamster (author)2015-07-03

Nicely done. Thanks for sharing this!