Model Railway Forum

Go Back   Model Railway Forum > Model Railway Construction > Wiring & Electronics > Other


Reply
 
Thread Tools Display Modes
Old 10-10-2017, 11:57 PM   #31
AviatorAtHeart
Don't ask, I don't know!
 
AviatorAtHeart's Avatar
 

Join Date: Jun 2017
Location: Chalfont St Peter
Posts: 314
AviatorAtHeart is on a distinguished road
Default

Quote:
Originally Posted by Gordon H View Post
For generating psudo-random numbers with conventional logic, one of the usual techniques is to employ a serial-in parallel-out shift register and exclusive or gates. The exclusive or gates are connected to a combination of the shift register outputs and the final gate output is fed back into the shift register serial input.
See: https://en.wikipedia.org/wiki/Linear...shift_register
Mind blowing! even if I wasn't shattered......
Way more than my grey matter can comprehend!
I'll read it again later and see if it makes any sense, but I doubt it.
__________________

You can only drink so much lemonade
AviatorAtHeart is offline   Reply With Quote
Old 10-10-2017, 11:59 PM   #32
AviatorAtHeart
Don't ask, I don't know!
 
AviatorAtHeart's Avatar
 

Join Date: Jun 2017
Location: Chalfont St Peter
Posts: 314
AviatorAtHeart is on a distinguished road
Thumbs up

Quote:
Originally Posted by Teedoubleudee View Post
Glad you are having some fun there AaH. Thinking about it, what with components being so cheap especially if bought in bulk from China, one could build loads of these circuits and put one in every building. With long on/off times and slightly different values you could achieve something approaching a random effect. Do publish your finished circuit when complete so others can have a go.
Yeah having fun is what it's all about!
That and bacon rolls.......

Of course I will (publish!) hah hah, sounds way too official for my offerings..... But yes, you're welcome to my madness!
__________________

You can only drink so much lemonade
AviatorAtHeart is offline   Reply With Quote
Old 11-10-2017, 08:02 AM   #33
AviatorAtHeart
Don't ask, I don't know!
 
AviatorAtHeart's Avatar
 

Join Date: Jun 2017
Location: Chalfont St Peter
Posts: 314
AviatorAtHeart is on a distinguished road
Default

All 6 outputs from CD40106 IC.
The green led circuits were made up from an absolutely random assortment of capacitors and resistors.....literally the first things I plucked from the component tray (stuff pulled from past breadboard quests as yet to be sorted)

The chip is about 40pence or less.

https://flic.kr/p/ZhqUyQ

I think you get a nice enough on/off phase....just needs a longer on moment.
(Imagined at 18 leds as a minimum.......pretty cool looking!)

Also I think a switch (spdt) between 555 pin 3 out to Vcc on 40106 would allow on phase only.
So it isn't cycling. (Except the two leds on the 555 circuit, but you could replace these with regular diodes I guess, 1N400x family.)

Another thought, instead of a switch, use a pot like in the previous video, so you can adjust the rate, make it large 470k plus equal resistor......that should be on at full resistance (it was in the previous tests, well, it was on for longer than I was prepared to wait using a b1M pot!)
__________________

You can only drink so much lemonade

Last edited by AviatorAtHeart; 11-10-2017 at 08:18 AM.
AviatorAtHeart is offline   Reply With Quote
Old 11-10-2017, 09:30 AM   #34
chris_db4
Senior Member
 

Join Date: Nov 2014
Posts: 559
chris_db4 is on a distinguished road
Default

Its a very nice on sequence, but the off side of it is very much everyone goes to bed at the same time and the lights go out. Modelling the war periods perhaps?

As your powering down the timing side of the trigger circuit any instability in the RC circuit that would build in instability is lost as well.

Perhaps feed the 6 inputs into a flip flop for set and have another similar circuit for reset then would give staggered on and off, with random use of RC values would be different timings but still predictable. could also source some of the LED's on the high output so that all outputs high doesn't mean all lights off. The last output resets the first timer, or it could be the 4th and then some are still turning off while the first one is timing to turn back on again.

Anyway just some thoughts on it, its a nice idea, I even just like the idea of using it for staggered turning on, even though you would only see the effect at the start of a session.
chris_db4 is offline   Reply With Quote
Old 11-10-2017, 10:49 AM   #35
AviatorAtHeart
Don't ask, I don't know!
 
AviatorAtHeart's Avatar
 

Join Date: Jun 2017
Location: Chalfont St Peter
Posts: 314
AviatorAtHeart is on a distinguished road
Default

Quote:
Originally Posted by chris_db4 View Post
Its a very nice on sequence, but the off side of it is very much everyone goes to bed at the same time and the lights go out. Modelling the war periods perhaps?

Yes I agree fully with the above....even blackout wasn't so regimented!
------------//////
As your powering down the timing side of the trigger circuit any instability in the RC circuit that would build in instability is lost as well.

