Speedometer conversion using NJM4151 Frequency Voltage Converter - Questions

Status
Not open for further replies.

Thread Starter

jonnyphenomenon

Joined Nov 10, 2008
59
I just swapped the njm4151 with a ka331 without any changes to the circuit and it worked flawlessly. these two chips are fundamentally identical. Mouser has nearly 2000 of the njm's in stock.
 

jpanhalt

Joined Jan 18, 2008
11,087
Certainly the datasheets indicate that. During my search earlier, I came across this comment related to the 4152 that is also similar.

Source: anatekcorp.com
QUESTION NO. P41403-7: What is the cross for RC4152 Voltage to frequency converter?

RC4152 has the same pinout as LM331, so you could use LM331 or LM331A. But the reference voltage at pin 2 is typically 1.9V for LM331, versus 2.25V typically for RC4152, so the resistor value used off pin 2 of a LM331 would need to be decreased correspondingly from that used with a RC4152, to obtain the same frequency, as a circuit with an RC4152 would provide.
Again, it is something to be aware of, should parts become hard to get. But I don't think that is going to be an issue from what you have said. I have added it here primarily to keep the information available for future experimenters.

I second bertus's suggestion about publishing your project here. I don't believe there is any restriction to publishing it both places.

John
 

Thread Starter

jonnyphenomenon

Joined Nov 10, 2008
59
so I assembled the voltage to frequency converter and paired them up, but the waveform coming from Fout is pretty noisy and erratic.. I may have to rework my values for Ro and Co. but unfortunately, now I need to go to work. so no more electronics fun for today.
 

Thread Starter

jonnyphenomenon

Joined Nov 10, 2008
59
OK. I am having a problem and I dont understand how it's possible. allow me to lay it out for you.

My circuit has two parts. part 1: frequency to voltage, part 2: voltage to frequency.

Both work perfectly well independant of each other.
in the first part, I convert a frequency of 100hz to 5v. in the second part, I convert 5v into 200hz. (for simplicitys sake I am keeping them 1:2 but they will be variable ratios when Im done)

in part 2, if I provide the the 5v from a power supply, the frequency comes out perfectly at 200hz. however, if I apply the 5v that is coming out of part 1, the frequency comes out at 100hz. how can this be possible?? mathematically, the formula should come out to 200hz at 5v. so why doesnt it work when the 5v is coming from the f2v conversion?

Both are 5v exactly. one is from a supply, and that works right, the other from the output of a circuit, and that doesnt.

can someone shed some light on this for me?

Note: I am using schematics from the datasheet for the NJM4151. Part 1 using Figure 5, single supply Freq to Volts, with a 12v supply, and Part 2 using Figure 2, Single Supply Volt to Freq.
 

jpanhalt

Joined Jan 18, 2008
11,087
Good morning. Although I have a couple of the 4151 chips, I have not actually used them in any project. Some possibilities for the cause of that problem come to mind, but before I make a fool of myself, lets look at a few things.

Pin1 of the FVC supplies a max of 138 uA (from the 4152). There is also ripple on that output pin. Input current needs should be quite low, but there is a low pass filter on the input (resistor with capacitor to ground). That would shunt the part of the voltage you are measuring that is ripple to ground.

1) Have you looked at the output of the F/V converter with your scope? Does it sag when you attach the scope. Is there ripple?

2) When you attach the F/V to the V/F, look at the input pin on the V/F with your scope. If your scope caused voltage sag, then look at it only with your meter. If there was ripple, it should be gone. If not, how much in volts is there?

3) Do both sections have a common ground? They should. I assume you are simply taking the V_out and connecting it to the V_in filter. If not, please post the schematic of how you are doing it. Just to double check, you are using a capacitor input to the F/V converter, right?

4) If it is a loading problem, you can get around that with an op-amp between the two stages. But let's see what's going on at the input first.

