Mturk Jobs

Mturk Jobs
Mturk Jobs

Tank

Monday, November 29, 2010

16F84A Spindle Motor Control

In this post , we 'll see how to control a spindle motor using the Microcontroller PIC 16F84A.
The spindle motor is a special type of Brushless DC ( BLDC )Motor that runs on high speed.

Unlike other types of motors, spindle motors have more than 2 terminals ( They can have 3 , 4 or five terminals ) .
Thus , the spindle motor is driven by switching its coils ON and OFF according to certain sequence. The function of the microcontroller is generating the driving signals.


Of course, the output current of the Microcontroller is not sufficient to drive the motor coils. There is an interfacing IC that can supply the motor coils with the suitable driving current. 

This IC is ULN2003. It acts as an electronic switch opened and closed according to the output signals of the Microcontroller.


I connected the ULN2003 IC to the Microcontroller on the prototyping bradboard.



This is the real circuit connection






As you can see , I used an old hard disk drive motor. This is a three coil spindle motor. Actually it has 4 terminals ( 3 Coils and 1 Common ).






You can see the four terminals on the back of the motor


 
This video shows the spindle motor connected to the driving circuit and rotating

You can find the source code and simulation files on this link.
 

The simulation model shows LEDs connected to the Microcontroller 16F84A. That is because this version of Proteus ISIS does not contain a three coil spindle motor model.









This is the schematic diagram of the circuit.




 





You can get this offer of 5 stepper motors with 5 ULN2003 boards from Amazon or Banggood








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.



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.

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

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.

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.

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, July 24, 2010

16F84 SERIAL COMMUNICATIONS



In many projects exists the need to exchange information with outside world. This case can be the need to store information from your project to a database on a standard PC or a need to communicate with another device. RS232 is widely used serial communications protocol. Modern Microcontroller chips contain hardware modules for such communications protocol. In those chips all you have to do is configuring the RS232 module and to choose the right crystal to produce the desired baud rate .



But in Microcontroller as 16F84A there is no such hardware communications modules. Serial communication can be established by software or Bit-Bang method. The standard RS232 protocol uses +12v to represent logic 0 and -12v to represent logic 1 . While TTL uses +5v to represent logic 1 and 0 V to represent logic 0.

An external IC is used as an interface between the Microcontroller and an RS232 enabled device ( PC for example ) .This IC MAX232 or HIN232 performs this level shifting function between the RS232 and TTL protocols.


Recently , I found a website implementing RS232 protocol in software using C language. The new method represented in this website is using the inverted logic ( 0v for logic 1 and +5v for logic 0 ) .

This method enables connection of the Microcontroller directly to the PC. The web page clearly explains this method . The PIC 16f8A can withstand +12v and -12v when receiving data from PC . And for data transmission to PC 0v to +5v can be distinct by the PC as two different levels.


I really wanted to try this code in real world and built the simple circuit as shown in the web page. The designer recommends connecting a resistor for PIC protection .


Of course , you can find that it is a very simple circuit that provides another new usage for the PIC 16F84A.


So how can you use the serial data form the Microcontroller ?

You can write a simple software for the PC that reads from the PC's serial port ( com1 or com2 ) . Or you can simply open the famous program Hyper terminal that comes with all Microsoft windows versions under the menu Programs --> Accessories --> Communications --> HyperTerminal. Then you need to configure the right Com port , Baud rate and Flow control . As shown here







I used a serial connector from an old mouse to connect the circuit board to the PC .




Here is the pinout of the 9 pin serial connector




This is the Hyper terminal program showing "Hello World" message from the Microcontroller .


This is the schematic drawing of the circuit




Here is the real circuit board I built and the serial connector connected to it .


Here, we 'll use the serial communication protocol RS232 to adjust the Microcontroller which in turn controls a DC motor by the PWM signals.

By choosing the motor speeds and sending them to the Microcontroller, we are able to choose PWM signals duty cycles and sending them to the Microcontroller via RS232 protocol.

The ciruit between the Microcontroller and the PC is very simple. All you have to connect is the PIC16F84A ,the crystal oscillator and the RS232 9 pin female connector.

The Microcontroller is supplied by the 12V DC from RS232 pin 7 RTS. Do not be afraid of losing the PIC chip, it can withstand it without damage.

The PIC16F84A Tx pin 1 is connected directly to RS232 pin 2 Rx.

The PIC16F84A Rx pin 17 is connected to RS232 pin 3 Tx through 10k ohm resistor to adjust the input voltage to the PIC.

