1
\$\begingroup\$

I am thinking to use Arduino to generate square wave of various duty cycle and frequency. The square wave is going to be fed into a transistor amplifier.

What options do I have for programmatically controlling the output of a transistor?

MarianD
1,2732 gold badges5 silver badges16 bronze badges
asked Nov 12, 2010 at 2:27
\$\endgroup\$
1
  • \$\begingroup\$ you need to clarify the question. Are you talking about generating a DC voltage from the PWM? \$\endgroup\$ Commented Nov 12, 2010 at 3:04

2 Answers 2

4
\$\begingroup\$

The Arduino has an analogWrite(pin, level) function that takes care of the details of the on-chip PWM hardware. Programmatically, you just give analogWrite the pin number you're writing to, and a value 0 to 255 to control the duty cycle. If the hardware is such that the transistor saturates at one logic level from the PWM pin, and cuts off at the other, it should deliver proper PWM controlled power to your load. Be aware that the RMS value of PWM goes by the square of the duty cycle; 70% on, 30% off equates to half power.

MarianD
1,2732 gold badges5 silver badges16 bronze badges
answered Nov 12, 2010 at 3:41
\$\endgroup\$
0
\$\begingroup\$

If you use a low-pass filter (resistor to capacitor), you can filter the higher frequency PWM to be an average value of your PWM. So, if you are at 50% duty cycle and your voltage range is 0-5 V, you will get 2.5 V. This can be used to easily generate analog voltages.

The analog voltage can then be used to control the MOSFET.

MarianD
1,2732 gold badges5 silver badges16 bronze badges
answered Nov 12, 2010 at 3:20
\$\endgroup\$

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.