Halloween Forum banner
1 - 20 of 26 Posts

· Registered
Joined
·
126 Posts
Discussion Starter · #1 · (Edited)
I've been having fun printing some circuit boards lately, and I'm really happy with how this one turned out. It will control a bunch of lights in my yard this Halloween.



It uses an Arduino Nano to control PWM signals for six different channels of lights. There are two potentiometers, one to select the effect, and a second to change the speed of that effect. The board uses IRLB8721 mosfets to control current to the lights. According to Adafruit these mosfets are capable of switching 15A of current so each channel could run several (>250) lights in parallel.
These are the lights I use. They were suggested by another haunter, because they are waterproof, they fit inside a PVC fitting, and draw only 60mA at 12V DC.






There are 4 different effects:
1. Solid - all lights are on and dimmable by the speed potentiometer




2. Firelight - a low flicker meant to evoke the light of a fire. Works well with several amber on the same channel and 1 dim red on another channel



3. Wavey - All channels slowly pulse on and off at slightly different wavelengths so they don’t synchronize. Speed potentiometer controls how fast they pulse


4. Lightning - Each channel strobes on with a random delay and a random number of flashes. Speed potentiometer controls how frequent the flashes are.



Arduino code and schematics on my blog.
 

· Registered
Joined
·
126 Posts
Discussion Starter · #4 ·
Are you selling the board/nano ad a kit?
And cand you make a link for the lights?
Thx
Here’s a link for the lights. You can also search eBay for “eagle eye led”. Best price shipped from the US tends to be $10-12 for 10. Here’s how they fit together with PVC. I use 1/2” pipe (conduit because I like the finish and it’s cheaper), one 90 degree elbow, a small section, then a 3/4”-1/2” reducer. I’ve been using a stain for the black color, but could also spray paint. Cost works out to <$3/assembled light.

Wood Rectangle Beige Composite material Jewellery


Wood Hardwood Composite material Metal Flooring


Street light Road surface Asphalt Tints and shades Wood
 

· Registered
Joined
·
89 Posts
Awesome project! I went to your blog site and found the code for the nano but no schematics per your posting here. Will you be posting the schematics here or on your blog?
Big thanks!
 

· Registered
Dystopian CyberTech
Joined
·
178 Posts
I've been having fun printing some circuit boards lately, and I'm really happy with how this one turned out. It will control a bunch of lights in my yard this Halloween.



It uses an Arduino Nano to control PWM signals for six different channels of lights. There are two potentiometers, one to select the effect, and a second to change the speed of that effect. The board uses IRLB8721 mosfets to control current to the lights. According to Adafruit these mosfets are capable of switching 15A of current so each channel could run several (>250) lights in parallel.
These are the lights I use. They were suggested by another haunter, because they are waterproof, they fit inside a PVC fitting, and draw only 60mA at 12V DC.






There are 4 different effects:
1. Solid - all lights are on and dimmable by the speed potentiometer




2. Firelight - a low flicker meant to evoke the light of a fire. Works well with several amber on the same channel and 1 dim red on another channel



3. Wavey - All channels slowly pulse on and off at slightly different wavelengths so they don’t synchronize. Speed potentiometer controls how fast they pulse


4. Lightning - Each channel strobes on with a random delay and a random number of flashes. Speed potentiometer controls how frequent the flashes are.



Arduino code and schematics on my blog.
Looks great! Nice work!
 

· Registered
Dystopian CyberTech
Joined
·
178 Posts
I've been having fun printing some circuit boards lately, and I'm really happy with how this one turned out. It will control a bunch of lights in my yard this Halloween.



It uses an Arduino Nano to control PWM signals for six different channels of lights. There are two potentiometers, one to select the effect, and a second to change the speed of that effect. The board uses IRLB8721 mosfets to control current to the lights. According to Adafruit these mosfets are capable of switching 15A of current so each channel could run several (>250) lights in parallel.
These are the lights I use. They were suggested by another haunter, because they are waterproof, they fit inside a PVC fitting, and draw only 60mA at 12V DC.






There are 4 different effects:
1. Solid - all lights are on and dimmable by the speed potentiometer




2. Firelight - a low flicker meant to evoke the light of a fire. Works well with several amber on the same channel and 1 dim red on another channel



3. Wavey - All channels slowly pulse on and off at slightly different wavelengths so they don’t synchronize. Speed potentiometer controls how fast they pulse


4. Lightning - Each channel strobes on with a random delay and a random number of flashes. Speed potentiometer controls how frequent the flashes are.



