I tried to Revolutionize LED Lights!.....And FAILED?

231,352
0
Published 2024-04-07
Cheaper PCB layout Service at JLCPCB: design.jlcpcb.com/
6 Layers PCBs for $2(Free ENIG): jlcpcb.com/AAA
Get 6 layers PCB coupon: www.facebook.com/groups/JLCPCB/

Components list: (partly affiliate links)
3.3V Regulator: www.mouser.com/ProductDetail/595-LP2985-33DBVR
5V Regulator: www.mouser.com/ProductDetail/595-LP2985-50DBVR
ATtiny402: s.click.aliexpress.com/e/_DDtsuuH
VCNL4200: www.mouser.com/ProductDetail/Vishay-Semiconductors…
AL8860: s.click.aliexpress.com/e/_DlTFdi9
0805 Resistor Kit: s.click.aliexpress.com/e/_DBeArjf
0805 Capacitor Kit: s.click.aliexpress.com/e/_DmFOspJ
3015 47uH Coil: s.click.aliexpress.com/e/_DFhprnn
LEDs: www.lcsc.com/product-detail/Light-Emitting-Diodes-…
SI2301 MOSFET: www.mouser.com/ProductDetail/781-SI2301BDS-GE3
FDLL1418 Diode: www.mouser.com/ProductDetail/512-FDLL4148

Project files: (Schematic/PCB Design/Code): oshwlab.com/greatscott/stairledlight

The ATtiny Programming tutorial I used:
www.electronics-lab.com/project/getting-started-wi…

Previous video:    • "Salt" Batteries are FINALLY Here?! S...  

Facebook: www.facebook.com/greatscottlab
Twitter: twitter.com/GreatScottLab
Instagram: www.instagram.com/great.scott.lab/
TikTok: www.tiktok.com/@greatscottlab
Discord: discord.gg/zuAvkAuhsY
Support me for more videos: www.patreon.com/GreatScott?ty=h

In this big project video, I basically tried to revolutionize LED lights. That means I wanted to create an awesome led light for my staircase that only reacts when a human passes by and when it is dark. At the beginning everything worked just fine the mechanical mounting as well as the electrical design with uC, LED driver and distance sensor. After the programming and final assembly, everything fell apart. Check it out ;-)

Websites that were used/shown during the video:
4donline.ihs.com/images/VipMasterIC/IC/VISH/VISH-S…
github.com/SpenceKonde/megaTinyCore
github.com/ElTangas/jtag2updi
www.electronics-lab.com/project/getting-started-wi…
github.com/ktsai69/Vishay_VCNL4200
www.mouser.de/pdfdocs/Vishay_VCNL4200-SB.pdf
www.amazon.com/dp/B075MB414D/ref=syn_sd_onsite_des…
www.aliexpress.com/item/1005004866038739.html?spm=…

Thanks to JLCPCB for sponsoring this video.
Visit jlcpcb.com/ to get professional PCBs for low prices.

0:00 My Staircase problem
1:34 Intro
2:39 Mechanical Enclosure
4:20 Initial Plan for the Electronics
6:08 Testing the Distance Sensor
7:05 Creating the final Schematic & PCB Design
8:51 First Assembly & Test
9:48 ATtiny Programming & Finished Prototype
10:41 Final Assembly
11:24 PROBLEMS & TROUBLESHOOTING
12:43 Verdict

