Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

psuedo randomizer idea .....

Status
Not open for further replies.

captnstoed

New Member
How about using a circuit for "chasing led's", lets say 8 of them. If this was running continuously, and somehow (havent figured this part out yet), lets say replaced the led's with 8 different resistors. If a momentary switch was closed and directed through the circuit and the corresponding resistor value, they would be random enough for my purpose.
Does anyone think it could work? Im in the middle of another project but this one is next in line.
Im looking for random delay on times from 0 - 8 seconds using a 555 ic.

I'll keep you posted.

Thanks in advance.
 
A psuedo random sequence can be generated by a shift register with an XOR gate generating the feedback.

A 4 bit SR will give you 15 states (see attachement) and an 8 bit 254 states.

So a LED would be connected to each output of the SR.
 

Attachments

  • Pseudo  Random counter.gif
    Pseudo Random counter.gif
    4.8 KB · Views: 114
In Proton+ it would go a little something like this i guess;

PHP:
Device 16F877A
Declare XTAL 4

All_Digital = True

Dim Delay as Word
Symbol LEDS = PORTA.0

TRISA = 0
PORTA = 0

Seed $0345                      ' Change the starting location of the random table

Main:

	LEDS = 1  		 		' Turn something on/do something
	
	Delay = Random	 		' Create a random number between 0 - 65535
	Delayms Delay			'  and delay for that many mS
	
	LEDS = 0				' Stop doing it
	
	Delayms 65535 - Delay	' Find the differnce and do nothing for that time
	
	Goto Main                 ' Loop for ever
 
Or AVR's =)
If you want better random numbers you can always go with an encryption program. Good encryption algorythms essentially generate random data. Not exactly easy to implement though.
 
Or use a white noise source and an ADC.
 
Does white noise have a frequency range or limits? Would a simple band-pass filter work for a range of 20 kHz-30 kHz?

Sorry, to jump in like this, barely related to the topic...
 
In theory white noise is a random signal from 0Hz to ∞Hz, in reality this is limited by the bandwidth of the amplifier used.
 
Thanks, just something I wondered about a while ago. I wanted to generate some randomness in an LED Flame idea I had a while back.
 
Nigel Goodwin said:
As usual, using a PIC makes this a trivial job, and only requires one IC.
Agreed but not everyone wants to use a PIC.

I have suggested using a PIC to people on several occasions in the past but they have said that they prefer hardware.

I don't recall the reasons given now but I think they fell into 2 categories.

1. They don't have the programming hardware.

2. They are daunted by the PIC learning curve.

Besides, in my opinion, electronic design is about considering the options available before making a choice.
 
Yes, that's me and I fit into number 1.
 
ljcox said:
1. They don't have the programming hardware.

Hardly a problem, freely available, cheap, and easy to build.

2. They are daunted by the PIC learning curve.

People were daunted by transistors!, they were daunted by PCB's!, and by IC's - you can't live in the past - and the PIC learning curve isn't very difficult.

Besides, in my opinion, electronic design is about considering the options available before making a choice.

Yes, very much so, but one modern cheap IC as against a board full of old IC's for an inferior result - it's hardly a difficult choice?.
 
They are definitely worth the 'learning curve' imho, coupled with a decent development suit; you will be in disbelief of their power and diversity!

And there’s so much support for them out there - its not like you’re on your own in anyway, there are thousands of sites dedicated to PIC project development.
 
Nigel, I'm not living in the past. I use PICs for most of my designs these days.

However, if someone wants to do something in hardware, I'm happy to help, besides I can't force them to use a PIC
 
Nigel Goodwin said:
Hardly a problem, freely available, cheap, and easy to build.

That is not a fair statement. It isn't that we CAN'T get one, it is that we DON'T want to get one. Why? Because how do we know that our $40 investment will be worth it? How do we know that our 4+ hours(because we are most likely new to electronics) of building a programmer will work and not drive us away from electronics because of the frustration with a circuit that doesn't work?

Oh, and why suggest a PIC in the first place? There is nothing wrong with learning how to make complex circuits to do the simplest things(and i thought captnstoed had an IDEA, not something that he/she wanted to build to be practical. Maybe captnstoed was just thinking hypothetically. Designing things in your head is fun AND educational.)

Next time i suggest you think before you speak. Just because it isn't a problem for you, doesn't mean that it isn't a problem for us.
 
Marks256 said:
That is not a fair statement. It isn't that we CAN'T get one, it is that we DON'T want to get one. Why? Because how do we know that our $40 investment will be worth it? How do we know that our 4+ hours(because we are most likely new to electronics) of building a programmer will work and not drive us away from electronics because of the frustration with a circuit that doesn't work?

If you can't build a simple programmer, then you probably can't build anything else either!.

Oh, and why suggest a PIC in the first place? There is nothing wrong with learning how to make complex circuits to do the simplest things(and i thought captnstoed had an IDEA, not something that he/she wanted to build to be practical. Maybe captnstoed was just thinking hypothetically. Designing things in your head is fun AND educational.)

Nothing wrong with it, but little point to it - assuming it's a practical project? - if it's a school or learning project that's a different matter, then using old methods and components has some use.

Next time i suggest you think before you speak. Just because it isn't a problem for you, doesn't mean that it isn't a problem for us.


Have you forgotten to take your medication? - I suggest you take a pill and lie down!.
 
Last edited:
Nigel Goodwin said:
Hardly a problem, freely available, cheap, and easy to build.
Yes, I'm considering both building and buying options.

People were daunted by transistors!, they were daunted by PCB's!, and by IC's - you can't live in the past - and the PIC learning curve isn't very difficult.
The only thing that really puts me of is I hate writing software. Although I used to find it interesting it isn't my really forte and I now find it very boring.
Yes, very much so, but one modern cheap IC as against a board full of old IC's for an inferior result - it's hardly a difficult choice?.
However, the advantages outlined above are very appealing.
 
I think PICS are interesting and probably easier IF you know how to use them. I am new to electronics, and it is difficult to order the right parts and get them to work from a diagram that you get from somewhere on the internet! Lots of trial and error. I am having success and learning on the way.
As for the project I am working on, I am trying to develop a product to get to market ASAP. I dont think I can afford the learniung curve right now. If I had the resources, I would hire someone to design all this stuff. Unfortunately, I dont.
As of right now I will stick to what is working to get a few out there. Then some marketing , web site, fixing glitches, etc.... When the time permits, I will look into PICS. No harm in suggesting them.
And let me add , thanks for all the help.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top