Jump to content
Sign in to follow this  
iragdoll

Connecting Piezo Vibration Sensor to LaunchPad

Recommended Posts

Okay, How do I know if I am reading the voltage correctly?

 

Hmm, you'll need to know the basics of an ADC, instead of us holding your hand. Lets see, a couple of simple questions(select the right one) and you should know the answer to your question after that:

 

1) Whats the range of the MSP430 ADC in volts.

a) 0 to 10V

B) 0 to 5V

c) 0 to 3V

2) After making a conversion, what is the range of ADC register values

a) 0 to 65535

B) 0 to 1023

c) 0 to 255

 

edit: Slower than you, NTM.

Share this post


Link to post
Share on other sites
As far as I know, for number two, you can constrain the values any way you want. I have seen both 0 to 255 and 0 to 1023 used.

I'm pretty sure the ADC just returns 0-1023 (10 bits). You can convert it to any range you want in code. The map() function you asked about earlier just changed the 0-1023 to 0-1000.

Share this post


Link to post
Share on other sites

Thats correct for 1)

For 2), the reason it goes between 0 and 1023 is because the MSP430G2231 has a 10bit ADC.

2^10 = 1024 steps which results in values from 0 to 1023.

 

If it were an 8 bit ADC, it would range from 0 to 255 or 256 steps.

 

 

Now, to check if your ADC is working properly, a simple test would be:

1- Connect the ADC pin to 3V - the val should read 1023

2- Connect the ADC pin to GND - the val should read 0V

3- Connect the ADC pin to 1.5V - the val should read _____?

Share this post


Link to post
Share on other sites

Yea I am really confused man... I think Ill need some serious help please. Any help?

The problem is I cant read the voltage levels on the Local Debug window. It keeps saying 86...

Share this post


Link to post
Share on other sites

Man I dont think so... I need to get this working by tomorrow... I underestimated the complexity of MSP430 Programming. I made tons of projects with the Arduino, but the LaunchPad coding is much more confusing...

 

Yea I know how to read it, sort of. Can you guys sort of edit the code and I will test it out and sort of guide me through it?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...