Using 2 Microcontrollers powered separately

So I have 2 x 3.3v Microcontrollers that would be powered from 2 different sources. One would be powered from the wall and the other would be from my PC USB.

I would like to interface the microcontrollers so they can talk and work with one another by hooking them both up directly to each other and hooking them up to components on a breadboard.

The thing that concerns me is the separate power sources as I really can't afford to have them damaged. I did a simulation on TinkerCAD and in the simulation it showed that no matter how I wired them or used them it never caused any issues. However simulations are not reality.

A bit of poking around on Google showed mixed ideas, some said it would be perfectly ok and some said I'd have to a special setup or have special components or something of the sort.

Basically I decided to just ask on here if anyone can help me with this. I'm sure it's a very basic and beginner question but any help would be appreciated, thanks in advance.

You need to be a little lot more specific about your problem:
Post your schematic in CAD or a picture of a hand drawn circuit in jpg or png- (not a pretty Fritzing drawing).

Powering separate MCU’s (Microcomputer Units) with a data link between them is pretty common.

While you are at it, tell us what you are trying to accomplish- someone here may have a better idea.

Apologies for vague information:

  • Microcontroller 1 is an Arduino Micro (Powered via USB)
  • Microcontroller 2 is an Adafruit Metro M4 (Powered via wall outlet)

I'm playing around with different ideas and just want to work with leveraging 2 microcontrollers to do different things. I really don't have anything specific in mind. Here's some rough ideas I want to play around with:

Idea 1: Hooking wires up directly between microcontrollers like such to do whatever I can imagine. In this image I'm hooking up 2 wires, one to digital and one to analog to tryout different inter-microcontroller communication on analog and digital for learning purposes and expirementation.

Idea 2: Having a breadboard with some components on it, whatever they may be. In this example it's an LED light which is useless in and of itself but serves as a ground to see if a component can electrically handle 2 microcontrollers controlling it at the same time.

In Example Two the microcontrollers also both power the breadboard.

Idea 3: there's more going on, 2 micro controllers are powering the breadboard at the same time and their interacting with an and gate to power 4 led lights conditionally depending on the outputs of each microcontroller.

These are just random ideas I have, I could spend literally all day coming up with different ideas and setups. The entire point of the question is just if having 2 different 3.3v currents, one from a usb and the other from a wall, will (in whatever setup I do) cause components to be damaged because there's 2 currents flowing from 2 different sources.

NEVER connect two outputs together.
NEVER connect two positive power supply lines from different power supplies together.
NEVER connect LEDs to anything without a resistor.

If you do any of these three things you will damage something.

In order to let the two Arduinos communicate you NEED to connect the two ground lines together.
This is why:-
http://www.thebox.myzen.co.uk/Tutorial/Power_Supplies.html

Many beginners make the mistake of thinking you need to use two Arduinos. This is quite rare and is to be avoided if possible because it often causes more problems that it seems to solve.

Correct programming and appropriate use of port expanders can solve 99% of the "problems" a beginner thinks you need a second Arduino to solve.

The analogue pins on an Arduino will only read analogue voltage levels. They will not produce analogue output signals. However they can be used like normal digital inputs and outputs.

If your talking about image 1, based on your example and comment image 1 is perfectly ok i just need to add an additional wire for the ground?

Like this?

But the other two images are different and include a connected ground, are they correct?

Also I'm well aware that multiple microcontrollers is often not needed but I have two laying around next to me right now so I want to play around with inter-communication anyways.

EDIT:

Sorry I didn't see you had made several edits to your post:

  • The image posted is one that I quickly mocked up because it was requested on here. I'm aware the Arduino can only read on analog and analog write on certain pins capable of doing a write. This was a mistake in the mocked image.
  • I'm aware LED's require a resistor, this was a quickly mocked up image because it was requested. I'm not actually going to place LED's down without a resistor attached or really much of any components without a resistor.
  • I'm not linking two 5v currents, I'm linking 3.3v currents but it's interesting that I wouldn't be able to link 5v currents. Why one and not the other?

