Concept Review - Sophisticated Switch Panel

Hello, everyone. First off, let me introduce myself; I am a mechanical engineer with a bit of experience with programming and control systems, but not much hands-on experience with Arduino itself. I'm not scared of by technical projects or concepts, and I don't mind troubleshooting and optimizing systems.

I have a project I've been considering for a while, and I would like to have some of you who are more familiar with Arduino let me know what you think of the concepts feasibility (with regards to Arduino's ability to handle it) and specific component suggestions (boards, shields, components, etc.). With that, here goes!

I would like to use an Arduino to control a sophisticated switch panel for an automotive application. The Arduino will interpret signals from the switch panel and control various automotive relays while also providing feedback to indicators on the switch panel.

Switch Panel

The switch panel will have 7 momentary switches which will each control various functions (that will/can vary from application to application); some switches will have only one function, some will have multiple (1st Press = Function 1, 2nd Press = Function 2, etc.). Some switches will reset when power is removed, some will need to remember their last-used state. All switches will have RGB LED backlighting and an RGB status indicator LED.

Relays

The relays used and controlled by these switches will be standard automotive-type 12V ISO micro relays. These typically have a coil activation threshold of at least 8V at 0.1A. The relays used will NOT be latching relays, so the coil may need to remain energized for quite some time. At least 7 relays will be used, but there is a chance that more will be required. For now, let's say 10 relays will be the maximum amount.

Controller (Arduino)

The controller will perform several essential duties. It will need to be able to receive inputs from 10 sources; 7 from the switches and 3 additional inputs from the vehicle (not part of the switch panel, but required for logic functions) and control the 7 - 10 relays and 7 RGB status-indicating LEDs accordingly. It will need to be able to remember the last-used state of these functions when power to the system is removed. Additionally, the controller will need to be able to control the 7 RGB backlight LEDs. (The backlighting LEDs will all be the same color and intensity.) All LEDs will need PWM.

Known Inputs [10]:

  • Switch Signal #1
  • Switch Signal #2
  • Switch Signal #3
  • Switch Signal #4
  • Switch Signal #5
  • Switch Signal #6
  • Switch Signal #7
  • Vehicle Signal #1
  • Vehicle Signal #2
  • Vehicle Signal #3

Known Outputs [31]:

  • Illumination LEDs #1-7, R
  • Illumination LEDs #1-7, G
  • Illumination LEDs #1-7, B
  • Status LED #1, R
  • Status LED #1, G
  • Status LED #1, B
  • Status LED #2, R
  • Status LED #2, G
  • Status LED #2, B
  • Status LED #3, R
  • Status LED #3, G
  • Status LED #3, B
  • Status LED #4, R
  • Status LED #4, G
  • Status LED #4, B
  • Status LED #5, R
  • Status LED #5, G
  • Status LED #5, B
  • Status LED #6, R
  • Status LED #6, G
  • Status LED #6, B
  • Status LED #7, R
  • Status LED #7, G
  • Status LED #7, B
  • Relay Signal #1
  • Relay Signal #2
  • Relay Signal #3
  • Relay Signal #4
  • Relay Signal #5
  • Relay Signal #6
  • Relay Signal #7

Nice to Haves

It would be nice if the system could also include a CANBUS interface so that it could retrieve messages and statuses from the vehicle without needing discrete inputs for each function.

Again, please comment on the feasibility of an Arduino to effectively control this system as well as suggested components.

Thanks!

Your description is a little vague and hand-wavey, but, as far as I can see, considerably below the capabilities of the most basic Arduino. Except in two or three respects. But there are easy solutions for each.

Arduino cannot drive your relays directly because 12V and 0.1A are beyond the capacity of it's pins. I would recommend tpic6b595 chips for this. Each chip can drive 8 relays and the chips can be chained so that only 3 Arduino pins are needed to control all the chips.

Basic Arduino only have 6 pwm pins. Even larger Arduino do not have as many as you need. I would recommend ws2812b or apa106 LEDs. These LEDs have their own pwm drivers built into each led and can be chained so that only one Arduino pin is needed to drive all of them. Even for the LEDs that don't require pwm, it will be easier to use the same type of led.

Arduino inputs would be damaged by 12V signals. You can use simple voltage dividers (i.e. resistor pairs) to reduce the voltages down to the 5V range. But extra protection is wise, because vehicle electrical systems are prone to dangerous high voltage spikes caused by the ignition system. Zenner diodes can help protect the Arduino's pins when voltages exceed the expected/nominal 12V level.

PaulRB:
You can use simple voltage dividers (i.e. resistor pairs) to reduce the voltages down to the 5V range. But extra protection is wise, because vehicle electrical systems are prone to dangerous high voltage spikes caused by the ignition system.

Curiously, I suspect the ignition system is the least likely to generate high voltage spikes on the 13.6 V system and the easiest to suppress as they are continuous but brief.

There's a long SAE standard on automotive electronics. Every single wire that enters or leaves your box must be protected from a range of different faults. Consider what might happen if any of the wires accidentally brush against a live 12V wire. Yes, it will happen, no matter how careful you are.

Other faults include reverse jump-start which puts -12V on your power input and the "load dump" which can give a spike of +30V or more.

