Sonoff SV LED dimmer project help

625 views
Skip to first unread message

pete c

unread,
Sep 8, 2018, 9:54:32 AM9/8/18
to sonof...@googlegroups.com
Trying to figure out how to do this with a SonOff SV and a dimmer circuit from a $2 Ebay dimmer.

Current toggling LED lamps on and off with Mosquitto and the Sonoff SV.



I think it should be easy. 

Looking for suggestions here.

comboswitch.jpg


arduinodimmer.jpg



dimmer1.jpg


PVMA.jpg


Mosquitto control


toggle.jpg




mike2nl

unread,
Sep 8, 2018, 11:22:26 AM9/8/18
to sonof...@googlegroups.com
Hi pete c,

what do you want to do?
- switch on/off or
- dimming

I don't understand your question.
on/off via the relais or
dimming via PWM to GPIO pin.

Philip Knowles

unread,
Sep 8, 2018, 11:32:40 AM9/8/18
to pete c, SonoffUsers

I think this is going to be difficult.

 

The dimmer will almost certainly use the pot to vary between 0 and 12V to achieve the dimming.  I don’t think PWM will work well enough to give you a consistent voltage at the pot – it may do with a transistor output rather than a relay.

 

You could use an ESP-12 with some sort of digital to analogue converter and use all of the outputs to give you 256 steps of dimming

 

Good luck and I hope you prove me wrong!.

 

Regards

 

Phil K

Sent from Mail for Windows 10

 

From: pete c
Sent: 08 September 2018 14:54
To: SonoffUsers
Subject: Sonoff SV LED dimmer project help

 

Trying to figure out how to do this with a SonOff SV and a dimmer circuit from a $2 Ebay dimmer.

 

I think it should be easy. 

 

Looking for suggestions here.

 

dimmer1.jpg

 

PVMA.jpg

 

 

--
You received this message because you are subscribed to the Google Groups "SonoffUsers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonoffusers...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

 

pete c

unread,
Sep 8, 2018, 11:44:46 AM9/8/18
to SonoffUsers
Hello Mike,


what do you want to do?
- switch on/off or
- dimming

 I want to add dimming to functional toggling of the LED lamps.

I don't understand your question.
on/off via the relais or
dimming via PWM to GPIO pin.

I am doing on and off toggling of the LED lamps today using the Sonoff SV and Mosquitto and dimming using the circuit board above with a potentiometer..

I want to add the function of dimming to the Sonoff SV using PWM.

pete c

unread,
Sep 8, 2018, 1:30:00 PM9/8/18
to sonof...@googlegroups.com
Hello Phil,


The dimmer will almost certainly use the pot to vary between 0 and 12V to achieve the dimming.
 I don’t think PWM will work well enough to give you a consistent voltage at the pot – it may do with a transistor output rather than a relay.

Thinking the dimmer circuit board that I am using is doing PWM to the timer 555 and op amp.   I did not build this circuit board.  It comes with the el cheapo LED dimmer boxes available on Ebay for as little as $2.00 USD.

dimmerbox.jpg




Will check the voltage on the pot.  

Guessing here that it is a dimmer circuit that looks a bit like this which can also be used for motor control.

dimmer.jpg

NE555 Timer

555.jpg


LM356 Op Amp

LM356.jpg


D472A  N-Channel SDMOSTM POWER Transistor

D472A.jpg


 

78L05 5V 100mA Voltage Regulator


78L05.jpg

 

You could use an ESP-12 with some sort of digital to analogue converter and use all of the outputs to give you 256 steps of dimming

 

Have Arduino nanos here but want to keep the little project box to using only the Sonoff SV and dimmer circuit board.

Phil

unread,
Sep 8, 2018, 1:32:42 PM9/8/18
to SonoffUsers
If successful it will be a valuable addition to the tasmota feature set,

My electronics understanding is very limited. but if i understand correctly the problem is interfacing the 3.3v pwm signal from the SV board to the 12v circuit output from the potentiometer.


but you would need to loose the physical control pot or determine a method to switch/select controlling input.
Message has been deleted

pete c

unread,
Sep 8, 2018, 7:20:25 PM9/8/18
to SonoffUsers
Thank you Phil.

Learned that I cannot utilize the PVM out GPIO 13 (LED) for dimmer control.  Question was posted on the Tasmota firmware comments.

ESP8266 has only software PWM. There are known issues with low and high duty cycles (flickering) especially when you have network traffic. I think there won't be a satisfying solution using software PWM if your device has still some other work to do. What I could think of is the use of hardware pwm with something like https://www.adafruit.com/product/815. I2C is impemented so we would "just" need a driver and maybe a board layout like my IRremote extension to fit into the sonoff.

Read about WiFi controllers (multiple channel and single channel) which are firmware upgradable that I can do this with.  Found them on Ebay for around $10.

Philip Knowles

unread,
Sep 9, 2018, 2:24:50 AM9/9/18
to pete c, SonoffUsers

You could get an 8 step dimmer by creating a voltage divider with 7 resistors in series (across the pot +v and 0v) and use 8 transistors each controlled by an output from an ESP-12 which would feed into the pot wiper. Each transistor would give you an increased voltage at the pot. The reality is that you wouldn't need 8 steps perhaps only 3 or 4. Off would be no outputs on then say 25, 50, 75 and 100%. You could do that on a quite small piece of Veroboard.

Phil K


--
You received this message because you are subscribed to the Google Groups "SonoffUsers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonoffusers+unsubscribe@googlegroups.com.

pete c

unread,
Sep 9, 2018, 5:08:20 PM9/9/18
to SonoffUsers

Thank you Phil!!

Went googling here for a popular Wifi firmware upgradable RGB plus two white channel Wifi Controller.  Big mosfets and exposed JTAG and GPIO pins all for $8 USD.

Basically the only work involved with the device is to upgrade the firmware using the JTAG pins and create my Mosquitto stuff with it.

You are correct about the dimmer settings.  Use two settings here for the new SMD5050 5000k under the counter LEDs.  Minimum dim at night and full brightness during the day.  The old fluorescent lighting was 24/7 on.  What works nicely now with the Sonoff SV is that if I power off the LED driver the Sonoff SV remembers the setting of the relay.  I would like to see this with the upgraded controller.

I will probably never utilize RGB so will only be using one channel of 5 on the controller.    The controller was reviewed by the author of the Tasmota firmware to be well built and easy to upgrade.


Mark Roles

unread,
Sep 10, 2018, 4:30:55 PM9/10/18
to SonoffUsers
If you use a ESP8266 module that has an analog pin readily accessible on it (like the D1 mini) you can enable it by commenting out this line of code "#define USE_ADC_VCC "  in the in the file user_config.h.

Next hock up a Potentiometer to GND, 3,.3V and the analog pin. Then have a PWM signal sent out to the LEDs that changes  with the change of value that is created from turning the potentiometer.

pete c

unread,
Sep 10, 2018, 5:10:13 PM9/10/18
to sonof...@googlegroups.com
Thank you Mark.

Decided on using the N801 RGB 5 channel controller. 

Mostly because it will be easy to tinker with.  Using the channels here to control autonomous white LED strips in the kitchen.

Probably running the 12VDC wires down inside of the wall and up another wall from under neath the kitchen in the basement ceiling.

I would like to be able to keep using the current pot or use the Mosquitto automation for dimming.

N801.jpg




Reply all
Reply to author
Forward
0 new messages