Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Very Low Frquency V to F convertor.

Status
Not open for further replies.

muso52

Member
Hi Guys,
I am looking to impliment a simple circuit possibly consisting of a AD654 voltage to frequency converter (or other) with an approx voltage in the range of 0 - 10v and a max (at 10v) of 10c/s. These figures are arbitary at the moment and could and possible will be altered later.
I need to vary the input via a lin potentiometer and one of 10k would be suitable. This could probably be used on a linear regulator. It has to be a voltage to frequency device as I require an output freq at all positions of the 10k pot. The only observation I can make at at the moment is that many devices will not perform at such a low frequency and also linearity is important to me. In this case it may well be prudent to set a higher max freq say 10000 and divide down the output stream accordingly. DIL devices would be my prefered and output TTL 0 -5v

Any ideas's and comments gratefully received!
Thanks.

Willy
 
Last edited:
Hello again.
I havent read the datasheet properly but looking at the formula I get 10k for R1 and R2, and 470uF for Ct, 4k7 would be ok for a pullup, r comp ~22k or so.
An electrolytic 470u wouldnt be so good, you'd have to go for something like a tantalum bead cap for accuracy and low leakage.
Or use a 470n and a divide by 1000 or divide by 1024 counter.
A 7812 can be used to supply a 10 pot with 10v, all you need is 2 1k resistors in series with the + supply end.
Breadboard is your friend here.
 
1) I find doing timing with large capacitors to be a problem. leakage and temperature stability
So if you have a (V to F) IC that you like then run it fast and use a counter IC to divide down by 1000:1.

2) There are many little micro computers. (8 pin) They have a internal stable oscillator or can use an external crystal. They can measure a voltage in the 0 to 5 volt range. So your 10k pot could be connected across 0 and 5Volts. The micro can toggle a output pin at some frequency or time.
Because it is all software (math) you can have any function in between V and F. The disadvantage is that the micro can only measure the voltage in 1024 steps, so you can only have 1024 different frequencies. If you are turning the 10k pot by hand, the micro can read to 0.1 degree rotation. Is that good enough?
 
Hi Gents,
Many thanks for your thoughts.
Before I make any comments wrt your post's I feel it is only right that I share with you what I am trying to achieve. Please don't laugh!
As drpepper is aware I have another thread that concerns a model railway controller. This being a straightforward DC voltage follower circuit.
The second part of this project is to obtain a freq output that is relative to the size of the wheels and rotation and subsequent speed of the toy trains. Why? Once I have achieved this then it is relatively simple for me to apply, using midi and a pc/laptop, suitable chuff chuff sounds. No sniggers pse.
At the moment I have decided it is easier to totally seperate the two functions using a double gang pot. As the movement of the control knob is equal on each half of the individual pot windings then the travel/resistance is equal and relative.

As I said in the first post 'with an approx voltage in the range of 0 - 10v and a max (at 10v) of 10c/s.' The latter figure of 10 c/s has been arrived at because it roughly translates to a model loco at 25mph, the speed it will travel when the speed control is at max.The input voltage to the speed control can be adjusted to achieve this.
Of course such a system can not be considered accurate and what I am looking for is a good approximation. This is very much a feasibilty project. I know I can handle the sound aspects once I have a TTL pulse relative to the speed and or freq. However, even now I am considering (at a later date) changing to a PWM DC Motor controller as it would appear feasible to monitor the back emf of the dc motor and convert this to a frequency output with a subsequent increase in accuracy. But later on with that one.

drpepper.
Thanks as always for your comments.

Hello again.
I havent read the datasheet properly but looking at the formula I get 10k for R1 and R2, and 470uF for Ct, 4k7 would be ok for a pullup, r comp ~22k or so.
An electrolytic 470u wouldnt be so good, you'd have to go for something like a tantalum bead cap for accuracy and low leakage.
Or use a 470n and a divide by 1000 or divide by 1024 counter.
.

Thanks for the values. I can now place these into the equations and brush up my transposition skills!

A 7812 can be used to supply a 10 pot with 10v, all you need is 2 1k resistors in series with the + supply end.
Breadboard is your friend here.

Can you clarify that for me pse?
Also it may be desirable to use a variable 12v regulator with a pot from pin 3 to 2 to alter the output voltage from it again for the reasons I stated wrt the speed control. Basically I can trim the 2 fuctions independantly to sort of calibrate or sync between them.
Breadboard is at the ready.

Hi Ron,

1) I find doing timing with large capacitors to be a problem. leakage and temperature stability
So if you have a (V to F) IC that you like then run it fast and use a counter IC to divide down by 1000:1.

Yes am aware of this and the possibility of poor linerarity. So initially will go with the 470n drpepper suggested and divide down. Now the divide down I can handle!

