Arduino Forum

Using Arduino => General Electronics => Topic started by: Philter on Aug 18, 2019, 12:45 am

Title: switching comunication pins off
Post by: Philter on Aug 18, 2019, 12:45 am
hey everyone,
I have an arduino (1) wich is talking to an led matrix. But I want to connect another arduino (2) to the matrix and disconnect the first arduino. The first arduino should notice then the second one is connected and switch off the switches in the red box on the image. I already tryed using some n-channel mosfets (2N7000) but it wasnt working. I desided to ask for some help here before buying all differend kind of eletronic switches..
Does anyone have any idea what kind of fet or electronic switch will work?

Greetings, Phil

(https://www.bilder-upload.eu/thumb/ea8941-1566080229.png) (https://www.bilder-upload.eu/bild-ea8941-1566080229.png.html)
Title: Re: switching comunication pins off
Post by: Paul__B on Aug 18, 2019, 12:49 am
Sorry, clearly an "XY Problem (http://xyproblem.info/)" here!   :smiley-eek:
Title: Re: switching comunication pins off
Post by: jremington on Aug 18, 2019, 12:54 am
It is possible, but not at all easy, to have two Arduinos share the same output device.

You probably do not want to go down that road, so consider alternatives. Tell us in plain words what you actually want to do, without assuming that "two Arduinos" is the answer. But if it is, buy another LED matrix.
Title: Re: switching comunication pins off
Post by: Philter on Aug 18, 2019, 01:11 am
Thank you for the very fast response.
Im not realy good in english, but i try my best :)

Ok, lets just remove the second arduino here.

We have an arduino wich should switch off the 3 communication pins whenever i want to. So another device can talk to the matrix. The easiest way i know how it will work is a relay. But i need an eletronic switch to do the job.

I want to use the LedControl.h library for the matrix. I coudnt find a comand in the library that fits my need, so i want to do it on the hardware side.

Phil
Title: Re: switching comunication pins off
Post by: david_2018 on Aug 18, 2019, 02:52 am
Tri-state or open-collector outputs on all devices that drive the matrix would probably work.

Would probably be better, especially in the case of two arduino's, to just have one arduino control the display, and the second communicate with it when something needs to be displayed.

Very unlikely you will find a library with commands to support something like this, since it is so unusual, and generally easier to handle in software instead of hardware.
Title: Re: switching comunication pins off
Post by: jremington on Aug 18, 2019, 03:18 am
Quote
We have an arduino wich should switch off the 3 communication pins whenever i want to.
Just make those pins INPUT pins, and they are effectively OFF.

Connecting two OUTPUT pins on opposing devices is a good way to destroy one or both Arduinos.
Title: Re: switching comunication pins off
Post by: CrossRoads on Aug 18, 2019, 03:46 am
Add a  74HC125 to each Arduino. Have one Arduino control the output enables of each chip - only turn on one chip at a time.
Title: Re: switching comunication pins off
Post by: Paul__B on Aug 18, 2019, 06:34 am
We have an Arduino which should switch off the 3 communication pins whenever i want to. So another device can talk to the matrix. The easiest way i know how it will work is a relay. But i need an electronic switch to do the job.
So what is this other device and what is the purpose of the whole arrangement?

As has been pointed out, it is perfectly easy to set the Arduino pins as INPUT, but if the other device cannot do this you simply use a 74HC4066 as a "relay".  There is some concern regarding how these devices will be powered on and off.
Title: Re: switching comunication pins off
Post by: MarkT on Aug 18, 2019, 11:08 pm
Thank you for the very fast response.
Im not realy good in english, but i try my best :)

Ok, lets just remove the second arduino here.

We have an arduino wich should switch off the 3 communication pins whenever i want to. So another device can talk to the matrix. The easiest way i know how it will work is a relay. But i need an eletronic switch to do the job.

I want to use the LedControl.h library for the matrix. I coudnt find a comand in the library that fits my need, so i want to do it on the hardware side.

Phil
But why?  This isn't how displays are driven.  The display is driven by some controller, and whatever wants
to talk to the display talks to the controller, not to the display - its a black box effectively.
Title: Re: switching comunication pins off
Post by: Philter on Aug 19, 2019, 12:11 am
Just make those pins INPUT pins, and they are effectively OFF.
I just tried this tip and it works! Cant believe the solution would be this easy  :D And this is the cheapest solution too... I thought it was not possible in software..

Add a  74HC125 to each Arduino. Have one Arduino control the output enables of each chip - only turn on one chip at a time.
This IC looks promising, maybe I try one on a boring day. For now I have my solution but thank you very much for mentioning the IC.


So what is this other device and what is the purpose of the whole arrangement?

As has been pointed out, it is perfectly easy to set the Arduino pins as INPUT, but if the other device cannot do this you simply use a 74HC4066 as a "relay".  There is some concern regarding how these devices will be powered on and off.
Sorry but I really dont want to waste your time and energie with my XY Problem (http://xyproblem.info/).
But thank you for repeating what other people already mentioned.

Would probably be better, especially in the case of two arduino's, to just have one arduino control the display, and the second communicate with it when something needs to be displayed.
But why?  This isn't how displays are driven.  The display is driven by some controller, and whatever wants
to talk to the display talks to the controller, not to the display - its a black box effectively.
I will think about this kind of communication order.. Maybe its better than my plan.

Thanks everyone for the fast answers and hinds!

Phil