Touch Screen Relay Control

Hi all,

I am interested in creating a in-vehicle touchscreen interface to control various lights on the outside of my Jeep. I am very new to arduino, but I do have a little experience coding so learning new syntax and a some refreshing should set me up to pick through, alter and write new code.

Because I am new to arduino, I would like some input from more experienced tinkerers to tell me if this should theoretically work or if I am way off course. The relays I plan to be switching should all hold between 4-15A and the relay board I am looking at buying supports 20A relays. The one accessory that pulls more than 20A I plan on having the 20A relay board fire a larger relay(30-40A).

Here is where I have the hardware questions. Will these 3 components work together to achieve a [u]in-vehicle touchscreen relay controller[/u]? Arduino: Uno R3 Shield: TFT Shield Relay Board: 8 Channel 5V Relay Board

Do you agree with this choice of components? Would you select any other components that you think would work better?

Thanks for any help/advice, Caleb

Before you select components you have to get their data sheets and eventually related libraries. Without these you’ll run into problems when you try to connect and write code for the components. I cannot find such information from your links :frowning:

Without additional components it won't work.

Uses digital pins 5-13 and analog 0-3.
That means you can use digital pins 2, 3 and analog 4 and 5.
Pin 12 is available if not using the microSD.

So you need at least a simple serial port expander (shift register would do), because you only have 4(5) pins free to control your 8 relais.

@DrDiettrich: Thank you for taking a look at those links. Since I am looking at them from several different companies, I can understand the possibility of not having sufficient data to link these parts. If I were to buy all components from the forum store/adafruit, would I have a better chance of finding parts that match? Could you explain what I should be looking for on the data sheets to check for compatibility?

@Whandall: Also thank you for looking at those links. I see now that I overlooked those pins being used. I did some searching and found 8 and 16 pin input/output pins that only uses 2 i2c pins ( vs a shift register). Does this sound like a better trade off? Barring component compatibility that @DrDiettrich pointed out, could you see this setup working to send output to 8 relays?

New list of possible components: Uno R3 TFT Shield (Updated) Same Relay Board Serial Port Expander (Updated)

Thanks again for all your help and sending me in the right direction. I am eager to learn about what makes these components mesh and how to control all of them together.

Thanks, Caleb

That original TFT shield looks almost exactly like the Seeed Studio one that's available from Radio Shack in the USA. Of course that's three or six times the price but it did come with useable libraries.

The Adafruit one is not a shield, which may be an advantage or disadvantage for your planned physical layout and mounting hardware.

Personally, I would stay away from relay boards and use MOSFET type drivers. Mayben even something that's sold as a motor driver. The reason is that then you can dim the lights and work with LED lights much more intelligently. Relays are only off and on and they can't switch fast enough to simulate dimming or fading light. A relay can't control the current through a LED string, which means you are restricted in which LEDs you can use or you need external circuitry to control the LEDs.

Caleb9107: @DrDiettrich: Thank you for taking a look at those links. Since I am looking at them from several different companies, I can understand the possibility of not having sufficient data to link these parts. If I were to buy all components from the forum store/adafruit, would I have a better chance of finding parts that match? Could you explain what I should be looking for on the data sheets to check for compatibility?

Most important is the operating voltage of a module, as far as logic signals (data lines) are affected. When it differs from the Vcc of your Arduino, additional hardware (level shifters...) is required, so that you may be better off with a module of the right supply voltage. Or you use an Arduino board that operates at the same voltage, like a Pro Mini can work from either 5V or 3.3V. Consequently you may find modules or shields for either or both supply voltages, designed for use with an Arduino in general. This applies to the forum store or Adafruit products as well.

While a relay board does not require a library, it's sufficient to pull the signal inputs HIGH or LOW, a TFT or touch screen is somewhat useless without a library. Also all bus driven modules, using I2C, SPI or serial I/O, should be accompanied by according libraries, else you'll have to figure out their communication protocol (command and data sequences) yourself. OTOH many similar boards are based on the same controller chip, so that any library for that controller may be usable. In such cases it's extremely helpful when the controller type is specified in the data sheet. But unfortunately library documentation often doesn't include the used Arduino resources (timers, interrupt vectors...), so that some libraries can not always be used together in the same sketch.

Next comes the current drawn by a module, and a possibly required additional voltage for driving high current or voltage loads. Relay or motor driver boards typically require a separate power supply, even if their data lines have Arduino compatible signal levels. Other (low power) modules can be powered directly from the Arduino Vcc.

For shields a list of the used pins is important, to find out whether a pin is used by multiple shields, for different purposes. Bus signals, like e.g. SDA/SCL or MISO/MOSI, can be shared by multiple modules. The pinout of a shield also allows to find compatible libraries, which use or can be configured to use just these pins.

@MorganS - Thanks for your thoughts on the shield/breakout board. On the issue of mosfet's, I had briefly seen them mentioned on other threads but never gave them thought. After doing more searching, it looks like these will be the path I take. I have no idea how I am going to mount them currently but the schematics didn't look too difficult. The LEDs I will be driving are the LED bars/pods you currently see on 4x4 vehicles as opposed to individual LEDs.

@DrDiettrich - Thanks again for all the info. That was very informative and has given me plenty to research today. I researched more on the library issue and saw the various problems in mixing random components detailed in many threads across the internet. I also saw that adding more "shields" or various add-ons such as the serial port expander adds complications in wiring, fitment, and library usage. Because of these issues and desire to streamline as much as possible, I have ran across a complete board/shield/screen kit. I believe I have found the library or at least one that can be manipulated to work in the UTFT ( I believe) library. This kit uses a Mega 2560 as the base with a touch shield and a 3.2" LCD panel. Correct me if I am wrong, but from looking at the pictures and schematics it appears that there are at least 8 I/O pins open to drive the 8 mosfets I am now looking at driving. If I see this correctly, this kit coupled with the mosfets and some wiring in between should be able to switch power from the touch screen.

Shield/Screen Kit

Mosfets

Both of your advice and knowledge is really helpful and making me quickly learn what is needed and why I am needing to choose the components that we are discussing.

Thanks, Caleb