In the meantime, I have been working on another option using the CD4046 chip. Had it working at X4 last night down to about 3Hz input. That was just a first try and I hadn't done any calculations for adjusting the frequencies. Not trying to confuse you. Just looking at a possible PlanB; although, I think that is very unlikely to be needed.

It is just too darn cold here to do anything but goof off. What part of the world are you in?

John
 

debe

Joined Sep 21, 2010
1,390
Be very interesting to see your finished project & how you went about it. Will post a bit of info on a kit i built a few years ago for a client, who had changed a diff in his car & the speedo was a long way out. It worked quite well. It was published by Silicon Chip & the kit was Jaycar & still avalable. & used a PIC chip.
 

Attachments

debe

Joined Sep 21, 2010
1,390
Hi John, Unfortunatly I find micros completely daunting & cant get my head around them at all. Yes its easy for me if its a kit & pre programed.
 

Thread Starter

jonnyphenomenon

Joined Nov 10, 2008
59
Good morning. Although I have a couple of the 4151 chips, I have not actually used them in any project. Some possibilities for the cause of that problem come to mind, but before I make a fool of myself, lets look at a few things.

Pin1 of the FVC supplies a max of 138 uA (from the 4152). There is also ripple on that output pin. Input current needs should be quite low, but there is a low pass filter on the input (resistor with capacitor to ground). That would shunt the part of the voltage you are measuring that is ripple to ground.

1) Have you looked at the output of the F/V converter with your scope? Does it sag when you attach the scope. Is there ripple?

2) When you attach the F/V to the V/F, look at the input pin on the V/F with your scope. If your scope caused voltage sag, then look at it only with your meter. If there was ripple, it should be gone. If not, how much in volts is there?

3) Do both sections have a common ground? They should. I assume you are simply taking the V_out and connecting it to the V_in filter. If not, please post the schematic of how you are doing it. Just to double check, you are using a capacitor input to the F/V converter, right?

4) If it is a loading problem, you can get around that with an op-amp between the two stages. But let's see what's going on at the input first.

In the meantime, I have been working on another option using the CD4046 chip. Had it working at X4 last night down to about 3Hz input. That was just a first try and I hadn't done any calculations for adjusting the frequencies. Not trying to confuse you. Just looking at a possible PlanB; although, I think that is very unlikely to be needed.

It is just too darn cold here to do anything but goof off. What part of the world are you in?

John
Hi again John. I am from here in Central Maine. and let me tell you, its friggin cold here too. :rolleyes:

I am at work right now, So when I get home at 9pm I will try these tests you speak of. in the mean time, I have some questions about your prescribed tests.

first, you said pin1 supplies a max of 138uA from the 4152, but I am using a 4151. I am going to assume you meant 4151.

Next, I have looked at the output of the F/V conversion with my scope and it seemed stable enough. but I didnt scale way in to the mhz range to look at it. I am using a DSO Nano and unfortunately, its a bit noisy over in my corner where I am tinkering, so my scope picks up all sorts of hiss at those frequencies.

1) I am assuming that when you say "Sag" you mean, voltage goes down at Vout when I connect my scope probe to it. I have my meter connected to the Vout of the F/V conversion, and when I hook my scope up to it, I am quite sure it does not deflect away from 5v. - without being there in front of it, I cant promise the accuracy of that.

2) I have a volt meter constantly connected to the output of the F/V and it stays at 5v even when connected to the input of the V/F. with the two circuits connected together, I connected my scope to the wire connecting them and I do not detect a frequency. a little noise maybe, but I will have to check that for sure when I get home.

3) Yes, both sections have common ground. they are both running side by side on a little proto station I built a while back. And yes, I have a .022uf capacitor on my F/V frequency input per the schematic in Figure 5.

4) I had initially thought I would need an op-amp between these two devices. I had orignially intended to design both circuits with the same "ratios" and full scale values, and then use an opamp as my multiplier/divider. when I studied the datasheets for these 4151's and found they had adjustable scaling, I thought I might be able to get away without using an op-amp at all. but now I am not so sure.

