Share RF transmitter between two Arduinos?

Hello all. I currently have a project that has a Mega and a Nano running side-by-side. They have two separate functions, but they both need to use an RF transmitter. Instead of hooking up two RF transmitters (one for each board), is it possible to just simply share the transmitter? Like, just have two data wires coming from the module, one to each board. And yes, I am aware that there are serial communication options out there, but this would presumably be easier. Thank you!


You need to connect the grounds, otherwise the two circuits can't communicate.

You also need some way to ensure that it's not possible for the relevant pin on each Arduino to be both set as outputs at the same time, yet being driven the opposite way - if you had one arduino try to drive the pin high, while the other tries to drive it low, you are likely to damage one of the Arduinos (never connect an output to an output).

Maybe put a pull-down on the RF transmitter data pin, and connect it to the two arduino pins via a diode, so that if either one of the pins went high, the transmitter would transmit, but there's no condition under which two outputs could fight. Of course, if they both tried to transmit, you'd still get gibberish.

Oh yeah, forgot about connecting the grounds. Thanks for the diode and resistor idea. To make said circuit, what should I Google to find out how to do that?

Why need to Google? I listed all the connections…

Diode AND, Diode OR
Often used with cathode to the uC, and a common pullup resistor to hold the line high, Then either uC can pull the line without impacting the other. If both sides use input pins, then one side can switch to Output, pull the line low, such as for controlling a share chip select pin, or for letting uC let the other know it wants to talk or is done with the sharde device or something.
In this case, have the anode to the uC, with common cathode. If one side goes high, it cannot drive thru the other diode's cathode to drive the other uC pin high. Use a pulldown on the cathode so the juncture isn't floating when neither side is driving.

Do you need a schematic, or can you follow that?

Why need to Google? I listed all the connections...

Because I don't know what kind of diode to use or the resistance of the resistor and I don't like asking basic questions on a forum if the info is readily available on the internet somewhere. Don't like being that guy that people say, "Google it, you lazy ass" to, you know?

BAT46-TR, low current, fast switching schottky diode.
4.7K resistor should be fine, similar to I2C. 1K would be fine even.

Even less here

‘Switching diode’, something like a 1N914 ought to work, But,
That’s not very good arbitration.
Do they ever need to receive?
if “A” is xmitting, and “B” decides it needs to xmit, does “A” keep the priority, or does “B” overtake. and then what does “A” do if overtaken? Or, if “B” has to wait for “A” to finish, what does it do in the mean time, re-try, sleep, throw up all over itself?? and what does the receiver have to know about what to do???
How do the two arduinos talk to each other to work all this out?

Diode choice isn't crucial. There are only minimums to hit, while using one that is rated way higher than your application needs isn't going to be a bad thing. You should basically just have a bunch of 1N4007 diodes on hand. They're good for everything I've come across.

Your question 123Splat is where the first half of my reply #4 comes in handy - either side can pull a line low - but they need to check that it's not low already which indicates the other guy is already using the shared resource.
Or it can be used by one side to tell the other "hey, give up the line!". However the code decides to handle that.

1N4007 not the greatest, can have 1.1V across it. Not good when you're trying to get below 0.9V for a good low for example. Low voltage schottky is better in that situation.

In fact, for reply #4, a diode is not even needed if both sides are inputs all the time until one changes to an output and drives low. If the other side drives low at the same time, then no foul is committed.

1N4007 not the greatest, can have 1.1V across it. Not good when you're trying to get below 0.9V for a good low for example. Low voltage schottky is better in that situation.

Congrats for thinking of a situation where a 1N4007 is not the greatest.

Here's a cookie.

Since you're using a MEGA, why not feed the Nano tx data into one of the extra MEGA serial ports.
Buffer it in the MEGA RAM if necessary, then pump it out to the shared transmitter.
This will allow you to prioritise Nano vs Mega messages, as well as eliminating any possible contention over access to the transmitter.

playing off of Lastchance's (ingenious at that): why not just ping a pin on the mega with the nano, let the mega do the rest. select a message, prioritize messages and deal with xmit, ack/nack.

edit: if they are in that close of proximity, why do you need the nano at all?

I have a similar situation and I simply send what needs to be transmitted to the mega through I2C and let the mega transmit the data.

Works great.