i want to develop a system to control a DC motor in forward and reverse directions using PIC16F84A. Also how i can add temperature sensor inputs to this system.
Check earlier postings on this site about doing PWM - pulse width modulation. Go to National Semiconductor's site and get the spec sheet for LM34 or 35 (one is scaled in C, the other in F.
Before you start to write the code, perhaps selecting a microcontroller would be in order. Check the several threads on this site as to which is a good choice. If one seems to interest you, look at the company's web site, especially their applications library. Chances are good there will be examples of both temperature logging and DC motor control.
To control the speed of a dc motor, you need a speed sensor too. read the actual speed, if lower/higher than required then increase/decrease the driving power of the motor. That's the basic, but actually there are many control methods, and the most widely used is PID (Proportional, Differential, and Integral).
------------------------- http://www.softhardzone.com : high quality free ware, electronic hardware design trick, software programming tips, and many more..
thank u all
for this project i selected dsPic30F2010, although it is my first time to deal with, i went throuh microchip web site to find some examples but i failed,so know the question is how to proceed with the code :
1- i found difficulties to use the PWM function and how to call it in the main program to accelerate or decelerate the motor.
i am using the C30 compiler so my code is in C++
2- i have tried to write a small code to illuminate an LED.
hey...the best way in my opinion is to use fast PWM mode of a micro with respect to an external voltage reference for direction - eg a pot. so if the pot is 0.1-2.4V then spin proportionally in a direction, and if the pot is 2.5 - 5V then spin proportionally in the other direction....that is the pot controls the value to be stored in the timer used for PWM generation...higher pot value means when the ADC converts it , the timer will have a higher mark to period ratio etc