Go Down

Topic: Mux 4051 doesn't work correctly (Read 345 times) previous topic - next topic

Paul__B

Now note that a CD4051 is an essentially obsolete part, the proper version for 5 V operation is a 74HC4051.  This has a much lower switch resistance than the older device (75 vs 470 Ω).

Since I suspect that the photo-resistors will be mounted somewhere away from your PCB, they should connect to ground, not Vcc (5 V).  It is poor practice to have the 5 V supply connected anywhere it does not need to in case of accidental short circuits to something also grounded, and to minimise interference pickup.  This may not be a particular problem in your situation, but is simple good practice.

So you connect your photo-resistors to the multiplexer, and a single pullup resistor from the common selector to Vcc.  The internal pullup of the Arduino (presumably a Nano) is approximately 47k so that may suit or you may need an external, lower value.  In fact, you may have the option of using a value of perhaps 33k and choosing to switch the internal pullup on or off to provide two alternate effective pullup values.

PaulRB

Have you considered using Arduino Nano? Nano is much easier to use when building circuits. You can solder it to stripboard, for example. Plus it has 8 analog inputs, so your multiplexer would not be needed.

arad2456

#17
Oct 18, 2020, 12:12 pm Last Edit: Oct 18, 2020, 12:14 pm by arad2456
thank you guys so much :)

PaulRB no I hadn't actually. I thought about it now for a while though and I think it will not fit to my project. At the end I plan to have around ~50 photo resistors so I'll have to deal with lots of muxes anyway and even now when I have only 8 photo resistors there's simply too much wires. I am planning to build a sun vector so I am going to put the PCB inside a box with a hole in its top middle so a sun ray can come inside. A black PCB will make my life very easy while I am experimenting with it on a small scale.

Paul__B my electronic's store sells only the CD version (I checked now) but I'll remember that and do a better search when I build it in the second phase with couple of muxes. The photo resistors will be mounted on the PCB, I added a photo of how it should look at the end (but with better wiring though ahahahah).  I also added a photo of how it should look after my new design. I think I kind of understand what you say but I am afraid I don't have the required knowledge in order to actually bring it to practice. It's easy, I know, but after ruining one PCB I prefer to take this time the "sure" way and do what I know will definitely work.

Ok because of some reason I can't upload the pic of the PCB I printed but it will look just like the one in the new design only with different wiring



Go Up