This by far is the most helpful video on this topic! You should be really proud! There is a sea of videos on this topic and this one is a beacon! I Great work!
I really like how your videos show elementary tasks (introduce components, place components, connect wires, type code, et c.) with creating advanced results, and your companion articles are a great resource to follow at a slower pace. Your work is just right.
Awesome video! But let me tell of you a trick: there's a way to use only 4 wires instead of 6 to have expandable inputs AND outputs. This is great because you can use cheaper MCUs that have only 4 I/O pins instead of 6 or more. Another benefeat of this method is that you replace the input shift register for another output one, and it's generally cheaper to buy a pack of the same ICs. Basically you need: 3 output pins 1 input pin 2 output shift registers 1 resistor And as many diodes as buttons you want. Using this method you can expand your I/O pins from 4 to whatever you want If you or someone wants to know about this method let me know
Interesting, I think I may have seen that trick on RU-vid somewhere, thanks for sharing! It is also possible to do everything in this video with four wires, because you can basically share the CLOCK wire between registers (which I didn't do for simplicity) and also the DATA pin (also didn't do, because I wanted to keep things simple). So: one wire for data, one wire for clock, and then two enable lines, and that would get you an infinite number of inputs/outputs (at least in theory) :)
Thank you, glad you like it! Yeah, these are perfect for smaller LEDs. For bigger LEDs also check out my video on the TLC5916 driver: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-EsUxWO096L0.html
Good question! I learned C from a book, but in all honesty this was all useless to me for working with PICs. I basically looked at peoples' codes and tried to understand them, one by one, this was the easiest for me to learn. Wireless stuff is interesting, but it is quite far away from the level at which I place these tutorials here. If you have a link to what you have in mind, I would love to check it out! :)
"It activate it like Minecraft piston." Lol, that's fun. I am amaze by this presentation. I am frustrated in understanding this because mine doesn't work and I am switching from 74HC165 to CD4021 shift register due to it's lack of information to fix that or do that shift register and it is just annoying.
I am glad you liked the video! Yes, it can be very frustrating... Sometimes it helps to just have the shift register, with LEDs at all outputs, and pushbuttons at the input pins (with debounce capacitor and pulldown/pullup resistor) to check everything step by step. Have you tried that? Let me know if this helps. If not, I can explain more. Don't be discouraged by this. It is a normal experience, and I have had similar experiences, too. I almost gave up many times. But I know you can do this :)
@@FriendlyWire I actually did it. I didn't know 'shiftIn()' function actually works but it is quite tricky at timing. I just keep on believing on it that it'll work until it did and made me so happy. Also, for people reading this I don't recommend using breadboard I recommend soldering it in a temporary soldering board because breadboard can have a chance of loose connection of the resistors causing it to read different.
@@yamitokyoo I'm glad that it works now, congratulations! Awesome job, and thank you for sharing!! Yes, the timing can be a bit tricky, in the sense that if you do the clock pulses too quickly it may be too fast for the shift register. This is why I run these examples here at 4MHz (effectively 1MHz with PICs) which is slow enough so we don't have to worry. I am glad you got it working on a PCB! I like breadboards because they are so flexible, but if you get a bad breadboard it can be extremely frustrating because of loose wires/bad connections. Glad it worked out! :)
@@misterretrowolf1464 Thank you so much! The real problem is the amount of video tracks, especially when there is overlapping motion. I think in this video it was a new extreme and around 35 at some point.
@@FriendlyWire yes exactly!I was marveling at the fact your numbers move in a curve, when you could much easier moved them straight! True attention to detail.
I took separate photos (around 180 of them) and aligned them using a function in Photoshop. Unfortunately, Photoshop is the only program I could find (so far) that does a good job at that.
I was trying to make some sort of screen out of LED's. I'm not sure how to effectively that will work out but it's fun to try. The shifting works with two shift registers but now I need to see if I can do pwm with them and control each light.
@@Gkid8Oh I see! In that case you can also try to use the TLC5916 (video on my channel) or the MAX7219 (also video on my channel) if you are OK with multiplexing. Good luck!
@@FriendlyWire The MAX7219 seems really nice but the price point it pretty high for my price range. I might as well buy an arduino screen I feel like for $11. The TLC5916 has a better price and I will have to check that out. What I was trying to do with shift registers was multiplex something like 32 LED's on the input and output side to make a screen. This is a project I started 5 years ago and left it in a bin. I'm only circling around to it again as I was cleaning things up and remembered I didn't know how to finish this back then. My initial design may need some changing but we will see.
@@Gkid8The MAX7219 is expensive if you buy it separately, but you can get it in ready-made modules on many websites, and that will be cheaper (even as a DIP chip). Send me an email if you want and I can show you (you can find my email at the bottom of www.friendLywire.com). Your project sounds fun!
In the video I describe how the CD4021 and CD4094 work, you can implement this on any microcontroller platform you like. I use 3 pins for the CD4021 and 3 for the CD4021. You could perhaps the clock pins, and also the data pins maybe. Do you have a schematic or program to follow?
Is the output of the output-register a separate storage register or only a latch? I am searching for a shift reg where I don't disturb my outputs while shifting and I found this one. It looks to me that it has an output storage register + a latch for OE, but this makes me wonder why it's so much cheaper then the 74HC595.
It might be posible to adapt the extra buttom of the SNES controller to the input of a NES controller with this trick?...and how will be perceive by the NES console? ... Will be great if all the above wiil be made into the single motherboard of the SNES controller.
Thanks for the question :-) I am not sure if I understood 100%, but yes, it should be possible to connect the CD4021 to the NES, to make it think that it is a controller. Is that what you meant? :)
Man würde also Anschlüsse am Prozessor oder Controller sparen, aber gibt es denn auch ne möglichkeit die Uhrschläge zu sparen. Also die Clock Cycles. Dadurch dass man nun die Daten seriell sendet benötigt man doch für jedes bit einen Impuls. und so würde man doch in einem System, wie einem Game Boy oder der NES wichtige Rechenzeit für den Input nutzen. Könnte man dafür nicht einen weiteren Prozessor nehmen? Einer der nur auf die Inputs achtet?
Die Rechenzeit dafuer ist minimal, weil du die Inputs ja nur maximal einige hundert Mal pro Sekunde abfragst, es geht ja um menschliche Computereingaben, und nicht um digitale Signale. Wenn Du schneller reagieren moechtest, dann ist diese Auslesemethode in der Tat nicht die idealste, aber fuer Konsoleninputs reicht es alle mal :)
I would always recommend CMOS chips due to their wider operating voltage, so: the CD4094. But it depends on what you want to do with it. Remember that the CD4094 is not an LED driver, it can merely supply logic signals at its outputs. If you want to drive LEDs, I recommend the TLC5916 instead ( ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-EsUxWO096L0.html ).
Nice! I don't know anything about electronics. Well, I know some stuff and have repaired some things. Currently I'm working on some kind of modular pinball machine that is driven by a program on my PC. The problem is, I need an IO interface board with enough inputs and outputs to drive the switches, lights, coils... Thing is that they should be able to turn and stay on at the same time, so a multiplexor might not work for me. Instead, could this be a good solution for me? To clarify, I need about 96 inputs, 80 output for lights, another 67 outputs for relays, and about 10 outputs for extra stuff. I might need to add more of them in the future 😅
Hey Mike, I am glad you liked the video! Yes, this may be what you need. You can use a shift register in combination with an ULN2803A driver chip to drive your relays, and that chip also has a protection diode built in. For the inputs you can probably use the CD4021 as is. And I guess the refresh rate of this is low enough that you will get away with having all registers in series (and you can always add more in the future). Let me know if you have any questions, I am happy to help.
This is so helpful!! I'm curious though if the VDD for the 4094 shift register can be lower than the VDD for the Microcontroller. In your example, both microcontroller and 4094 are running at +4.5V. Can we connect a microcontroller running at +5V to a 4094 running at +3.3V or will that damage the 4094?
Thank you, glad you like the video! It's generally not a good idea to run logic chips on the same circuit at different voltages. Is there any reason why you need different voltages?
@@FriendlyWire My apologies for the delay. The main logic chip I am using runs at 3v3, but the PICs i program i typically run at 5v. I was able to test some things on the breadboard and get things to work together just running my PICs at 3v3 now instead. Thanks again for your help. My next question is how this relates to SPI. I've seen that microchip has some digital potentiometers, but they require SPI to communicate and I'm thinking there is a connection somewhere in there.. but I've just got to keep looking... :)
@@lubdar A lot of PICs can run just fine at 3V. The PIC16F1455, for example, works fine in the range of 2.3V to 5.5V. SPI is a serial protocol to transmit and receive data with other devices. Do you have a datasheet for this potentiometer? What do you want to build? :)
@@FriendlyWire Thanks So much!! I apologize for my delayed response. I'm kind of all over the place with exploring and learning new bits of code at the moment, I would like to digitally control the nuvoton ISD17120PY voice recorder to record and play back audio recordings. Needless to say, my limited knowledge of SPI is holding me back. But this video has helped me and I have even incorporated the CD4094 into a current project so thank you, again for creating these videos!!!
@@lubdar No worries, I know this hobby can consume a lot of time when we're learning new things. I am so excited to hear about your progress, congratulations! Let me know if you have any questions, I will be happy to help, and thank you for your kind words!
Hi, Sir I hope u are doing good. I just wanna ask one thing , in one of your videos in which u are multiplexing max7219 dot matrix module with pic microcontroller, in that tutorial u have used pic16F1455, Sir can I use pic16F877a microcontroller and what should be the changes in pin connections plus the program code. Can u please please guide me regarding this it would be of great help. Best wishes for you... Sir u just have clear explanation that is why I'm bothering you, I literally need a guidance for my project.
Yeah, of course, it is possible. Did you follow the MAX7219 tutorial? If yes, the next step is to set up a project for the PIC16F877A in MPLAB. Does that work already? If yes, we can do the next steps :)
@@FriendlyWire Sir I'm a bit confused for the pin connections of pic16F877a with max 7219 module? And would the entire code be same as it is for another microcontroller?
@@Syeda-Hadia I would love to, but it's a bit difficult within RU-vid comments. Can you reach out on Twitter? (Email also works, you can find it at the bottom of my website www.friendlywire.com)
You can add a third shift register in series :) See here for cd CD4094 (www.friendlywire.com/tutorials/cd4094-cd4021/#ch6) and here for the CD4021 (www.friendlywire.com/tutorials/cd4094-cd4021/#ch7). Let me know if it helps!