Monitoring a few analog values and a few binary bits over the internet?

Status
Not open for further replies.

MikeMl

Well-Known Member
Most Helpful Member
We just built a "little house on the prairie"; actually a summer house that will sit unoccupied for most of the year. I would like to monitor the state of a few analog parameters in the house (temperatures, voltages, currents), and some binary bits (pump running or not, alarm on/off, etc) via the internet. I can handle getting the signals conditioned to nominal 0-5V levels, getting them into an A/D converter (like in an Arduino, for example), and writing code to trip alarms if something is too high or too low, but don't know how to make the data accessible via the internet.

First, presently, I do not have internet at the house, but do have a wifi signal from my brother-in-law's modem across the street. He subscribes to a system called "Rural Internet", which is a rooftop antenna pointing at a tower about 15mi distant. He gets moderate download speeds (better than DSL on twisted-pair telephone), but it is nothing like the speeds that folks that live in big cities get. He could give me Internet access on his account. (It might cost me)...

Alternatively, I could subscribe to the same service, in which case I would get a modem that has four network ports with a local Wifi (a router). Now start the questions:

How would an Arduino with an ESP-8226 play into that scenario? Presumably, it connects to the WiFi, but then what.? Does the ESP-8226 have a "web page" interface that I can call up over the Internet where I can see the numbers? Does it have a "static" url address? How do I find it (url?)?

Do I have to create the web page layout? How is that done?

Alternatively, can I set it up to send me a daily email containing a history, or an immediate email if something goes wrong (the decision of "ok" vs "something wrong" being done locally by, say, an Arduino)?

Is there an easier way? Rasberry Pi, etc?

Help me get started with this...

Thanks
 
Last edited:
I did something similar a while ago. I used a Wemos mini (esp8266) board that I can buy for around US$4 that has 4M of flash and 80k ram. I had it setup as 1M program and 3M flash drive (spiffs). I setup a server on the Wemos and uploaded html pages to the spiffs drive. I then had to make it visible via my router so that port 80 was visible to the world - expect lots of request for all the different config files (php_config, mysql_config etc.) from hackers. I could then access a html page that used get and post request to fetch temperature and humidity from a DHT22 connected to the Wemos. All the information required to get this working is contained in this document. You can download it as a pdf which I recommend. Hope you already know html and java.

Mike.
 

You need to look at access points and the modes they offer. For instance a D-link DAP-1665. http://support.dlink.com/ProductInfo.aspx?m=DAP-1665

But, that's your "smaller" problem. You could actually repeat his wireless network which just makes the signal strength higher.
or you can convert a wired signal to a wireless one and back to a wired one with two identical models and point the antennas at each other.
keep that network that does not broadcast it's SSID,

Within your house, set up another SSID or just use wired.

This works when all your doing is sending data from your house or connecting from your house.

Somebody in this mess needs a static IP address or a Dynamic DNS service. So, if your relative had a router that supported DDNS and you just broadcasted his wired network with a well-formed beam to a wired network on your side. You would the port-forward some port to your little embedded gizmo with a web-page. I'd use a wierd port # is specified by the colon.
so http://www.google.com is the same as broken link removed Port 80 is the default port that understands html.

You could forward port 8080 on the router to port 80 on your device for example or even make 8080 default on your device.

A general problem with that is sending emails and SMS messges from home.

Another way is to use a cloud. The gizmo posts to a cloud and your application runs on the cloud or just uses the cloud.
Amazon Web Services is just one way to send SMS and emails.

Here's another thing to read:
Anaran Atmosphere
**broken link removed**

Remember that ISP's do frown on you running web servers.
 
Last edited by a moderator:
You could simply drop the Arduino idea, and use an ESP32 - much faster, more powerful, and has WiFi built-in - basically an ESP8266 on steroids

Once you've got an internet connection, then I would suggest ignoring all the hassles of static IP addresses, port forwarding etc. and do what I'm currently working on at work (following on from my home system).

Use the ESP32 (or whatever) to read your sensors, and then send the data to a server somewhere - as long as you have a website of your own (that has PHP and MYSQL) it's simple to do, or you could use an existing service, such as ThingSpeak as my home system currently does - I've never got round to altering it to my server yet, as it's mainly for experimental reasons.

This is my home system, uploading via WiFi to ThingSpeak:



And this is my current experimental system at work uploading via GPRS (the project is about developing and building commercial GPRS systems), I added the temperature and humidity sensor to give some live data, and it's on test waiting for the batteries to go flat (it's been running just over a week so far, from 4 x 18650 LiIon batteries in parallel - there's a protection board with the batteries, so I'm expecting that to shut the batteries off before the project itself stops running). For the purposes of this test, it's transmitting the readings every five minutes (so 288 readings a day), and while the GSM modem is turned off between readings, I've made no efforts (so far) to reduce the processor current - which is an 18F PIC running at 64MHz.



Assuming it's cheap to use GPRS in the USA? (as it is here), then it might be a far better solution than paying for Internet, or paying to borrow your brothers?. SMS is pretty expensive here (around 5 to 15 pence per txt message), where my 288 uploads per day are only costing about 1 pence per day on a pay as you go SIM card. Assuming a txt is 10 pence, that would be £28.80 per day!!.

