How transfer data from 4 chips CD4026 to PC array, ussing arduino uno? - Page 1
Forum section: electronics / general

author: Rhou
author_rank: Newbie
timestamp: March 09, 2025, 08:44:59 pm
content: How transfer data from 4 chips CD4026 to PC array, ussing arduino uno?automatic generation 4 random digit for interval 5 sec.

author: Benta
author_rank: Super Contributor
timestamp: March 09, 2025, 09:40:08 pm
content: Not a lot you can do except read the 28 segment lines and act accordingly.

author: Ian.M
author_rank: Super Contributor
timestamp: March 09, 2025, 10:39:42 pm
content: OTOH, the ATmega328P on the Arduino Uno has hardware counter/timers, and the 16 bit one, Timer 1, can be used without interfering with normal Arduino operation, and clocked by a signal on digital pin 5, so it may be sufficient to connect the Arduino to the clock and other control signals driving the CD4026 counter chain and have the Arduino do its own counting, reducing the number of signals you need to hook up to two or three.

author: forrestc
author_rank: Unknown
timestamp: March 09, 2025, 10:55:24 pm
content: I have to ask the question... why?There are many ways to get a hardware-generated random number, which will be less of a PITA than trying to read the value this is producing.For example, reading the least significant bit of a floating analog input multiple times to utilize the noise on the ADC input as an entropy source. (Search for "ADC as hardware RNG" for ways to do this).If the value needs to be displayed as well, then adding a display to an Arduino is relatively straightforward.

author: themadhippy
author_rank: Super Contributor
timestamp: March 10, 2025, 12:11:07 am
content: web cam pointed at the display bit of ocr job done

author: PCB.Wiz
author_rank: Super Contributor
timestamp: March 10, 2025, 03:49:17 am
content: Quote from: Rhou on March 09, 2025, 08:44:59 pmVery unusual request? Perhaps a 'bot?The CD4026 is higher voltage than Ardunio, and counts 7-segment.If this existing equipment? simply generates a random number, rather than level shift and read 28 segments, you could simply count the clocks, and maybe reset signal (if even present)?Addit: How fast does this clock? One 'random generation' scheme may run a fast clock, and then a slower gate, both using RC timers.The counter overflows many times, but that is unseen by the user.A MCU can usually count up to just under SysCLK/2 for a 50% waveform, but you may need > 16 bit timer.

author: pcprogrammer
author_rank: Super Contributor
timestamp: March 10, 2025, 06:40:25 am
content: As the interval is slow sampling only 7 wires at once with a multiplexer setup will do the trick. You will need level shifters or resistor based dividers to match the voltages to the multiplexer inputs. You need 7 4 input multiplexers to read the 4 digits.In the software do the sampling often enough to catch each transition and send them to the PC via serial print.

