Pins Used for TFT Touchscreen

I'm using an Elegoo 2.8" touchscreen TFT with the Uno board and an Aideepen Screw Shield and trying to figure out what pins are available for me to use for other things. Pins A0, A1, A2, A3, A4, 8, and 9 are defined in the code I've borrowed from examples. A2 is defined as both LCD_CD and XM while A3 is defined as LCD_CS and YP. Further down in the code, two lines use pinMode to fix the directions of XM and XP as they are shared. I have simply copied this code without understanding it. I suspect other pins are used without being defined.

My hope is to connect 8-DS18B20 temperature sensors (which may be connected to a single pin as I read the product description) and 8 relays which will need separate pins unless I can find a relay block that operates off a single pin (no luck so far). If I get this to work, I'll use one version of it to manage the kiln I use for drying lumber and another version to manage temperature of wine as it ferments.

Sorry for being long winded but I'm new to Arduino and to assembling this sort of hardware in general. I'll appreciate any help and being pointed to a discussion of pins and pin sharing for beginners if one is available.

Thanks in advance.

It is a question of arithmetic.

Count the pins that you need. Count the pins that are on your Uno board.

You can put 8 DS18B20 on one pin. You can use the SPI pins to drive a SPI Port Expander or SPI Shift Register to drive your relays.

Life would be easier with a MEGA2560. Plenty of pins. The TFT shield plugs staight into the Arduino headers.
It is simpler to use individual GPIO pins for each relay. No external chips.

David.

I have 6 analog pins and 14 digital pins as I read things. If only the 7 declared pins are unavailable that leaves 13. Am I understanding this correctly?

Thanks for the confirmation on the DS18B20 sensors and the tip on the port expander. I'm working with the Uno as that's what the students at the school where I volunteer are using for a robotics class. I thought I'd do something that I could use as a project.

I greatly appreciate the assistance.

Yes, I suppose that you have 14 digital but it is wise to avoid 0, 1 that are used by Serial.
14 Digital + 6 Analog = 20 GPIO.

The TFT needs 13 GPIO. OneWire needs 1 GPIO. 8 Relays need 8 GPIO. Total 22 GPIO.

You are 2 short !!

The other consideration is : drive current per Relay. 8 Relays x 10mA = 80mA if all are on at once.

Even with a Port Expander you have to think about the total Relay current that the Port Expander can supply.

Could you manage with 6 relays ?
Be realistic. Relays that control a 10kW kiln are chunky.
Relays that control a 1000L fermentation vat are similarly large.
A 5V relay with a 10mA coil is wimpy.

David.

Good points about the current!

I'm thinking now that the best plan for the wine system would be to split it in two with each unit running 4 relays. I'm just making wine in 6 gallon glass carboys and heating them with Dollar Store heating pads so the relays don't have to be large. I do 8 carboys in the fall with California juice and 4 gallons in the spring with Chilean juice so the split system makes sense.

Thanks for the education.