cristyyman 0 Posted April 19, 2013 Share Posted April 19, 2013 Hi everyone! I have to do a digital tachometer . Informations : - speed range : 300-600 rot/min ; - measuring time : 0,2 seconds ; - display resolution : 10*rot/min; - optical warning when overruning from 550 rot/min . My teacher said that i should generate a signal with two timers on a pin and then to convert it into rotations per minute . After that i should display it on 7segments or LCD display . I will be very grateful if you will help me with this project ! Thanks ! Quote Link to post Share on other sites
roadrunner84 466 Posted April 19, 2013 Share Posted April 19, 2013 First, this is a school assignment, so we'll give you hints at best. Then, try to describe what should exacly happen, which signal should go high/low when, why, what does it represent. Try to split the task in blocks, for example: measuring the tacho, calculating the RPM, display a value on the display. If you have the separate tasks working, only then start to integrate them into a whole. cristyyman 1 Quote Link to post Share on other sites
cristyyman 0 Posted April 23, 2013 Author Share Posted April 23, 2013 Unfortunately, my teacher doesn't help me very much ... He didn't learned us almost anything about microcontrollers but he espects from us to search on google and make this project . This is what he told me about how to make the signal generation : ... it's about setting two timers ... a formula about frequency ... external interrupt ... And, I think a different method is changing the duty cycle . I don't know what to do ... if i will not make this project, then i will not be able to give the exam, which is very hard . Quote Link to post Share on other sites
RobG 1,892 Posted April 23, 2013 Share Posted April 23, 2013 First of all, do you have any hardware to work with? LaunchPad, sensor, display? Do you have to choose the sensor and display? Or is it a software only exercise? Quote Link to post Share on other sites
cristyyman 0 Posted April 23, 2013 Author Share Posted April 23, 2013 I have MSP430G2553 LaunchPad . I have Code Composer Studio 5.3.0. Display should be LCD or 7 segments . I asked my teacher if i can do my project like in this tutorial : http://www.pyroelectro.com/tutorials/digital_tachometer_rpm/parts.html with IR emitter diode and IR Detector ... and he said that this is difficult and that i should generate signal (for 0.2 seconds) on a pin of the microcontroller and connect with a wire to another pin of the microcontroller and make the conversion to rotations per minute .. and then.. display it . We are counting how many rotations are in 0.2 seconds . Quote Link to post Share on other sites
RobG 1,892 Posted April 23, 2013 Share Posted April 23, 2013 Got it, so all you need to do is simulate sensor pulses on the same MCU. Do you have to buy and use the display? Instead of display, can you just send the data to PC using serial comm? cristyyman 1 Quote Link to post Share on other sites
cristyyman 0 Posted April 23, 2013 Author Share Posted April 23, 2013 Yes, I have to buy the display . About using serial comm .. i don't know what to say .. sincerly i haven't heard about it . Quote Link to post Share on other sites
RobG 1,892 Posted April 23, 2013 Share Posted April 23, 2013 My display suggestions: 16x2 char display- $5, requires 6 wires, pretty easy to implement Nokia 5110 LCD - $4-$5, requires 4 wires, large screen, rather easy to implement (43oh store has a BP board for it.) 7 segment LED module - $5, depending on how the module is done, might require 3 to 11 pins, should be easy to implement. You can also make your own module, but I would suggest getting one that is already assembled. 7 segment SPI - $2, requires 3 wires, easy to implement Serial comm is very easy to do, your PC acts as your display, you see your output on the Terminal screen. Here's my suggestion for your app: TimerA0 generates pulses. If you want to get fancy, you can connect a pot to one of the analog inputs, use ADC to measure it, and adjust the "speed." you can also use the internal temp sensor to change the "speed." TimerA1 is used to count the pulses The rest depends on which display you choose You can find all the code you need right here on 43oh. bluehash and cristyyman 2 Quote Link to post Share on other sites
kenyee 5 Posted April 23, 2013 Share Posted April 23, 2013 Unfortunately, my teacher doesn't help me very much ... He didn't learned us almost anything about microcontrollers but he espects from us to search on google and make this project . FWIW, I don't think this project is hard. You kids have it easy now...everything is easy to learn how to do by searching or watching youtube videos :-) Go through the MSP430 tutorials so you can learn how to program it. It's easy: http://processors.wiki.ti.com/index.php/MSP430_LaunchPad_(MSP-EXP430G2) Then buy an LCD display and look at the data sheet on how to program it or look for MSP430 LCD examples and buy the one they specify. Mount a wheel w/ a hole and add a contact or hole or something to let you know when it has turned. Go hack on it for a while and tell us where you get stuck. You don't have classmates you can work with this on? cristyyman 1 Quote Link to post Share on other sites
cristyyman 0 Posted April 24, 2013 Author Share Posted April 24, 2013 @ kenyee : I have one classmate with the same project.. but he does not know how to do it . Thanks you all for advices ! Quote Link to post Share on other sites
cristyyman 0 Posted April 24, 2013 Author Share Posted April 24, 2013 I found a code for generating clock and measuring here : http://forum.43oh.com/topic/2548-measuring-time-in-clocks-between-edges/ What do you think? It's ok ? Or this ? http://forum.43oh.com/topic/2548-measuring-time-in-clocks-between-edges/?p=21396 Quote Link to post Share on other sites
cristyyman 0 Posted May 8, 2013 Author Share Posted May 8, 2013 I found a code for generating clock and measuring here : http://forum.43oh.com/topic/2548-measuring-time-in-clocks-between-edges/ What do you think? It's ok ? Or this ? http://forum.43oh.com/topic/2548-measuring-time-in-clocks-between-edges/?p=21396 Please answer ... Quote Link to post Share on other sites
cubeberg 540 Posted May 8, 2013 Share Posted May 8, 2013 Please answer ... Yes - that code is intended to generate a signal on one pin and reading frequency on another. Quote Link to post Share on other sites
Fred 453 Posted May 9, 2013 Share Posted May 9, 2013 I did something almost identical recently - not the generation of pulses but the tacho part. My project is to count pulses from a water flow sensor to ensure water is flowing. I was actually trying out Grace to see if that was any good and it had 90% of the configuration done with a few clicks. (I'm not sure I'm a Grace convert yet though. It didn't help much with ADC and that's the bit that always causes me pain.) It's about as simple a tacho as you can get and I'll explain it from the basics. I'm not sure where you are on this, so ignore me if you're already past this stage. I declared an unsigned int counter variable with global scope and ensured it was declared as volatile. I set up a pin as input and to trigger an interrupt. On this interrupt I incremented the counter variable. I set up a timer to cause an interrupt every second. On this interrupt I checked the counter variable and then reset it to zero. I could send you this simple code, but as it's a school project you'll learn more by working it out for yourself. And there's plenty of improvements that can be made. Going beyond the bare minimum for a project can earn you extra credit. Rather than counting pulses over a certain period, would it be better to measure the time between pulses? How can you avoid jitter? With my simple example a fixed 2.5Hz signal would show as 2 then 3 then 2, etc. gsutton 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.