The motor driving part of the circuit has already been explained in the PWM DC motor control post. So I 'll use the same driving circuit.

The PWM signal comes from the PIC16F84A to the NPN 2N2222 transistor base. This transistor acts as an electronic switch.

The DC motor is driven by an external DC 9v battery.



This image shows the Proteus 7 Model of the project


As usual , you may want to try the code and the circuit om the simulator first before building it . So , you 'll find the Proteus 7 model and code in this link . But to properly send and receive data form PIC 16F84A to the virtual terminal model in Proteus 7 environment it must be configured to use inverted data . You 'll find that I configured this for the model . But if you want to see it for yourself , right click on the virtual terminal model and choose inverted .


يمكنك قراءة هذه المقالة باللغة العربية

You can read this post in Arabic Language





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.

Tuesday, July 13, 2010

16F84A VGA Output


Have you ever thought of this ?

That you can generate any kind of signals using your little Microcontroller PIC 16F84A . And one of these signals is the VGA signal that appears on your PC monitor . I thought of this idea but I couldn't implement it. But I found it at this website. So I wanted to try if it is working and share it with you.




Here is the VGA connector from Amazon

I found an old web page containing this project http://tinyvga.com/pic-vga . I just made some minor modification on that project and put it into a real circuit. I found that the there is a small timing issue in this software that makes the monitor flicker repeatedly.


The circuit is very simple. It consists of the Microcontroller PIC 16F84A and the 15 pin female VGA connector. They all are connected on a breadboard.



This is the schematic diagram of the circuit


This is the pinout of the VGA connector




There is a simple hint for your when downloading the software on the

Microcontroller . Make sure that the configuration is :


PRTE ON

XT

WDT OFF


I took this pictures for the monitor after running the program.




This picture shows the circuit.







You can see in this video the flickering I told you about.




I 'll try to fix this issue and post it when I am done with it. Now I will show you the results of the current software. I hope you enjoy it.






Here is the link for the Proteus 7 Model , source code and Hex file .


You can read this post on my page on instructables.com







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.


يمكنك قراءة هذه المقالة على مدونتى باللغة العربية 


You can read this post in Arabic 




Saturday, July 10, 2010

Hacking Infrared with PIC 16F84A


Send an Infrared signal with PIC 16F84 :

In this post, we 'll learn about transmission of the Infra red signals using PIC16F84. You can use Infra red signal in many projects ( Robots, Touch less counters, Theft alarming .. )

All you need to know to start using Infra Red signals are IR transmitters ( IR LEDs ) and IR receivers ( IR receiver modules ).








The IR LEDs are normal LEDs in the outer shape but they emit IR signals and of course these signals cannot be seen by the human eye. You can though make sure it is working fine by using a digital camera. The digital camera can detect the Infra Red signal and makes them visible to you.

This image shows you how the digital camera in the mobile phone can make you see the IR signal transmitted from a normal IR remote control.





The other difference between visible light LED and IR LED is that in visible light LED, the +ve terminal (Anode) is the longer one. But in IR LED, the +ve terminal (Anode) is the shorter one.



The second thing you need to know is the IR receiver module. It is an IR receiver component connected to a demodulator and amplifier circuit. The function of the demodulation circuit is to demodulate the modulated signal received by the receiver module. This means that this module can receive and understand ONLY modulated signals !!!

YES , that's true. And this is used to differentiate between the IR communication and control signals and IR signal emitted from all the objects around us and from all visible light sources. The demodulator circuit has a Band Pass Filter (BPF) that can detect only signals modulated by a 34kHz carrier signal. Here is a datasheet for TSOP312 Infrared receiver module .



 IR Module
This means that if you want to transmit a signal that can be demodulated as (1), you need to send a continuous signal of 34kHz from your IR transmitter LED.





This is the signal I captured from the Remote Control by the IR receiver




And this is the signal I generated from the PIC 16F84A








The software is very simple this time and written in Assembly Language . All it does it sending pulses to the IR LED at the correct frequency for the correct periods of time. It consists of a 34KHz carrier modulated by the signal of consecutive zeros and ones.


I knew the time coding of the TV remote control by capturing the signal using the IR receiver module to the sound card of the PC . Then I viewed it using a sound editing software to show the exact times for the IR signal.



Here is the link for the Proteus 7 model and software for the project.


Project on instructables:

https://www.instructables.com/id/Capturing-and-Generating-Infra-Red-Signals-With-PI


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