Hello - I am fairly new to arduino and programming as a whole, but I am a quick learner.
I am designing a site model for a school project and I would like to light my site. Basically something like this http://redthread.utah.edu/wp-content/uploads/2012/01/site-model.jpg but where the buildings are perforated with windows. I will be placing what I believe will be a series of LEDs on the interior of the building to simulate interior light usage of a residential building throughout a 24 hour timeline. Now my questions are:
- have you seen something done like this before? if not ---->
- can I have atleast four different light blinks and fades on one arduino at once? i'm assuming yes.
- how do i do that? (do I just combine the codes and specify a different pin to different blinks and send to a string of LEDs?)
- I realize I will have to add additional power to light more LEDs, maybe you can direct me to a good video on how to do that...
Any help would be greatly appreciated... The first steps of this project are due in the next couple weeks so I have time to fiddle around my but I was hoping I could get a jumpstart with some help.
Thank you in advance.
I have an arduino uno btw.
What kind of LED's will you be using? Standard (20mA) or high-power?
Do you want to fade all of your LED's or just blink?
The Uno has 6 pins capable of PWM that can fade your LED's on or off. You can drive up to 15 standard LED's max from the arduino itself without straining the onboard power regulator. If you're using the pin to supply the current, don't connect more than one LED per pin.
What you want to do is really simple. I'd suggest loading the "Blink", "Fade", and "Fading" example sketches in the Arduino IDE and you should should be able to figure it out...
You probably want WS2811 or WS2812 type parts so you can make a long string of them with individual controls.
Check them out here.
Yes I have been able to do all the sketch examples with LEDs so far so I feel confident about that part. I guess it's the wiring where I'm unsure where to start.
They would actually all be blinking at different intervals. I want to building an interior framework to hold the lights inside the envelope of the building. That board that crossroads suggested is cool but I guess I was thinking more of a strip or something flexible so that i can randomly place them and it gives the illusion of different rooms using lights differently.
If I have more than 15 leds how can i add power?
You can switch them on/off or fade them using an npn transistor with the base signal coming from the arduino and the power to the collector emitter from your power supply (not through the arduino).
Something simple would be - Let’s say you want 30 total LED’s on 5 different controlled settings. Using a 12v power supply you could run 6 LED’s in series controlled by 5 different pins using 5 2n2222 transistors. Just make sure your power supply provides enough power for the arduino and the LED current draw.
If you want all the LED’s to “have a mind of their own” and blink independently of each other you can use a shift register and wire each separately.
Be brave, explore a little bit.
You haven’t said how many - they are designed to broken apart and wire like so.
If you just need a single color with fading, and fading was part of your original question, then WS2803 might be what you’re after.
Run power & a control signal from WS2803 to each location.
WS2803-preliminary-En.pdf (437 KB)
Why fade? Are you trying to simulate someone using a dimmer switch? Check this thread - similar requirement: Memory optimization - Programming Questions - Arduino Forum. Here though, there was a desire to flicker the lights on startup to mimic fluorescents.
Look up shift registers and figure out how many spaces you want to light.
not a problem for the Arduino. just make sure your power supply can handle the load.
also, make sure your shift register will be able to handle the LED power directly. no need to waste time connecting seperate transistors.