I have another friend who is also considering this project and he thinks a PLL might be the answer. I havent worked with PLL's before so I dont know how well it would work. My limited understanding of them suggests that they can only perform whole number multipliers. 2,4 etc. - but I dont know how accurate this is.

I do know that for my needs the ratio is not a simple 1:2 multiplier. in my exact case it might be 1:1.894 for summer tires, to 1:2.1113 for winter tires. I want my design to be adjustable on the fly with the turn of a single pot and it would be really great if my final design could have the ability to do division and multiplications of a very wide range. Can a PLL do that? - either way, lets not get ahead of our selves - :)

Be very interesting to see your finished project & how you went about it. Will post a bit of info on a kit i built a few years ago for a client, who had changed a diff in his car & the speedo was a long way out. It worked quite well. It was published by Silicon Chip & the kit was Jaycar & still avalable. & used a PIC chip.
I am interestedin in this Kit Debe. I know I am probably reinventing the wheel here, but I am having fun with it. I originally approached it with a Parallax Basic Stamp, (which has a PIC on it) but I found with my rudimentary program that it would pause for something like 200ms after every cycle, and that was just too long especially when my speed measurement step was only like 17ms. Could some other microcontroller do the job better? probably, but I am vested in my current solution so I am going to stick with it a little longer yet.

Yeah, micros are so easy, it is almost like cheating. John
they might be for some, but I have had virtualy Zero experience with them, so they seem a bit daunting to me as well. :)
 

Thread Starter

jonnyphenomenon

Joined Nov 10, 2008
59
John: a buddy of mine thinks my output might not have enough current, so since I dont have an adjustable power supply at home I am going to borrow one from work. He suggests that I try to replicate the symptoms from another power source without the F/V connected. also, since I have been using the frequency generator in my DSO nano, its possible that this is some how causing my readings to be affected. I will bring home a proper function generator as well.


Debe: this must be the kit you speak of.
http://www.jaycar.com.au/productView.asp?ID=KC5435

I wonder if it could be adapted to produce a signal that is up to 400% of the original input with a little fine tuning? either way, its more money than I want to spend.

Q: Why build it if you can buy it?
A: because you can BUILD it and NOT buy it. - (insert gutteral man sounds here)
 

jpanhalt

Joined Jan 18, 2008
11,087
I am anxious to hear how the new generator works. I don't think that is the problem, though. It's still worth a try. If you can test the voltages and scope on the interface, I would appreciate it. At least that bit of knowledge might be helpful in the future.

The CD4046 method (Plan B) I mentioned has been working fine. It locks right onto the signal. I get pretty linear 4X results with input from 0.5 Hz (my generator is lousy and unstable at that frequency) to 160 Hz. That's probably fast enough for a VW bus, but it can be taken higher, if needed.

John
 

Thread Starter

jonnyphenomenon

Joined Nov 10, 2008
59
I am anxious to hear how the new generator works. I don't think that is the problem, though. It's still worth a try. If you can test the voltages and scope on the interface, I would appreciate it. At least that bit of knowledge might be helpful in the future.

The CD4046 method (Plan B) I mentioned has been working fine. It locks right onto the signal. I get pretty linear 4X results with input from 0.5 Hz (my generator is lousy and unstable at that frequency) to 160 Hz. That's probably fast enough for a VW bus, but it can be taken higher, if needed.

John
the circuit doesnt actually need to respond to anything lower than about 8 hz. since speedos dont even read till ten miles per hour, an 80" circumference wheel driving a 4 pulse per rotation sender is actually 8.8hz
thats (5280*12)/80*4/60/60=8.8hz

