Feasibility design review needed!

Hi all,

I have a control box with red and green light that reacts to switches and buttons, it is operating at 24V and 1A max, this is a product we manufacturing in my company.

I am trying to create an automatic tester that can simulate toggling switches and button pressing and have the Arduino observe the state of the box.

There is the functional block diagram:

Basically, the way it works is I’m sending an 8 bit binary number to the SIPO shift register, this 8 bit number represents the interfaces in the box, for instance, the first digit might be setting switch_1 high and switch_2 low. Then, the shift register will send logic signals to the transistors and thereby simulate a toggle on switch or pressing a button.

After the triggers are imposed on the control box, the control box will react based on the trigger you sent. Since the control box operates at 24V, I’m using a voltage divider array to scale down the voltage so the PISO shift register can read, you can see the resistor ratio in the functional block diagram.

The PISO shift register will store the scaled down signals and that can be fed into the Arduino.

In the code, I have already identified the trigger/expected state pair, all I have to do is subtract what I see in the PISO and the expect state to see if the control box is behaving properly or not.

One other question:
To simulate the switches, I am using a relay (G6DN-1A DC5‎) and drive this relay, I am using a general purpose transistor (2N3904).

The relay requires 22mA to drive, looking at the Datasheet, at saturation when Ic=50mA, Ib = 5mA, so on the base, the resistor should be 860ohms, am I correct?

What I want to ask is, does anybody see any flaws? improvements that I need to know about before I start drawing out the schematic?

The relay requires 22mA to drive, looking at the Datasheet, at saturation when Ic=50mA, Ib = 5mA, so on the base, the resistor should be 860ohms, am I correct?

Probably not, but it would help to know how you got 860 Ohms from needing 5mA, then I can tell if you are right and if you are wrong then then what your mistake is.

For switching multiple relays I would not use individual transistors, use something like ULN2803, which will drive 8 relays, no need to worry about flyback diodes or resistor values.

Thank you, since I am really new to electronics, what the design make any sense to you? if you were the designer, am I close to the ball park?

wingsuncheung2609: Thank you, since I am really new to electronics, what the design make any sense to you? if you were the designer, am I close to the ball park?

My approach to teaching is to ask you how you arrived at something, so I want you to tell me how you arrived at the resistance of 860 Ohms for 5mA. It's almost certainly wrong, but until I know what you did I am not answering further.

In general terms I think your approach is about right. The specifics you will have to work out by building and experimenting. If you were hoping for a 100% correct design that you can just put together and expect to work, sorry, that won't happen. You have to try stuff, see what works and improve as you go.

Why not use “Solid State Relay” instead?
(in this case it’s really just a heavy duty optoisolator, PVT212 https://www.digikey.com/product-detail/en/infineon-technologies/PVT212PBF/PVT212PBF-ND/1927996)
I just came up with a card with 8 of them on one card.
Shift data into a TPIC6C595 (same as you would 74HC595), it turns on the SSR output and can close a switch.
I put some video up of it running last night, acting as a switch to turn on a high power (5V, 700mA) LED. Indicator LEDs also to let you know which channel is active.
Here I am just sending in 0xAA and 0x55. I manually checked the outputs were all working by moving the LED down the line thru the outputs.
8xOpto with screw terminals - YouTube

What is the voltage output of the shift register? Divide that by 0.005.

PerryBebbington: My approach to teaching is to ask you how you arrived at something, so I want you to tell me how you arrived at the resistance of 860 Ohms for 5mA. It's almost certainly wrong, but until I know what you did I am not answering further

Great, I like it,

On the Datasheet for the transistor, on page 2, there is a row titled "collector-emitter saturation voltage". Underneath it, there are two rows:

(Ic=10mAdc; Ib=1.0mAdc) (Ic=50mAdc; Ib=5.0mAdc)

My thinking is "okay, since the relay requires 22mAdc, the first row will not work because at Ib=1.0mAdc, I'm only getting 10mAdc on the collector, but the second row will work because Ic=50mAdc, which is greater than 22mAdc, which is what I need"

So, I need 5.0mAdc current from the shift register to the base of the collector, since at saturation, a silicon transistor, the Vbe = 0.7, and the voltage for the shift register operates at 5V, here are my calculations:

(5 - 0.7) / 0.005 = 860ohms

Is my train of thoughts correct?

Is my train of thoughts correct?

Yes, perfectly, your answer is too.

However, I would still go with either the ULN2803 or CrossRoads' board,.

CrossRoads: Why not use "Solid State Relay" instead?

What would be the advantage of using SSR and the relay I am using?

PerryBebbington: However, I would still go with either the ULN2803 or CrossRoads' board,.

I will definitely check this out, is this basically an array of transistors and all you have to do is give it a logic high to switch on the transistor? if that is the case, that is amazing!

Also, I am using 7 voltage dividers to scale down the voltage so I can measure, is there an IC that steps down voltages for reading purposes?

I will definitely check this out, is this basically an array of transistors and all you have to do is give it a logic high to switch on the transistor?

Correct, also includes fly back diodes for inductive loads, such as relays. I think there is a MOSFET version too, but I stress I think as I have not been able to find them when I wanted some. Maybe someone else here knows.

Also, I am using 7 voltage dividers to scale down the voltage so I can measure, is there an IC that steps down voltages for reading purposes?

I'm not aware of anything, maybe someone else can suggest something.

The data coming back is digital? You can use optoisolators for that also.
Drive the LED side with appropriate current limit resistor from 24V, output be digital 0/1 output if you use a logic level output parts.
Example https://www.digikey.com/product-detail/en/toshiba-semiconductor-and-storage/TLPN137-F/TLPN137-F-ND/7595004

Advantage of SSR and Optoisolators is longer life (relays are mechanical and eventually wear out), noise (there is none, vs relays clicking/clacking away), and probably lower power needed to energive vs 20+mA to energize a relay coil, and the extra driver needed for it.

If you don’t need the 0.25ohm contact closure resistance, a less expensive part can be used with 3 ohm contact closure resistance.

How many buttons are you trying to electronically close vs having someone press them by hand? Up to 8? More? The shift register on the board is daisy chainable to more groups of 8.

My board is a shift register, shift in a 1 and the SSR 'closes', connecting two pins with a pretty low resistance (0.25 ohm). You could use a Relay to do the same, it's just noisier. For example, here is an 8-channel relay board I did. https://www.youtube.com/watch?v=ukRtgLK_b5c

Non-shield version, same shift register chip controlling the relays. |500x304 5V relays need more current than 12V relays. SSR needs even less.

CrossRoads:
Why not use “Solid State Relay” instead?
(in this case it’s really just a heavy duty optoisolator, PVT212 https://www.digikey.com/product-detail/en/infineon-technologies/PVT212PBF/PVT212PBF-ND/1927996)
I just came up with a card with 8 of them on one card.

I just looked into the Datasheet for that SSR, it only requires 5mAdc to switch, however the contact side I need 1A to operate, so this part might not work?

I really like you non-shield relay board you built, do you have a schematic that I can study it on? it is pretty much what I need, thank you