All Comments (21)
  • @greatscottlab
    The comments/feedback is crazy!! Thank you all for your awesome ideas, suggestions, tips, tricks and whatnot. Really awesome to hear so many advices, opinions. I think part 2 of this project will be a "community" video in which I will partly test your ideas. Will be lots of fun. But it will certainly take a while until I get to that. So stay tuned ;-)
  • @foamyrocks665
    I appreciate more the "I failed" videos than the "here how do to X perfectly". This is the best way to learn something and understand a project.
  • I found where you have the problem!!!! I also double checked with a electronics technician that has 50+ years in component level troubleshooting and high frequency circuit design who just happens to be my father that my suspicions where correct. He was able to give a solution and explain why it was happening along with why you were getting that specific frequency. Your driver circuit for the LED needs a second filter on the other side of the coil (U6) but before the diode (D3). In the current configuration, with the PWM being fed into there, you are pumping a RLC circuit in a single direction that has no where to release its energy other than ground and the power monitoring pin of the micro-controller (pin PA6 of part U3). Since it is going though a series of diodes, it is reflecting off of them and this is causing a doubling of the frequency. If you run a RLC calculation f = 1 / [2π × √(L × C)], you get 7.341 kHz for with the ideal component values and 14.682 kHz for the doubled, which is within 95% of the ideal component values, so accounting for the variance in the parts and the sub-harmonics we are seeing on the oscilloscope, this is pretty good proof that the hypothesis is correct. To test it further, removing a single unit for testing would be advisable and then replacing filter capacitor C10 with a different value or adding one in parallel to change the value and then checking with an oscilloscope might be a possible way to check for it. It is also possible that the oscillating circuit is internal to the LED driver IC, so adding this cap may do nothing, but adding the filter at the location that I specify as the solution is going to still work as that is the correct filter location in the circuit. You are going to need to put rejection filters between U6 and D3 that only pass DC and the fundamental frequency for your PWM signal. You could also get away with a low pass filter if the fundamental frequency for the PWM is low enough. I would suggest changing the PWM frequency to a lower value so that you can just use the low pass filter as high frequency noise is easiest to filter out. The datasheet for the micro-controller shows how to do this. As long as the resulting frequency is at least 10% below 7 kHz it should get rid of the noise. Assuming you are on the default settings for it, you should be well below that, but double check. Now as to the why on why this was causing so many problems with the micro-controller. The default clock speed of the micro controller might be set to 16 kHz (+/- 3% over voltage range and +/- 2% over temp. range) by default, so, if you have a signal on the other end of the PWM output pin that is close to that and really noisy while being unstable, like you have, and that pin isn't optically isolated (which this micro-controller doesn't have optical isolation on its I/O pins and problems like this are why you want optically isolated I/O pins) the interference can be feeding back through the circuit and causing problems with the PWM circuit. 97% of 16 kHz is 15.52 kHz, which is close enough for some signal coupling, so it can feed back into the circuit and cause the clock for the PWM to start having errors that the processor will have to correct, which will cause all sorts of strange behavior. I would change the internal clock that the PWM is using to the 20 kHz mode that the micro-controller has the option of using to just completely take it out of using a similar frequency. Make sure that the fundamental frequency that gets produced by the PWM still stays below the 7 kHz range using the equations given in the datasheet for how resolution and clock selection and clock type result in the output PWM signal's fundamental frequency. Just putting the filter in will probably fix most of the noise, but lowest noise possible is the best thing to do when dealing with micro-controllers. I would suggest in future only using micro-controllers with optically isolated outputs and always make sure that if you have a cap and coil in series in an oscillating circuit with diodes that you have a filter for both directions that the coil can discharge unless you are trying to make it oscillate or build a higher voltage.
  • @eugenes9751
    It's legit more enjoyable to watch the fail videos than the success videos. The fails are where you REALLY learn something new.
  • 6:50 you can use a diffuser cover and drill tiny (1mm diameter should suffice) holes right in front of the IR sensor.
  • To be honest this was one of the most eye-opening of your videos to me. Seeing such a theoretically simple and trivial project experience issues due to noise and other things.
  • @Fight2Survive559
    @greatscottlab LED Lighting Electronics Engineer here. I reviewed your project files and a few things: 1) put 0.1uF and 10uF cap on the input and output of your LED switcher. You actually need a high freq cap and lower freq cap to cover the freq range for input and output ripple 2) I like the 4-layer idea, but do 2 internal layers of ground, and only route on top and bottom. Also, make sure to sink a ground via right next to every signal line via (this will help the signal keep good ground reference and force the inductive coupling on the internal layers to follow a set path. Try to reduce the number of vias per net as much as possible (don't want added inductance) 3) Make sure to look at the recommended switcher layouts and make your switching nets small, and DO NOT let them go onto other layers (don't want to have inductive coupling between layers). Also, try and get ground between traces so you don't get cross talk. At the lengths of your PCBs, I'd expect you could get Volts worth of cross talk, even at sub 100MHz freq. 4) I'd add a common mode choke to the input of every PCB and a Pi-Filter too. It may be overkill, but for a few extra bucks you grantee each board isn't getting noise on the input. Make sure to route this all on the same layer as the connection between boards (so top layer for you). The shear length of the boards all ganged together is working against you and stray fields from surrounding power lines and appliances/electronics could get onto the boards and cause some weird behavior. Better to go all out and find you you don't need it then to find out you do need it haha. I highly recommend "philslab" on youtube as has some great videos giving best practices. The whole FEDEVEL group is very helpful for PCB design for EMI / EMC. Wish you the best of luck man! I love your videos and love the idea ;) Keep it up man!
  • @abhijeetbyte
    Frugal Engineer : This can be done with two proximity sensors, the 1st at the beginning of the staircase and the 2nd at the end. Keep the entire LED strip on until you pass the ladder. Use reliable MCU and LED drivers. As per my understanding, you don't want to manually turn on/off the house lights, and you don't want big bulbs to be lit
  • @SmithyScotland
    Perhaps use a white Pcb next time? Might blend in a bit more. Canny help debug unfortunately.
  • @Elberto71
    I did this using an addressable strip, arduino and 2 pir sensors for top and bottom, it's been working great for around 7 years now
  • When I made some under cabinet led tape lights integrate with doors and mains power about five years ago, I had a similar story. A "weekend project" spiraled into about 8 work days of effort and required a one year break for "finishing touches". I could not be happier with the results, even thought it needs another minor touch up. Your project is so much more ambitious and I cant wait to see how it turns out!
  • @markdog3355
    I was going to make animated lights on my staircase but decided a simple "all on", when a person is detected, was safer. I used a multivibrator circuit to turn on the lights for 30 seconds, and re-trigger whenever motion is detected. Fancy lighting effects look cool, but are distracting and dangerous IMHO. I love your method for mounting the LEDs. I chose to do the massive wiring to each LED approach, lol.
  • @YarianZy
    The design of the data lines won't work as indended as described at 5:12, there should be one diode for each OUT pad, not one for both. In your current design, every other board is commoned together via the OUT-Line of the board in between: Board A In2↔Board B OUT1/OUT2 ↔Board C IN1/IN2 ↔Board D OUT1/OUT2↔Board E IN1/IN2... Most likely that's why all the boards were lit in most of your initial trouble shooting. The boards at the top of the stair (which later you found missbehaving) pulled all the other inputs low, until you introduced smaller pull-ups until the voltage drop was enougth to be registered as low.
  • @AmateurSuperFan
    i don't know why your impression of your girlfriend was so funny to me
  • @smichels5117
    I feel your pain, my friend… we all have those frustrating project experiences. Thank you, for sharing yours. I’ll look at the files and think about this and send any thoughts later. Great video, as always! 👍😊👍
  • Great project! Thanks for honestly sharing that not everything worked as expected!! Super helpful for the listeners to learn as well!
  • @brandonstews238
    If you redesign the boards, it might be easier to use connectors to slide them together, soldering them all together will have to many failure points and you cant take it apart to diag and repair.
  • @TheHellis
    Nice to have pictures of yourself everywhere on the walls. 😂
  • @Moonlight0551
    What a great project. Well thought out and implemented (almost). I look forward to the next episode. As always, keep up the good work.
  • @supercurioTube
    I love that you show what didn't work. I'm still at the beginning and my first thought would be to illuminate the whole staircase dimly with a few presence detectors (including beginning & end) or use buttons for simplicity and use a timer to turn it off after a suitable amount of time. Illuminating each few steps individually seems like an anti-feature feature because we literally lookahead to plan our steps in advance.