Adding a ramp timer

oreo54

5000 Club Member
View Badges
Joined
Sep 18, 2017
Messages
6,898
Reaction score
4,093
Rating - 0%
0   0   0
I heard it well when you proposed a TC-420 for the task :beaming-face-with-smiling-eyes:

I get it though, one is a ready to use package and the other needs some more diy on top.
OK so lets sort of brainstorm your idea for a bit..
So I envision..
1) Lights on a manual on/off timer .
2) Manual dimmers set to a specific level of ones choosing.
3) Power switch to "on"
4) Dimming switch set to "manual"
5) new micro-controller goes in-between manual dimmer output to driver

Software needs to detect PWM voltage out and respond with a PWM ramp function for a set amount of minutes.
My esp32 based driver/dimmer boards ramps any change in a 15min increment.

How does one "sense" dusk time?
One could set an"on time duration" but that involves 1) a way to program it manually or 2) set and forget time period of 8, 10, 12 hours.Which one is stuck with unless you access the programming.
Cycle ends abruptly at timer off time.

What microcontroller would one use?
And how do you program it to detect voltage. Current would work as well though it's probably like 20-40mA at best.
I suppose another esp board?

There is a completely "wrong" way to do all this quite easily. People have used dimmable smart plugs to actually dim constant current led aquarium lights..
It's bizarre and completely WRONG but for some reason it seems to work.
I'm now on my second year of figuring out why and what repercussions it could have.
See it's just turning the LINE voltage on/off. I have no other explanation for it.
I personally frown upon it. Led drivers are not meant to have the AC side "pulsed" unless designed for it (like household led light bulbs designed for triac dimming)
 

DanyL

Valuable Member
View Badges
Joined
Jan 13, 2023
Messages
2,233
Reaction score
2,440
Location
Middle East
Rating - 0%
0   0   0
OK so lets sort of brainstorm your idea for a bit..
So I envision..
1) Lights on a manual on/off timer .
2) Manual dimmers set to a specific level of ones choosing.
3) Power switch to "on"
4) Dimming switch set to "manual"
5) new micro-controller goes in-between manual dimmer output to driver

Software needs to detect PWM voltage out and respond with a PWM ramp function for a set amount of minutes.
My esp32 based driver/dimmer boards ramps any change in a 15min increment.

How does one "sense" dusk time?
One could set an"on time duration" but that involves 1) a way to program it manually or 2) set and forget time period of 8, 10, 12 hours.Which one is stuck with unless you access the programming.
Cycle ends abruptly at timer off time.

What microcontroller would one use?
And how do you program it to detect voltage. Current would work as well though it's probably like 20-40mA at best.
I suppose another esp board?

There is a completely "wrong" way to do all this quite easily. People have used dimmable smart plugs to actually dim constant current led aquarium lights..
It's bizarre and completely WRONG but for some reason it seems to work.
I'm now on my second year of figuring out why and what repercussions it could have.
See it's just turning the LINE voltage on/off. I have no other explanation for it.
I personally frown upon it. Led drivers are not meant to have the AC side "pulsed" unless designed for it (like household led light bulbs designed for triac dimming)

I thoguht of doing it a lot more abstracted than this.

Think about it more like a MITM attack:
1. You get a PWM signal for a channel
2. You decode it using the pulse counter on an esp32 (PCNT)
3. Determine the channel percentage (needs reversing)
4. Generate a new signal that ramps from current channel percentage to new channel percentage.
5. Repeat.

Since you already know what is the current percentage (because you are generating it), and you are aware of the new one - you don’t really need to consider what time it is, because you only care about generating the ramp from one point to the other.

This also preserves the built in functionality.
The only thing that will need programming or some kind of bt/wifi interface is the ramp duration.

The downside of this approach is that the ramp duration will be fixed across changes.
But I don’t think it will matter much for OP (unless it is of course).

As for wether it is the wrong or the right way to achieve it - I think it’s a fine hack, it isn’t exploiting some undefined behavior but rather implements a certain functionality in a similar way that it would’ve be implemented if it was built in, just externally.

And no, I’ve never even heard of controlling LEDs with AC dimmers outside of those that are built to work with them. No idea how this black magic even works. It’s not supposed to.
 

pooootiqe

Active Member
View Badges
Joined
Aug 15, 2022
Messages
209
Reaction score
175
Location
NY
Rating - 0%
0   0   0
Here's a dumb idea...

What if you hook up two digital potentiometers in place of the dimming knobs and use a small MCU with RTC to control the "manual dimming"?
 

DanyL

Valuable Member
View Badges
Joined
Jan 13, 2023
Messages
2,233
Reaction score
2,440
Location
Middle East
Rating - 0%
0   0   0
Here's a dumb idea...

What if you hook up two digital potentiometers in place of the dimming knobs and use a small MCU with RTC to control the "manual dimming"?
Not a dumb idea at all.
The downside of this approach is that it will take away the current functionality, and you will have to implement everything from scratch, including the scheduler, and at this point it would be easier to simply use a TC-420 like Oreo suggested.
 
OP
OP
jsmkmavity

jsmkmavity

Valuable Member
View Badges
Joined
Apr 21, 2023
Messages
2,487
Reaction score
3,943
Location
Sandpoint
Rating - 0%
0   0   0
So is this the microcontroller?
 

Attachments

  • 20250410_124105.jpg
    20250410_124105.jpg
    144 KB · Views: 21
OP
OP
jsmkmavity

jsmkmavity

