Components for scaling/ recreating frequency from motor speed sensor

Thread Starter

PerEivind

Joined Nov 6, 2017
10
Hi. First of all; I'm new to this forum, but I'm very interested in learning electronic. I've done some simple Arduino projects earlier, and have basic eletronics knowledge.
I need some help to figure out which IC's and what other components to use.

The case:
  1. I wan't to read PWM-pulses from a motor speed sensor (3-pin hall sensor). It's a 12V system, so it changes between 0-12V. (I need to reduce the voltage from 12V to 5V, so that an Arduino can read it) Typically, at 10 km/h, the frequency is about 160 Hz. See attached picture for readings from oscilloscope.
  2. Then I have to count the pulses, and then "scale the frequency" output with a numerical value in the software. Example: If I read 200 Hz into the Arduino, then I must multiply it with a contant so I get a 300 Hz output from the Arduino.
  3. The new, transformed PWM output from the Arduino, must be 12V so that the motor control unit in the vehicle can read the new signal.
  4. MAJOR Question : What components do I use to read the sensor signal?
  5. Summary: Read 12V PWM signal --> convert it to 5V signal --> count the frequency --> make a new frequency output --> scale frequency to 12V.
I've already bought a LM7805 Voltage regulator, BC547A transistors and some other components. Maybe I need some more things. Maybe I'm totally wrong...
I appreciate every help I can get.

Thank you.
 

Attachments

Alec_t

Joined Sep 17, 2013
15,105
Welcome to AAC!
A simple 2-resistor voltage divider can get the sensor signal down from 12V to 5V.
Since this is an automotive project you might also need protective components (varistor or zener diode etc) to prevent high or negative voltage spikes from zapping the regulator and the Arduino inputs.
 

MaxHeadRoom

Joined Jul 18, 2013
30,562
If the hall sensor is plain open collector you do not always have to use any kind of conversion, presumably the Arduino and the 12v circuit shares the same common, if so just use a pullup resistor from the open collector to +5v for the Arduino.
Max.
 

shortbus

Joined Sep 30, 2009
10,050
And be aware before putting 12V to that hall sensor, if it is an automotive sensor, that it may not live long. Car computers use 5V on most of the sensors. The 5V comes from the ECM internally.
 

MaxHeadRoom

Joined Jul 18, 2013
30,562
The scope trace appears to be 5v+ p/p.
Is this after 5v conversion?
Automotive hall sensors such as the popular Honeywell 1GT101DC use from 4.5vdc to 26.5v.
Max.
 

Thread Starter

PerEivind

Joined Nov 6, 2017
10
And be aware before putting 12V to that hall sensor, if it is an automotive sensor, that it may not live long. Car computers use 5V on most of the sensors. The 5V comes from the ECM internally.
Thanks for the reply. The hall sensor is originally driven by 12V system, so thats no problem.
 

Thread Starter

PerEivind

Joined Nov 6, 2017
10
Wait a second... I´ve been reading wrong values from the scope. MaxHeadRoom, youre right. It seems to be 5V signal coming from the Hall-sensor. I must confirm this tomorrow, before proceeding.

Thank you guys.
 

Thread Starter

PerEivind

Joined Nov 6, 2017
10
So, the only thing I need is some zener diodes to make some sort of safety so I dont ruin the ECU.
BUT, what is the best way to count the pulses coming in? Can I use some sort of interrupt, or pulseIn function? As I understand from Arduino reference, it can measure the length of a pulse. And then I can use the returned value of the pulseIn function, multiply or divide this, and then use this value in "writing" a PWM signal?
 

Raymond Genovese

Joined Mar 5, 2016
1,653
Hi. First of all; I'm new to this forum, but I'm very interested in learning electronic. I've done some simple Arduino projects earlier, and have basic eletronics knowledge.
I need some help to figure out which IC's and what other components to use.

The case:
  1. I wan't to read PWM-pulses from a motor speed sensor (3-pin hall sensor). It's a 12V system, so it changes between 0-12V. (I need to reduce the voltage from 12V to 5V, so that an Arduino can read it) Typically, at 10 km/h, the frequency is about 160 Hz. See attached picture for readings from oscilloscope.
  2. Then I have to count the pulses, and then "scale the frequency" output with a numerical value in the software. Example: If I read 200 Hz into the Arduino, then I must multiply it with a contant so I get a 300 Hz output from the Arduino.
  3. The new, transformed PWM output from the Arduino, must be 12V so that the motor control unit in the vehicle can read the new signal.
  4. MAJOR Question : What components do I use to read the sensor signal?
  5. Summary: Read 12V PWM signal --> convert it to 5V signal --> count the frequency --> make a new frequency output --> scale frequency to 12V.