Arduino code and schematics on my blog.
Curious why you opted not to include gate resistors in your schematic. If it works, it works but to anyone building this circuit or changing the duty cycles of the various effects in sketch, it's cheap insurance to protect the Arduino, no? Great work all the same!
I'll be adapting this sketch to set effects based on MagiQuest wand casts (I have like, 10 of them from bringing the kids to Great Wolf Lodge in Niagara Falls over the years), if you don't mind. Of course I'll post it here in kind for anyone else who happens to have these little gems lying around.
Also as an aside, just compiled your code for the Nano and the RAM usage was 12-13% leaving 1772 bytes (totally non factor in this scenario) but have you ever worked with the Nano Every? It just compiled at 4% leaving 5887 bytes for just a couple bucks more. From the marketing on Arduino page:
"The Arduino Nano Every is an evolution of the classic Arduino Nano sharing the same exact pinout but featuring the ATMega4809, a more powerful processor as well as 48KB of CPU Flash memory and a higher clock speed of 20 MHz. "
 

· Registered
Joined
·
126 Posts
Discussion Starter · #10 ·
Curious why you opted not to include gate resistors in your schematic. If it works, it works but to anyone building this circuit or changing the duty cycles of the various effects in sketch, it's cheap insurance to protect the Arduino, no? Great work all the same!
I'll be adapting this sketch to set effects based on MagiQuest wand casts (I have like, 10 of them from bringing the kids to Great Wolf Lodge in Niagara Falls over the years), if you don't mind. Of course I'll post it here in kind for anyone else who happens to have these little gems lying around.
Also as an aside, just compiled your code for the Nano and the RAM usage was 12-13% leaving 1772 bytes (totally non factor in this scenario) but have you ever worked with the Nano Every? It just compiled at 4% leaving 5887 bytes for just a couple bucks more. From the marketing on Arduino page:
"The Arduino Nano Every is an evolution of the classic Arduino Nano sharing the same exact pinout but featuring the ATMega4809, a more powerful processor as well as 48KB of CPU Flash memory and a higher clock speed of 20 MHz. "
Ahhh…. Gate resistors on mosfets. I am definitely not an electrical engineer, but if you want to lose a few hours (?days) read the electrical engineering and other forums on the need for a gate resistor between arduino GPIO pins and mosfets. Suffice it to say there are many points of view, with maybe a few more on the “it’s good practice to do so” side. That said there are numerous circuit diagrams from respectable sources that do not include them, and a dearth of “I did this and it broke my arduino / GPIO pin” reports.

So are resistors cheap? Yes. But they take space and time to solder. And I have good company for not using them in this setting, so I won’t.

In terms of the Nano Every, what’s the advantage of the extra RAM if the program fits on the cheaper device? I’ve found myself actually going in the other direction. I like the size and price ($1.50) an ATTINY85 and have built a couple prop controllers around them.
 

· Registered
Dystopian CyberTech
Joined
·
178 Posts
Ahhh…. Gate resistors on mosfets. I am definitely not an electrical engineer, but if you want to lose a few hours (?days) read the electrical engineering and other forums on the need for a gate resistor between arduino GPIO pins and mosfets. Suffice it to say there are many points of view, with maybe a few more on the “it’s good practice to do so” side. That said there are numerous circuit diagrams from respectable sources that do not include them, and a dearth of “I did this and it broke my arduino / GPIO pin” reports.

So are resistors cheap? Yes. But they take space and time to solder. And I have good company for not using them in this setting, so I won’t.

In terms of the Nano Every, what’s the advantage of the extra RAM if the program fits on the cheaper device? I’ve found myself actually going in the other direction. I like the size and price ($1.50) an ATTINY85 and have built a couple prop controllers around them.
On resistors: your design and that's fair enough. As I say, if it works, it works. I include them because I think it best practice based on what industry holds and something akin to Pascal's wager.
As for Nano Every: there's no advantage in your use case. In fact it adds cost and you'd do well to use ATTINY85 or one I just found out about STM32 BLUEPILL. I just happen to like the Nano Every for the extra headroom for maybe some version 2.0. Again, that's just me.
To be clear, I'm not knocking your work at all, it's great. I think I really just like the tech banter, bashing ideas together and learning from others, putting concepts and designs to the test, that kind of thing.
 

· Registered
Dystopian CyberTech
Joined
·
178 Posts
Looks great! Nice work!
One question: what did you like about this FET for a driver such as this? I have only used a few different ones myself before (usually FQP30N06L for switching 12V loads via automotive relay), always like to hear what informed others' decision of x vs any of the zillions of possibilities out there (or so it seems). I based my go to choice ^ for robotics applications based on Gordon McComb's excellent book "Robot Builder's Bonanza".
 

