Using digital pins to link two Aurduinos

I should say, before I start on the detail, that I am relatively new to Arduinos and have only a basic to meagre grasp on electronics.
I have a project where I wish to have two processes going on in parallel. In order to achieve this, I have written one routine (pulsing a pair of LEDS) on a Arduino micro. The remaining (main ) code is written to an Arduino UNO. The loop on the UNO does a number of things and, in part of the loop, pulls one of the pins (pin 3 )high. Pin 3 on the UNO is connected to pin 9 on the micro. The sketch on the micro initiates the LED pulsing routine when it sees a HIGH on pin 9. I have not used any pull up or pull down resistors.

Currently, I am powering the UNO via the USB and the Mirco using a external 12v supply. The grounds are commoned.

When running the sketch on the UNO, the LEDS, driven from the Micro, pulse as they should, however, when the Micro pin 3 on the UNO is pulled LOW the LEDs continue to pulse. I have checked the pin 3 at the UNO end (when disconnected from the Micro) and this is going LOW.

Am I missing some intrinsic property of the Arduinos logic levels that makes this approach unsound or am I missing something simple?

I would be very glad of some help or advice.

Many thanks

You have forgotten the most important, to post those codes and the wiring. What do You think helpers are made of?

Study the topic "Doing several things at the same time", and "Using millis." Then You will do this using one controller. Using 2 controllers, trying to make them cooperate multiplies the difficulties.

Post the code for the Uno and Nano. Read the how get the most out of this forum sticky to see how to properly post code. Remove useless white space and format the code with the IDE autoformat tool (crtl-t or Tools, Auto Format) before posting code in code tags.

Am I missing something simple?

Yes, you really, really don't need 2 Arduinos for this. This is simple stuff for 1 Arduino.
https://forum.arduino.cc/index.php?topic=223286.0
https://forum.arduino.cc/index.php?topic=503368.0

If you power down one Arduino, it may be killed by the current delivered by the other through the connected I/O pins. At the very least you should place a 10k resistor between the two as protection against this.

Also of course a 12V supply is not exactly the best way of powering what is essentially a 5V device...

Many thanks for the assistance. There is now a 10K resistor between the two I/O pins and everything is working!

I was puzzled about your comment on the use of a 12v power supply for the controllers; in both cases the Arduino documentation confirms that 12v is ok. See below:-
"The board can operate on an external supply of 6 to 20 volts. If supplied with less than 7V, however, the 5V pin may supply less than five volts and the board may become unstable. If using more than 12V, the voltage regulator may overheat and damage the board. The recommended range is 7 to 12 volts"
The above is for the Micro, however, the advise for the UNO is similar.

Once again, many thanks.

I know. While technically correct, it is not sound advice.

Not sure about the Micro, but the older designs (Uno et. al. and many other boards) use a linear regulator to step down the voltage. An Uno takes some 30-35 mA by itself just to operate; drop 20V to 5V is 15*35 = 525 mW of power to dissipate in that one small component - don't even think of adding as much as an LED to that. Newer designs use a buck converter, which is far more efficient.

Back in the day when the Uno was designed, a 9V wall wart was a common power supply. Unregulated, they could go a good bit above that when unloaded. A regulator made total sense. However still you could not power much else from that 5V pin or you would have overheating problems.

However internally an Uno runs at 5V. Nowadays just about everyone and their dog have a drawer full of disused 5V power supplies - your old phone chargers. Those can power an Arduino directly. Plug it into the USB socket (if it happens to be compatible, all those different types that look almost identical continue to drive me crazy), or strip the wire and connect it to the 5V pin. That same 5V supply can now be used for other things, including high power devices such as relays or even servos.

Once again, many thanks for a comprehensive and pleasantly non - patronising reply.

I shall re-think the power supply set up. It was governed from advice elsewhere that the 5V supply from the Arduinos would struggle to drive a servo and the fact that I have a shiny new 12v power supply on my bench!

You can use your 12V supply. Get a 12V to 5V DC DC converter (buck converter) and connect the 5V output to the 5V pin of your Arduino (in place of the phone charger).

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