I've already bought a LM7805 Voltage regulator, BC547A transistors and some other components. Maybe I need some more things. Maybe I'm totally wrong...
I appreciate every help I can get.

Thank you.
I am unclear about whether you are measuring PWM or the frequency of a square wave. Seems like the Hall effect sensor will be providing a measure of RPM, so I don't see where the pulse width is modulated, but maybe I am being dense. In either case, I think that you can do the job with a simple and cheap Picaxe chip, providing your timing requirements are not too great..

There are a number of ways to go from 12V to 5V as already mentioned. I have use an 1N914 diode and a pullup resistor (on the 5V side) to the input bit (see schematic here with regard to a fan ).

Use pulsein or a combination of pulse in and count to determine the PWM or just the frequency of the RPM signal (see here, for example), if that is what is going on.

Do your conversion and than use PWMOUT on another pin to form the new signal. If it is just a square wave frequency, you could probably even use PULSEOUT or TOGGLE with a delay (see command list).

There are several ways to get that corrected signal from 5V back to 12V - a BJT is probably the simplest.

Seems to me that these PIC-based Picaxe chips might suit your dedicated purpose nicely.

Hope this helps.

Edited to add. Now I see some additional posts about the the 5V signal - in any event, the fundamental approach outline above is probably still applicable.
 

MaxHeadRoom

Joined Jul 18, 2013
30,562
what is the best way to count the pulses coming in? Can I use some sort of interrupt, or pulseIn function?
I don't use Arduino, but if it offers the same features as the PICmicro, there is a input that can detect either a rising or falling edge pulse which can be counted/recorded.
Max.
 

Thread Starter

PerEivind

Joined Nov 6, 2017
10
Hi again. This project has been paused for a while, but tomorrow I'll try out my setup. I need some help to assemble the components in the correct order. Sometimes I doubt my basic understanding of electronics, so I need help to confirm this. Does this look ok :
  1. Connect the arduino 5V output to a BNC547A. I use a 11000 ohm resistor between base/arduino. I use a hFE factor of approx 100.
  2. I want to limit the current, so I dont ruin the ECU. Do I have to limit this current any further than using a transistor for this purpose?
Please give me a good example, how to do this.
I'll "borrow" the 12V supply signal from the hall sensor to make a new square-wave signal.
 

MaxHeadRoom

Joined Jul 18, 2013
30,562
Couldn't find that BNC #?
Can you provide a sketch or more info on what you are doing and want to achieve?
If you want some info on different control and monitor methods, check out Roman Black web site.
Max.
 

Thread Starter

PerEivind

Joined Nov 6, 2017
10
Sorry. Its a BC547A. Please see attached picture.

Short version:
  • Make a paralell-branch so I can read the 12V hall-sensor output into an arduino, using a voltage divider.
  • Read the sqaure-wave, and multiply it with a defined constant to make a modified signal.
  • Use a digital output on the arduino into a BC547A to switch the 12V signal ("stolen" from the vehicle) to make a modified square signal.
Here´s where I´m getting unsure. Do I need to limit the current further, in the BC547 branch? I dont want to burn out the ECU :)
20171127_203137.jpg
 

MaxHeadRoom

Joined Jul 18, 2013
30,562
Actually revisiting it, what is the nature of the load current?
If just ECU input it will be high impedance I would assume.
Maybe a 2n7000 fet.
Why the emitter follower?
Max.
 

Thread Starter

PerEivind

Joined Nov 6, 2017
10
The load current is directly connected to the 12V battery leads (through a fuse), so it´s going to be shorted while transistor is saturated, right?
How can I limit this current, without blowing anything up, and at the same time giving the ECU the 12V it wants?

Can someone help me with some simple sketches or something?

In its simplest form, what I´m trying to do is described in the attached picture:
 

Attachments

bwilliams60

Joined Nov 18, 2012
1,450
What part of the vehicle ECM are you feeding this into and what outcome are you hoping for? Are you trying to duplicate a certain signal to the ECM.
 

Thread Starter

PerEivind

Joined Nov 6, 2017
10
I havent traced the wires from the hall sensor to the ECM - so I dont know what part of the vehicle ECM I'm connecting to.

I want to connect my system "between" the hall sensor and the ECM to modify the signal to a slower/faster square wave signal...

I'm not trying to duplicate it, but rather changing it. The ECM shall not notice my box between the two devices - the ECM shall just recieve a modified signal :)
 
Top