One BIG advantage of uploading to your own server is that you can do a great deal of the programming on the server itself, all the remote unit has to do is upload the data to a MYSQL database (it does this via a simple PHP script), and everything else can be done in HTML and PHP on the server, accessible from anywhere in the world. You could also easily set the PHP script (that uploads the readings) to send you an email when it does.

If you look at the battery voltage graph above, you'll notice that it's scaled from 3V to 5V - this was based on my assumption that the protection board will cut-off around 3V - assuming it doesn't, I'll simply edit the PHP script that draws the graph (changing a single value) to lower the bottom limit (probably down to 2.5V or 2V - as it shouldn't go below 2.7V).

I've also got a wager coming up - many of the envisioned uses for the project will use non-rechargeable LiIon, as existing GSM types do - and these commonly transmit once a week only, with an expected five year battery life. The batteries are 19Ah, and usually used with at least two in parallel, with a 'best' capacitor across them - the batteries have high internal resistance, so can't supply the high current pulses the modems require. So the next test will be to power it from one of these batteries (adding a best cap - I've got a space for it on the PCB) and see how long that lasts. My boss reckons that it will last more than 60 days, I reckon it won't make 60 days - so we've got a bet on it, with the loser buying lunch!

As the 18650's haven't run out yet, it's a bit difficult to predict - the 18650's are 2.2Ah each (so 8.8Ah), but are second hand batteries - so that makes it even more difficult. I'm guessing they won't make three weeks - if that proves the case, and they are truly 8.8Ah, then the 19Ah shouldn't make 60 days!.

Anyway, enough rambling on, hope this gives you some ideas.
 
Set up a raspberry pi with an ADC. Write a python script to ready the digital pins on a regular basis. Then you can send results with your python code via FTP or PUT commands to another site. Especially easy if you know PHP and SQL to accept the data when you set up the second site. Amazon Web Services has a free first year of web services.
 
Yes to all those, an esp8266 is made for the job.
I've used an esp8266 with a high gain antenna to reach a long way.
 
Yes to all those, an esp8266 is made for the job.
I've used an esp8266 with a high gain antenna to reach a long way.

I dismissed the ESP8266 as it only has VERY limited analogue inputs, hence my suggestion to use the ESP32 instead.
 
Yes to all those, an esp8266 is made for the job.
I've used an esp8266 with a high gain antenna to reach a long way.
Do you have a link to what high gain antenna you used? Did you use a pluggable unit, like the ESP7 and disconnect the ceramic one?

Dont mean to hijack the thread, I'm just interested in extending the range
 
I used one from RS components,
I like directional antennas. It keeps the neighbors from knowing there is another network in the air.
I get my internet connection from 5 miles away wireless. At 2.4ghz there will be no signal in the rain. No signal if the humidity is high. We switched to 5ghz and solved that problem. Also 900mhz works in the rain and it shoots through trees much better than 2.4 or 5.
 

At work (and I used to use them at home) we use W3Z () who supply broadband via RF - mine used 2.4GHz (normal WiFi) over a fair few miles, but the one at work now uses a smaller 5GHz 'dish'. I've actually sourced a 5GHz 'dish' to play with (from where someone moved out, and left it behind - and the landlord removed it), they simply connect via Ethernet cable using POI to power it, and can be configured for various uses, just as with most routers.

I never had any weather problems with the 2.4GHz service, only 'problem' I ever had was a mains failure at the mast I was connected to, they went out and fitted a generator - but that ran out of fuel after a while

While I think about it, I mentioned earlier I was going to test a non-rechargeable battery EVE ER26500 once the 18650's ran out - but I'd got enough bits to build another unit (and a suitable SIM card), so I've build that up and got it running now, feeding a separate MYSQL table for simplicity. So we'll see if it makes 60 days!!.
 
I didnt know 900mc was used for networks.
I have a 'cb' somewhere that uses 900mc.
 
If you've got an email host that has a normal POP interface, you could just get the remote unit to put all the data into emails.That would avoid the need to have server access.

If you do have access to a server, I agree with Nigel that PHP scripts aren't that difficult.

This is what I have collected running a solar-powered GPRS module. It is measuring the voltage of the Li-Ion battery, (blue) the solar cell voltage (green) and the charging current (orange).

The data is sent every half hour to a MYSQL database, and the web page that displays it uses another script puts it into a graph. Sending data to the server used less than £1 of credit from the PAYG SIM this year.

 
Yes Xbee of course.
Being tight I've never used them.
I used some cheap Rf modules on a silo contents guage system, simplex comms, and 3 slaves talk to one master, the slaves transmit at random intervals, so occasional collisions are not an issue and are dealt with by simple error checking.
 
Most peripherals work best with a digital interface. Depending on what your needs are the esp8266 may suffice. Tell us more.

Mike.
 
Yes the final version used a -07, the one with the fancy aerial connector that cost more than the esp itself, you can even get a patch lead to go to a Sma connector found on most wifi aerials.
However the prototype I hacked a -01 device, breaking the track and soldering on a Sma socket, it worked.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…