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?