PaulRB:
Your description is a little vague and hand-wavey, but, as far as I can see, considerably below the capabilities of the most basic Arduino. Except in two or three respects. But there are easy solutions for each.

Arduino cannot drive your relays directly because 12V and 0.1A are beyond the capacity of it's pins. I would recommend tpic6b595 chips for this. Each chip can drive 8 relays and the chips can be chained so that only 3 Arduino pins are needed to control all the chips.

Basic Arduino only have 6 pwm pins. Even larger Arduino do not have as many as you need. I would recommend ws2812b or apa106 LEDs. These LEDs have their own pwm drivers built into each led and can be chained so that only one Arduino pin is needed to drive all of them. Even for the LEDs that don't require pwm, it will be easier to use the same type of led.

Arduino inputs would be damaged by 12V signals. You can use simple voltage dividers (i.e. resistor pairs) to reduce the voltages down to the 5V range. But extra protection is wise, because vehicle electrical systems are prone to dangerous high voltage spikes caused by the ignition system. Zenner diodes can help protect the Arduino's pins when voltages exceed the expected/nominal 12V level.

Thank you for the response!

The TPIC6B595 looks like it may do the trick for the relays. Will it have any problem operating all of them simultaneously, however? (This is likely to occur!) If not, then this would be a great option.

Using the LEDs you've suggested MAY work for the illumination LEDs (I'll need to look into them more), but will not work for the status LEDs. Status LEDs will be Adafruit 2739s (Diffused Rectangular 5mm RGB LEDs - Pack of 10 : ID 2739 : $5.95 : Adafruit Industries, Unique & fun DIY electronics and kits) or similar. As such, PWM will be an issue. Can you make a suggestion as to how to handle this? Perhaps another shift register?

A voltage divider for the inputs is not a problem; If that's the best solution, that's what I'll work toward.

There are any ready-made shields for these components/uses, by chance?

It seems many boards would suffice, so would you care to make a suggestion?

MorganS:
There's a long SAE standard on automotive electronics. Every single wire that enters or leaves your box must be protected from a range of different faults. Consider what might happen if any of the wires accidentally brush against a live 12V wire. Yes, it will happen, no matter how careful you are.

Other faults include reverse jump-start which puts -12V on your power input and the "load dump" which can give a spike of +30V or more.

Isolating the control module from these sorts of issues should not be a problem. I'm quite familiar with automotive wiring, so there's no need for the exaggerations. (If two fully-&-properly-insulated wires brush against one another, nothing will happen. :wink: ) This system will be used for auxiliary components and be nearly completely separate and isolated & protected from the other systems.

At 0.1A per relay coil, tpic6b595 can energise 8 simultaneously. It's smaller brother tpic6c595 could do this in theory, but it would be right on the limit, so stick with the "b" version. There is often no price difference anyway, even though the "c" is a slightly smaller chip.

Status LEDs and illumination LEDs: can you clarify the requirements?

For the illumination LEDs, they can all be the same colour, so 3 Arduino pwm outputs and 3 small transistors.

For the status LEDs, how many colours are required? If a choice of red, green, blue, yellow, cyan, magenta or white is sufficient (plus off), then pwm outputs are not required and ordinary shift registers could be used.

PaulRB:
Status LEDs and illumination LEDs: can you clarify the requirements?

For the illumination LEDs, they can all be the same colour, so 3 Arduino pwm outputs and 3 small transistors.

For the status LEDs, how many colours are required? If a choice of red, green, blue, yellow, cyan, magenta or white is sufficient (plus off), then pwm outputs are not required and ordinary shift registers could be used.

Illumination LEDs will all be the same color, so yes, only 3 PWM outputs should be required.

Status LEDs will need to be able to change depending on the application, but will almost always be one of the following colors: green (blue-green, not yellow-green), amber, blue, or red. I may be able to downgrade this to use a blue/amber or green/red bi-color LED, but I would prefer to use RGBs and let the programming vary, not the hardware.

In some cases, I'd like to able to indicate the following:

  • On, but Inactive (Green)
  • On & Automatically-Activated (Blue)
  • On & Manually-Activated (Amber)
  • Off (None)

This would best be accomplished with three colors for the status indicator.

If having true RGBs is going to be that much an issue, again, I would consider using an appropriate bi-color LED for these indicators.

I will need to examine what the "Standard" colors are to see if they will match up in the various applications - they very likely might. In fact, they may match for both indicators AND illumination options (I'm mainly worried about shades of green & blue, along with white. Yellows, reds, and purples are of less concern for illumination in this application.) If the standard colors would work, I could reduce the PWM to 8 pins total (1 illumination + 7 indicators) and control the intensity with the cathode I believe. That would be quite a bit simpler to set up!

Shift registers can be made to perform pwm, through a software library called "ShiftPWM". This may require quite a lot of the Arduino's processing power to maintain. Simultaneously monitoring buttons/switches and operating relays won't be a problem. But if the Arduino needs to transmit or receive canbus data at the same time, this could possibly cause flickering of the LEDs being pwm controlled via shift registers. You would need to build a small prototype and experiment to find out.

If the "standard" 7 colours available from RGB leds are acceptable, you can control them without using the ShiftPWM library. Overall brightness can be controlled by connecting an Arduino PWM pin to the "Output Enable" pins of the shift registers.