and my condition is not allow to use mux and latched IC.
My objective is to ON/OFF some valve with relay which all the control need to ON/OFF independently.
What! You have some medical problem that prevents you from using certain components?So what has multiplexing got to do with this? Just connect an output to each of the pins you want to control and turn them on and off. Then use a FET to turn on your valves for the output pin signal.
carry out 4 to 16 MUX
Nope, just that my boss don't want us to design any PCB. He prefer using finished products like Arduino
and I can't find any module for 8 bit latched in my area.
I seems you want to control some valves ? (type, voltage, current) ?With a microcontroller with limited outputs ? (is it already used for other things) ?You have already decided you need relays for that ?Why do you think a multiplexer is the answer.Time division muxing is ok for LEDs (persistence of vision), but not for relays.A shift register could be a better solution (depending on the rest of the hardware).Post links to the valves.Leo..
I think the OP meant to say demultiplexer.Yes, is possible with an Uno. No, I don't think a switch case would be suitable.I would suggest holding the 16 output pin numbers in an array. Also hold the 4 input pin numbers in a second array. Read the 4 input pins and turn those readings into a number between 0 and 15 using bitWrite(). This number can then be used to look up the output pin number from the array.
Who said anything about designing a PCB?Without real information we can only offer you so much advice. Stupid artificial constraints don't go down well here.You don't have any post where you live?
If I am not wrong, shift register is shift the output state across the output pin which I don't think suitable for my case because I need to switch on the relay individually. Correct me if I am wrong.
Basically we just need a device that can control multiple output individually with latch function, it must be low cost and finished products, like Arduino which we can buy and use it immediately.
If i using the bitWrite function, the output will hold until i set it to OFF? or i need delay and interrupt timer functiona also?
just that i cant found any 8 bit latched module in the market of my country
Hi all, I am new to Arduino. And I wish to use Arduino to carry out 4 to 16 MUX with latched function.My objective is to ON/OFF some valve with relay which all the control need to ON/OFF independently.
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..
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?
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?
Sounds to me like an addressable latch.