iragdoll 0 Posted October 20, 2010 Share Posted October 20, 2010 How do I connect a Piezo Vibration Sensor to the LaunchPad? How would I go about coding this because it is an analog input device? The Vibration Sensor that I am using is: http://www.sparkfun.com/commerce/produc ... ts_id=9197 Please reply -- Thanks! Quote Link to post Share on other sites
bluehash 1,581 Posted October 20, 2010 Share Posted October 20, 2010 You can use juani's code as an example to interface the piezo to an ADC. His code interfaces to accelerometer outputs X,Y, and Z viewtopic.php?f=9&t=142 You can find more information about your sensor here. Quote Link to post Share on other sites
iragdoll 0 Posted October 23, 2010 Author Share Posted October 23, 2010 I was looking at the code, but as I beginner, I did not really understand it. I was hoping someone from the forums could help me in depth, with connecting the Piezo sensor to coding it. How do I configure the ADC? I think the first thing I need to do is to figure out how to connect the Piezo sensor to the LaunchPad. Anyone have any ideas? Any help will be much appreciated! Thanks! Quote Link to post Share on other sites
iragdoll 0 Posted October 23, 2010 Author Share Posted October 23, 2010 I was looking at the code, but as I beginner, I did not really understand it. I was hoping someone from the forums could help me in depth, with connecting the Piezo sensor to coding it. How do I configure the ADC? I think the first thing I need to do is to figure out how to connect the Piezo sensor to the LaunchPad. Anyone have any ideas? Any help will be much appreciated! Thanks! Quote Link to post Share on other sites
bluehash 1,581 Posted October 23, 2010 Share Posted October 23, 2010 I see you posted on theTI-Launchpad groups too. Peter provided a link to NJC's article. That is very well commented. You should be able to set up your ADC with the code provided. If you don't understand a particular line, let us know. NJC 1 Quote Link to post Share on other sites
iragdoll 0 Posted October 23, 2010 Author Share Posted October 23, 2010 Yea I had posted there as well. I am going to look at NJC's code and see if I can apply it to the Piezo Vibration Sensor. However, I still do not know how to hook up the Piezo Vibration Sensor to the MSP430 LaunchPad physically. Do I need a resistor of some sort? Any help will be much appreciated! Thanks! Quote Link to post Share on other sites
iragdoll 0 Posted October 23, 2010 Author Share Posted October 23, 2010 Can I hook up the sensor as shown in the diagram below? This is with the Arduino but I think it can apply to the MSP430 LaunchPad as well. Any help will be much appreciated! Thanks! Quote Link to post Share on other sites
gatesphere 45 Posted October 23, 2010 Share Posted October 23, 2010 Can I hook up the sensor as shown in the diagram below?This is with the Arduino but I think it can apply to the MSP430 LaunchPad as well. That will work, but you might want to replace the zener with a 3.3v version. Also, connect it to one of the P1 pins, there's no difference on the LaunchPad between GPIO and ADC. Quote Link to post Share on other sites
iragdoll 0 Posted October 23, 2010 Author Share Posted October 23, 2010 You sure that will work? If you really think so then I will go with your opinion. Also, do you have any code examples for this? Can I use the P1.4 pin? Will it not work with the 5.1v Zener Diode? Which is more safer to use? Quote Link to post Share on other sites
GeekDoc 226 Posted October 23, 2010 Share Posted October 23, 2010 Can I use the P1.4 pin? You can use any P1.x pin as long as you configure it to ADC.* Will it not work with the 5.1v Zener Diode? Which is more safer to use? The extra components there are for voltage limiting (zener diode) and keeping the pin voltage from floating when there is no voltage from the peizo (pull-down resistor).* The Arduino is a 5v device and accepts 5v logic. The MSP430 is a 3.3v device; 5v logic could damage the MSP430. Replacing the zener with a 3.3v version will limit the output to 3.3v (anything higher will be shunted to ground through the zener diode). Using the 5.1v zener could allow a damaging voltage level (5.1v) to your MSP430.* *Note: I'm not the best at this stuff on this forum, and I have been wrong before. :? Hopefully others will confirm or correct my post. -Doc gatesphere 1 Quote Link to post Share on other sites
gatesphere 45 Posted October 23, 2010 Share Posted October 23, 2010 The answer to both of your questions, are exactly as GeekDoc stated. (here's confirmation, Doc ) Quote Link to post Share on other sites
GeekDoc 226 Posted October 23, 2010 Share Posted October 23, 2010 (here's confirmation, Doc ) Thanks gatesphere BTW iragdoll: In answer to your question about code examples, NJC's code is always well documented. Try this one. Gatesphere did a simpler ADC example, linked in this topic. -Doc NJC 1 Quote Link to post Share on other sites
iragdoll 0 Posted October 23, 2010 Author Share Posted October 23, 2010 Okay... um... where exactly can I get this diode? All I see are 5.1v Zener Diodes... Thanks for the links to the ADC examples. They helped a lot. I will post if I have any problems with the code. But first I want to connect the Sensor to the LaunchPad to make sure everything is correctly hooked up. I can buy the mega-ohm resistor from RadioShack, but they only have a 5.1v Zener Diode. Quote Link to post Share on other sites
gatesphere 45 Posted October 23, 2010 Share Posted October 23, 2010 http://www.goldmine-elec-products.com/p ... ber=A10626 $.20 for a 3.3v Zener. Quote Link to post Share on other sites
cde 334 Posted October 23, 2010 Share Posted October 23, 2010 You can get them cheaper on ebay (No minimum charge, no excessive shipping) if you can weight about 2 week. 1N4728 A couple of them are at 1.22 buy it now free shipping for 10. You could even use the best offer and try to get them down to 99 cents. There's currently an auction for 30 3.3v Zeners (1/2watt instead of 1watt though) but no part number for 1.49 or best offer. Ebay is often the best for one-off part orders. Unless you are ordering 15+ dollars worth of parts, shipping from web-stores hurt. GeekDoc 1 Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.