author: Ian.M
author_rank: Super Contributor
timestamp: March 10, 2025, 08:19:49 am
content: Quote from: PCB.Wiz on March 10, 2025, 03:49:17 amThe overflowing counter mismatch problem is fixable in software. The CD4026 decimal counter chain counts 0 - 9999, but a 16 bit binary counter counts 0 - 65535. After seven rollovers of the decimal counter, there are only 5536 pulses till the 16 bit counter rolls over. At that point 'bump' it by adding 5535, so at all times the 16 bit count modulo 10000 matches the decimal counter.(hopefully I haven't got a 'fencepost' error in the above)

author: Rhou
author_rank: Newbie
timestamp: March 10, 2025, 09:22:28 am
content: Quote from: pcprogrammer on March 10, 2025, 06:40:25 ammaybe 4 multiplexers with 7 inputs? what chip would you recommend?

author: Rhou
author_rank: Newbie
timestamp: March 10, 2025, 09:23:42 am
content: Quote from: Ian.M on March 09, 2025, 10:39:42 pmgood idea. but, my signal is - white noise. cd4026 at the input. but will the incoming pulses be the same? can be different or skipped. need exactly the same.Modify message

author: pcprogrammer
author_rank: Super Contributor
timestamp: March 10, 2025, 09:38:36 am
content: Quote from: Rhou on March 10, 2025, 09:22:28 amEasiest is to use the 7 multiplexers as it will give you one digit per scan, but it is also possible to do it with 4 multiplexers that have 7 inputs. This makes the software a bit more complex since you scan the separate segments and need to de serialize the input, but you need to decode the data anyway.For the 4 input multiplexers the 74153 in what ever form is available (LS, HCT, etc) can be used. These are dual 4 to 1 multiplexers with combined selects, so you would need 4 of these IC's. For the other option the 74151 can be used. You would also need 4 of those, so does not matter in the IC count.The only difference is the number of pins needed on the Arduino UNO. 9 versus 7.

author: dietert1
author_rank: Super Contributor
timestamp: March 10, 2025, 09:39:18 am
content: Another effective solution is a SPI peripheral made of four parallel load 8 bit shift registers.What is the supply voltage of those CD4026 counters?What is the counting frequency? 65535 in 5 seconds gives about 13 KHz. Easy to capture.

author: Rhou
author_rank: Newbie
timestamp: March 10, 2025, 10:02:46 am
content: Quote from: dietert1 on March 10, 2025, 09:39:18 amnot need fast. read slowly. every 5 seconds. 5 seconds of generation. after then it stops and the led lights up the digits also for 5 seconds. and repeat.cd4026 power supply 9 volts.

author: dietert1
author_rank: Super Contributor
timestamp: March 10, 2025, 12:50:10 pm
content: Quote from: Rhou on March 10, 2025, 10:02:46 amSo one could use CD4014 shift registers from the same supply and insert three level shifters on the SPI side (chip select = capture, spi clock, slave out = master in).

author: Ian.M
author_rank: Super Contributor
timestamp: March 10, 2025, 01:01:14 pm
content: The Arduino as counter could work if you guarantee the CD4026 counter chain and the Arduino count to the same result, by inserting a comparator in the clock line to the first CD4026 to get a known threshold for the clock pulse, and simply count the pulses using the Arduino Timer 1 as described above. Use a quad comparatior with open collector outputs with all the -INs held at 4.5V, (half of the 4000 logic Vdd), a pullup to +9V on the output driving the CD4026 clock, and use the remaining comparators with pullups to +5V as level shifters to feed the Arduino with the thresholded clock + the other control signals that drive the CD4026 counter chain. You may need some extra logic to gate the clock to the Arduino if that's how the board handles its alternating count/display function to avoid it occasionally being off by one count.However I think t would be simpler to pull all the socketed CD4026 chips and drive the displays from the Arduino so you can be *ABSOLUTELY* certain that both use the same count.It would help if you can show us a schematic for the existing board.

author: PCB.Wiz
author_rank: Super Contributor
timestamp: March 10, 2025, 06:34:21 pm
content: Quote from: Rhou on March 10, 2025, 09:23:42 amDo you have a scope ?If you can capture the input clock waveform and the clock to the second counter?You could reduce the wiring to 8 or less, by sample the 7 (or fewer) segments of ctr 1 and the ctr 1 clk out, and have the MCU track the total.The MCU timer then counts at 1/10 the peak LSB speed, and you would need to do a binary to BCD conversion to extract the upper 3 digits. (could be > 16 bits)Addit: you need 5 wires to extract BCD from 7 segments.https://www.elektormagazine.com/magazine/elektor-197612/57792That's just 6 signal wires in total, to your MCU. Level shifters can be resistors, or a CD4049/CD4050.

author: Rhou
author_rank: Newbie
timestamp: March 11, 2025, 09:17:35 am
content: I liked the idea of ​​using an arduino counter. I will use additional logic. I have an oscilloscope, I will show you what the signal of my white noise generator is.noise frequency 80KHz - 500KHz. CD4026 input reaction level about 5,8 volts. :

author: PCB.Wiz
author_rank: Super Contributor
timestamp: March 11, 2025, 06:43:46 pm
content: Looks ok.Put the scope on the clock-out of the first 4026, to check the narrowest pulses.

author: Rhou
author_rank: Newbie
timestamp: March 11, 2025, 08:08:02 pm
content: signal about 9volts, at pin 5 on first CD4026BE:but, I still need, automatic controled regular and regulate interrupted (stop/start/stop...) intervals 1-10 seconds, my white noise signal, before both counters,..