1)

2) There are many little micro computers. (8 pin) They have a internal stable oscillator or can use an external crystal. They can measure a voltage in the 0 to 5 volt range. So your 10k pot could be connected across 0 and 5Volts. The micro can toggle a output pin at some frequency or time.
Because it is all software (math) you can have any function in between V and F. The disadvantage is that the micro can only measure the voltage in 1024 steps, so you can only have 1024 different frequencies. If you are turning the 10k pot by hand, the micro can read to 0.1 degree rotation. Is that good enough?

As a retired controls guy, I have no expierence ( as yet) of using micro's or compiling(?) the software for same. A friend suggested using an auduino. However there is a small issue to be considerd. The figures outlined in my first post are relative to a model engine with x diameter wheels. What would happen if the wheel size changed? At the moment it would mean uploading a new math program to the micro I believe.

Thanks to the both of you, hopefully It won't be long before my grandsons toy Thomas and Percy engines have sounds aswel!
And of course grandads not toy loco's but model loco's
Willy
 
Why not just get a VtoF that runs over some normal freq range, like 1KHz to 10KHz, and follow it with a digital divide-by-100 (or 64 or 128) counter?
 
The figures outlined in my first post are relative to a model engine with x diameter wheels. What would happen if the wheel size changed? At the moment it would mean uploading a new math program to the micro I believe.
Not really... The micro in question can be fitted with two pots, one being a trimmer pot that can be used to affect the output to allow such modification... The tiny pic12f1840 has many, many features... As you are here in the UK I could help you with that!!! I want to design my own train controller... I have several engines and I too want all these things you speak of!!
 
Connect one end of the 10k pot track to ground, and the other end to a 1k resistor, followed by another 1k resistor, then connect that to +12v, so its +12 - 1k - 1k - 10k pot track upper - 10k pot track lower - gnd.
1v will be across both the 1k resistors, and 10v across the pot as required.
You could make your own independent reg just for the 10k pot with a 78l05 and a 5v1 zener in its ground leg, you'd also need a 10k from the input pin to the ground pin of the 'l05 to bias the zener.

I tried to think of an 'easier' way to do this with a 555, but it soon got complicated with jfets & junk so stick with what you have.
 
At one time I had some ICs that are used in "time delay relays". It was a "555" plus a frequency divider. (4040, 4060) Can't find it now.
Look at the LTC6991 and LTC6993. Look at some of the circuits in the data sheet.
 
Once I have achieved this then it is relatively simple for me to apply, using midi and a pc/laptop, suitable chuff chuff sounds.
How are you planning to use the sub-10Hz frequency in conjunction with a pc/laptop? Are you aware that the frequency response of the average soundcard drops off a cliff below 20Hz? I'd be looking to generate frequencies in the middle of the audio spectrum.
 
Ron the chip your looking for I think is the 4536.
Allthough I dont think it'll be a lot of use here, at least as the oscillator, maybe the counter divider would be of use.
 
Hi Guys,
Many thanks for your comments and my big apologies for not getting back to you sooner.

Why not just get a VtoF that runs over some normal freq range, like 1KHz to 10KHz, and follow it with a digital divide-by-100 (or 64 or 128) counter?

Mike. With respect I alluded to this concern in my original post which drpepper commented on. You would think however that it would be relatively simple to generate a 10 c/s stream without multiplying and dividing? Just a thought.

How are you planning to use the sub-10Hz frequency in conjunction with a pc/laptop? Are you aware that the frequency response of the average soundcard drops off a cliff below 20Hz? I'd be looking to generate frequencies in the middle of the audio spectrum.


Hi Alec. I was somewhat bemused and amused by your above comments!

How are you planning to use the sub-10Hz frequency in conjunction with a pc/laptop?
As I said ' it is relatively simple for me to apply, using midi' Musical Instrument Digital Interface.

Are you aware that the frequency response of the average soundcard drops off a cliff below 20Hz?
Well actually yes having recently calibrated ( yes, calibrated) the sound cards in my home studio PC! Of course there is no audio content in the 10c/s digital stream. Why did you think there was?

I'd be looking to generate frequencies in the middle of the audio spectrum.
No, The 10c/s once in digital format trigger real sounds in the pc.

However I believe your post has raised some questions as to how I invisage this working and I feel it's only right that I share them with you all for your better understanding. (Am I sounding like a school teacher?)

