Electronic Dice - How can I improve this circuit / build? - Page 1
Forum section: electronics / beginners

author: jewelie
author_rank: Regular Contributor
timestamp: January 14, 2018, 02:37:16 am
content: HiyaTL;DR Jump to the question at the end in bold.Decided to make up a stupidly cheap Chinese electronic dice circuit up (the one that decodes into a normal die face) and put it in a box as an excuse to get some practise in, especially the hacking up a box part.As is always the way, it almost worked right!But debugging and fixing is all part of the fun and the learning experience.Firstly, there's an error on the PCB layout. one of the LEDs has been put in the wrong place. (So a 3 looks like .-. instead of .-', a 2 looks like . . instead of . ', etc.) Fortunately I managed to work around that.The bigger problem: the circuit had a huge bias for selecting the number 1!Given that 1 has the least number of LEDs lit, and given that I am running the circuit on a pair of CR2032s (the most I can fit in the box) I figured this was probably an artefact of circuit current draw and voltage drop across the batteries? Measuring the voltage with a DMM and confirmed the unstable supply voltage depending on what was displaying. Oops.So.... I played about with the current limiting resistor values: changed the 500ohm current limiting resistor for the single LED to 4.7Kohms and the 100ohm ones for the dual parallel LEDs to 2.2Kohms. Very little affect on brightness but hopefully a big change in current. Sadly, that didn't fix it.Next.... I tried speeding up 555's pulses by reducing the 10uF capacitor to 1uF. Was still biased too much to 1. Left the 1uF in.Tried a 220uF capacitor across the power. Still liked 1 too much. Left the 220uF there.Finally, I gave up on the 47uF capacitor on the transistor base's RC input. This means no delayed switch off now and makes the transistor kinda redundant but...... BINGO... that works.And that's where I am.QUESTION: How can I add 47uF capacitor back in to give the roll button a delayed switch off again without biasing the circuit towards showing 1 or otherwise being not as random? Assuming it's due to slightly unstable power, I can't really power it by anything juicier than the two CR2032s.Would adding something like a LM2940CT-5.0 voltage regulator work, as there's an extra 1V to play with and it's low drop out (0.5V @ 1A but much much less when the current is much less, which this is.) I've got a dodgy cheap chinese pack of 5 of LM2940CT-5.0 on order as, if they work, they might be handy.Warm RegardsJulie (Derby, UK)

author: Cyberdragon
author_rank: Super Contributor
timestamp: January 15, 2018, 11:40:42 am
content: No, you don't have an extra volt. There's a protection diode in there, so there goes half a volt. The 555 minimum voltage is about 4.5V so at 5V - 0.5V it wouldn't be happy. If it will fit, this circuit should just run straight from a 9V, the LED current would have to be checked though. You could add a 6V regulator if that would be a problem.(Yes, I know chips can sometimes work outside their operating range, but it's not guarunteed.)Note: You could also rip out that nasty silicon rectifier diode and replace it with a schottky diode for less loss.EDIT: of course, you could just remove the diode entirely, just be careful. Also, the 4017 minimum voltage should be 3V, so it shouldn't be cutting out (of course, it could be fake and dodgey).Wait...are D1, D7, and D9 supposed to be backwards?Doh, it's inverted. But it's also the pin that triggers the one. That should't affect it though, but I'm not sure how much current the 4017 will sink on it's grounded pins.

author: jewelie
author_rank: Regular Contributor
timestamp: January 23, 2018, 05:07:58 am
content: Thank you! Yes, the plan was always to rip out the rectifier diode if I was going to try that regulator. Can't fit a 9V in there, no.For £1 delivered I fully assume the CD4017 is entirely fake.I did dramatically reduce the current draw on it. If it goes it goes, I've got another one from another kit or I could get a proper one with a future CPC order.Ta again.