Electronics > Microcontrollers

Amplify 500mV 0-pk square wave to >2V for PIC MCU

(1/18) > >>

JDW:
I need to get a PIC16F1503 MCU to read a 500mV 0-pk squarewave. (Minimum half cycle pulse-width is 3ms, and longest pulse-width is about 1 second. Rise/Fall times are not critical and are about 20us or less.) The problem is that 500mV voltage level is so low I can't even switch a BJT or MosFET with it.

What is the easiest and most straight-forward way to amplify the 500mV 0-pk squarewave to at least 2V 0-pk (preferably 5V), so the PIC can properly read HI/LO? (I have access to 5.0V and 12.0V voltage rails.)

Thank you.

nvmR:
take a comparator or an op amp with hysteresis (both with rail to rail), create a threshold at 1/2 of 500mV using a resistor divider at one input, and place your signal at the other. The result will be at your desired voltage.
Or use a level shifter.

PSR B1257:

--- Quote ---What is the easiest and most straight-forward way to amplify the 500mV 0-pk squarewave to at least 2V 0-pk
--- End quote ---
Why amplify at all?
I would consider the build in ADC or comparator.

redkitedesign:

--- Quote from: JDW on March 27, 2023, 06:38:34 am --- The problem is that 500mV voltage level is so low I can't even switch a BJT or MosFET with it.

--- End quote ---

Of course you can switch a BJT with 500mV, how do you think a Rail to Rail opamp works?

In your situation, consider using a BJT in a common base configuration:
Connect the base to a resistor divider at 1V. Connect the signal to the emitter. Now the BJT will switch on at 0V, and off at 0.5V (0.2V actually).

Pull up the collector to the input voltage of your MCU, and pronto!

Just remember that the source will have to sink the base and collector current, thus choose the resistors appropriately. Perhaps you need to add a second BJT to get enough speed to drive the MCU input; YMMV.

Kleinstein:
One can still use a BJT, e.g. in base configuration, if the signal source is low impedance.

Most PICs, inluding the PIC16F1503 have an internal comparator that can be use with a 500 mV signal. It would only need a divider for a trigger level if one can not use the internal DAC for this.

Navigation

[0] Message Index

[#] Next page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod