Simplest way to make an LED flash (part of) the Fibonacci Sequence?
Would something like a 555 timer work for this, or is that silly? Would that also drive the audio? What is the simplest way to do this? My experience with electronics is very, very basic - nothing beyond playing with LEDs, soldering/unsoldering components, wire splicing, a super-simple Jacob's ladder, etc. Is this project too advanced for the time being?
I'm not asking for the schematic to be built for me, just some direction - I don't know what I'm doing here. Help?
26
answers
|
Answer it!
|
How ? As discrete LEDS or as numbers on 3, 7 segment displays ?
It would be interesting in these days of microcontrollers to do it "old school", but demanding on someone who hasn't worked with discrete logic, and as soon as you commit to discrete logic, and decide to change something, you are back down in state diagrams and truth tables.
I'd probably aim to use an Arduino, and either my favourite MAX7221 or 74HC595s.
Steve
Sounds like I need a microcontroller, then - but I'm not sure if those models would work for what I describe. I'll investigate arduino along with picaxe, then. Thanks for the information! The only problem is that microcontrollers appear a cost somewhat more than I'm wanting to spend on this...oh well.
So if you're willing to do a bit of additional work, you can develop the thing, then rebuild it around a stripped-down stand-alone processor and reuse the development platform for the next project.
So, one LED flashing for 1,2,3,5 periods ? Or flashing 1, then 2 times, then 3 times, then 5 etc ?
Easi-peasy.
Steve
Yes, one LED flashing once, then once, (1,1...), then twice, then thrice, etc. It'd have to speed up, of course, so you could tell they were grouped...
Thanks. :)
A Arduino would be somewhat overkill and is pricey.
Still, as replies to this are intimating, there are way more than one way to skin a cat.
Something I have done in the past is to use a PROM to basically run a linear State Machine. If you can program a PROM, you could create this project in very few parts, and you could easily drive more than one LED with the data ouputs.
You would need a counter I.C. (74LS163) and a slow RC timer circuit (eg. 555) to run the PROM through its addresses, and perhaps a driver chip to drive the LEDs, although some older PROMS could drive them directly.
I'll leave the details for you to ponder.
Cool! This is exactly the type of information I was hoping for (not that Steve didn't provide it). I've researched Arduinos, but just got confused as to what, exactly, I needed to buy to get started.
Thanks for the rest of the information, too! Hopefully I'll be able to use it. :)
They took the place of the electromechanical rotors which had been used during World War II.
Very loosely Fibonacci sequences can mean any sequence generated by summing at least some of the previous numbers.
Here is a hint, you can use electronic or even electromechanical "shift registers" with a pulsing clock to drive it all, and read out the successive state of the register by blinking an LED.
It seems pointless to use a microcontroller because you are not getting at the heart of the purpose and mathematical and logical meaning of generating a Fibonacci sequence. You are just trivially simulating the result.
So search for Koken and crypto and linear feedback shift registers (LFSR)and you'll have a cool and meaningful project to work on. Best wishes, bet you will learn a lot - the best kind of hacking.
x = 0
y = 1
z = 15
CALL fibo(x, y, z)
END
SUB fibo(a, b, n)
PRINT a, b,
REM first two terms are already printed so started from 3
FOR I = 3 to n
s=a+b
PRINT s,
a=b
b=s
NEXT I
END SUB
That one isn't very simple, but then using sequencers or digital comparitors or, as Kelsey mentions counters, would be a challenge but is an interesting one.....I must think about this a bit :-)
I'd like to build it the "right" (hard) way someday, but I think for now I'll do as others suggest and get a microcontroller. :)
Well the obvious solution, nowadays, is to use a microcontroller (PIC or AVR like Arduino). Doing the sequence programmatically is trivial. If you know basic soldering, and can both follow instructions and use your computer, then you could set something like this up in a few hours.
Much more interesting (and more difficult) would be to try to do it with components. Something like a five- or six-bit adder would be sufficient; you'd put two in sequence and alternate which was "active" for triggering a gate to the 555. The other would be there to remember the previous value, before getting the current value added into it and becoming active.
I'm getting a bit out of my own depth, here. I can figure out conceptually how to do it, but I don't have the knowledge of components that the real electronics experts around here have. Let's see if Steve, for example, decides to weigh in...
The consensus seems to be solidly in favor of a microcontroller being easiest. I keep hearing about Arduino so I'll be looking into that. (I think I can safely rule out doing it with components, at least for the time being - too advanced.) Thanks for the help - hopefully I can build what I have in mind.
http://www.picaxe.com
for more information
If you download their free programming editor from their web site it has a simulator where you can run this programme without having to buy any hardware.
Start:
B0=1 'sets up initial value
main:
B1=B0+1 ' adds 1 to that value
B2=B0+b1 'adds original number to increased number
gosub flashled ' flashes LED that many times
B0=B2 ' changed value to the new fab value
if B0<121 then goto main 'does it all again.
flashled:
for b3=0 to B0 ' for a count of 0 to the Fab value
high 2 ' turn output 2 on - this could be an LED
pause 100 ' wait for 1/10 os a sec
low 2 ' turn output off
pause 100 ' wait 1/10 sec
next b3 ' continue the loop until the full count is reached.
return ' go back to do it again.
This way for low numbers the flashing is slow and as the number of flashes gets higher the flashes get faster.
Mmm I have far too much time on my hands - It's very cold out side here at present though.
![]() |









































