Electronic candle with PWM and flicker effect

แชร์
ฝัง
  • เผยแพร่เมื่อ 10 ก.ย. 2024
  • Let's build an electronic candle that has a realistic flickering effect!
    This is a small and simple PIC microcontroller circuit and makes use of the analog to digital converter and the pulse-width modulation modules. You can use it for winter decoration, doll houses, or anywhere else where you want to mimick the flame of a candle. Check out the companion article on my website for more details and an up-to-date list of all components: www.friendlywir...
    Thanks for tuning in, and let me know in the comments if you have any questions!
    Website: www.friendlywir...
    Twitter: / friendlywire
    Reddit: / friendlywire
    Facebook: / friendlywire
    Instagram: / friendlywire

ความคิดเห็น • 59

  • @MindFlareRetro
    @MindFlareRetro 4 ปีที่แล้ว +2

    A great project and a great video - everything is well shot, edited and presented very nicely. Excellent job!

    • @FriendlyWire
      @FriendlyWire  4 ปีที่แล้ว +1

      Thank you so much, I am happy you like it! Do you have any suggestions on future topics that might be interesting? I am thinking of doing an RS232 tutorial and I also have one CMOS project in the pipeline.

    • @MindFlareRetro
      @MindFlareRetro 4 ปีที่แล้ว +1

      @@FriendlyWire Well, RS232 is very interesting to me as a retro computer enthusiast. I would enjoy that very much.

    • @FriendlyWire
      @FriendlyWire  4 ปีที่แล้ว +1

      @@MindFlareRetro Consider it done! :) I actually am very fond of RS232 because it is such a simple interface, and most controllers have a USART module that is compatible. The only pain is the level shifter MAX232 which makes it a bit more involved.

    • @MindFlareRetro
      @MindFlareRetro 4 ปีที่แล้ว +1

      @@FriendlyWire Nice! Looking forward to it. I purchased a used Fluke 45 dual display bench multimeter (with an RS232 interface at the back) a couple of years ago. And about a year ago I came across a gentleman who created a small Windows program that would display the DMMs output via the RS232 port. I should probably get myself a cable to see this in action.

    • @FriendlyWire
      @FriendlyWire  4 ปีที่แล้ว +1

      @@MindFlareRetro Yeah, RS232 is a really nice, simple, and non-proprietary interface for that sort of thing :)

  • @axeldaguerre8838
    @axeldaguerre8838 4 ปีที่แล้ว +1

    Thank you it helps me for my future projects, plan to do something for Christmas, it was just perfect explanation

    • @FriendlyWire
      @FriendlyWire  4 ปีที่แล้ว

      Thanks, that's great to hear! :) Make sure to share your photos and tag me @FriendlyWire on Twitter if you want (or share it on our subreddit /r/FriendlyWire), I would love to see the project. Have a great day!

  • @labibmuhammadasif1510
    @labibmuhammadasif1510 4 ปีที่แล้ว +1

    Great Tutorial.... Please keep making interesting project tutorial

    • @FriendlyWire
      @FriendlyWire  4 ปีที่แล้ว

      Thank you so much, I am very happy you like it! I am almost done with the next video, but it will be on the CD4017 counter IC (no microcontroller). After that I have some microcontroller videos planned.
      Do YOU have any suggestions for future videos? Anything you want to learn about PIC microcontrollers? Because my channel is so small I always love to take direct suggestions from as many viewers as possible :)
      Have a great day, and thanks for stopping by :)

  • @abdullahshamim2218
    @abdullahshamim2218 4 ปีที่แล้ว +1

    That's really some work for a candle :)

    • @FriendlyWire
      @FriendlyWire  4 ปีที่แล้ว +1

      True :) But after you know how to use analog to digital converters and pulse-width modulation on a microcontroller, there are many many other cool things you can do. I believe in finding a simple starting project, and then taking it from there :)

  • @VintageProjectDE
    @VintageProjectDE 4 ปีที่แล้ว +1

    A really nice idea!
    And I like your presentation. Well done!

    • @FriendlyWire
      @FriendlyWire  4 ปีที่แล้ว

      Thank you Thilo, glad you like it!

  • @GiuliaArmaneli
    @GiuliaArmaneli 2 ปีที่แล้ว +1

    Muito legal o projeto 😁👏🏻

    • @FriendlyWire
      @FriendlyWire  2 ปีที่แล้ว +1

      Muchas gracias, Giulia :) Glad you like it!

  • @tziirkq
    @tziirkq 3 หลายเดือนก่อน +1

    Thanks so much, this is great. Literally exactly what I want to do, but haven't the MC knowledge to figure it out for myself. I have a couple of questions; is it possible to use a potentiometer to control the rate, and can the signal be used to control things other than an LED? Thanks again.

    • @FriendlyWire
      @FriendlyWire  2 หลายเดือนก่อน

      I am glad you liked the video, and apologies for my late response. Yes! You can do that! Check out the PIC16F455 ADC tutorial here: th-cam.com/video/AlpbbeX7-BU/w-d-xo.html . What kind of other things would you like to control with the circuit?

    • @tziirkq
      @tziirkq 2 หลายเดือนก่อน +1

      @@FriendlyWire I'm a musician, I was hoping this would be a handy way to make a smooth sample and hold LFO. Really I'd like to be able to make and program musical devices, like digital effect pedals and synths, without having to put an entire Arduino inside, as that seems wasteful.

    • @FriendlyWire
      @FriendlyWire  2 หลายเดือนก่อน

      @@tziirkq Ohh that is so interesting! I have no experience with this, but could you describe it a bit more, perhaps via email? You can find my address at the bottom of www.friendlywire.com :)

  • @akshaygs292
    @akshaygs292 3 ปีที่แล้ว +1

    Good Explanation,
    Nice simple and effective animation!
    We can even add a sensor to blow out the candles next time,.. haha
    What is the Software you use to create videos?

    • @FriendlyWire
      @FriendlyWire  3 ปีที่แล้ว

      Thank you, glad you liked it! And that's a great idea! :) I use DaVinci Resolve to make the videos.

  • @ben10er6
    @ben10er6 16 วันที่ผ่านมา +1

    can someone help me how many of these 220 resisters do i need for a flickering orange bulb with two aa batterys

    • @FriendlyWire
      @FriendlyWire  11 วันที่ผ่านมา +1

      You can try 100 Ohms, it should work OK.

    • @ben10er6
      @ben10er6 9 วันที่ผ่านมา +1

      @@FriendlyWire thankyou

    • @FriendlyWire
      @FriendlyWire  2 วันที่ผ่านมา

      @@ben10er6 Happy to help! If anything doesn't work, let me know, we will figure it out together :)

  • @s1nister688
    @s1nister688 4 ปีที่แล้ว

    Hoping one day you'll do some videos on drones(quadcopters? using arduino as a cheap flight controller?)
    I love these videos though.

    • @FriendlyWire
      @FriendlyWire  4 ปีที่แล้ว

      Thanks so much! For now I have no planes on drones/quadcopters, I feel like there are so many great diy projects out there, and the controls and regulating circuits are really advanced :)

  • @overclockers6835
    @overclockers6835 3 ปีที่แล้ว +1

    Nice video. Done similar projects using an attiny25/85 and an arduino as the programmer. Any reason you used a pic16f1455? I haven't used this mc yet, wondering if I should.

    • @FriendlyWire
      @FriendlyWire  3 ปีที่แล้ว +1

      Thanks! I like PIC controllers because they are fairly affordable and rather simple to use, but there is no reason you have to do this project on a PIC, the general idea works with any microcontroller that has ADC inputs. I like the PIC16F1455 and also its related chips like the PIC16F1459, they are quite powerful.

  • @torbjrnrosseland598
    @torbjrnrosseland598 3 ปีที่แล้ว +1

    How long will this last with the battery pack?

    • @FriendlyWire
      @FriendlyWire  3 ปีที่แล้ว

      Good question! According to Google, a typical AA battery has between 2000mAh-3000mAh capacity. If both LEDs were on at the same time, and each LED draw around 10mA, that would be 20mA total current draw (with the current consumption of the controller negligibly small), resulting in 100-150 hours of continuous operation. Of course that is just an approximation: the LEDs are not on continuously (they are driven by PWM at reduced effective brightness, after all) and also the batteries won't last until zero capacity. So I would guess that the circuit should run for around three days straight.

  • @boltex_4280
    @boltex_4280 3 ปีที่แล้ว +1

    hi. can i use the PIC16F1455 with led strip and 12v? thanks u

    • @FriendlyWire
      @FriendlyWire  3 ปีที่แล้ว +1

      Hello :) The PIC16F1455 is for 5V maximum, so I don't think it works right away. Do you have a link to the LED strip you have in mind? It might be possible to use a special driver :)

    • @boltex_4280
      @boltex_4280 3 ปีที่แล้ว +1

      @@FriendlyWire Hello thanks for answering, this is the link a.aliexpress.com/_mroQxPn, I want to make a lava diorama and I want to do the candle effect but it is 12volts

    • @boltex_4280
      @boltex_4280 3 ปีที่แล้ว +1

      @@FriendlyWire I would appreciate your answer🙌🏻

    • @FriendlyWire
      @FriendlyWire  3 ปีที่แล้ว +1

      @@boltex_4280 These LED strips are "smart" LED strips that can be any color you want. If you search TH-cam for "Neopixel fire animation" you should find something that works well. The project in my video here is just for single-colored LEDs, and unfortunately it's not "smart" enough.
      My next project will be about the PIC16F1455 and how to drive Neopixel LEDs with it, but it will be a few weeks until it is out.

    • @boltex_4280
      @boltex_4280 3 ปีที่แล้ว +1

      @@FriendlyWire Thanks, I'll look for neopixel on youtube, I don't need rgb anyway, I want 2 strips warm white as a candle

  • @Sanaullahalam95
    @Sanaullahalam95 3 ปีที่แล้ว +1

    Sir can you make more effects like fire, welding spark, lightning effect, cloud pass, tv blink, etc.

    • @FriendlyWire
      @FriendlyWire  3 ปีที่แล้ว +1

      Thank you for your question and for your interest, Sanaullah, it's great to have you here! :) With just a few LEDs you can make very simple animations, but they can be quite powerful. I think all the key is in the timing. Have you looked at the source code of this project? I am sure you could try it! Let me know if you have questions about it, you can always reach me on Twitter @FriendlyWire as well, happy to help! :)

    • @Sanaullahalam95
      @Sanaullahalam95 3 ปีที่แล้ว +1

      Thank you so much Dear respected sir
      Sir if i want to find the timing of any effect then how to get it like spark timing of welding By the way, how did you determine the timing of the candle flickering?

    • @FriendlyWire
      @FriendlyWire  3 ปีที่แล้ว +1

      @@Sanaullahalam95 My pleasure, and thanks for your interest! :) I just tried around to get the effect I wanted. I am no expert with animations but I had some idea what I was after. If I wanted to do a welding spark thing I would change the color of the LEDs to white and blue, and use sharper transitions. You could also look at welding videos on TH-cam and play them back at a lower speed (click on "options" and then on "playback speed" and you can set it to 0.25) which will give you more details :)

    • @Sanaullahalam95
      @Sanaullahalam95 3 ปีที่แล้ว +1

      @@FriendlyWire thank you dear sir
      Sir if microcontroller pic16f1455 is not available in my local market so can change the ic number like pic16f676 in source code?

    • @FriendlyWire
      @FriendlyWire  3 ปีที่แล้ว +1

      @@Sanaullahalam95 Yes, it works also with the PIC16F676, it is very similar to the PIC16F1455. BUT you will need to change some parts in the code. Feel free to message me on Twitter @FriendlyWire if you need help with that, we will get it to work! :)

  • @Sarahbuildsstepsequencers
    @Sarahbuildsstepsequencers ปีที่แล้ว +1

    Ugh, I don’t know how to program.

    • @FriendlyWire
      @FriendlyWire  ปีที่แล้ว

      But you can learn it! :) Try this beginner tutorial here if you are interested: th-cam.com/video/e4Q2dYVedPY/w-d-xo.html