Running out of inputs.

Hello,
First time post here.

I have a project where I want to log the force vs displacement of various non-linear springs.
I’m using an ‘Infiduino UNO’, with a load cell for measuring the force, and a set of digital calipers for measuring the displacement.
I want to log the recorded values to a SD card, so that I can later view/manipulate the data.
I also would like to plot the data in real time on a small display (I have a 3.5” tft shield).

The load cell is working well. I’m using a HX711 to interface it with the Arduino. No problems with that part of the project.
The HX711 will use up two inputs (clock & data).

Interfacing with the digital calipers is proving to be a challenge, but I’m making progress there, and expect to eventually sort out my code (I’ll post my specific issues with the caliper interface in a separate thread).
If I can’t get the digital caliper interface to work, I’ll revert to using a linear potentiometer into the arduino’s analog inputs.
The digital caliper interface will use up another two inputs (clock & data), or a linear pot would use one input.

For the data logging, I have a SD card shield (with RTC included). I have previously had success with this shield on another simple project (logging my dog barking when I’m not home).
The digital calipers send out a signal approximately every 0.3s, which is a sufficient sample rate for my project. So for every measurement that the calipers spit out, I plan to log that, as well as the load cell value, and a time stamp from the RTC.

To plot the data on the TFT display, I would just use the Force/Displacement data to draw a white pixel at every sample.
The 3.5” TFT display also has a mini SD card slot in the back, so potentially I can use that for data logging rather than the separate logging shield. The only drawback would be that I wouldn’t have a proper time-stamp from the RTC, which isn’t really a deal-breaker, I can manage with a micros() time stamp. Or I could add a separate RTC to the circuit.

So, my major challenge is now how to combine all of this onto one Arduino.
The 3.5” TFT appears to use most of the available pins. I could discard some of the input pins, since I’m not interested in using the ‘touch screen’ aspect of it. But I don’t think this will free up enough pins required by the other components.
Could I run all of these devices on one ‘loop’ using the I2C protocol? I’ve since bought a small I2C display, but it is really a bit too small for my liking.

I would appreciate any suggestions regarding the best way to combine all of this with a single UNO board (I have ordered a MEGA also, in case that will make things easier).

My code will run something like this:
Wait for calipers to send out data, interpret caliper data, read load cell, write caliper & load cell & time stamp to SD card, draw caliper & load cell pixel on display, repeat.

Thanks,
Hugh.

Is a MEGA really that expensive? There's much fewer shields designed for it but you can stack the display shield from the UNO and then connect the additional sensors to the MEGA pins that aren't covered by the shield.

Hi, If you just want to display text/values on a display, it takes only 2 pins for THESE Displays

Don't forget the analog pins A0-5 are digital....

Rather than a TFT screen and an SD card, the data could be output to the serial monitor for direct storage on a laptop or desktop.

I'm guessing that you could potentially buy a cheap I2C board that connects the display to the Arduino, that only uses IO 2 pins (in addition to power & ground). This is how I connect my 16x2 LCD to my Arduino. This is assuming that there exist such boards for your touch display, with matching library. Or, you could build your own board with an I2C chip that has enough output pins, and figure out the code. I generally like to let the supporting HW do as much of the work as possible.

Or move up to a 1284P.
This board I offer has RTC and SD card, leaving 26 other IO free. 2 for serial, leaves 24.
Can be set up with or without screw terminals, and onboard or offboard USB/Serial adapter.
Power/Gnd available at all IO pins as well if you want to install male/female headers instead of using screw terminals.
http://www.crossroadsfencing.com/BobuinoRev17/