Maker Pro
Maker Pro

PWM

TheLacasse

Jun 8, 2015
15
Joined
Jun 8, 2015
Messages
15
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!!!
 

Gryd3

Jun 25, 2014
4,098
Joined
Jun 25, 2014
Messages
4,098
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!!!
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)
 

poor mystic

Apr 8, 2011
1,074
Joined
Apr 8, 2011
Messages
1,074
Is the project to make lights controllable by sound volume?

oops a "post crash"...
Your ball, Gryd
 

Gryd3

Jun 25, 2014
4,098
Joined
Jun 25, 2014
Messages
4,098
I want the light to follow the music beat
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)
 

hevans1944

Hop - AC8NS
Jun 21, 2012
4,878
Joined
Jun 21, 2012
Messages
4,878
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

Jun 25, 2014
4,098
Joined
Jun 25, 2014
Messages
4,098
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.
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

Hop - AC8NS
Jun 21, 2012
4,878
Joined
Jun 21, 2012
Messages
4,878
@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.
 

TheLacasse

Jun 8, 2015
15
Joined
Jun 8, 2015
Messages
15
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:
Top