two signals 5V and 2,5V in A0 to output D2 for 5V or D3 for D3 how do do?

Hello,
two signals 5V and 2,5V in A0 with 2 resistors , to output D2 for 5V or D3 for 2,5 Volts How ?

John.

Hello,
two signals 5V and 2,5V in A0 with 2 resistors Pullup , to output D2 for 5V or D3 for 2,5v, How ?
TKS
John

Assuming your arduino is operating on 5V the solution is not to involved. Take the 5V directly in and the 2.5 you will need to use a level translator. You can make one by taking the signal into the base of a NPN transistor via a resistor, 2.2K would work then use a pull up to the 5V, (another 2.2K would work) from the collector, this point becomes your input.
Good Luck & Have Fun!
Gil

GM Gil

Thank you for this message,
can you draw a little schema ?

John

john35S:
Hello,
two signals 5V and 2,5V in A0 with 2 resistors , to output D2 for 5V or D3 for 2,5 Volts How ?

John.

Do offer schematic on your input.

What do you get when both signals give a voltage? What happens to the voltage when one is on, one is off?

Hello,

For this moment, this schematic was my solution, but it is open to read the soft.

Please, how to put my schema here in JPG ?

John.

Image posting guide

TKS wvmarle,
I go to see the guide and after , my schema in image here

John.

IMAGE AND TEXT

When SW1 is pressed, you can not detected SW2.

Use a resistor ladder instead (and higher resistor values - 10-20x higher or so), so you can detect both buttons individually.

For that matter why not use A1 for SW2, or indeed a digital input - are you out of pins?

tks for messages,

yes, when SW1 is pushed , because in reality, this switch will be a contact of relay and not a pushbutton , the

SW2 is not pressed;

it's SW1 or SW2 for out D2 or D3

SW1 pushed : D2 = HIGHT SW1 no-pushed : D2 = LOW

SW2 pushed : D3 = HIGHT SW2 no-pushed : D3 = LOW

for analogic input A1, A2, A3 on UNO Card , it will be the such schema

Please give me your solution,

John.

complement,

A1 such schema and digital output used D4 D5

A2 such schema and output used D6 D7

A3 such schema and output used D8 D9

John.

Hello,

New schema and text for analog input

Relay coil with 3 resistors.

John

OP's image:

That will do fine for your application. You did calculate the voltage for SW2 wrong, it should be lower than half as R2 is the smaller of the two. Note also that there's a fourth, in-between voltage: when you have both buttons pressed.

And again you should increase the resistor values. R2, R3 10k, R2 4k7 are much more sensible values. No need to run that much current through the switch.

Good morning wvmarle,

thank you for the message,

For you this schema is well. no error ?

But error in values of resistor.

I see yours values 10 K and 4,7 K Ohms

I read in your text R2 R3 10K and then also R2 4,7k
for R1 what value ?

For the relays:
the relays SW1 and SW2 are interlocked, it is not possible to feed the coil of the second relay when the other is in use. it is in an other electric schema.

For intensity in contact:
the contacts ON OFF in the relay are not manufactured for a very small intensity, minimum 0,3 Ampère would
be well.

I hope to see you again, TKS

John.

Typo. R1, R3 10k; R2 4k7. So roughly the same ratios as your schematic but higher values.

Relay contacts should conduct any current up to their rated current just fine. When a relay is closed the resistance should be very close to zero, in the tune of a few mΩ typically - negligible, like the resistance of your wires.

Thank you wvmarle,

I go drawing the schema with R1 and R3 = 10K R2 = 4,7K
Voltages A0 with Sw1 closed = 2,5V
with Sw2 closed = next 1,6V

modify schema tomorrow.

OK for milli-Ohms on contacts when it is closed.

After... the first soft for that.
setup

void

I hope to see again, TKS

John.

Modification on schema with 3 Resistors

John.

Hello,

let's start the program !

First, please , can you put the new download ( post up), here, I do not know how to do it.

TKS

John.

please new image :