Can I wire my Arduino MKR wifi 1010 to my Arduino MEGA?

I set up my MKR to communicate with Alexa and have been successful to the point where Alexa can change the status (on/off) and brightness of the LED. However, I need the MKR to be connected to my MEGA to control an air pump (as per the specs and designs of the project) and I was wondering if there was an ideal or specified way to connect the two boards where the MKR would essentially be the "master" and the MEGA the "slave".

Joining two processors could add more problems.
Different logic levels for starters.

Why do you think the MKR board can't control that pump.
Leo..

I doubt that...

Mega cannot control a pump directly; the current, and possible the voltage, required by the pump would damage the Mega. You would need some kind of driver between the Mega and the pump, such as a relay or MOSFET.

The MKR could control that relay or MOSFET directly, without the Mega.

Introducing a second controller is to ask for extra difficulties. Communication is not an easy task.

1 Like

Allow me to elaborate a bit, I'm using a TRIAC and after hooking everything up, the pump runs. So the pump is not "directly" connected to the MEGA but through a TRIAC. Any thoughts on connecting the two boards though?

not used a MKR WiFi but have used a MKRFOX connected to a Mega
on the MKRFOX Serial is used for USB communications and Serial1 is a hardware serial port on Tx pin 14 Rx pin 13
the MKR uses 3.3V logic and the Mega 5V therefore a level converter or potential divider is required on the Mega Tx to MKR Rx line, e.g.

also the Serial1 Tx and Rx pins on the MKR WiFi are in a different place - see Arduino-Nano-BLE-Sense-pinout

I agree with @PaulRB and @Railroader - not sure why you need a Mega and an MKR WiFi - interprocessor communications adds a layer of complexity - can you not drop the Mega and connect the relay and other devices to the MKR?

1 Like

Thank you for the explanation! The project at hand also has an LCD along with numerous FSRs to provide feedback and the MKR simply doesn't have enough pins to accommodate everything that is involved so a MEGA was purchased to able to make up for the lack of pins from the MKR.

Read reply #4

Is replacing the MKR with a Mega an option?

Unfortunately, it's not. The MKR is needed to communicate with Alexa and the IOT cloud and receive commands from her.

Don't.

Use port expanders, not a second processor.
Leo..

1 Like

MKR has lots of pins. You just have to use them more effectively.

A very common beginner mistake. Ask for advice on the forum before making purchases.

Post links to the components you need to connect and the forum can suggest ways to achieve this without the Mega.

you could consider the Mega-WiFi_R3_ATmega2560_ESP8266 which is a Mega with an onboard ESP8266 for WiFi connection
it would remove your problems of hardware connections, level shifters, etc
however, you still have the complexity of Mega <> ESP8266 serial communicaations
also the DIP switches used to switch between programming the Mega, programming the ESP8266 and the serial connection between the mega and ESP8266 are awkard to use

a rethink of the design may be a good idea

1 Like

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