Like I said, I just thought it was funny how the thread immediately went from a pushbutton and some wire to a full on wifi network.
When somebody asks you how hard do they need to hit their thumb with a hammer to forget their headache, you think it is funny how instead of answering "pretty hard, but try not to pulverize the bones in your thumb", people immediately start going with some full on "take an aspirin and go to a doctor" nonsense
You, sir, are an idiot.
Simple answers are harmful when they omit the wisdom of experience.Here, the biggest task will be digging the ditch to put the cable into. Having to do it
twice because you didn't think it through the first time, will hurt. If you pay someone else to do it, the cost will dwarf everything else in this project, so leaving yourself
options is worth it.
As others have already mentioned, this assumes you have already decided you want a wired connection, and not a wireless one (WiFi/LoRaWAN/etc.). A wireless one is something to carefully consider at this point, because of its minimal installation cost.
A 100m (330') roll of Cat6a S/FTP that can be directly installed in a shallow ditch without mechanical shielding costs about 100€ here. If you pay someone else to dig the ditch, use either aluminium (~20mm diameter) or plastic (~50mm diameter) piping intended for exactly this purpose, to minimize ground frost damage (if living in an area where the ground freezes during winter at the depth the cable is installed at) and to let you pull additional cables to the shed later on if desired; the added cost is very small compared to the cost of having to re-dig the ditch. I personally would not bother, and would just use sand as a buffer around the Cat6a, and do the shovel work myself.
Cat6a is twisted pair, and can be used for Ethernet, or RS-485, or even a current loop over individual pairs. Tool-less RJ45 connectors cost about 5-10€ in singles here (the ones I'd use are 5€ for males, 10€ for female connectors); I'd definitely put female ones at each end in a small utility panel, and connect to those via short patch cables etc. If using it for non-Ethernet purposes, I'd use cheap ready-made Ethernet cables, cutting them in half, plugging them into the utility panel at each end. Keep your options to a maximum: it is annoying to have to redo everything because you forgot to leave yourself choices to change your mind.
An approach I personally would consider here, is to use a passive PoE injector to supply the power needed by the microcontroller in the shed, and a PoE Ethernet shield (similar to the
Arduino Ethernet Shield 2) in the shed to power the microcontroller and communicate with it. The
Raspberry Pi 3/4 PoE adapter is a cheap option, if instead of a microcontroller you switch to a 'Pi. There are also a lot of POE-capable cameras, in case you decide put a camera at the shed.
(I happen to have a very similar use case, and some 50m of ditch-digging, waiting for me later this summer a bit north of the Arctic Circle, you see. Fortunately, the ground is all sand, no rocks, only an occasional small pebble, so I can get away without conduit/mechanical shield piping, and ground frost is unlikely to cause major issues with the shielded Cat6a cable.)