Ultrasonic Sensor print screen over network

Hi all,

I need some help. I have an HC-SR04 sensor connected to an Arduino Uno, and a 16x2 LCD I2C screen connected to the Uno.

Currently, it is working and showing the distance on the screen. But I need to show the distance on a screen far away from the sensor.

So I need to make the sensor and the Uno the sender and another Uno and the screen the receiver but over a network. I have a network shield for the Uno's.

The question is, would this work or is there another way or method I can make this work?

I have attached my current working code for my setup.

Thank guys.

Working1.ino (775 Bytes)

That will work. There are multiple options for communicating over distances between Arduino boards. To me, the primary advantage of using a computer network is that allows communication with anything on the network. If you wanted to, you could check the sensor on your computer, smart phone, tablet as well. If you wanted to do that with most any of the other options, you would need a bridge between the communication protocol and the network.

Popular distance communication options would be RS-485, nRF24L01, LoRa, XBee, GSM, WiFi, Ethernet.

Yes, this idea should work. One Arduino can be the Server and the other can be the Client. I imagine the Arduino with the lcd screen would be the Server, but it could also work the other way around. HTTP protocol could be used with the Client sending a GET or POST request to the server.

Alternatives would include RS485 wired connection between the two, or NRF2401 or similar RF wireless connection. How far apart are the two Arduino, and how many walls between them?

They are about 1km from one another thus the idea would be to use the ethernet shield with a MikroTik link between them or a fibre link with converters. How would I start with the code since I need to give them both ip's. And if I use RS485 how would that code look like.

So then the arduino with the screen would then be the master and the arduino with the sensor would be the slave, we would like to later add another sensor at a different location with either one of the communication links. What links would work the best?

Ah, that is certainly "far away".

mastershifu101:
the idea would be to use the ethernet shield with a MikroTik link between them

I'm not familiar with this MikroTik link. Maybe you could provide a link to more information. I believe that as long as you are using a static IP, it should be no problem. If you want to use DHCP then that will require a router to assign the IPs but I suspect this MikroTik link thing might have a router?

mastershifu101:
or a fibre link with converters.

That sounds like it would be expensive. Is the fibre only to be used for this distance sensors application?

mastershifu101:
we would like to later add another sensor at a different location with either one of the communication links. What links would work the best?

What is the required update frequency of the sensor readings? I see how you are doing it in the current sketch but I don't know whether you really need to update so frequently for your application.

As already suggested, LoRa might be an option. I have known my home built sensors, using rfm95 modules, with only a short length of wire as an antenna, to be received 11Km way. But the receiver was a professional quality multi-channel gateway with a high gain outdoor antenna mounted in a prominent location.

I also thought of LoRa as a good alternative. The current code is updating every 20 ms + the time for the sensor read and display updates. Can you do that with LoRa? I was under the impression it was not to be used for that sort of application, or is that LoRaWAN specifically?

Yes, I believe you are thinking of LoRaWAN. When you share the network with others you have to play nice. But LoRa can also be used for point-to-point communications between individual devices that are not part of a wider network. I've never done this myself, but I understand it's not much different to doing the same thing with nrf2401 or hc-12, but the range can be even better.

Which reminds me to say that hc-12 modules are another potential solution.

I'm not sure why or if the OP needs 20ms updates from 1Km away.

Hi.

I will probably use the fibre for cameras as well.
here is a link to the mikrotik systems.

The update time can be changed to every 20-30min. I only used this for the setup and forgot to change it.
The idea is to monitor our water tanks on our farm.

I am not familiar with "LoRaWAN".

It makes sense to utilize whatever communications system that's already used for the cameras for the sensor readings as well. The high bandwidth requirement of the cameras changes things significantly.

LoRa is a radio frequency communications system designed for long distance communication with low power consumption. I don't think it is suitable for video streaming. It is very well suited for intermittent sending of sensor data. That is precisely the sort of application it's designed for. LoRaWAN is a network protocol that uses the LoRa communications technology. With LoRaWAN, you can have gateways that act as routers for end node devices, which can be simple, low cost, low power, microcontroller-based devices.

Arduino sells a board with a LoRa radio called the MKR WAN 1300.