Or how to ghetto build an extendable sensor network.
Well really, other people have fine this before me, I’m just trying to come up with a quick and dirty hot despair system. It’s more of a brain exercise than how I’d really go. Chances are I’ll just drive all these with a stack of Pi Zeros with hacked together Ethernet. But what if I don’t. This would be for the planter cubes. Each one would report moisture, temperature, illumination (to show if there’s a problem) maybe some other low grade sensors. The data wouldn’t be much. Now I want this to be cheap and plug and play. Any time I plug in a cube, I want it to give me a couple LEDs. Red is bad, flashing green is coming online. Green is go. So what happens when it’s coming online?
I’m thinking we have a power rail. Next to this we have…
Sorry, just realized I’m a tool shed who should learn about parallel and series circuits.
…master line. This will be used to send a pulse down to all cubes on the rail. This will start the calibration for internal timing, and provide everyone a chance to become acquainted. So when someone comes online, it listens for the first pulse and then listens to the data line. During this time all onlined critters are sending their data. If we listen to that, we find out how many other cubes are on. After the next pulse, I now can calibrate my internal timing to everyone else’s timing which means that I don’t have to have high quality parts. After a quick sanity check I’ll use one of the sensors to seed an RNG. This will provide an offset from the back end off the pulse. At this time it’ll give a shout out. The rest of the time it’ll be listening to ask the established cubes. If it detects another new cube, the first one wins. Now since we can’t know if there’s another cube on the same time track, we keep on going with more RNG action all the way down the line until our newest cube is right after the last established cube. Once we’re there, we start transmitting actual data.
End the day, assuming I have a large enough current source, this will work. I could probably limit my current needs fit the boxes by having signal diodes on the data lines, and then… oh duh.
Master gives start. New boxes do their thing. When the new boxes transmit, they transmit a unique identifier. The units identifier gets passed back by the master. If the master passes back a corrupted identifier, we have cross talk. Do another round of rng hangs. If this happens three times, start flashing the red LED which is the pop out and plug in signal. This should be enough to get it back on the rails.
I should start putting together a BOM.