Hi
I am building a home brewery setup. I'm basing it off BruControl which is an awesome processor. It runs off an Arduino Mega and features an interface in Windows which is able to control the different outputs etc.
I have built(a few months back actually) a 8 channel relay connector box which I used prior to converting. BruControl is great, but it has a limitation where speaking to another Arduino is hard through I2C etc. And the control box is a simple 8 channel relay controlled with an Arduino Nano. It will be placed a bit to far away to utilize I2C or other serial connections. Besides, I am not able to use that in the BruControl interface anyway - so the only option I have is to either run the 8 connections from a digital output on the Mega to 8 digital inputs in the Arduino Nano and have them "forward" it to the 8 connections on the relay - or to go directly to the relay, which means I'll have to add another 5V wire.
Now I tried the first method, since basically it was already integrated and using switches so it was a quick fix to set up and it works. The only problem is - when the BruControl loads or shut downs, the Nano reads floating pins and switches back and forth really quickly - of course.
Wiring is simple - from Arduino ports 34 - 41 a signal is digitally output to the Nanos D2-D9, then a simple check through a for loop check each of the readings and if HIGH, then output to corresponding relay pin.
Could I say -
-
power the Nano through the 12V, and power the relay with 12V on JD-VCC, and the VCC from the 5V pin on the Nano and just run the wires directly to the relay instead?
-
Use INPUT_PULLUP to get rid of the floating pins?
-
Write some sort of script using millis to determine last time the state was changed, and filter out some of the floating?
-
Debounce it some way? Debouncing it over 3 seconds would create too much of a lag time, tbh....