Valuable Member
View Badges
Joined
Apr 21, 2023
Messages
2,487
Reaction score
3,943
Location
Sandpoint
Rating - 0%
0   0   0
It only has 2 wires going to it from the switch,
2 wires going to the dimmers and 2 wires going to the 12w-12v board.
Am i right in assuming its capable of way more than it is hooked up for now?
 
OP
OP
jsmkmavity

jsmkmavity

Valuable Member
View Badges
Joined
Apr 21, 2023
Messages
2,487
Reaction score
3,943
Location
Sandpoint
Rating - 0%
0   0   0
I just noticed it has a micro usb connecter on one end
 
OP
OP
jsmkmavity

jsmkmavity

Valuable Member
View Badges
Joined
Apr 21, 2023
Messages
2,487
Reaction score
3,943
Location
Sandpoint
Rating - 0%
0   0   0
Cool! I just unscrewed it from the base and turned it over and it does have the antenna!
 
OP
OP
jsmkmavity

jsmkmavity

Valuable Member
View Badges
Joined
Apr 21, 2023
Messages
2,487
Reaction score
3,943
Location
Sandpoint
Rating - 0%
0   0   0
The light dimmer knobs only turn no push button function which i think is how it would switch between settings if it was setup for manual programming.
 

DanyL

Valuable Member
View Badges
Joined
Jan 13, 2023
Messages
2,233
Reaction score
2,440
Location
Middle East
Rating - 0%
0   0   0
It only has 2 wires going to it from the switch,
2 wires going to the dimmers and 2 wires going to the 12w-12v board.
Am i right in assuming its capable of way more than it is hooked up for now?
Yes, it’s likely an overkill for what it’s being used for, unless it also utilizes the wifi functionality.
 
OP
OP
jsmkmavity

jsmkmavity

Valuable Member
View Badges
Joined
Apr 21, 2023
Messages
2,487
Reaction score
3,943
Location
Sandpoint
Rating - 0%
0   0   0
So i do have a laptop. It is probably at least 3-5 years old. I dont connect it to the internet. My dad updated it a year or 2 ago for me. It is intentionally a stand alone unconnected laptop. Would that work to program the esp8266 with a cord?
 
OP
OP
jsmkmavity

jsmkmavity

Valuable Member
View Badges
Joined
Apr 21, 2023
Messages
2,487
Reaction score
3,943
Location
Sandpoint
Rating - 0%
0   0   0
I am going to plug in power to the light and see if it will connect to my phone
 

DanyL

Valuable Member
View Badges
Joined
Jan 13, 2023
Messages
2,233
Reaction score
2,440
Location
Middle East
Rating - 0%
0   0   0
So i do have a laptop. It is probably at least 3-5 years old. I dont connect it to the internet. My dad updated it a year or 2 ago for me. It is intentionally a stand alone unconnected laptop. Would that work to program the esp8266 with a cord?
You will have to install a driver for the usb controller, and at the very least a toolchain to be able to compile code and reprogram it.

If it’s a Linux/macOS machine than you can access the serial port without additional tools, but for windows you’ll also need a serial client (unless I’m not aware and they added one built in?)
 
OP
OP
jsmkmavity

jsmkmavity

Valuable Member
View Badges
Joined
Apr 21, 2023
Messages
2,487
Reaction score
3,943
Location
Sandpoint
Rating - 0%
0   0   0
Its a lenovo solid state
 
OP
OP
jsmkmavity

jsmkmavity

Valuable Member
View Badges
Joined
Apr 21, 2023
Messages
2,487
Reaction score
3,943
Location
Sandpoint
Rating - 0%
0   0   0
The phone isnt finding a wifi for the light. What would it likely be named?
 
OP
OP
jsmkmavity

jsmkmavity

Valuable Member
View Badges
Joined
Apr 21, 2023
Messages
2,487
Reaction score
3,943
Location
Sandpoint
Rating - 0%
0   0   0
Would it need power applied to one of the other pins for the wifi to work?
 

DanyL

Valuable Member
View Badges
Joined
Jan 13, 2023
Messages
2,233
Reaction score
2,440
Location
Middle East
Rating - 0%
0   0   0
Its a lenovo solid state
It’s a windows machine. You will also need a tool like PuTTY for serial access. Not sure if esp toolchains come with any of their own. They might.

The phone isnt finding a wifi for the light. What would it likely be named?
Might start with “ESP”
But it depends if they changed the default auto generated name or not.

If you don’t see anything, it may need to be first enabled through the physical interface on the fixture itself.
 

TOP 10 Trending Threads

HOW DO YOU ADJUST YOUR CUC AS ALGAE DISAPPEARS?

  • Capture and re-home CUC

    Votes: 8 7.3%
  • Increase white light/hours in tank to spur algae growth to feed CUC

    Votes: 6 5.5%
  • Feed nori to support CUC

    Votes: 39 35.5%
  • Feed herbivore pellets to support CUC

    Votes: 39 35.5%
  • Allow attrition to balance CUC and algae

    Votes: 46 41.8%
  • Provide macro algae to feed CUC

    Votes: 7 6.4%
  • Introduce CUC predators

    Votes: 1 0.9%
  • Other (please explain)

    Votes: 11 10.0%
Free Phyto Promo
Spend $39+ → free 16oz Phyto · Use code FREEPHYTO at checkout · $16.99 value · Densest 6-species blend · Free shipping on every order · 100% live arrival guaranteed Spend $39+ → free 16oz Phyto · Use code FREEPHYTO at checkout · $16.99 value · Densest 6-species blend · Free shipping on every order · 100% live arrival guaranteed
Shop Now Code: FREEPHYTO
Back
Top