We have established that I require a digital pulse (TTL level) that represents the speed or rotation of a model steam engine wheel. Once this is achieved it is used to trigger a midi input device to the pc. A few simplistic words on Midi. Basically two type of events in a midi message namely note events and control variables. With note events think of the rise of the pulse as the start of the note, its width the length of the note and its fall the end of the note. Now the speed at which the pulse rises and falls is relative to the velocity that the note on a keyboard is struck. Think of a piano the softer you hit the note, the softer the sound etc. Other information contained in the midi message note event with respect to this is the relative musical note ie Fsharp Bflat etc. Ok so far?
We also have control variables. Typically 0 - 5v controlled via a pot or other. Think of Volume and Pan.

Ok we send this midi data to a pc which has all the sounds. But how are they triggered?
I am sure most of you will have heard of the term sampler. Using a software sampler we can load not only musical sounds into it but real world sounds also.

So simply put our digital midi input is a musical keyboard and the software sampler produces not musical sounds but real world ones ie my steam engines. The sampler triggers the .wavs held in memory and routes them to the soundcard.
Sound difficult? No it is very very simple and many millions of musicians like myself use this system on a daily basis.

I should mention that the abilty to have sound in model loco's is already available utilising Digital Command Control (DCC). This consists of individual chips in each loco with individual addresses which listen to superimposed data on the tracks and respond accordingly. Some of these chips have the ability to produce sound. So why am I going my own route to achieve this? It is the very poor sound quality and high cost of DCC sound systems that put off myself and others. A DCC equiped sound loco will have at best a sample rate of 16K and dynamic range of 8bit. Not to mention the very poor frequency range of the very small speakers fitted which more than often do not extend much below 500c/s.
My favoured method is to use a surround sound system. 5.1, 7.1 or even 8.0 what ever. But how do we position the steam engine in this 'field'. That was a question which bugged me somewhat. I didn't realise that the answere was so easy! Since we now have a hoped for digital indicator of the engines wheel rotation then simple maths are all that is required. Let me explain . A loco has a wheel of a known diameter . We know the distance travelled with one rotation of this wheel so it is relatively easy to convert this to a Midi CV namely the pan control. Length or circumference of our trainset divided by the wheel rotation pulses. This I believe can be easily implemented using counters and a digital pot. However as alluded to by Ian this aspect would be a lot simpler using a tiny mico I believe.

But you want your sound point onboard the loco? No problem. See this.
**broken link removed**

The advantages of the above over existing DCC methods need mentioning. 48kz sample rate, 16 bit dynamic range 3w +3w stereo! And the difference in cost minus the speakers? Only about £100! This, drpepper is the reason for my modified controller to source this unit when the loco is not moving.

Is all this possible? Well yes. May I invite you to a view a series of video's I uploaded 5 yrs ago now. Pse look at this.
Its 10 mins long so maybe a short itermission is required!

So guys I hope you now have a better understanding of what I am trying to achieve and your continued help and advice would be greatly appreciated.
Cheers for now,
Willy
 
That sulzer motor sounded pretty good through my cheapo pc speakers, if I had time & space that would be cool on scalextric.

If I get time away from the mrs this weekend I'll look into prototyping a 10hz vco, but I'll be using an Ne567 chip and the lowest freq will probably only be around 0.5hz.
 
Why did you think there was?
I didn't think there was. One way of getting info into a PC is to convert the info to audio tones and poke those in through the mic input. I wondered if that was what you planned to do. Obviously not :). But I was (and still am) puzzled as to how you'll get <10Hz into the PC? I'm aware of the MIDI protocol: it uses serial comms at 31.25kHz. A MIDI (or other) input on a soundcard won't accept sub-10Hz.
 
Hi Guys,

That sulzer motor sounded pretty good through my cheapo pc speakers,

Why drpepper. Are you a closet trainspotter? Put your anorak on when you come out of it!

.......if I had time & space that would be cool on scalextric.
But joking aside absolutely would work just the same. The way the audio (revs+ gear changes) is manipulated in the software sampler would be different but simple and not a problem. Ref space: Put the sound module and speaker in the car? Use real recordings of the cars. Simple's. Imagination rule's ok.

If I get time away from the mrs this weekend I'll look into prototyping a 10hz vco, but I'll be using an Ne567 chip and the lowest freq will probably only be around 0.5hz.

The problem with that is a steam engine do'es not 'chuff' when it is not moving. Just sounds like a kettle or boiler. So It has to go to zero.

One way of getting info into a PC is to convert the info to audio tones and poke those in through the mic input.

Maybe so. However too covoluted. With inherent latency which when trying to visually sync the steam engine movement to sound it becomes a problem. Midi is easier and a very established protocol whether one uses dedicated midi ports on a pc ( as up to a few yrs ago as it was faster than USB 1) or now USB 2 and above with suitable driver software. I have in the past ripped out midi controllers from old discarded keyboards.