The timing side is the 555ic this always has power. I use the output switch to power down the trigger IC.
-------------//////
Perhaps feed the 6 inputs into a flip flop for set and have another similar circuit for reset then would give staggered on and off, with random use of RC values would be different timings but still predictable. could also source some of the LED's on the high output so that all outputs high doesn't mean all lights off. The last output resets the first timer, or it could be the 4th and then some are still turning off while the first one is timing to turn back on again.
-----------////////
Do you mean the led input? It does need a reverse cycle... for off.....
I'll look at that but I really don't know what I'm doing! I just have an assortment of parts bought for a synth (I read about synth circuits) although I'm still very much a novice! Just a keen experimenter.....
Easiest way would be a second trigger chip with its own cycle? (I think, but I'm answering in haste)
------/////////////
Anyway just some thoughts on it, its a nice idea, I even just like the idea of using it for staggered turning on, even though you would only see the effect at the start of a session.
Yes I really like the staggered on cycle.
Perhaps you can remotely assist in the development!
Please!

Once a unit has been finalised, I'll draw up instructions for a stripboard.
Then anyone can make it!
(They will look exactly like my other stripboard plans....only one is online for the noose toaster, see my electronics album on Flickr....the links above are all in the same album.)

I'm pretty inspired by this, so while I'm saving for the next parts of my layout, I have not much else better to do with my spare time, excepting aviation models!
__________________

You can only drink so much lemonade
AviatorAtHeart is offline   Reply With Quote
Old 11-10-2017, 04:41 PM   #36
chris_db4
Senior Member
 

Join Date: Nov 2014
Posts: 559
chris_db4 is on a distinguished road
Default

My simulator doesn't want to play ball with what I'm trying to do, and realistically all it will be is a set of time circuits one for on and one for off so its pretty much back to the simple 555 timer and again its not random but will repeat over and over.

A software version is a much easier solution using Picaxe I knocked up the piece of code attached. It first steps on the lights (as a test more than anything but the random flashing is done in the second part). Firstly it generates a random number and then displays that out on 8 of the pins as binary I set it to wait 1 second before each repeat (for testing) where it will generate another number and change the output to match, it certainly seems pretty random. I allowed for two switched inputs one to use the random sequence and one to switch all 8 on.
it still leaves a few extra inputs and outputs if needed.
it would also be possible to use an outside source to compute the value, a variable resistor or to use that to control the speed it changes.
Attached Images
File Type: jpg pic.jpg (141.7 KB, 11 views)
chris_db4 is offline   Reply With Quote
Old 11-10-2017, 07:20 PM   #37
Teedoubleudee
All round good guy
 
Teedoubleudee's Avatar
 

Join Date: Aug 2014
Location: Downham Market
Posts: 3,179
Teedoubleudee is on a distinguished road
Default

Quote:
Originally Posted by chris_db4 View Post
My simulator doesn't want to play ball with what I'm trying to do, and realistically all it will be is a set of time circuits one for on and one for off so its pretty much back to the simple 555 timer and again its not random but will repeat over and over.

A software version is a much easier solution using Picaxe I knocked up the piece of code attached. It first steps on the lights (as a test more than anything but the random flashing is done in the second part). Firstly it generates a random number and then displays that out on 8 of the pins as binary I set it to wait 1 second before each repeat (for testing) where it will generate another number and change the output to match, it certainly seems pretty random. I allowed for two switched inputs one to use the random sequence and one to switch all 8 on.
it still leaves a few extra inputs and outputs if needed.
it would also be possible to use an outside source to compute the value, a variable resistor or to use that to control the speed it changes.
Thanks Chris
__________________
If I agreed with you, we'd both be wrong
Teedoubleudee is offline   Reply With Quote
Old 11-10-2017, 07:34 PM   #38
AviatorAtHeart
Don't ask, I don't know!
 
AviatorAtHeart's Avatar
 

Join Date: Jun 2017
Location: Chalfont St Peter
Posts: 314
AviatorAtHeart is on a distinguished road
Default

So we have a true digital solution!
Perfect, but I'm not able to utilise it!

Just got home...... Let the experiments begin.
I have a 556 based D type flip flop on a bread board (rob paisley circuit, stall motor driver)

Just need to figure out how to phase the off sequence.
(If you hear a fire engine screaming past, I got it wrong.........)
__________________

You can only drink so much lemonade
AviatorAtHeart is offline   Reply With Quote
Old 11-10-2017, 08:50 PM   #39
AviatorAtHeart
Don't ask, I don't know!
 
AviatorAtHeart's Avatar
 

Join Date: Jun 2017
Location: Chalfont St Peter
Posts: 314
AviatorAtHeart is on a distinguished road
Default

Open air thinking.....
Am I approaching this from the wrong angle?

Would using a comparator chip (Lm339) work as the switch..........
Bank of LEDs.....
Lm339 (quad output) duty cycle from 555/556 or any thing that can output square wave.


Tonight's experiment......
I have three LEDs switching on during the opposite phase of the 555(and still cycling through the already shown phase)
Using pin 5 of the 555 but the voltage is low, so the LEDs are not very bright......
So I had a think, maybe opamp it up.....

Or maybe start from the beginning.
Can't get much from a D type flip flop.......
And even though I have LEDs on during the opposite phase, there is still a "reset" (all off) when it changes back over..... I can't think how to add hysteresis? here.

Still, I'm having quite some fun, no magic blue IC smoke! So that means it is going well!
__________________

You can only drink so much lemonade

Last edited by AviatorAtHeart; 11-10-2017 at 08:53 PM.
AviatorAtHeart is offline   Reply With Quote
Old 11-10-2017, 10:03 PM   #40
chris_db4
Senior Member
 

Join Date: Nov 2014
Posts: 559
chris_db4 is on a distinguished road
Default

Sounds like your having fun with it,
I had a little play tonight too but on the software side of things so this is the end result
https://www.youtube.com/watch?v=v_PU9iPMKtg
Obviously the delay would need to be increased but it certainly does a random pattern. there is also an override on a pushbutton that puts them all on
the code used is attached

For people who haven't come across such chips the centre IC is the actual picaxe chip the two flanking it are just extra isolators as its a test board so its a bit of a funny layout. To make the circuit on a bread board it would need less components and once programmed the chip will run the outputs with just itself a switch and the LED's and resistors so its not too bad
Attached Images
File Type: jpg pic2.jpg (69.0 KB, 3 views)

Last edited by chris_db4; 11-10-2017 at 10:10 PM.
chris_db4 is offline   Reply With Quote
Reply

Bookmarks



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT +1. The time now is 02:09 AM.


Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.