But the other two images are different and include a connected ground, are they correct?

NO - because they connect the 5V lines together. This will cause damage.

What happens if you connect two outputs together is that as long as the two outputs are the same things are fine. But when one is HIGH and the other is LOW you will damage the pins.

You can't change two output pins on two different processors at the same time.

Also not the edited point about your LEDs.

If your talking about image 1, based on your example and comment image 1 is perfectly ok i just need to add an additional wire for the ground?

Read what I said about the analogue pins, and digital pins not both being outputs. If one is an input and the other an output then things are fine. If you must do this then put a series resistor of about 330R between the two pins for when you inevitably make a mistake.

I added an edit because I didn't see your edits, I'm reading through this information right now.

I'm not linking two 5v currents, I'm linking 3.3v currents but it's interesting that I wouldn't be able to link 5v currents. Why one and not the other?

No you can't link any supply voltages no matter what they are.

Also you are showing a Uno and they work at 5V. If you are using 3V3 then you are not using a Uno so your diagram is lying, and that many people here very annoyed.

This is not a board meeting where I'm presenting a product for review to a company.

All I'm doing is saying I'm an electronics enthusiast and software enthusiast even though I'm really new to embedded programming and hardware. I'm just asking a very basic electronics question purely so I can explorer my passion for hardware further.

There's no goal in mind, there's no drawn up schematics, there's no mock images, there's no product. I'm literally just playing around with wild and crazy ideas where most of them would not have very much practical use but it's just for learning.

I'm going to go out on a limb and say you didn't even read my post where I mentioned all of this including the 3.3v system in it. I'm going to also go out on a limb and say you saw images, you skipped reading, you commented on the images alone.

I literally didn't even want to post images, It's like asking an incredibly basic question on electronics and instead being demanded that my project review to the board meeting is extremely shotty and in need of serious overhaul before I represent the product to the board.

I created crappy mock images to make everyone happy even though their hardly relevant, mock images of what? Schematics of what? Detailed presentation of what functionality? I'm asking about an abstract brainstorming idea, like a "what if" idea, how the heck do you want me to make schematics, mock images, and a detailed setup and goal for that. There is none, it's just a "What if I link 2 controllers together" kind of idea you may have in your sleep kind of thing.

Instead I'm getting attacked and mocked because I'm supposedly only suppose to ask questions on here if it's a highly detailed and highly documented project that feels like this is a corporate board I'm selling a mostly fully working product to and thus feels more toxic than even StackExchange when Arduino is all about creating passionate electronics enthusiast banding together and helping each other out.

I'm been patient on these forms long enough but I've very rarely gotten any kind of helpful answer and many of the information given has been downright wrong to begin with or far over-complicated like this thread. I'm through with you guys, consider this thread abandoned and I'll just be posting to StackExchange from now on, at least their a lot less toxic than this dumb place.

In fact what I may do is just link them up and if they fry well I'll have my answer. It'll still be better than trying to ask on here which turns a simple question in basic electronics into something of rocket science.

And before you say anything such as it can be more complicated or some reasoning as to what this thread has turned into this is not the first time I've been attacked on here. Almost every single post I've made on here I have been attacked, mocked, and the entire thread turned into something terribly complicated and it turns out the answer is often stupid easy and didn't warrant all this.

Just go away because I am, I'll continue to buy Arduino products but I sure as heck won't reccomend their supposed community to anyone.

Reply #1 asked for the information required to address your question, and you failed to take the request seriously. You also failed to read and follow the directions in the “How to use this forum” post.

Not a good start on a technical forum.

Your "mockup" needs to be accurate - just putting something down as you admited to just to put something down is bad because someone will look at the drawing and point out the issues in the fake drawing - hand sketches also work fine here - if you have two processors of different voltages problems and damage can happen - it can be done but special level shifting needs to be done

This is a good place to get help - BUT - accurate drawings and code as well as a good description of what you want to do is essential as well as the why

