The analog input pins can be configured as either digital or analog input, so yes, you can move the digital inputs there.
There are alternate techniques that can be used to extend either inputs or outputs, but at that point you’re getting into adding external chips and writing code to support them. Considering that you can find ProMini clones on eBay for $3, I’d be hard pressed to say that it’s worthwhile if you’re just cloning existing behavior.
Thanks. I’ll get the 5V 16MHz Pro Mini and the FTDI USB board to connect it to my PC for programming.
My old controller has power outlets that I’ll use with 4 DC adapters at 5V to drive the analog inputs and I’ll run the digital outputs to my H box relay to power the actuators.
The controller has digital outputs but they’re limited to 10mA, so that forced me to use optical isolators before the relays.
I believe I can drive the relays directly from the Arduino, right?
Another noobie question… Leaving the breadboard and wiring up the pro mini to my 8 relay board, I was just going to solder the wire directly to the mini. Is that the preferred method?
Do most people use a pin array and socket board (in case the mini malfunctions)? Does that even exist?
If it does what you want, go for it. Doing code review is too much like real work
You can solder wires directly to the arduino. However, it does make it harder to change things later. I prefer to have a connector at one end or the other, or both!
Now that I got it working, I’m starting to explore more sophisticated potential…
My external controller can generate a signal between 0-10V. I’ve been using it at 50% to generate a step 5V/0V on/off signal.
the time delay (10ms or 15ms) was to allow enough time for the linear actuator to be completely open or completely closed. But now I’m thinking of an option to control flow based on the actuator position. It has a 2" stroke.
So… My thinking is to take the analog output from my external controller and use a resistor divisor to get it to 5V max (compared to the 10V from my external). The external controller has a 10mA max limit per channel, so at 10V, the impedance has to be higher than 1K. The Arduino analog input channels have a 100M impedance, so it only draws 0.05mA at 5V (max). So I can use a couple of 1M resistors and meet both requirements.
Now, I should have an analog read between 0 and 1023. Here is where it gets tricky. It takes 10sec to completely open (2" stroke pull) and a little more (I use 15ms for safety but it’s not that much) to close.
I could keep a variable that counts forward time and reverse time to get a capture of the actuator piston position. Then the analog signal can become a reference for the feedback loop so it reduces the error to zero and meets the new piston position requirement…
My concerns…
First, the actuators are not stepper motors, they’re not super accurate and the stroke speed can vary over time. I can calibrate up front, but I don’t know when it’ll need adjusting again.
Second, the accumulation of error over time could mean that my virtual position variable in the Arduino and the actual piston position will drift over time.
If I use an optical distance sensor to determine piston position (I don’t know how to do that yet), I’ll quickly run out of channels. I need 4 signal channels for the position setting and 4 to measure the piston position. This is possible with a Mega but I don’t know much about this path yet.