# 555 Timer as a Square Osc?

I was doing some tests with a NE555 Timer today, and was wondering if I could control frequency and pwm-duty from 2 arduino PWM outputs? Just curious, as I have no clue on how. I did manage to get pwm-duty working, by replacing the resistor with pwm from pin 3, and it works. But I can't figure out how to handle the frequency...

Wk

Replace R1 and R2 with potmeters P1 and P2 and you should be able to change the frequency on pin 3. But be aware that the frequency depends on both potmeters.

With P2 you can change the LOW and HIGH timing : high = ln(2) * (P1 + P2) * C;
with P1 you can change the LOW timing : low = ln(2) * P2 * C;

wavelength = high + low = ln(2) + (P1 + 2*P2) *C; => so freq = 1/ wavelength = 1 / (ln(2) * (P1 + 2 * P2) * C);

The way to work is:
first make LOW timing correct with P1 , then adjust HIGH timing with P2.

Note that the HIGH time >= LOW time. ==> dutycycle is allways > 50%

Hopes this helps,
Rob

Thanks, but I think I'm lost. You mean Potentiometers? Sure, I did that, works great. BUT, I want to use the Arduino PWM to control that. Imagine using MIDI messages to fire up multiple 555 timers?

Wk

I would think there's a way to use a digital pin to enable/disable the 555 to output a frequency, or not.
Maybe triangle wave instead with some post-filtering to get a cleaner tone out of it.
Gotta read the data sheet ...

You mean Potentiometers?

yes,

What do you think of using two I2C potentiometers for R1 and R2 - http://arduino.cc/en/Tutorial/DigitalPotentiometer -

(no electronic expert disclaimer)
Dont know how to do it with PWM, my intuition states that the bistable schema should be used and you need one PWM to set and another ot reset the outgoing pulse.

I was just reading a 555 datasheet. If you set up the 555 as an astable multivibrator, than the output should oscillate at the frequency set by 2 resistors and a capacitor when Reset is High, and not when Reset is Low.

Thus I suppose if you had a shift register driving the reset lines of eight 555 timers (or their multple-part per package variations), then you could control 8 tones at once. I don't know how much lag that would be, perhaps using SPI to shift out would be needed.

See a data sheet like National Semiconductor, which has a graph to give an idea of values to use, or you can plug the formula into an excel spreadsheet, pick the frequency and a couple values, solve for the others.

Take the 555 outputs, add them together using an op amp, add low pass filter to keep high frequency switching noise out. Pass on to your sound system.
Make one of the parts some kind of tunable part to dial the frequency in. Could likely do that with a digital potentiometer, use the arduino to measure it and make it autotuning!

Good ideas, thanks, I will play around with it some more soon.

Wk

Oh, check this out:

Looks like I can setup things up and just use Pin 5 to modify the frequency, will test that out tomorrow.

Pin 5. ? Control Voltage, This pin controls the timing of the by overriding the 2/3Vcc level of the voltage divider network. By applying a voltage to this pin the width of the output signal can be varied independently of the RC timing network. When not used it is connected to ground via a 10nF capacitor to eliminate any noise.

And here's a very nice picture of the 55 inner workings:

Strange, works for me, just tested it out again.

Wk

HA! IT WORKS! "Its Alive! Its Alive!!!" 8)

All I did was add voltage to Pin 5, using a Potentiometer, and it works. When I get some time I will use a filtered PWM output to control more than 1x 555 at the same time. I'm sure I will get some lush sounds.

BTW: check this out!

http://www.getlofi.com/?p=518

Heck, you don't need to tie up PWM pins if all you need is a static voltage - get one of the octal DACs that Analog Devices makes, think you talk to them via SPI (or I2C), can get a lot more control in frequency than you'll get with the 255 steps that PWM offers.

Will definitely make this thought from my earlier post possible!
"Make one of the parts some kind of tunable part to dial the frequency in. Could likely do that with a digital potentiometer, use the arduino to measure it and make it autotuning!"

Good idea, but for now let me try the PWM output, see what I can cook with just 555 timers.

Wk

Did you ever get this working? I am trying to do the same thing right now, but haven't made much progress with it yet.

As far as i remember the CV input on pin 5 can only control a small part of the freq. range of the oscillator.

Hi all

I think to write here because quite near to my subject.

I want to control PWM fans with arduino. I try arduino own analogWrite, but because crappy (500hz) frecuenzy fans keep annoing sound.

Now think is that easiest to use 555 timer to keep up that frecuency about 20-25khz.

Just thinking how i get easiest way to do arduino + 555 chip PWM controller what give output 25khz frecuenzy and i can control pwm signal with arduino. What is easiest way do this with 555 timer.

Try to get all works with passive components, not need more chips after arduino and 555 timer.

PWM fans use that pwm signal only driving, fans get power with different wire. 555 only need give pwm signal not need current so much, thats why i think i can put 555 output pin directly on pwm fans (pwm signal pin).

All hint and tips are welcome.

Start a new thread, this one is 2013

"I want to control PWM fans with arduino. I try arduino own analogWrite, but because crappy (500hz) frecuenzy fans keep annoing sound."

You can use the Timer1 library to generate the PWM and frequency you need.

.