Mturk Jobs

Mturk Jobs
Mturk Jobs

Tank

Showing posts with label PWM PIC 16F84. Show all posts
Showing posts with label PWM PIC 16F84. Show all posts

Thursday, April 2, 2009

DC MOTOR PWM CONTROL :


In this post, we 'll learn the DC motor control using PWM signal. We learned how to generate PWM signal using PIC 16F84 Microcontroller.

Hardware :

The PWM signal drives a 2N2222 transistor which acts as an electronic switch. The transistor switches the motor driving current on and off at high rate.

In the following figure, there are two circuits. The control circuit ( the microcontroller ) and the driving circuit ( the motor and the transistor ).

The DC motor draws relatively high current than the current in the microcontroller circuit. The transistor isolates the two circuits.


By changing the duty-cycle of the PWM signal, we get different average DC voltage
for each duty-cycle value . The result is the change of the motor speed corresponding to that duty-cycle.





Software:

We use the PWM routine with two defined duty cycle values. The duty cycle value duty1 is the larger value which drives the motor faster than duty2 value. When the Boost button is pressed, the first duty cycle value is selected. When the button is released, the second value is selected.



The software routine is very simple. As usual, you can download the Proteus 7 model from here.

If you need any help or have any feedback, just let me know.





If you like this blog you can support us by many ways:
   
   1. Leave comments stating your point of view about this article.

   2. Buy our book on Amazon Learn By Making.

   3. Click on links of our sponsors without adding any extra cost on you if you make purchase from them. Actually, many of these offers are totally free.
This means that you can enjoy something for free and still support our blog to keep posting useful stuff.


Amazon.com - Read eBooks using the FREE Kindle Reading App on Most Devices


This is the well-know Amazon Kindle platform. If you sign up for the free reader from Amazon to read any book, we get commission. 
There are many useful book for free on Amazon Kindle. Even you can find best sellers offered for free on Kindle format.
The best part is you can have the application on any platform. You can even read any book without installing any application by using Amazon Cloud-Reader on your browser.


Join Amazon Kindle Unlimited 30-Day Free Trial

You can join Amazon Kindle for 30 days free to have access to many paid book for free. You can cancel you subscription anytime.


Try Amazon Prime 30-Day Free Trial


The Amazon Prime is a special paid service from Amazon that offers good promotions and one-day free shipment for Amazon Shoppers. You can try this service for 30 days. You can cancel you subscription anytime.

Shop Amazon - Give the Gift of Amazon Prime


Try Audible and Get Two Free Audiobooks


Audible is the audio books website from Amazon. Many Kindle books are sold on Audible. You can try this service for free and get 2 free book. You can cancel you subscription anytime.


Shop Amazon - Create an Amazon Baby Registry

If you have a new baby borne or expecting one, you can create your free baby registry to easily save products and get offers and promotions on baby requirements.

  4. Visit our new website outatime.tech.

Thank you for visiting our blog.

Saturday, March 7, 2009

PWM Mood Light using PIC 16F84

Generating PWM signal using PIC 16F84

PWM ( Pulse Width Modulation ) is a square signal involves changes in the duration of the on time ( duty cycle ) . It can be easily generated by the PIC 16F84 . This PWM signal can be used in many applications ( for example : DC motor speed , LED brightness intensity , Mood Light Lamps ) .

PWM can be used when no DAC ( Digital-to-Analog Converter ) is available in the microcontroller chip or as a stand alone chip. The average DC voltage values are equivalent to analoge values as where you used DAC for motor speed control .

And for light brightness intensity , at high frequency , the blinking process is not observed by human eyes and what you see is only brightness intensity corresponding to the duty cycle ( time at which light is ON)

At longer duty cycle , LED is ON for longer time , so you see it brighter.












At shorter duty cycle , LED is ON for shorter time , so you see it less brighter.




The previous examples used constant duty cycles at each time which means constant brightness LED and constant speed for motor.

To make Mood Light LED, you need to change the duty cycle of the PWM signal by increasing and decreasing it back and forth.

You get this one .


Note :

You see this image still, just click it and save it to your PC you 'll see it animating ( PWM is variable ) .



I connected this circuit to the LED and it did just as I expected , it looked brighter then dimmed and then brighter again.


You can have the circuit and the code files from here.


If you need any help configuring the compilation settings for Hi-Tech and ISIS 7 , you can check the previous posts. If you need further help about code and hardware you are welcome to contact me.





If you like this blog you can support us by many ways:
   
   1. Leave comments stating your point of view about this article.

   2. Buy our book on Amazon Learn By Making.

   3. Click on links of our sponsors without adding any extra cost on you if you make purchase from them. Actually, many of these offers are totally free.
  4. Visit our new website outatime.tech.

Thank you for visiting our blog.

Tank