×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Are you an
Engineering professional?
Join Eng-Tips Forums!
• Talk With Other Members
• Be Notified Of Responses
• Keyword Search
Favorite Forums
• Automated Signatures
• Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

#### Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

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

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

(OP)
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?

### RE: How to use 0-9v to simulate 4 switches?

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
www.gke.org
--------------------------------------
Half full - Half empty? I don't mind. It's what in it that counts.

### RE: How to use 0-9v to simulate 4 switches?

(OP)
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?

### RE: How to use 0-9v to simulate 4 switches?

(OP)
Can you show me a simple sample circuit?

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. ### RE: How to use 0-9v to simulate 4 switches? (OP) 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. ### RE: How to use 0-9v to simulate 4 switches? (OP) >Check out this article about controlling a fan with an RCX. Your TG1-4 inputs will be similar. >http://homepages.udayton.edu/~hardierc/EGR101/RCX%... I am a software engineer, I am not sure how to extend one SW to four SWs, can you show me a simple circuit? ### RE: How to use 0-9v to simulate 4 switches? 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 ### RE: How to use 0-9v to simulate 4 switches? (OP) 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? ### RE: How to use 0-9v to simulate 4 switches? 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 www.gke.org -------------------------------------- Half full - Half empty? I don't mind. It's what in it that counts. ### RE: How to use 0-9v to simulate 4 switches? 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.

### RE: How to use 0-9v to simulate 4 switches?

(OP)
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.

### RE: How to use 0-9v to simulate 4 switches?

This has become less about at-work engineering questions and more about hobby stuff.

Dan - Owner
http://www.Hi-TecDesigns.com

### RE: How to use 0-9v to simulate 4 switches?

Well, it is interesting that a micro could be less work than a 3914. This is ENG-TIPS. I suggest but don't do the work.

#### Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

#### Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Close Box

# Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

• Talk To Other Members
• Notification Of Responses To Questions
• Favorite Forums One Click Access
• Keyword Search Of All Posts, And More...

Register now while it's still free!