Building engine RPM sensor

Discussion in 'Embedded Systems and Microcontrollers' started by gigakristjan, Oct 19, 2010.

  1. gigakristjan

    Thread Starter New Member

    Oct 19, 2010
    5
    0
    Hy!

    My name is Chris and i'm 15 years old. I have a motorcycle and it don't have RPM sensor. I'm curious anyway about microcontollers and electronics, so i decided to make on. Since my Physics is 5+ in the school and i've been working with LED's, soldering and general electronics repairing, i thought this can't be hard... well, i thought wrong. I've been searching for a few days from google about PIC's and microcontrollers, and how to write data on to them, and haven't found much.

    Basicly, i want Microcontroller to calculate my RPM from impulses from my engine's coil(each impulse means that engine made 1 revolution). So, PIC/aTmel gets around 20,000Volts Per 1mS, depends on RPM. I want that microcontroller measures how many times it gets impulses in 100ms and calculates my RPM and sends it to LCD.

    Can you guys please give me advice how to learn about PIC's, how to connect them to PC etc etc, basic stuff in other words. Oh, and i have 20 pin aTmel AT8902051, can i use it in my project? I know that my English isn't good, thats becouse i'm kinda foreign. ;)

    Little scheme about my RPM idea:
    [​IMG]


    Thank you,
    Chris :)
     
  2. Kermit2

    AAC Fanatic!

    Feb 5, 2010
    3,792
    948
  3. gigakristjan

    Thread Starter New Member

    Oct 19, 2010
    5
    0
    Can't i just make the PIC connecting board and connect it to the computer, write the data and done? Isn't there some general guide for that?
     
  4. Kermit2

    AAC Fanatic!

    Feb 5, 2010
    3,792
    948
    I thought you wanted to learn about them. You sound like you know all about it and just want to hook it up to the computer via USB and program it up.

    Which is it?
     
  5. gigakristjan

    Thread Starter New Member

    Oct 19, 2010
    5
    0
    Oh, sorry. I want to make a board to connect PIC/aTmel to PC, and I want some guide and program to write on the PIC/aTmel. That's it, i guess :) I have already aTmel AT89C2051, can i use this in my RPM project?
     
  6. Kermit2

    AAC Fanatic!

    Feb 5, 2010
    3,792
    948
    It is most certainly 'do-able'. Yes you can use that chip or a multitude of other similar chips.

    I personally can't help much with the programming part. I only just recently got into micro's myself, with the purchase of a 'PICkit 3' programmer and a 44 pin micro-dev board. Still waiting for a project in which I can use it.

    :)
     
  7. retched

    AAC Fanatic!

    Dec 5, 2009
    5,201
    312
    Is that like kinda pregnant? ;)

    AVRfreaks.com will help get some info on the atmel coding and interconnections to the PC. They have alot of the info on site.

    Just use the search option for the forum.
     
  8. DonQ

    Active Member

    May 6, 2009
    320
    11
    Wrong thinking. At, for example, 1000 RPM, there are 1.666 'impulses' per 100mS. Since you can't count fractional 'impulses' with a micro-controller, you will read either 1 or 2. This will bump your display back and forth between 600 and 1200 rpm. In other words, reading the number of 'impulses' in 100 mS will only give you a resolution of 600 RPM. Even reading the number in an entire second will only give you a resolution of 60 RPM.

    If, instead, you read the number of microseconds per pulse, your resolution can be less than 1 RPM. Reading the number of microseconds per pulse is the sort of thing that micro-controllers are good at. You have to invert the value to get RPM (time-per-pulse inverts to pulses-per-time), but again, that is something micro-controllers are good at.

    You will still have to do some things like keeping track of large numbers for low RPM (greater than 2^16), and maybe some smoothing, but that's how it goes.

    Also, putting a 20,000 Volt spark straight into a micro-controller is probably not a good idea. Perhaps some signal conditioning is in order?

    If it were easy, everybody would be doing it.

    Some people do this by using a one-shot and driving an analog meter. This way takes about 5 parts and maybe a couple of hours to do.
     
  9. retched

    AAC Fanatic!

    Dec 5, 2009
    5,201
    312
  10. gigakristjan

    Thread Starter New Member

    Oct 19, 2010
    5
    0
    Soo, again, i've been searching A LOT. I will be useing DonQ method, but can you tell me please more about this signal conditioning? Also, i haven't found programmer for my aTmel. In my country, programmers cost about $50, so it's kinda expensive, so can someone please explain me how to connect my microcontroller to PC, using parallel port, RS232 or USB? Here's picture about my MC, can you tell me which pin's connect where:
    [​IMG]

    And another question, do i need somekind on clock too? I read somewhere, that you need clock too to make MC work. I have another picture which shows my MC and circuitboard. I got this circuitboard form my old LED picture. It had LED's on it and if you pushed button LED's began to flash, turned off, or just worked. (Crazy sentence, i know ;) )

    [​IMG]

    Thanks again, you guys made me obsessed with microcontrollers. ;)
     
  11. gigakristjan

    Thread Starter New Member

    Oct 19, 2010
    5
    0
    So can someone help meh? :rolleyes:
     
Loading...