SX1509 to connect between A.nano and A.mega ?

hi all,
want to manage switches (servo controlled) at Arduino.mega
by Arduino.nano over Expander-Board SX1509, because nano has too less pins..

Job of A.nano : to give power for model railway tracks by servo relais and
control tracks power to realize a roadmap to drive several trains.
Additionally it has to read the actual switch-positions to decide wehther
the switch has to move or not..
At least, there should send a state information about if automation is wanted or not..

Job of A.mega : control switches manually and by signal from A.nano.

the sx1509-expander has 3.3V-Level, A.mega awaits 5V-Level at its pins,which
will be programmed as INPUT (-Pullup?).

My question is : must resistances wired between Expander-Board and
A.mega to avoid damage to the expander ?

please excude my bad english, its not my mother tongue :face_with_open_eyes_and_hand_over_mouth:

Mega inputs can handle 3.3V just fine. According to the SX1509 datasheet, the IO pins are 5V tolerant so no series resistors needed.

Have you considered that a Nano is a 5V device and your SX1509 is a 3.3V device; I'm not sure if the SX1509 will survive the 5V on the I2C bus.

That will cause problems since the Mega need to see a 5V input signal.

An MCP23017 would be much bettor for your application

The minimum VIH for a 2560 is specified as 0.2 * VCC + 0.9V. So that would be 1.9V for a processor running on 5V.
The minimum VOH of the SX1509 is specified as VCC - 0.3V. So that would be 3V.

I do not see a problem why you state that it will cause a problem.

I agree on that; why use 3.3V device in a system that is further 5V?

ATMega2560 datasheet DS40002211A section 31.1
Vih min = 0.6*Vcc

SX1509 datasheet from Sparkfun
Voh min = VCC1,2 - 0.3V

1 Like

You're right; looked at the wrong datasheet :frowning:

hi, thanks for answers !
until now, on a test equipment, sx1509 had no problems with I2C bus connected to Arduino nano and lcd-display !

added : on Logic Levels - SparkFun Learn
i found that is no problem with logoc-levels what matched with my experience on my experimental peripherie..
on other site of sparkfun i found the advice, to wire a resistance (1-2 kOhm) between
input io of expander and arduino..so i put 1,5k-resistors in the connetions..

so far all works well until now..no smoke :smiling_face:

with this i didnt succeed.. may be it was damaged from start ?
or any differences in descriptions or datasheets ?

Maybe
However, since the Mega wants a 5V singam and the SX1509 only outputs 3.3V you may have problems. It may work with one set-up and not another. It may work one day and not the next. It may work with the train stopped but not when it is running.

Because the Mega wants 5V and you are giving it 3.3V any little noise on the connections will cause problems.

what is the principle of a (data)-bus) ?
..to connect between several equipment independent of individual purposes !
so i didnt suppose to find problems connecting arduinos, displays and expanders with this bus..

to add for better understanding
a.mega and a.nano are Not connected via I2C , but in different circuits..only GND is common !
a.mega gets switch-status-info Only by the output-pins of expander !

The SX1509 (3.3V) is connected via the I2C but to the Nano (5V); we leave the Mega out of the equation for this.

Both the mega and nano are 5.0V and the SX1509 is 3.3V.
The Mega inputs are 5V and the SX1509 outputs are 3.3V

Why are you trying to use a device that is intended for a 3.3V device with two 5V devices.
Why not do things the right way and use a 5V expander.

Why is everyone ignoring that the original requirement is nonsensical?

SX1509, or similar like MCP23017, give Nano more pins. So it is incorrect to say that it has "too less pins". The Mega is not required. Without the Mega, the problem disappears.

If more pins are required, add more SX1509 or MCP23017 or PCF8575 connected to the Nano.

hi again,

testing the high - output of Anano with sx1509 to A.mega results in the fact, that the output
does not reach enough voltage for the HIGH-input of A.mega : only 2,1 V

As i had no level-converter here i tried again with mcp23017 ..

this time it ran with success giving enough voltage for HIGH-value on A.mega with over 4 V ..
may be , there was an error or something missing in wiring the mcp23017 before..

and found, that might be important to set the I2C-adresses of other environment
expressively, i.e. for the lcd-display.. Not automatic searching !

thanks for your help anyways ..good night and nice weekend !

Glad you finally got rid of the SX1509.

not really..i guess there will be another job for sx1509 in future
in any project for model railway issues..

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.