Personal, I had this happen to me in another forum - ran out of outputs for my project and was asking about a larger processor and such - when one of the members pointed out that a shift register = serial to parallel chip would give me more outputs - turned out to later that I also maxed out the processor memory - but I did get the project running and has been running well now for over two years - so the secret is ask the correct question - you have access here to literally several centuries and thousands of projects of experience for FREE here

Read about GROUND in the Introductory Tutorials section.

Everything revolves around GROUND, even 0V ! They aren’t the same, but often at the same potential.

Grumpy_Mike:
What happens if you connect two outputs together is that as long as the two outputs are the same things are fine. But when one is HIGH and the other is LOW you will damage the pins.

I do this in one project where two processors are sending semaphores to each other. I haven't damaged an I/O port yet.

put a resistor between the conflicting pins - to limit the current.
it’s the current that kills a pin.

junebug12851:
Instead I'm getting attacked and mocked because I'm supposedly only suppose to ask questions on here if it's a highly detailed and highly documented project that feels like this is a corporate board I'm selling a mostly fully working product to and thus feels more toxic than even StackExchange when Arduino is all about creating passionate electronics enthusiast banding together and helping each other out.

I apologise if it sounded like I was asking for details, but your original post was pretty specific about your project, so it seemed like you were pretty far along in your project development.

As Grumpy said, "No you can't link any supply voltages no matter what they are.". You can power each board with its own power source, but if there is any communication between them, either through I/O pins, I2C or Serial ports, they must have a common ground.

Just don't let the + of the power sources touch each other.

Egon: Don’t cross the streams.
Peter: Why?
Egon: It would be bad.
Peter: I’m fuzzy on the whole good/bad thing. What do you mean “bad”?
Egon: Try to imagine all life as you know it stopping instantaneously and every molecule in your body exploding at the speed of light.
Raymond: Total protonic reversal.
Peter: That’s bad. Okay. Alright, important safety tip, thanks Egon.

Start with the basics. Run the example code on one Arduino. If you run into problems, ask for help here. (We're really a nice bunch; only occasionally grumpy).

lastchancename:
put a resistor between the conflicting pins - to limit the current.
it’s the current that kills a pin.

I have to disagree. You can safely connect IO1 to IO2 and set IO1 as input and IO2 as output. You cannot hurt the input pin this way because according to the Atmega datasheet, the Arduino pins consume pretty close to zero input current. From section 26.2 DC Characteristics:

Input Leakage Current I/O Pin low = 1 uA
Input Leakage Current I/O Pin high = 1 uA

Current doesn't kill the input pin. It will draw only the current it needs. But trying to suck more than 20mA from an output pin can kill it. (Like driving a motor or solenoid directly from the I/O pin, or accidentally connecting it to ground.).

The resistor is a good idea in any situation where the pin states could become unknown !
Connecting inputs together won’t cause a problem, but if you accidentally tie an output to any driven pin or supply rail is fairly certain to cause problems over time.

Do whatever you want, it’s your money!

You can safely connect IO1 to IO2 and set IO1 as input and IO2 as output.

Nobody ever said you could not do that.

junebug12851:
I'm going to go out on a limb and say you didn't even read my post where I mentioned all of this including the 3.3v system in it. I'm going to also go out on a limb and say you saw images, you skipped reading, you commented on the images alone.

Well again you would be wrong. I did read everything you wrote several times before I posted. The bit where you said about using 3V3 did not make any sense in the context of the questions you were asking, so I assumed you had made a mistake because your images contradicted the words. Images are much more powerful than two words that seem to contradict them. Your questions showed you did not know very much so I assumed your words were a miss understanding of what you were dealing with. I never dreamed for a moment you would use the wrong processor in an image.

many of the information given has been downright wrong to begin with

I find that hard to believe please post a link to information you have received here that has been downright wrong and another member has not corrected it.

I did not mock you, if you think I did then this is all in your head and you should not be so paranoid.

You have to remember you are talking to engineers here, not some school teacher that has to say your opinions are valid even though they are not.

consider this thread abandoned and I'll just be posting to StackExchange from now on, at least their a lot less toxic than this dumb place.

At least we don’t block posts because someone asked the same question two years ago. Good luck with that forum.