Connect with us

PWM

Discussion in 'General Electronics Discussion' started by TheLacasse, Jun 8, 2015.

  1. TheLacasse

    TheLacasse

    15
    0
    Jun 8, 2015
    Excuse my english

    Hi I'm a beginner in electronic I have a project in mind but I need your help. I want to take the output voltage of my iPod sound jack that is around 1.5v maximum and convert it into PWM so when the voltage is 1.5v the duty cycle will be 100% and when it is 0v the duty cycle will be 0%. The PWM will control a transistor that will control any type of light(LEDs etc). I would like to know if it could work and how I could do it.

    Thanks!!!
     
  2. Gryd3

    Gryd3

    4,098
    875
    Jun 25, 2014
    How deep down the rabbit hole do you want to go?
    You can actually store audio files on your phone that play back a PWM waveform... run it into an opamp to buffer it and drive what you want.
    If you want the volume out of the 3.5mm jack to control the PWM duty cycle, it gets slightly more complicated... (either making or purchasing a voltage - PWM converter)
     
  3. poor mystic

    poor mystic

    1,059
    28
    Apr 8, 2011
    Is the project to make lights controllable by sound volume?

    oops a "post crash"...
    Your ball, Gryd
     
    Gryd3 likes this.
  4. TheLacasse

    TheLacasse

    15
    0
    Jun 8, 2015
    I want the light to follow the music beat
     
  5. Gryd3

    Gryd3

    4,098
    875
    Jun 25, 2014
    You are in luck. Do you want to try a little research by yourself first?
    You will need an amplifier to take the signal from your audio port to boost it to the desired level. (An opamp for this is perfect)
    From here, the signal from the opamp goes to a Voltage controlled PWM chip and bobs your uncle!
    (If you want to make your own PWM 'chip' you will need to 555 timer, a comparator and a few misc parts)
     
  6. hevans1944

    hevans1944 Hop - AC8NS

    4,231
    1,995
    Jun 21, 2012
    Or you can buy this device from Linear Technology. Voltage control in, you pick the PWM frequency it puts out. But, what will be the effect of PWM modulating a single fixed frequency using an audio signal from the iPod? What does it even mean to convert the iPod audio to a PWM signal? What is being pulse width modulated? Why not just have a threshold detector that turns on whenever the peak amplitude of the music crosses an adjustable level? That generally works pretty well for recovering the "beat" of the music.
     
    Gryd3 and poor mystic like this.
  7. Gryd3

    Gryd3

    4,098
    875
    Jun 25, 2014
    So many ways to do things :)
    If you're curious about the type of behaviour @TheLacasse , do a quick google search for 'light organ'
    They generally have 3 lights (Trebble, Mid, Bass) but you can omit two of the three if you only want it to respond to bass notes.
     
    hevans1944 likes this.
  8. hevans1944

    hevans1944 Hop - AC8NS

    4,231
    1,995
    Jun 21, 2012
    @Gryd3 I forgot to mention that the threshold detector is usually preceded by either a band-pass or low-pass filter to extract the bass components of the audio, if all you want to do is detect the music beat. Thanks for catching that.
     
    Gryd3 likes this.
  9. TheLacasse

    TheLacasse

    15
    0
    Jun 8, 2015
    Thanks everybody!!

    I already did this project in the past but I was using an op-amp (LM324 it was stereo) that was outputting around 5v maximum I was not able to drive powerfull light this is why I want to use PWM to control a transistor that will drive any kind of light. There is a video of the thing I made using an op-amp: @Gryd3 as you said "So many ways to do things" but I think I'll go with an op-amp and a voltage-controlled PWM using a 555 timer because this is a great opportunity for my to learn about the 555 timer.

    Excuse my english again
     
    Last edited: Jun 10, 2015
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-