Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to use 0-9v to simulate 4 switches?

Status
Not open for further replies.

mikezang

Computer
Mar 5, 2014
7
0
0
JP
I am a circuit as attachment, I want to use output 0-9v signal to simulate 4 SWs, what can I do?
Then if my power is 9v, how can I use it for this 3v circuit?
 
Replies continue below

Recommended for you

Assuming that you want to control this little device using a voltage instead of the four switches shown, you should either use a simple flash A/D and some logic or, which is a better choice when there are no more than four switches, a quad comparator and a voltage divider plus a string of resistors to create the reference voltages.

It is quite difficult to understand what you are saying. So I respond to what I guess that you want to do. It may be far from what you really meant to ask.

Gunnar Englund
--------------------------------------
Half full - Half empty? I don't mind. It's what in it that counts.
 
Thanks for your reply.
In fact, that circuit is a train sound generator for train model, I want to use Lego RCX or PF to control that 4 switches, so that if I set RCX/PF output to 1v, SW1 is on and sound1 on, set output to 2v so SW2 is on and sound2 on, and so on, when set output to 0v, all SWs off and no sounds are on.
May I make sense?
 
For ease of consrtuction I would use an arduino UNO. The outputs could be fed into a simple voltage divider to get 3V into the sound chip. Small delay could be implemented to prevent false triggering of tones as the voltage rises. I buy the UNO for less than $10 shipped. And you could add a lot of nifty functions. Hands down the easiest and cheapest way to do it.
 
I think that 3v power supplier is not key point, I can provide it without problems. I want to know how to simulate 4 SWs when I change output voltage.
Then I have about 10 RCXs and I need to use them.
 
What is your control - an 'output voltage' or 'one SW'? I'm assuming an output voltage from a RCX motor controller.

As you have a software background, the Arduino suggested earlier might be your best approach. Tie the motor output to an A/D input and then use whatever algorithm you want to control four outputs.

If you want to stay in hardware, you could wire four comparators up to control the four switches. Do you care about the other 12 stages that four bits give you? Use google or DigiKey to pull up a comparator datasheet and you'll see an example circuit.

Z
 
Like you guessed, I want to use a RCX output port to simulate TG1-TG4. It is said the LM3914 is a possible choice, can you show me a sample circuit with LM3914?
 
Sorry, I said "6 Mar 14 1:29 ...a quad comparator and a voltage divider plus a string of resistors to create the reference voltages..."

And now you have the name of such a comparator - even a decoded one. Isn't about time that you do some work of your own? This is not "Free Engineering" it is EngTips. Youv'e got the tips. Now start engineering!

A final tip: there's not much left to do when you use a decoded comparator.

Gunnar Englund
--------------------------------------
Half full - Half empty? I don't mind. It's what in it that counts.
 
Everyone wants a one chip solution and that is possible with the UNO. You can program the UNO chip using the FREE compiler with
the standard board. The chip is socketed and that can then be popped out and installed in your custom board. This could be made
very small and cheap by a board house that caters to small lots. Only four functions would be needed. The oscilator could be just
about any close frequency you find cheap on ebay since you don't use timing for serial communications. Power on reset could be just
a resistor and capacitor. The output pins would be connected to a 2.2K/2.2K voltage divider. This would give 2.5V at the input
pin of the sound chip. That should be sufficient to trigger it. Haven't looked it up but the UNO chip may even work on 3.3V the
same as the sound chip eliminating the divider. Uno chips with the bootup are about $5. Another appropriate voltage divider is
needed for the A/D input to bring the voltage down. Use a higher resistance value 22K/22K to give more input protection. Use of
the UNO is open so you would be free to sell this solution to others. This same solution is possible with many other microprocessors.
 
How much about total cost about your suggestion? Then I want to use RCX output to control Uno, is it possible? For example, when RCX sensor find a object, RCX will let Uno to play sound a while then stop, and son.
 
This has become less about at-work engineering questions and more about hobby stuff.

Dan - Owner
Footwell%20Animation%20Tiny.gif
 
Status
Not open for further replies.
Back
Top