the important thing to note is that the multiplier is not a round number. for this application, I am converting a old vw bus to run from an engine and instrument cluster from a modern "Donor car". which normally gets it speed input from a gear driven by the donor transmission. since that transmission will not be used in my bus, I have to drive the speed sender from a cable driven by the wheel. by counting teeth on the meshing gears of the donor transmission and speedo, I have CLOSE to 1:8 wheel rotations per speedo sender pulses. but with the bus, that ratio is precicely 1:4 rotations to pulses. Doubling the otput of the sender with a PLL might get my speedometer close to accurate, but since the bus is using tires that have a much larger circumference, the speed reading will still be considerably off.

stock wheel size from the donor car has a 72.9" circumference. the bus's tires have a 80" circumference. - so about 10% error. and thats not considering the actual ratio of the donors speedometer may not be exactly 1:8.

so. yeah, thats why I need to be able to turn a pot to get it exactly right. :D
 

jpanhalt

Joined Jan 18, 2008
11,087
Somehow or other, when I clicked on the e-mail notification, I didn't see your other post. The PLL method works great, but it is more digital in the sense that you cannot easily get ratios of 1.88 or so. I thought you only needed a 1:4 ratio. No car speedo I have seen is completely accurate.

If you have any op-amp, I would try an op-amp buffer such as here:

http://en.wikipedia.org/wiki/Buffer_amplifier

Almost any op-amp will work. A single-supply version will be easier to wire up for testing.

Here's the PLL circuit I came up with . The CD4046 (or equivalent) is required. The counter was just something I had sitting around. It's pretty crude at this point.



Based on your needs and the challenge, I'd like to see you to get the F/V to V/F method working.

John
 
Last edited:

Thread Starter

jonnyphenomenon

Joined Nov 10, 2008
59
I am quite sure I hae piles of op-amps in my collection, but Ill have to browse through them to find one suitable. - this might seem like a laymans question, but why would an op-amp NOT be a single supply?

I looked all over the shop at school and couldnt find an adjustable power supply. you wouldnt know where I could find a nice adjustable DC supply with adjustable current too would you?

edit: do adjustable supplies ever come with adjustable current? I seem to have a vague reccolection of some that do.. its been a while since I had a need for one.

edit2: aha! heres a NICE one. Mastech HY3005F-3 TRIPLE LINEAR DC POWER SUPPLY 0-30V @ 0-5A oh, if only I had a few extrqa hundred bucks laying around...
 
Last edited:

jpanhalt

Joined Jan 18, 2008
11,087
- this might seem like a laymans question, but why would an op-amp NOT be a single supply?
The earliest op-amps were designed for supplies that provided + and - voltage (e.g., the 741). That is so a sinewave or other AC could be amplified on both the positive and negative parts of the cycle relative to ground. Also from the very beginning, methods were used to obtain "split" supplies from single supplies using resistors. Single-supply op-amps have the splitting (or negative voltage generation) built in. They work the same, but are a little easier to hook up. Your circuit doesn't involve any negative voltages, so a single-supply op_amp will be the easiest for you to hook up.

John
 

Thread Starter

jonnyphenomenon

Joined Nov 10, 2008
59
also, I got home and hooked up a proper function generator and my symptoms are the same. any signal I put into stage 1 comes out the same at Fout of stage 2. If I disable Fin and only supply Vin manually, Fout is the desired frequency.

I looked into this "Sag" you speak of, and in fact it would appear that there is some voltage drop when I hook my scope up to Vout. in fact, at 100hz, my circuit is calibrated to produce 5 volts. when I hook the scope up to Vout it drops to 4.2 volts.
 

Thread Starter

jonnyphenomenon

Joined Nov 10, 2008
59
update: I was trying to use a pair of 1uf electrolytic caps for the RbCb networks, and I just replaced them with a pair of tantalums. now I am getting a peculiar waveform from Fout which is all over the place, but a lot closer to my target.

(without my camera handy, I will try to describe the waveform. )

the output is long high, short low, short high, short low, and back to long high. over anf over again. there are no long lows, instead its as if the long low is broken up by a short high right in the middle of it. *sigh*. I should just go find a camera..
 
Status
Not open for further replies.
Top