An Arduino Device That Monitors Your External IP Address

[Bayres’] dad setup a webcam as a surveillance camera for a remote property. The only problem was that the only stable Internet connection they could get at this property was DSL. This meant that the external IP address of the webcam would change somewhat often; the needed a way to keep track of the external IP address whenever it changed. That’s when [Bayres] built a solution using Arduino and an Ethernet shield.

The main function of this device is to monitor the public IP address and report any changes. This is accomplished by first making a request to checkip.dyndns.org. This website simply reports your current public IP address. [Bayres] uses an Arduino library called Textfinder in order to search through the returned string and identify the IP address.

From there, the program compares this current value to the previous one. If there is any change, the program uses the Sendmail() function to reach out to an SMTP server and send an e-mail alert to [Beyres’] dad. The system also includes a small LCD. The Arduino outputs the current IP address to this display, making it easy to check up on the connection. The LCD is driven by 74HC595 shift register in order to conserve pins on the Arduino.

The system is also designed with a pretty slick setup interface. When it is booted, the user can enter a configuration menu via a Serial terminal. This setup menu allows the user to configure options such as SMTP server, email address, etc. These variables are then edited and can be committed to EEPROM as a more permanent storage solution. Whenever the system is booted, these values are read back out of the EEPROM and returned to their appropriate variables. This means you can reconfigure the device on the fly without having to edit the source code and re-upload.

42 thoughts on “An Arduino Device That Monitors Your External IP Address

    1. Agreed. this thing is redundant and total overkill. Dynamic DNS updating + free public subdomain = a better and a free solution with no required specialty hardware. He wouldn’t need to get the IP emailed to him, he could just use a regular old web address everytime.

    1. On the other hand my provider disconnects me every 23h just to change my ip. They hidden this behind clause “ISP reserves right to maintenance disconnection”. Orange Poland – the worst provider in Poland.

      1. Many ISPs in Europe do that. Reason for that is their “fixed IP” option which usually costs you more than internet connection so they do not want you to have fixed IP if you’re not paying for it. If you pay for that option they disconnect you every 24h but you get the same IP every time.

  1. The arduino can make http get requests and get the external IP of the network it is connected to.

    Then it can update a free dyndns at afraid.org using their HTTP API.

    Boom, I just made this a whole lot easier, it could even auto setup via DHCP.

    1. The best way is to run your own VPS sevice and connect to that, and for ~$3 a year a server isn’t that expensive anymore, it’s even cheaper than dyndns.

  2. Before I started reading the comments, I had checkip.dyndns.org written down on a sticky note. While reading the comments, I read that it is fee based. Now that is scratched off my sticky note and I have afraid.org, No-ip.org, and ipecho.org/plain on the sticky, Thanks commenters!

    1. Then you got things confused a bit ;)
      (dyndns the dynDNS service costs money, afraid.org and no-ip are alternatives to it. checkip.dyndns.org and ipecho.org/plain are sites that just tell you your IP address and are free)

    2. Ive been using no-ip,org for a couple years now… I am pleased with the free service enough to consider the paid. (free service requires clicking an email link and entering a Captcha once a month to keep it active.)

      I use it to keep my purchased domain name pointed at my home server.

    1. Why not just upgrade to a static ip over dsl. I have a small business and believe me, money is tight, but we run static dsl ip’s. We have to have it was because our point of sale system must talk to a server somewhere out there in the world, and they require a static ip to whitelist. I couldn’t imagine running people’s credit card info over a free to use dynamic ip provider. Oh and we have an ip cam and recorder, so yes it made perfect sense to upgrade.

      1. The data does not run through the providers network, dynamicIP providers just offer a service that seeds the worlds DNS nameservers with your domain\IP info.

        …it’s like… DynIP are the people that collate the names\numbers to print, the nameservers are the phone book and the internet is the phone system. Just because you looked the phone number up in the phone book doesn’t mean someone at the Yellow Pages office is listening to your phone call.

  3. lol this is literally the most idiotic thing I’ve seen on HaD. I honestly don’t think I could come up with a worse way of doing this.

    As others have said, there are many free DDnS solutions he could have used, most of which are probably already built in as an option on his modem, router or the camera itself.

  4. You are all correct, a free DDnS service would have been a much easier solution. I looked at many of them before putting this together. None of them would work because there was no DDnS support on the DSL modem or camera system (yes it was a cheap camera setup). The only alternative was to run a DDnS client on a PC 24/7, this wasn’t an option because there was no PC permanently at the property. Paying the ISP for a static IP would have more than doubled the price of the internet service. I’m sure there are other, better ways to do this but this worked and was low cost.

    1. If you ever find yourself revisiting this then maybe look into 3rd-party router firmware like OpenWRT or DD-WRT? In addition to supporting more DynDNS providers some firmwares also would allow you to log into the router remotely via SSH or with a browser using a built in webserver.

      3rd-party firmwares essentially turn routers into low-level linux machines… I’m sure something could even be rigged to regularly reboot the remote system… (modem, router, cameras… all of it)

      …or like you said… cheap, easy and it works- no need to go fiddling and break it, right?

  5. You are all correct, a free DDnS service would have been a much easier solution. I looked at many of them before putting this together. None of them would work because there is no DDnS support on the DSL modem or camera system (yes, it is a cheap camera setup). The only alternative was to run a DDnS client on a PC 24/7, this wasn’t an option because there was no PC permanently at the property. Paying the ISP for a static IP would have more than doubled the price of the internet service. I’m sure there are other, better ways to do this but this worked and was low cost.

  6. I have a Juiper SSG-5 router. It does DynDns. Why reinvent the wheel. That is how my dynamic IP is resolved. Way to complicated to do what was done in this article.

    Just about any router with DD-WRT will do this in 2 minutes of setup. These routers are cheap compared to a Juniper router.

  7. Already do this with my Pi. Haven’t activated the comparison part yet because I’m using it to send messages about house temp in the winter with all the cold. but that’s the next upgrade to that feature.

  8. There is another case where this would be useful.
    I have a remote site with it’s internet supplied by the mobile network. Unfortunately the modem/dongle i have doesn’t support bridged mode so the main router is actually behind the router built into the dongle. The main router never sees the real public IP address, only the local address supplied by the dongle. So a built in DDNS client in the main router doesn’t work. And the dongle has no
    But a $2 arduino setup that makes a request to one of the services listed in the comments to get the public IP and then send that to the NOIP server to update the listed public IP would likely work. NOIP has a simple HTTP GET format that would make the update trivial. https://www.noip.com/integrate/request
    Yes, i could change the hardware (dongle and main router) to a mobile and DDNS capable router.
    But the $2 solution looks better than a $100 solution.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.