Connect with us

Reading Pulsewidth

Discussion in 'General Electronics Discussion' started by microchipdip1, Dec 20, 2010.

Scroll to continue with content
  1. microchipdip1

    microchipdip1

    2
    0
    Dec 20, 2010
    Hi,

    I am new to the forums. I am trying to read a signal with a microchip. However the microchip has a max input of 5v. The incoming signal is a square wave (0v, 12v). At the end of a hi pulse, it spikes to 40volts or even more. Id really appreciate it if someone could tell me what components I would need to put in that circuit to drop it down to (0v, 5v), and block out that spike.

    Thanks,
    Steve
     
  2. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,480
    2,828
    Jan 21, 2010
    Try something like this:

    [​IMG]

    The 10K resistor limits the current. The 2 diodes clip any voltage higher than 5 or lower than 0) The additional 1k resistor limits the current through the protection diodes on the microchip should a really large spike come along,
     

    Attached Files:

  3. microchipdip1

    microchipdip1

    2
    0
    Dec 20, 2010
    Can you point me to the most suitable and preferably cheap diodes that will do this? I am inept with electrical components. I only know how to program the microchip. Would TVS diodes be suitable?
     
  4. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,480
    2,828
    Jan 21, 2010
    Almost any diode will work in that circuit. The only exception would be zener diodes rated at significantly less than 5V -- in fact, making the bottom one a 5.1V zener has some advantages (but I digress)

    1N400x would be fine (use whatever is cheapest). If you have some 1N4148's or 1N914's or almost anything.

    A 40V spike will give you about 4mA through the diode. The reverse voltage will never exceed about 5V. Switching speed may be an issue, so I might prefer the small signal diodes if the spikes are especially fast (rise time) or high in energy.

    Where is this input coming from (it's not the ignition coil of a car is it?)
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-