Arduino Based 12V PWM Generator
by jntan in Circuits > Electronics
3107 Views, 0 Favorites, 0 Comments
Arduino Based 12V PWM Generator
![result.JPG](/proxy/?url=https://content.instructables.com/FBG/GDR8/KZ9UN9HG/FBGGDR8KZ9UN9HG.jpg&filename=result.JPG)
12VDC is an important power source in cars. As a matter of fact, many automotive components like radiator fans, water pumps, valves and small motors can be controlled in a stand-alone fashion with a supply of 12VDC power and 12V PWM control signal, besides the LIN/CAN protocol. If you want to test an automotive part on your bench before putting it into your car, you would probably need a 12V PWM signal and this project will teach you how to generate a 12V PWM signal using Arduino.
Supplies
- LM339 x1
- Arduino Uno x1
- 2.7K/0.25W Resistor x2
- 1K/0.25W Resistor x1
- Jump wires
- Breadboard x1
- 12VDC power supply x1
![Cover.JPG](/proxy/?url=https://content.instructables.com/FE3/AEZU/KZ9UN91Q/FE3AEZUKZ9UN91Q.jpg&filename=Cover.JPG)
![wiring.JPG](/proxy/?url=https://content.instructables.com/FIZ/ZDE4/KZ9UN923/FIZZDE4KZ9UN923.jpg&filename=wiring.JPG)
![mysetup.JPG](/proxy/?url=https://content.instructables.com/F9Z/BU80/KZ9UN9H8/F9ZBU80KZ9UN9H8.jpg&filename=mysetup.JPG)
![result.JPG](/proxy/?url=https://content.instructables.com/FEO/8N9R/KZ9UN9H9/FEO8N9RKZ9UN9H9.jpg&filename=result.JPG)
There are four short steps only:
- Prepare your parts according to the BOM;
- Wire up your circuit according to the diagram provided;
- Program your Arduino - the code is provided at the end of the post ;
- Test your setup.
I'm including my setup and 12V PWM signal output on oscilloscope for your reference. I hope everyone finds this tutorial useful and enjoys what you do.
Best,
JT_Enliten
Arduino Code:
#include <PWM.h> const int PWM_pin = 9; void setup() { pinMode(PWM_pin,OUTPUT); InitTimersSafe(); bool success = SetPinFrequencySafe(PWM_pin, 60);//frequency pwmWrite(PWM_pin, 128);//duty cycle } void loop() { }