Good explanation Ralph. About 15 years ago I built an information display board for a friend, it was for showing stats for Ice Hockey and had 20 7 segment displays, some of them those big 3 inch ones. It was all built through-hole on veroboard (budget and time didn't stretch to a PCB!) and the bigger displays needed driver transistors, but it all worked on the same principles you described here. My friend was amazed we could connect all those displays with just a few wires. He built the controller (it was a PIC if I remember correctly) after I explained how he needed to send out a 160 bits every time he wanted to change a digit, and made it look nice with a display box. We completed it and got it working the night before the first hockey match...... The only real problem was the power supply wasn't really up to the job and got very hot due to all the LEDs but we upgraded that for the next time it was used. It was one of a number of strange projects my friend got me involved in, although usually he was the electronics man and I did the software, so it was a bit of a change for me!
Hi Ralf. I've been messing with these shift registers just this week for my next book. I've got mine wired up to SPI which makes life a bit easier, just dump the value into SPDR and off it goes. SDA goes to SER, SCK to RCLK, plus a couple of GPIO pins for CS and ~OE and Bob's yer Auntie! Hope you are well. Cheers, Norm.
Another great one, Ralph! I honestly wish I had teachers like you in uni. There were a few, but few indeed and far between. I hope people in the microcontroller community realise what a treasure your channel is. A heartfelt "thank you" is in order as I've been watching your videos for years now and have learned so much from you.
The shift register is a most useful chip. It can also be used as a divider. But its primary serial to parallel job saves so much bit banging. The "decimal point" can also be used to indicate various states. With two digits they can indicate 4 states with optional flashing. Just OR in the h bit (toggling can be done by AND 0xfe).
Using the decimal point is always a good way to show things are still running. I do that on almost all my projects (eg the Smart Workshop Heater and its sensors all do it).
Hi Ralph, its good to see you putting out SMD videos ! it was a while back now but you weren't very keen on using SMD at first and now you enjoy (or at least tolerate !) it. Great tutorial....cheers.
I'm very happy and comfortable using SMD now. It has a number of advantages, the main one is that components are a lot smaller (sometimes _too_ small for my eyes!) so you can get more on a PCB. Next video shows me soldering up that dual digit project, only a few components which is why I thought it could be a persuasive argument for those in denial to "have a go!"
The 2 digit board you bought feeds bits from left digit to right. Presumably the '595's could have been designed to shift bits from the right hand side of the module. I realise the direction is fixed at design time - so the end user can't choose to force data in from the end they wish. Another excellent video
That's right. The "overflow" from one 595 feeds the other and for some reason this design (and mine too) feeds from left to right. Perhaps it's the tens and units format we adhered to, but there is no reason at all why it cannot feed in the other direction. In fact, with a couple of jumpers (or cut-able tracks) it could be made to work in either direction.
Nice video Ralph. I really enjoyed it and the banners at the bottom were great. Every time I was thinking "But Ralph, what about this?" a banner addressing my exact question would pop up. Well done.
for those wondering how the overflow works in circuit, the input of the first register takes high, or low, and I assume it follows a clock signal, which Ralph has set up to step every time he presses a button, but usually you'd use a crystal or similar for that. it could also be just looking for a rising/falling edge (voltage goes up, voltage goes down, on, off) The OUTPUT of that register, is of course a bunch of pins, and the way a shift register functions is you press on, pin 1 gets positive voltage, you press off, pin 2 and NOT 1 gets positive voltage etc. The last pin in this sequence, however? That one feeds into the second register's input, serving as your virtual button presser, just far behind, and so if you make a four, then press all 0s, the first register will shift all of it's bits over and past that last pin, feeding into the second register, and will end up cleared out. Actually, about the clock signal, just noticed the description said latching shift register. Latching means you press ON on a push button, and instead of going OFF as you release it, it STAYS on, and so another ON press will likely either pull the signal LOW and then latched ON, or it will simply do nothing except step a clock signal, meaning your current ON state will be re-read as another bit
Yes, nicely summarised. The LATCH just copies the registers to the output (pins) so subsequent LATCHes don't do anything (they just re-copy the same registers to the output) unless the registers have changed, of course.
Always interesting... thank you!!! And one funny thing that could be done, is to show how all those bits travel from start to finish on a 4 or 6 digit display. And a clock made that way could be amusing at firt and annoying after a while...
A bit-animated, 4-digit clock, you say? Yes, amusing for a while but quite long-winded if you happen to glance up to see the time just as it's starting it's bit rolling pattern! Perhaps just do it on the hour, or something? Hmm.
16:58 for readability (again) don't use both camelCase (i.c. "charSet.h") and snake_case (i.c."wiring_shift.c") for file names in a single project. Choose one and be consistent.
I _always_ use camelCase, standard for C# programming. The "wiring" file is not mine but from Arduino themselves who obviously are animal averse. I guess we are therefore both consistent but not when mixed.
Greetings Ralph,\ i really enjoyed this video. You brought back the memories about when i first figured out the power of using shift registers as I/O expanders, the way you have done. It was such an "Aha!" moment. 😅😅 The real fireworks came when I realized that I could easily achieve a refresh rate of 5-10 times / second, with fairly rudimentary code. It still impresses me how well the chips were designed to work together, to do the low-level work so quickly and easily. Also amazing is how many years ago that was. These designs are not new! Cant wait to see your SMD assembly video on this. Trying to get my old eyes and hands geared up and trained up to do it myself! Cheers! Keep up the great work!
I'll pre-empt the video a bit and suggest you scour Banggood for SMD practice kits. They (usually) don't result in any kind of working board, they are just for SMD soldering practice. Very cheap ($5) and worth their weight in gold. SMD video on Friday 14th October, 2022 10am GMT+0100 Video #252! Be there or be square! (Something they said back in the 1960s)
Hi Ralph, I have watched a couple of your video's/tutorials and it helped me a lot to get a better understanding of how I should structure/improve my Arduino/ESP coding. The downside is that for some completed projects I decided to develop the next version purely for quality improvements which results in improved stability/reliability. Maybe its there however it would be nice if you could do a video on char/string passing and returning to/from functions. In my solutions I always avoid the use of strings as they can (when improperly used) ruin your run-time memory. Anyway long story short: A big thumbs up from the Netherlands for the way you share your knowledge and experience.
I'm happy your getting value from my videos 👍 You are correct that using Arduino Strings can fragment your Heap memory, leading to eventual crashes. Using Strings or Chars in parameters is never a great idea; it's better to use an integer that represents a String (eg an error message). That said, you can technically pass an std::string as a parameter; ideally you don't want to modify the string, especially not increase its size. Re-writing your proof-of-concept code is always a good idea. I'm always refactoring my original code, once it's working!
You know more about my stats than I do, Mike! I try to not get too transfixed by numbers except views per video, as that indicates how popular they were with my Arduinites! Of course, when I watch other people's videos and see they get 200K+ views _per video_ it does make one feel somewhat deflated. 😟
That is a great project It'd be nice if you added the dot, letters, and maybe symbols It is useful for warngings, sometime my bench power supply outputs OtP ( = Over Temp Protection ) on the 7segment display.
Nice video Ralph I have used the 8x8 led boards in banks of 4 and you can do letters as well as numbers and join the boards together to make longer words and scrolling as well great fun to play with😏
I have a 0.9m (about 3ft) strip of 8x8 LED pixels but they are controlled by a MAX7219 chip (one chip per 8x8 module) and I have a project on the go for it, right now! It's been sitting in my workshop for about 2 years waiting for this moment. Stay tuned for a future video on how that went.
16:46 for readability: don't write "tens" and "units" in the comment and then use variable names "outer" and "inner'. Instead name the variable for the outer loop "tens" and the lcv for the inner loop "units". That way your code shows what it is doing, rather than you having to explain it in the comments and have the reader confused as to why you subsequently use two different variable names in your loop. Lines 117 and 118 become immediately clear as to which one is sending units and which is sending tens. As you wrote it here, the reader has to mind-map "outer" and "inner" back to the earlier statements.
Separation of concerns. The inner and outer loops are just that. They might be used to send out tens and units _now_ but the two are not really connected. A bit like calling a variable greenLEDPin. That's my thinking, anyway.
If you chain multiple displays together, you can create a retro (scrolling) text display. It should be pretty easy: Convert (single byte ascii) text to led equivalent, optionally add some animation function, then pump the bytes to the leds bit by bit. I had to do that project in 6502 assembly as part of a college course, circa 1995; The programming and platforms may have changed a lot, but the underlying method to achieve the result (what the program has to do) stays the same.
Indeed, it's often not the "what" but the "how" that is important. Once you have the sequence of events, it "just" needs translating into the language and methodology that you are using.
It is regarding a library which can ease up using 7 segment display. So library takes care of all the shifting process. (You have mentioned around17:25 in this video) Thanks always.@@RalphBacon
Good news and bad news. The good news is that I definitely wrote a tiny library for this (and have used it in my projects). The bad news is that I never officially launched it. How about I just add it into this project's repository now? [Done] Any issues or questions let me know.
I've been aware of shift registers since I first got my hands on a TTL databook, some time in the early 1970s, I guess that was. I hadn't considered them terribly useful until considered in the context of using an arduino and wanting to minimize the number of i/o lines in use. The one shortcoming of the devices shown, both the commercial unit and the one you came up with, are that they are not stackable, in the sense of being able to build larger arrays, say four or more digits. The spacing on either side doesn't allow this to work, and perhaps it should be a design consideration for future versions.
Yes, electrically they stack (cascade) very well, but physically there is a (large) gap. Might be just about OK for a 4-digit clock. That said, it would be very straightforward to design a stackable PCB. Or use a 14-segment LED that most certainly do butt up against each other very well and you can then write _anything_ you like! Mine are not designed to stack as they have two fixed digits and are oriented vertically (you'll see next video).
Hi Ralph, as you say simple when explained well great job. As a change of topic how about something on using, now getting redundant, hard disk drive motors as stepper motors or rotary encoders, etc.
Yes, I only noticed that whilst I was editing the video and did make a note that it was a palindrome (but I changed it on the fly to include the decimal point so it was, finally, different in one direction to the other!). I only stuck with "4" as it was part of the magical "42" combo 😁
Indeed, there is a circuit diagram in a previous GitHiub of mine: github.com/RalphBacon/247-Error-Reporting-Display In summary, the "overflow" of the first 74HC595 chip on pin 9 (QH`) goes to the serial input of the second chip on pin 14 (SI, Serial In).
Well, yes, I suppose you might be able to do it with SPI but we would be cheating. There is no MISO requirement (the device never sends anything back) and the SS is not required because it is the SCK that tells the chip to read the input (MOSI) line. So not really SPI at all. The shiftOut command works well for this and my library wraps it all up to make it even easier (a future video, I think).
@@RalphBacon Why cheating? It's obvious that this is one way communication (only MOSI, CLK), and SS could be used to latch shift register. Another advantage is hardware support - less code - more space for main program. You could try SPI on f.osc/2 clock (I'm wondering is it real 8MHz on ATMega 328P@16MHz) and test/show it on oscilloscope.
I was planning on doing _something_ with them, but as the control of 14-segments requires a special chip (on the reverse of the PCB you saw) it might be a very quick video. I'll see what I can come up with!
Yes I have. Now uploaded. You can find them here (look for the Gerber Files folder): github.com/RalphBacon/251-8-bit-Shift-Register-for-7-segment-LEDs If you need anything else please ask. Note that although I used (initially) 7-segment LEDs (uk.rs-online.com/web/p/led-displays/6165428 ) from UK-based RS Components, I also found some on AliExpress that worked great (but were green, not orange). Like this: www.aliexpress.com/item/1005003861707022.html but do ensure you get the correct common cathode LEDs that is required for your project!
I have a 4 digit 7 segment display that i need to wire to the shift register, ive watched multiple videos on top of this one and its just too confusing, i know that i need to get D1-4 to cycle but there aren't enough pins to wire up to. What do i do?
Pretend you have a single digit, 7-segment display. Can you make that work with a Shift Register (spoiler: this video proves it works). To have it display values on 4-digits you will have to learn about multiplexing. That is, switching each digit on (and off again) very quickly, during which time you display the required value for _that_ digit. Then the next one and so on. It's how all bedside alarm clocks work. So you need 8 GPIO pins for each of the segments in a 7-segment display (plus the decimal point) and 4 more GPIOs for the anode (or cathode) of each of the 7-segment LED devices. I'm pretty sure I showed all this in a previous video #43. It's an older video but should show your what I mean: ruclips.net/video/6piP5YuK0Lc/видео.html
Hi, I am just having trouble writing a program to use your library functions. Can you make a video about this topic. Like 7 segment temperature monitor or something else which can utilize full functionality of your library. Thanks
It won't need a video on how to use that tiny library, believe me! Let's see... Step 1. Once you have #included the library in your sketch, by including this line at the top of your sketch: #include "DualDigit_74HC595.h" you next create the object and tell it whether your device is common cathode or common anode. If you get gibberish on the display, chances are that you have specified the wrong type. Don't guess, look it up! Example: DualDigit_74HC595 dualDigit(DualDigit_74HC595::commonLedType::CATHODE); Step 2. Then you need to initialise your 7-seg device by telling it which is your data pin, clock pin and latch pin. You can use pretty much any pins that are OUTPUT pins. On an ESP32 it might look like: #define dataPin 25 #define clkPin 32 #define latchPin 27 Example: In your setup( ) function then add the line: dualDigit.begin(dataPin, clkPin, latchPin); Step 3. In your loop( ) or other functions, just display the (integer) value you want to appear. Example: dualDigit.updateValue(value); dualDigit.sendOut(); Don't forget to include the "sendOut" function call, which does the actual transmitting of the bits, otherwise nothing will appear on the display! Is that not super simple? Let me know how you get on!
I like to move it, move it I like to move it, move it I like to move it, move it Ya like to (move it!) I like to move it, move it I like to move it, move it I like to move it, move it Ya like to (move it!) I like to move it, move it I like to move it, move it I like to move it, move it Ya like to (move it!) I like to move it, move it I like to move it, move it I like to move it, move it Ya like to (move it!) Worked ... God Bless You!
Hi Ralph Once again a fine video. Especially the first program where you can step through the serial sequence one bit at a time is great for learning. Is it possible to get the schematics for the pcb you are using for this demo in the video? BR Tomas
If you mean the larger, dual digit device (not my design) then I haven't one, but should be very similar to my own with one CAVEAT: the larger display I used is a common ANODE display (the Common pin goes to VCC), whereas my design is a common CATHODE display (Common pin goes to GND). So my design SOURCES current for the LEDs from the HC595, the larger device SINKS current into the 74HC595. See here: github.com/RalphBacon/247-Error-Reporting-Display for the schematic on which I (loosely) based mine. I've also uploaded my actual design into the above-mentioned repository.
@@RalphBacon Hi Ralph Exactly. Thanks for the schematics. I prefer CC displays as well. I am planning a similar pcb for educational use, so I find your solution as a lump of gold on my behalf :) I really enjoy your videos - they are strait forward, but still at a level where the need for paying attention is neccesary!
Well done Ralph, you are so clear on the important "bits" ;-) I like to think of the bit movement (order) as water going over a waterfall.... --->---> a b c d e f g dp
@@RalphBacon haha just wanted to say hi. Lol A hurricane in Nova Scotia took 75 my roof away with it just over a week ago. 8 days without power until yesterday or the day before. Thankfully we evacuated our 5 kitties into a vacant apartment in my basement. Water even got down there in a few rooms that That to be gutted. No water went through our hardwood floor on the main level. A testament to quality of older hardwood from the early 60s. This is probably the only time in my life where I'm happy for extensive insurance. I lost a bunch of gear but that can be replaced. The contractor had a need roof built in 4 days by himself and a very green apprentice. You don't hear of many people getting into that trade anymore. My house was built by a family of carpenters. They say carpenters do the worse work when they're not paid. I watched the previous owner replace the roof a year before we bought the place. I could go on but I'm not looking for pitty. It was good to see your video. Made me smile. Do I have to buy you a coffee every month or is it automatic? I may take you up on that pcb offer as well but I'll pay the shipping. You have tons that would be good material for my local makerspace classes as teaching material. Sorry for rambling
It's not native SPI as such but the data stream can be used as an SPI stream, or the other way around. Arduino's regular GPIO pins are not SPI; pins 13,12,11,10 are the "standard" hardware SPI pins although you could "bit-bang" the SPI protocol on any pins (much more slowly though).
Good explanation Ralph. About 15 years ago I built an information display board for a friend, it was for showing stats for Ice Hockey and had 20 7 segment displays, some of them those big 3 inch ones. It was all built through-hole on veroboard (budget and time didn't stretch to a PCB!) and the bigger displays needed driver transistors, but it all worked on the same principles you described here. My friend was amazed we could connect all those displays with just a few wires. He built the controller (it was a PIC if I remember correctly) after I explained how he needed to send out a 160 bits every time he wanted to change a digit, and made it look nice with a display box. We completed it and got it working the night before the first hockey match...... The only real problem was the power supply wasn't really up to the job and got very hot due to all the LEDs but we upgraded that for the next time it was used. It was one of a number of strange projects my friend got me involved in, although usually he was the electronics man and I did the software, so it was a bit of a change for me!
The PSU is often overlooked. My 0.9m LED matrix display uses 1.7A when fully lit. I get a feeling an Arduino would not cope.
The demo with the push buttons was a great idea. That really reinforces how the data shifts one bit at a time.
I'm glad you thought so, Mark, I was worried about switch bounce but all was well!
Hi Ralf.
I've been messing with these shift registers just this week for my next book. I've got mine wired up to SPI which makes life a bit easier, just dump the value into SPDR and off it goes. SDA goes to SER, SCK to RCLK, plus a couple of GPIO pins for CS and ~OE and Bob's yer Auntie!
Hope you are well.
Cheers,
Norm.
Sounds great! Oh, "your next book". Nicely done, Norm, good luck with it.
@@RalphBacon Thanks. It's coming along slowly, like the first one. All about Arduino Interrupts.
Cheers,
Norm.
Another great one, Ralph! I honestly wish I had teachers like you in uni. There were a few, but few indeed and far between. I hope people in the microcontroller community realise what a treasure your channel is. A heartfelt "thank you" is in order as I've been watching your videos for years now and have learned so much from you.
Wow, thank you! High praise indeed. Glad you liked it.
Nice demo! And brilliant humor choosing 42 as demo code. 😎👍
Glad you liked it! And appreciated the significance of 42.
The shift register is a most useful chip. It can also be used as a divider. But its primary serial to parallel job saves so much bit banging. The "decimal point" can also be used to indicate various states. With two digits they can indicate 4 states with optional flashing. Just OR in the h bit (toggling can be done by AND 0xfe).
Using the decimal point is always a good way to show things are still running. I do that on almost all my projects (eg the Smart Workshop Heater and its sensors all do it).
Hi Ralph, its good to see you putting out SMD videos ! it was a while back now but you weren't very keen on using SMD at first and now you enjoy (or at least tolerate !) it. Great tutorial....cheers.
I'm very happy and comfortable using SMD now. It has a number of advantages, the main one is that components are a lot smaller (sometimes _too_ small for my eyes!) so you can get more on a PCB.
Next video shows me soldering up that dual digit project, only a few components which is why I thought it could be a persuasive argument for those in denial to "have a go!"
Thank you so much. I’ve been afraid of shift registers for a long time but not anymore.
Your fears have been allayed. Good!
The 2 digit board you bought feeds bits from left digit to right. Presumably the '595's could have been designed to shift bits from the right hand side of the module. I realise the direction is fixed at design time - so the end user can't choose to force data in from the end they wish. Another excellent video
That's right. The "overflow" from one 595 feeds the other and for some reason this design (and mine too) feeds from left to right. Perhaps it's the tens and units format we adhered to, but there is no reason at all why it cannot feed in the other direction. In fact, with a couple of jumpers (or cut-able tracks) it could be made to work in either direction.
A good explanation of shift registers and how to use them
Thanks Keith, nice of you to say. 👍
Again a very good tutorial! Nice to understanding shift registers. Thanks Ralph! It's really very helpfull for me. 😊
Thanks from the Netherlands
Glad it was helpful!
Nice video Ralph. I really enjoyed it and the banners at the bottom were great. Every time I was thinking "But Ralph, what about this?" a banner addressing my exact question would pop up. Well done.
Glad you enjoyed it! Thank goodness I added all those banners!
for those wondering how the overflow works in circuit, the input of the first register takes high, or low, and I assume it follows a clock signal, which Ralph has set up to step every time he presses a button, but usually you'd use a crystal or similar for that. it could also be just looking for a rising/falling edge (voltage goes up, voltage goes down, on, off)
The OUTPUT of that register, is of course a bunch of pins, and the way a shift register functions is you press on, pin 1 gets positive voltage, you press off, pin 2 and NOT 1 gets positive voltage etc.
The last pin in this sequence, however? That one feeds into the second register's input, serving as your virtual button presser, just far behind, and so if you make a four, then press all 0s, the first register will shift all of it's bits over and past that last pin, feeding into the second register, and will end up cleared out.
Actually, about the clock signal, just noticed the description said latching shift register. Latching means you press ON on a push button, and instead of going OFF as you release it, it STAYS on, and so another ON press will likely either pull the signal LOW and then latched ON, or it will simply do nothing except step a clock signal, meaning your current ON state will be re-read as another bit
Yes, nicely summarised. The LATCH just copies the registers to the output (pins) so subsequent LATCHes don't do anything (they just re-copy the same registers to the output) unless the registers have changed, of course.
Nice tutorial. I've heard the term many times, but now thanks to you I know what it means. More like this if you can please.
Thanks, will do!
Perfect timing - I just yesterday decided I wanted to learn more about shift registers. Thank you for your content.
I knew you were interested in this topic, Daniel, enjoy!
Good work, I expect to see some library next series :) , that will help us understand how people wrote their library
The library is simple (more a wrapper, really) but could be a good intro to newcomers.
Always interesting... thank you!!! And one funny thing that could be done, is to show how all those bits travel from start to finish on a 4 or 6 digit display. And a clock made that way could be amusing at firt and annoying after a while...
A bit-animated, 4-digit clock, you say? Yes, amusing for a while but quite long-winded if you happen to glance up to see the time just as it's starting it's bit rolling pattern! Perhaps just do it on the hour, or something? Hmm.
As always, very well explained. Thanks Ralph.
Glad you liked it!
Brilliant tutorial, clear as crystal 🎉😊
Thank you! 😊 Nice to know it was understandable.
Thought I was subscribing. Realized I wasn't. Now I've set things as they should be.
Excellent! Glad to have you along, David 👍
I learned a lot. This will let me move forward on a project I have been thinking about. THANKS for sharing!
Glad it was helpful!
16:58 for readability (again) don't use both camelCase (i.c. "charSet.h") and snake_case (i.c."wiring_shift.c") for file names in a single project. Choose one and be consistent.
I _always_ use camelCase, standard for C# programming. The "wiring" file is not mine but from Arduino themselves who obviously are animal averse. I guess we are therefore both consistent but not when mixed.
Greetings Ralph,\
i really enjoyed this video. You brought back the memories about when i first figured out the power of using shift registers as I/O expanders, the way you have done. It was such an "Aha!" moment. 😅😅 The real fireworks came when I realized that I could easily achieve a refresh rate of 5-10 times / second, with fairly rudimentary code. It still impresses me how well the chips were designed to work together, to do the low-level work so quickly and easily. Also amazing is how many years ago that was. These designs are not new!
Cant wait to see your SMD assembly video on this. Trying to get my old eyes and hands geared up and trained up to do it myself!
Cheers! Keep up the great work!
I'll pre-empt the video a bit and suggest you scour Banggood for SMD practice kits. They (usually) don't result in any kind of working board, they are just for SMD soldering practice. Very cheap ($5) and worth their weight in gold.
SMD video on Friday 14th October, 2022 10am GMT+0100 Video #252! Be there or be square! (Something they said back in the 1960s)
Hi Ralph, I have watched a couple of your video's/tutorials and it helped me a lot to get a better understanding of how I should structure/improve my Arduino/ESP coding. The downside is that for some completed projects I decided to develop the next version purely for quality improvements which results in improved stability/reliability.
Maybe its there however it would be nice if you could do a video on char/string passing and returning to/from functions. In my solutions I always avoid the use of strings as they can (when improperly used) ruin your run-time memory.
Anyway long story short: A big thumbs up from the Netherlands for the way you share your knowledge and experience.
I'm happy your getting value from my videos 👍
You are correct that using Arduino Strings can fragment your Heap memory, leading to eventual crashes.
Using Strings or Chars in parameters is never a great idea; it's better to use an integer that represents a String (eg an error message).
That said, you can technically pass an std::string as a parameter; ideally you don't want to modify the string, especially not increase its size.
Re-writing your proof-of-concept code is always a good idea. I'm always refactoring my original code, once it's working!
Slowly but surely sneaking up to that 50k subscriber level. Also a respectable 4.1 million total views. Great work Ralph. Mike V
You know more about my stats than I do, Mike! I try to not get too transfixed by numbers except views per video, as that indicates how popular they were with my Arduinites!
Of course, when I watch other people's videos and see they get 200K+ views _per video_ it does make one feel somewhat deflated. 😟
I really enjoyed this explanation. thanks
Nice of you to say so, thank you 💖
Thanks Mr Digit
Welcome!
Again a very good video, very helpfull! I'm a big fan of you! Thanks Ralph.... 😊
Kind of you to say, Guido 👍
Im enjoying this series. All the best Ralph
Glad you're liking it, Gr eg!
That is a great project
It'd be nice if you added the dot, letters, and maybe symbols
It is useful for warngings,
sometime my bench power supply outputs OtP ( = Over Temp Protection ) on the 7segment display.
Yes, you can _easily_ extend the sketch in the GitHub to allow letters or symbols. Just extend the _digits array. Job's done.
Great stuff. Your approach is very easy to follow and a pleasure to listen to.
Nicely said, Hari, I'm glad you liked this video.
Well done.
Looking forward to the next one on this.
I'm just wondering what the next one is... oh, I'm editing it now! How did you know, Jorgo?
Nice video Ralph I have used the 8x8 led boards in banks of 4 and you can do letters as well as numbers and join the boards together to make longer words and scrolling as well great fun to play with😏
I have a 0.9m (about 3ft) strip of 8x8 LED pixels but they are controlled by a MAX7219 chip (one chip per 8x8 module) and I have a project on the go for it, right now!
It's been sitting in my workshop for about 2 years waiting for this moment. Stay tuned for a future video on how that went.
@@RalphBacon with baited breath🙂
@@fredflintstone1 SQUEAK!!
@@andymouse Cheese!!!!!!!!!!!!!!!!!!!!!!!!
16:46 for readability: don't write "tens" and "units" in the comment and then use variable names "outer" and "inner'. Instead name the variable for the outer loop "tens" and the lcv for the inner loop "units". That way your code shows what it is doing, rather than you having to explain it in the comments and have the reader confused as to why you subsequently use two different variable names in your loop. Lines 117 and 118 become immediately clear as to which one is sending units and which is sending tens. As you wrote it here, the reader has to mind-map "outer" and "inner" back to the earlier statements.
Separation of concerns. The inner and outer loops are just that. They might be used to send out tens and units _now_ but the two are not really connected. A bit like calling a variable greenLEDPin. That's my thinking, anyway.
If you chain multiple displays together, you can create a retro (scrolling) text display. It should be pretty easy:
Convert (single byte ascii) text to led equivalent, optionally add some animation function, then pump the bytes to the leds bit by bit. I had to do that project in 6502 assembly as part of a college course, circa 1995; The programming and platforms may have changed a lot, but the underlying method to achieve the result (what the program has to do) stays the same.
Indeed, it's often not the "what" but the "how" that is important. Once you have the sequence of events, it "just" needs translating into the language and methodology that you are using.
I am waiting for the future video. Thanks from Canada.
Coming soon! Er, hang on, what future video? Remind me!
It is regarding a library which can ease up using 7 segment display. So library takes care of all the shifting process. (You have mentioned around17:25 in this video) Thanks always.@@RalphBacon
Good news and bad news.
The good news is that I definitely wrote a tiny library for this (and have used it in my projects).
The bad news is that I never officially launched it. How about I just add it into this project's repository now? [Done] Any issues or questions let me know.
@@RalphBacon You are a Super ⭐. Thanks
18:10 Soldering SMD 🥶🥶 thats me LOL
Watch next week's video, Pekka. You might just change your mind.
I have a pile of boards that uses four 595s to drive an LED array. Was used for scrolling signage. Talk about bit-banging.
Probably the cheapest way of doing it!
Nice info, thanks for sharing it :)
Thanks for your visit! 😜
Very informative video Sir
Glad you liked it Muhammed. You been away, not seen your comments lately?
Great video
Thanks for the visit!
I'm looking forward to the code that just does it.
All in the GitHub. Well, not the library I wrote but the basic sketch.
Briliant!
Thanks, Stu, appreciated!
I've been aware of shift registers since I first got my hands on a TTL databook, some time in the early 1970s, I guess that was. I hadn't considered them terribly useful until considered in the context of using an arduino and wanting to minimize the number of i/o lines in use.
The one shortcoming of the devices shown, both the commercial unit and the one you came up with, are that they are not stackable, in the sense of being able to build larger arrays, say four or more digits. The spacing on either side doesn't allow this to work, and perhaps it should be a design consideration for future versions.
Yes, electrically they stack (cascade) very well, but physically there is a (large) gap. Might be just about OK for a 4-digit clock.
That said, it would be very straightforward to design a stackable PCB. Or use a 14-segment LED that most certainly do butt up against each other very well and you can then write _anything_ you like!
Mine are not designed to stack as they have two fixed digits and are oriented vertically (you'll see next video).
Hi Ralph, as you say simple when explained well great job. As a change of topic how about something on using, now getting redundant, hard disk drive motors as stepper motors or rotary encoders, etc.
Great suggestion! I might even have a hard disk somewhere. Although I did do a clean out before moving house 18 months ago. I'll check.
As well as SMD soldering, can you please include a short segment on how you did the pcb design?
Hmm, that's certainly an idea, Jonathan and took far longer than soldering the board up! We shall see.
The choice of "4" was a bit unfortunate for the demonstration of the significance of bit order, since it reads the same in reverse!
Yes, I only noticed that whilst I was editing the video and did make a note that it was a palindrome (but I changed it on the fly to include the decimal point so it was, finally, different in one direction to the other!).
I only stuck with "4" as it was part of the magical "42" combo 😁
@@RalphBacon No worries, you're still the man, Ralph.
Can you show the schematic where the first shift register passes the bitstream to the second shift register? Thanks.
Indeed, there is a circuit diagram in a previous GitHiub of mine:
github.com/RalphBacon/247-Error-Reporting-Display
In summary, the "overflow" of the first 74HC595 chip on pin 9 (QH`) goes to the serial input of the second chip on pin 14 (SI, Serial In).
Next time you could show us how easy is to control shift registers via onboard hardware SPI.
Well, yes, I suppose you might be able to do it with SPI but we would be cheating. There is no MISO requirement (the device never sends anything back) and the SS is not required because it is the SCK that tells the chip to read the input (MOSI) line. So not really SPI at all.
The shiftOut command works well for this and my library wraps it all up to make it even easier (a future video, I think).
@@RalphBacon
Why cheating? It's obvious that this is one way communication (only MOSI, CLK), and SS could be used to latch shift register. Another advantage is hardware support - less code - more space for main program.
You could try SPI on f.osc/2 clock (I'm wondering is it real 8MHz on ATMega 328P@16MHz) and test/show it on oscilloscope.
I saw at the bottom of your video a set of 4 14 segment display could you do a video about that.
I was planning on doing _something_ with them, but as the control of 14-segments requires a special chip (on the reverse of the PCB you saw) it might be a very quick video.
I'll see what I can come up with!
do you have the gerber file available, want to build a countdown timer! great work.
Yes I have. Now uploaded.
You can find them here (look for the Gerber Files folder):
github.com/RalphBacon/251-8-bit-Shift-Register-for-7-segment-LEDs
If you need anything else please ask.
Note that although I used (initially) 7-segment LEDs (uk.rs-online.com/web/p/led-displays/6165428 ) from UK-based RS Components, I also found some on AliExpress that worked great (but were green, not orange).
Like this: www.aliexpress.com/item/1005003861707022.html but do ensure you get the correct common cathode LEDs that is required for your project!
@@RalphBacon Thanks! I'm going to get some made!
Yes, a shifty video for a doddering old lot like me! But how does one eat an elephant, one byte at a time.
Really easy to use, David, you should get one of those modules and have a go. Nothing beats doing it yourself.
could you design perpetual calendar in STM32 please
Sorry I don't do custom code, but if you can connect to Wi-Fi you can then get the current date/time from an NTP server.
I’m going to a wedding, thanks for the chat topic. “Hey Jim I have been messing around with my 74HC595… You?
Don't forget to include the words "... yes, that old 8-bit Shift Register!"
I have a 4 digit 7 segment display that i need to wire to the shift register, ive watched multiple videos on top of this one and its just too confusing, i know that i need to get D1-4 to cycle but there aren't enough pins to wire up to. What do i do?
Pretend you have a single digit, 7-segment display. Can you make that work with a Shift Register (spoiler: this video proves it works).
To have it display values on 4-digits you will have to learn about multiplexing. That is, switching each digit on (and off again) very quickly, during which time you display the required value for _that_ digit. Then the next one and so on. It's how all bedside alarm clocks work.
So you need 8 GPIO pins for each of the segments in a 7-segment display (plus the decimal point) and 4 more GPIOs for the anode (or cathode) of each of the 7-segment LED devices. I'm pretty sure I showed all this in a previous video #43. It's an older video but should show your what I mean: ruclips.net/video/6piP5YuK0Lc/видео.html
super bro
Glad you found it useful (or entertaining)!
wonderful video!!
I really like the way you explain things, would give 2 thumbs up if possible
keep up the good work
Thank you very much! Two thumbs up you say? Wow!
Hi, I am just having trouble writing a program to use your library functions. Can you make a video about this topic. Like 7 segment temperature monitor or something else which can utilize full functionality of your library. Thanks
It won't need a video on how to use that tiny library, believe me! Let's see...
Step 1. Once you have #included the library in your sketch, by including this line at the top of your sketch:
#include "DualDigit_74HC595.h"
you next create the object and tell it whether your device is common cathode or common anode. If you get gibberish on the display, chances are that you have specified the wrong type. Don't guess, look it up!
Example:
DualDigit_74HC595 dualDigit(DualDigit_74HC595::commonLedType::CATHODE);
Step 2. Then you need to initialise your 7-seg device by telling it which is your data pin, clock pin and latch pin. You can use pretty much any pins that are OUTPUT pins. On an ESP32 it might look like:
#define dataPin 25
#define clkPin 32
#define latchPin 27
Example:
In your setup( ) function then add the line:
dualDigit.begin(dataPin, clkPin, latchPin);
Step 3. In your loop( ) or other functions, just display the (integer) value you want to appear.
Example:
dualDigit.updateValue(value);
dualDigit.sendOut();
Don't forget to include the "sendOut" function call, which does the actual transmitting of the bits, otherwise nothing will appear on the display!
Is that not super simple? Let me know how you get on!
Thank you very much. :)@@RalphBacon
I like to move it, move it
I like to move it, move it
I like to move it, move it
Ya like to (move it!)
I like to move it, move it
I like to move it, move it
I like to move it, move it
Ya like to (move it!)
I like to move it, move it
I like to move it, move it
I like to move it, move it
Ya like to (move it!)
I like to move it, move it
I like to move it, move it
I like to move it, move it
Ya like to (move it!)
Worked ... God Bless You!
Excellent! 👍
Love your face Mr Bacon
I'd probably like yours just as much, I'm sure!
Hi Ralph
Once again a fine video. Especially the first program where you can step through the serial sequence one bit at a time is great for learning.
Is it possible to get the schematics for the pcb you are using for this demo in the video?
BR
Tomas
If you mean the larger, dual digit device (not my design) then I haven't one, but should be very similar to my own with one CAVEAT: the larger display I used is a common ANODE display (the Common pin goes to VCC), whereas my design is a common CATHODE display (Common pin goes to GND).
So my design SOURCES current for the LEDs from the HC595, the larger device SINKS current into the 74HC595.
See here: github.com/RalphBacon/247-Error-Reporting-Display for the schematic on which I (loosely) based mine.
I've also uploaded my actual design into the above-mentioned repository.
@@RalphBacon Hi Ralph
Exactly. Thanks for the schematics. I prefer CC displays as well. I am planning a similar pcb for educational use, so I find your solution as a lump of gold on my behalf :)
I really enjoy your videos - they are strait forward, but still at a level where the need for paying attention is neccesary!
Will Bacon be using the hotplate method? I like mine crisp but not burnt.
Hmm, crispy Bacon 😋 Although USA bacon is very, very different to UK bacon (and I'm not talking about accent).
Well done Ralph, you are so clear on the important "bits" ;-)
I like to think of the bit movement (order) as water going over a waterfall....
--->--->
a
b
c
d
e
f
g
dp
Yes, that's a good metaphor!
Hey RALPHIE!?!?!?!?
Hey, Joeyeyeyyeye! (Yeah, I know, doesn't work). But nice to see you here.
@@RalphBacon haha just wanted to say hi. Lol A hurricane in Nova Scotia took 75 my roof away with it just over a week ago. 8 days without power until yesterday or the day before. Thankfully we evacuated our 5 kitties into a vacant apartment in my basement. Water even got down there in a few rooms that That to be gutted. No water went through our hardwood floor on the main level. A testament to quality of older hardwood from the early 60s. This is probably the only time in my life where I'm happy for extensive insurance. I lost a bunch of gear but that can be replaced. The contractor had a need roof built in 4 days by himself and a very green apprentice. You don't hear of many people getting into that trade anymore. My house was built by a family of carpenters. They say carpenters do the worse work when they're not paid. I watched the previous owner replace the roof a year before we bought the place. I could go on but I'm not looking for pitty. It was good to see your video. Made me smile. Do I have to buy you a coffee every month or is it automatic? I may take you up on that pcb offer as well but I'll pay the shipping. You have tons that would be good material for my local makerspace classes as teaching material. Sorry for rambling
Is that SPI?
you can drive shift registers with the SPI peripheral
Are the arduino regular data pins spi ?
It's not native SPI as such but the data stream can be used as an SPI stream, or the other way around.
Arduino's regular GPIO pins are not SPI; pins 13,12,11,10 are the "standard" hardware SPI pins although you could "bit-bang" the SPI protocol on any pins (much more slowly though).
Is that how bitcoins are made?🥳
Does anyone know how BitCoins are made?