You're wrong.
This is basically how a shift register works:
1) micro shifts a byte in a shift register, or a string of bytes into a string of shift resisters.
Every bit of the byte(s) represents a shift register output.
2) micro generates a latch pulse, and the data/byte is moved to the outputs of the shift registers (and stays there).
3) micro is not needed anymore, until a different relay pattern is needed.
A common Arduino (Uno, Nano) has enough I/O to control two common/cheap 8-channel relay boards.
An Arduino output pin does not change it's state until you tell it to.
Leo..
Ok. But my system is trigger relay independantly.
So, if everytime i switch the output condition, is it I need to set for other output as well?
For example now I only trigger GPIO1, then i need to set the GPIO = 0000 0001 (binary).
You would not be using bitWrite function to change an output, you would be using it to turn the 4 inputs into a number between 0 and 15. The next part of the code would then switch on or off an output based on that number. Yes, as mentioned above, outputs do not change until the code changes them again, or the Arduino is reset or power is disconnected. You will not need timer or interrupt functions, unless there is some requirement you have not told us about yet. But the coding details are not important now. You should focus on the circuit design.
Do you have enough pins on the Uno? 16 outputs, 4 address inputs, plus, I assume, a data input and a latch/enable input. That's 22 in total. Does an Uno have enough?
Actually my microcontroller have around 20 outputs, for our design actually we just want to expand it.
So, in this case as long as Arduino can provie around 12 to 15 is consider ok.
I did check Arduino IO Pin before, total have 19pin including analog.
Thanks for reminding.
And can you explain the data input and latch/enable input funtion in this case?
Sorry that i am still trying to get the concept of the code.
Then you are stuffed as you don't seem to want to make anything with components. For this simple problem no other system is better than the Arduino.
If you can't find a relay board how on Earth are you going to find something much more scares with a built in relay. I still don't understand what is wrong with buying one from another country and having it delivered to you.
By latched do you mean a relay that retains its state when the power is removed?
Hi, no, what I mean is that we do not prefer customize a board because we do not want to spend much time on trial and error.
And cost is what we are concerning as well.
Actually my latch means like, when first start, everything is off, then I trigger output, it becomes ON, trigger second time then it set to OFF, something like this.