Ok. When I play a note on an electronic musical keyboard, that note will play as long as the key is pressed. Similar on a piano that note will ring out (though not indefinately) for as long as I hold the key down. What I did not say on looking back was that any given note will play as long as the pulse is high.The length of the pulse is relative to the audio output (sound). Now the pulse going High means play a given note. How long for? As long as this pulse is high. When the pulse falls, switch off the sound.

In the case of our steam engine we are not interested in the length of the note and its fall only the rise. Why? If you think of a drum when you hit it once to make a sound and the software sampler is told ' Play the drum sound everytime you see its respective pulse rise' This is known as a one shot. The designated sound will play through to the end irrespective of pulse length. Similar with a cymbal or any other percussive instrument.

Now out of interest the prototype (real) loco of my toy one has 2 cylinders and will have 4 chuffs per wheel revolution. Incidently the sounds we require are recorded from the original. Now to use the same chuff sound for each segment of the wheel rotation would sound like a motorboat Phut Phut Phut etc... What we do now is have four individual sounds for a given note input and play numerically 1-2-3-4-1-2-3-4 etc. Good eh. Well I think so.
Do not think of the 10c/s as a frequency but the number of times the sound will change with respect to the movement of the engine at a given speed. A digital on/off switch. Indeed it could be a lot less depending on the speed.

Hope this of interest .

Willy
 
Nope, but I know a thing or 2 about napier deltics, not the loco the diesel engine, I rebuilt 3 at leyland motors where I used to work, fascinating machines, and they sound like nothing else.

I could be an anorak and get along with the odd one, but I cant keep it up for long just an hour here & there, fortunately.

I've played with sound with 'duino's & Sd cards, not hard to do, & beleive it or not I messed about with a callesen marine diesel sound rev wise, its tricky to do, you have to slice & patch files to get rev changes, I didnt really get it to work, but it was only a sunday aft playtime.

The circuit attached goes from 0.8hz to about 8 hz, so not so much use, its tricky to do, the ne567 wouldnt even do what the 'hc4046 does, I think to get the thing to work you'd have to get down to a low freq with the vco then using a comprator monitoring the control voltage stop the osc near ground control voltage, that would be tricky to get right as steam engines dont suddenly stop. I have to say at this point I'd be reaching for my arduino, or maybe a attiny 8 pin job.

20170915_183205.jpg
 
Nope, but I know a thing or 2 about napier deltics, not the loco the diesel engine, I rebuilt 3 at leyland motors where I used to work, fascinating machines, and they sound like nothing else.

Wasn't it a V engine ? If I am right I think it was developed for marine use.

I could be an anorak and get along with the odd one, but I cant keep it up for long just an hour here & there, fortunately.
Yep know where you are coming from.........
Of course I was only joking.
You do not consider the AD654 viable then?

Willy
 
The micro in question can be fitted with two pots, one being a trimmer pot that can be used As you are here in the UK I could help you with that!!! I want to design my own train controller... I have several engines and I too want all these things you speak of!!

Hi Ian,
Firsly my apologies for not acknowledging your post. Have been busy answering questions as I hope you will have seen. Your offer of help would be truly apreciated as is that of your enthusiastic interest.
A few years ago now with only limited elctronics know how but a good knowledge of Midi and computer music I started to look at ways how I could use both to create a sound system for a model railway and the result is shown in the above video. I think this was successful but need to take it to the next level. With a steam loco I have to synchronise as near as possible not only the sound but the engines visual movement and speed as defined by the wheel coupling rods.
drpepper believe's this would be easier to do with a micro or auduino but with no know how of both, where do I start? Therefore a good place to start would be to shout........... HELP!!

Please,
Willy
 
The deltic has 3 cylinders in a deltoid, hence the name, there are no cylinder heads its an opposed piston.

The mrs likes your loco video.
 
The deltic has 3 cylinders in a deltoid, hence the name, there are no cylinder heads its an opposed piston.

Yes , I knew it was something..........
The mrs likes your loco video.

Bless her!
That sulzer motor sounded pretty good through my cheapo pc speakers, if I had time & space that would be cool on scalextric.

If I get time away from the mrs this weekend I'll look into prototyping a 10hz vco, but I'll be using an Ne567 chip and the lowest freq will probably only be around 0.5hz.

If I get time away from the mrs this weekend.........

After all these years I still want to spend as much time with my wife as possible and luv her, she says that I can have as much time away from her as I want.
What bothers me is she being nice or trying to tell me something!?

OR MAYBE CORRIES ON RIGHT NOW AND YOUR WIFE LIKE MINE WANTS US OUT OF THE ROOM. OR DO YOU WATCH IT WITH HER!!!!

tomorrow,
Willy
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top