· Registered
Joined
·
126 Posts
Discussion Starter · #13 ·
One question: what did you like about this FET for a driver such as this? I have only used a few different ones myself before (usually FQP30N06L for switching 12V loads via automotive relay), always like to hear what informed others' decision of x vs any of the zillions of possibilities out there (or so it seems). I based my go to choice ^ for robotics applications based on Gordon McComb's excellent book "Robot Builder's Bonanza".
My understanding is that both FQP30N06L and IRLB8721 are good 5v logic level Mosfets. The second ones are the same as what Adafruit sells, so I went with that for this build.
 

· Registered
Dystopian CyberTech
Joined
·
178 Posts
My understanding is that both FQP30N06L and IRLB8721 are good 5v logic level Mosfets. The second ones are the same as what Adafruit sells, so I went with that for this build.
Adafruit is one of my favorite parts houses. Arduino owes a debt IMO to Limor Fried for the company she built and how much it helped Arduino actually get into the hands of so many who might otherwise have never picked up a soldering iron.
I also like Mouser, though mostly for their massive inventory. Imagine my glee when I discovered the Canadian warehouse is like, in the next town over to me soooo one day delivery huzzah!
 

· Registered
Joined
·
304 Posts
Love this dialog!
Coming from an industrial electrical background the details of design are always fascinating. So discuss on, most of the applications I deal with are German engineered. So they are all about theory and documentation. Most always it is overengineered, with redundant safety and monitoring. With that said, if this was a daily use item eventually something on the output side fails, I've repaired alot of smoked boards, and when that happens the damage can be contained down to just the output components. If costs were not a factor, opticouple is the std. Since this is driving leds and not solenoids, I would opt for simplicity. Yet if the FET fails a gate resistor should protect the Nano.
 

· Registered
Joined
·
128 Posts
I'll be adapting this sketch to set effects based on MagiQuest wand casts (I have like, 10 of them from bringing the kids to Great Wolf Lodge in Niagara Falls over the years), if you don't mind. Of course I'll post it here in kind for anyone else who happens to have these little gems lying around.
Hey! I've had the same idea! I bought a lot of 5 used ones from ebay and was thinking that there's got to be some Halloween fun to be had with these... can you elaborate a little bit on what you're planning on doing? I'd love to hear more!

-=CoasterBP
 

· Registered
Dystopian CyberTech
Joined
·
178 Posts
Hey! I've had the same idea! I bought a lot of 5 used ones from ebay and was thinking that there's got to be some Halloween fun to be had with these... can you elaborate a little bit on what you're planning on doing? I'd love to hear more!

-=CoasterBP
Sure, I'll PM you so as not to appear to be hijacking the thread.
 

· Registered
Joined
·
23 Posts
I am an Electrical Engineer, and I would opt for using resistors to protect the arduino. The few pennies and the extra 15 min it would take is worth the piece of mind. I would also add heat sinks to the FETS.

Other than these concerns it looks great. Well done!

Gary
 

· Registered
Joined
·
220 Posts
Thank you so much for sharing your project and code. I have been playing with Arduino for a while and I like seeing advanced coding methods, especially with your use of Arrays and Millis.

@garyf629 - What value of resistor would you recommend you using? I have a couple of premanufactured boards, one has a 100 ohm resistor and one has a 1k resistor. Also, would you suggest a 10K pulldown as well? As Jekyll had mentioned, there are a lot of opinions out there regarding the use and value of the resistor.
 

· Registered
Joined
·
126 Posts
Discussion Starter · #20 ·
This is fantastic. Great discussion,

I’m an irreligious heathen, so it’s going to take more than Pascal’s Wager to make me include resistors in my design. :)

Can folks clarify their reasons for adding resistors? The gate to source leak current is trivial (<100 nano amps for this fet). Parasitic oscillation is a potential issue, but that’s not really about protecting the arduino. I’m also assuming we’re not talking about pull-down resistors, those have a different role entirely.

I’m assuming most people are concerned about inrush current when the mosfet is switched on, acting like a charging capacitor. The data sheet rates the typical gate charge capacity as 7.6 nanocoulombs, which would make it a 1.5 nanoFarad capacitor at 5 volts. That’s a really tiny capacitor.

People are welcome to include gate resistors, but they are not without risk. If you are using the mosfet as a switch (as we are here), gate resistors in series will slow charging of the mosfet and cause you to spend more time in the transition zone between full off and full on. If you’re running PWM, this potentially becomes meaningful.

Adafruit does not generally include gate resistors in their tutorials for circuits involving mosfets. Sparkfun sells several mosfet boards. They generally do not include gate resistors in these designs either. I would argue that the risk/benefit does not favor their inclusion, and it seems I have some company.
 
1 - 20 of 26 Posts
Top