Introduction: PIC 16F917 Gyroscope Interface

In this post we will study the ADC ( Analog-to-Digital ) Module of the Microcontroller PIC16F917 . We will study a real circuit of PIC16F917 interfacing to a semiconductor Gyroscope.


The Gyroscope is a motion sensor that senses tilt in a certain direction . The used sensor is a yaw rate sensor ( free sample from Analog Devices . The GyroscopeADXRS613 was sent in an evaluation package EVAL-ADXRS613 ) . Yaw means rotation around the vertical access . And rate means the acceleration of this rotational motion.



The output from this sensor is analog signal which represents the Yaw rate in certain direction ( Left or Right ).

The analog signals are converted in the ADC module of the PIC16F917 and are represented on an LED column according to the yaw rate and direction.



The program is very simple and straight forward. It starts by configuring the ports of the Microcontroller for input and output. Then the ADC Module is also configured ( Channel , sampling rate and result data format ).



Then the infinite loop of the program starts which contains the step of

starting the conversion ,

waiting for conversion to complete and

displaying the result on the LEDs.



When the circuit moves in clock wise direction , number of LEDs in one half of LEDs column illuminate according to the rate of change in angular motion.

And When the circuit moves in counter clock wise direction , the other half of the LEDs illuminate indicating change in direction and indicating rate of change in angular motion.





This is the circuit as shown on Proteus 7 simulation environment


The Gyroscope is replaced in simulation by a variable resistance because Proteus 7 does not contain a Gyroscope model.




Wish you the best. And have fun ,Live free And Read Books on Amazon




Step 1: Software and Simulation

The code is written in C and compiled with Hitec C Compiler.

The program is very simple and straight forward. It starts by configuring the ports of the Microcontroller for input and output. Then the ADC Module is also configured ( Channel , sampling rate and result data format ).

Then the infinite loop of the program starts which contains the step of

starting the conversion ,

waiting for conversion to complete and

displaying the result on the LEDs.

When the circuit moves in clock wise direction , number of LEDs in one half of LEDs column illuminate according to the rate of change in angular motion.

And When the circuit moves in counter clock wise direction , the other half of the LEDs illuminate indicating change in direction and indicating rate of change in angular motion.

I added a software part that makes the buzzer sound in two different sound when the board is rotated to the Right or to the Left.



The Gyroscope is replaced in simulation by a variable resistance because Proteus 7 doesn't contain a Gyroscope model.



Here is part of the software used to convert the Analog output into Yaw direction and amplitude.


Step 2: Hardware

Components

PIC16F917 from Amazon US , Amazon UK, Amazon CA, Amazon DE, Amazon FR or eBay , or Aliexpress


Analog Devices Rate Gyro EVAL-ADXRS613 from Amazon US , Amazon UK, Amazon CA, Amazon DE, AmazonFR or eBay , Banggood or Aliexpress

LEDs from Amazon US , Amazon UK, Amazon CA, Amazon DE, Amazon FR or eBay , Banggood or Aliexpress

Verro board from Amazon US , Amazon UK, Amazon CA, Amazon DE, Amazon FR or eBay , Banggood or Aliexpress

9 volt battery connector from Amazon US , Amazon UK, Amazon CA, Amazon DE, Amazon FR or eBay , Banggood or Aliexpress

sound buzzer from Amazon US , Amazon UK, Amazon CA, Amazon DE, Amazon FR or eBay , Banggood or Aliexpress

40 pin IC Socket from Amazon US , Amazon UK, Amazon CA, Amazon DE, Amazon FR or eBay , Banggood or Aliexpress


Connect the circuit as in the schematic diagram.

You need to load the Microcontroller with the Hex file ( Code Program ).

Here is an instructable on PIC16F917 programming with a programmer circuit I 've built.



Then , you need to put the Microcontroller into the IC socket.

Step 3: Tilt to Tick

Here is the final step. You 'll connect power to the circuit and see it working.









Here is the post on my blog Embedded Egypt

http://embedded-egypt.blogspot.com/2010/11/yaw-rate-gyroscope-interface-to.html



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

You can also read this article in Arabic on my blog

http://arabic-embedded-egypt.blogspot.com/2010/11/blog-post.html

=============================================================

Thank you for reading my instructable.

Wish you the best. And have fun ,Live free And Read Books on Amazon

You can also find my book Learn By Making on Amazon website.

If you like this instructable 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 instructable.

Comments

author
gonec (author)2015-05-11

About This Instructable

5,119views

21favorites

License:

Bio: For me, instructables is more than a website. It is a lifestyle. It gave me the chance to live my dream. Share what I do ... More »
More by ahmedebeed555:Solar Pyrography Garden QuotesWind Turbine Mobile USB ChargerHow to Make a Gyroscope in One Minute
Add instructable to: