5

I'm beginning with electronics and don't have all the good reflexes yet. So here is my question:

Can I do what I did here?

can i do this http://www.movod-design.com/forum_img/canIDoThis.jpg

Do I have to add diodes between the Nano +5V and the junction point?

My goal is to have one button's state read by 2 Arduino Nano.

  • 1
    Providing the 5V to the button should be coming from just 1 arduino. And you can also use the internal pull-up resistor from the arduino. That way you'll only need to connect one side of the button to the ground and the other side of the button to the 2 input pins of the arduino. To use the internal pull-up use pinMode(pin, INPUT_PULLUP); – Handoko Jun 10 '14 at 10:46
  • Question is: why do you want two arduinos to do exactly the same? Maybe we could get rid of the second one altogether :) – Tom Jun 13 '14 at 14:24
8

You don't need to add anymore components to your schematic. But you can leave some components.

Before you're adding a button to your schematic please consider first how you want to detect your signal. A logic 1 as if a button is pressed? Or logic 0 as if a button is pressed. You can do this using pull-up and pull-down resistors. These resistors should be wired like this.

pull resistor

(The 100Ohm resistor in an internal resistor from the MCU)

Using the pull-down resistor means that when the button is pressed you'd get a logic 1. Using pull-up resistors means that when the button is pressed you'd get a logic 0.

When I see your schematic it seems like you're trying to make a pushbutton with pull-down resistor. Then you should wire your arduino like this.

pull-down button

Another option is to use the Arduino internal pull-up resistors. That way you don't have to add the 10k resistor in your schematic. And your schematic will look like this.

internal pull-up

To use the internal pull-up resistors from the Arduino you'll need to put this in your setup(): pinMode(pin, INPUT_PULLUP); where pin should be your pin number. Please keep in mind that when you use the internal pull-up resistor a logic 0 means the button is pressed.

  • 1
    thx a lot for the trouble you went through explaining at such great length! Very appreciated! :)) – MadCat Jun 12 '14 at 8:16
  • No problem mate. That's why we're here ;) – Handoko Jun 12 '14 at 8:17
0

I have done something like this to be able to have a redundant system. Is this what you were doing: Two computers receiving the trigger, if one computer failed you have the other running?

If that is your case, then there is a problem on this setup:

  • If one computer shuts down the Arduino on that computer will be powered by the second one and there will be not enough power for both.

I fixed it with a couple of diodes.

I still had some problems with false triggering from time to time, with tests on a Mac running OSX. The same tests with a Linux machine give no problem for now.

I wanted to make this really stable (next I'll try to use opto-isolators) I'm not a Programer nor a Engineer. Please tell me if I'm saying something stupid or if there is any other easy fix.

I was using two Arduino Pro micro Chinese copies and passing the data to midi to the computers - I did not test with real Arduinos to see if it was a board problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.