Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using a hall effect sensor for measuring the RPM of the engine. The output of this sensor needs to be fed into the ECU (for engine control) and Microcontroller (I am controlling a linear motor based on engine's RPM). The ECU is providing the hall effect sensor 8V supply, therefore the output of sensor will be either 0V (LOW) or ~8V (HIGH) but for my microcontroller digital input, I need 0-5V (I will measure the frequency of digital input using my microcontroller to get sense of RPM).

So basically I need to covert 0-~8V to 0-5V, what's the best method of doing this?

share|improve this question
Voltage divider, and perhaps add a zener for safety. Please search through this site, there are several variants of this question out there. – Anindo Ghosh Feb 2 '14 at 7:59

As the purpose of reading the signal at the microcontroller is to obtain the pulse rate, and not actual detailed waveforms, all that is needed is for the signal at the GPIO to be near zero for 0 Volt input, and reasonably higher than the GPIO's "High" threshold for ~8 Volt input.

The schematic below will provide a 0 to ~4.7 Volt signal that can be used for the GPIO. Feel free to use other combinations of R1 and R2 to tweak the desired voltage. The zener protects the GPIO against spikes from the ECU, if any.


simulate this circuit – Schematic created using CircuitLab

share|improve this answer

The simplest method you can use is with a single Schottky diode in a configuration like below:


simulate this circuit – Schematic created using CircuitLab

The mcu can have a wide supply range, the configuration will work with either 3.3v or 5v etc.
If the mcu doesn't have an internal pull-up you can use an external resistor pulling the input to Vcc.

  • When the output of the hall sensor is 8v then the diode doesn't conduct (reverse biased) and the mcu input state is set by the pullup resistor to high (Vcc level).

  • When the output of the hall sensor is 0v then the diode conducts and pulls the mcu input low to about 0.3v which represents low logic state.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.