Multiple Candle Flicker

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
eviltom
New user
Posts: 2
Joined: 31 Jul 2017, 14:11

Multiple Candle Flicker

#1 Post by eviltom » 31 Jul 2017, 16:01

Hi all,
I've just found ESPEasy again after a couple of years and am really enjoying playing around with all the new features since then.

I'm currently planning a project for Halloween which will involve a number of animated props and scenes. I'm very keen to use D1 mini's wherever I can (I have a job lot from aliexpress!!) to control the various elements and ESPEasy seems ideal. Most of the functionality I want seems to be there already, mainly servo and relay control, PIRs and button inputs. I think I can do almost all of the 'animation' I want with rules on various ESPEasys embedded in props and triggered by one master unit, in turn controlled from my phone.

One of my props is a cluster of fake candles. These are powered by a orange LED and I intend to run them from PCA9685, with one or two LEDs (candles) per channel. To create a semi-realistic flame effect I need to update the PWM level of each of those channels several times a second. Normally I would use something like an Arduino and just loop through each of the channels setting each to a random level, pause for a random time and start again.
I think I can see four ways to do this;
1)Use an external controller to perform a HTTP call for each channel to set it's level. However this will overwhelm the ESPEasy very quickly with hundreds of requests.
2)Use a Rule to loop through each channel and set a random level, and then a timer to wait a random amount and start again.
Will the Rules engine cope with that, and more to the point, is there a Random() function available?
3) Write a Plugin to do the same. I've had a look at some of the more basic plugins and I think I could probably write something to do it but I'm a little confused as to the structure of the plugins and exactly how they work. Is there a Tutorial somewhere, or a really basic plugin I could adapt to my needs without getting in to deep?
4) Use the ESP Easy to trigger another micro controller (even just a ATiny85) to run the PCA9685 for me. I'm leaning towards this option as It would just mean making a few changes to an Arduino sketch I already have. It would also mean that even if the ESPEasy failed to boot for whatever reason the slave controller could go into a default mode and work independently.

I do like the idea of a more compact solution though, having it all on the D1. How easy is it to port an Arduino sketch to the a plugin?

Can anyone advise on this one?

Many thanks in advance.
Tom

wrbrower
New user
Posts: 6
Joined: 16 Oct 2016, 17:18

Re: Multiple Candle Flicker

#2 Post by wrbrower » 02 Aug 2017, 05:53

Have you seen this? http://www.letscontrolit.com/forum/view ... lit=candle

Check the video links.

eviltom
New user
Posts: 2
Joined: 31 Jul 2017, 14:11

Re: Multiple Candle Flicker

#3 Post by eviltom » 02 Aug 2017, 15:18

wrbrower wrote: 02 Aug 2017, 05:53 Have you seen this? http://www.letscontrolit.com/forum/view ... lit=candle
Hi,
Yeah I saw that, and have had a play with a few WS2812B pixels. I liked the effect but I was concerned about cost. There will be several of these setup around the house, maybe 150-200 candles powered by several different controllers. I have bags of yellow and orange LEDs but would have to buy the neopixels. I know it's not a massive cost but I'd prefer to use what I already have.
I'm thinking that a cheap clone arduino pro mini (got loads of these too) to do the grunt work and an ESP to act as the interface and pass commands of i2c is the way to go at the moment.

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests