Using One Arduino to Trigger Another

187 views
Skip to first unread message

Jeffrey Cicolani

unread,
Nov 16, 2016, 2:00:30 AM11/16/16
to The Robot Group Mailing List, atxhs-...@googlegroups.com
So, here's an interesting question for the group. Does anyone see a reason why a digital output pin on one Arduino board can't be tied to a digital input of another Arduino board?

Here's the scenario...

Nomad has a power problem which is causing the main board to lose power and shut down. However, the motor controller will continue to execute the last command it was sent. Which means if Nomad is going top speed when the main board goes out, it continues going top speed until I can catch the little rascal and shut it off.

There is an Arduino Mega already on board. The Mega collects sensor information and controls the pan/tilt servos and will likely take on more responsibilities as things progress. It is connected to, and powered by, the main board via USB. So, when the main board goes down, so does it.

I am adding a second Arduino, an Uno, to manage the power system. As is, the power button on the main board requires a timed double pressing in order to turn on the board. That will be simple enough to emulate with the Uno and a relay. I have an eight relay board I'm putting on as well as a separate 30A relay for the motor controller.

As a safety precaution, when the main board goes down, I want to shut off power to the motor controller. In order to do this I need to detect when the main board has, in fact, gone down. It occurred to me that I may be able to connect a pin on the Mega to a pin on the Uno. When the Mega powers up and executed it's program it will set that pin high. On the Uno side, as long as that pin is registered high the MC power is applied. When it goes low, the MC power is shut off.

Does this long winded logic sound right? Am I missing something?

Thanks.

Jeffrey Cicolani
Vice President; The Robot Group; http://therobotgroup.org
Chair; Chupacabracon; http://chupacabracon.com

See my most recent geekiness at www.cicolanistudios.com and http://nomadrobot.info

"Power to the people powerful enough to crush the other people" Joss Whedon
"Always be yourself... unless you suck." Joss Whedon

Paul Williamson

unread,
Nov 16, 2016, 2:33:17 AM11/16/16
to atxhs-...@googlegroups.com, The Robot Group Mailing List
The scheme you describe will detect when the Mega has lost power (as long as they share a common ground, and you might need a pull-down resistor), but it won't detect any other crash on the Mega. If you instead have the Mega send a periodic pulse, or some more complicated data pattern, then the Uno can detect any case where the Mega isn't running. Extra bonus points if you can weave the data pattern generation into every crucial part of the Mega code, in such a way that it can't possibly generate the pattern unless it is sane and running correctly.

cf "Watchdog Timer"

  -Paul



--
You received this message because you are subscribed to the Google Groups "ATXHS Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to atxhs-discuss+unsubscribe@googlegroups.com.
To post to this group, send email to atxhs-...@googlegroups.com.
Visit this group at https://groups.google.com/group/atxhs-discuss.
For more options, visit https://groups.google.com/d/optout.

Riley

unread,
Nov 16, 2016, 3:41:32 AM11/16/16
to atxhs-...@googlegroups.com
Does the motor controller have an enable line or e-stop input?

If so then tying that to a relay (or opto) switched by the same power source as the mega would be the simplest/safest.

Brain dead, no go!

If it doesn't have such a safety circuit it needs one added...



As for connecting data pins between microcontrollers, no sweat.

Between a powered and possibly unpowered micro? Use an opto-isolator.

You're pretty much spoiled for watchdog timer protocols, low speed serial, i2c, 1 wire, roll your own high/low hokey-pokey, two data pins that should never have the same level, etc. If you're already using i2c sensors that wouldn't even need extra pins allocated.




-
Riley









This email was sent from my KLü Tablet


Jeffrey Cicolani <jcic...@gmail.com> wrote:

So, here's an interesting question for the group. Does anyone see a reason why a digital output pin on one Arduino board can't be tied to a digital input of another Arduino board?

Here's the scenario...

Nomad has a power problem which is causing the main board to lose power and shut down. However, the motor controller will continue to execute the last command it was sent. Which means if Nomad is going top speed when the main board goes out, it continues going top speed until I can catch the little rascal and shut it off.

There is an Arduino Mega already on board. The Mega collects sensor information and controls the pan/tilt servos and will likely take on more responsibilities as things progress. It is connected to, and powered by, the main board via USB. So, when the main board goes down, so does it.

I am adding a second Arduino, an Uno, to manage the power system. As is, the power button on the main board requires a timed double pressing in order to turn on the board. That will be simple enough to emulate with the Uno and a relay. I have an eight relay board I'm putting on as well as a separate 30A relay for the motor controller.

As a safety precaution, when the main board goes down, I want to shut off power to the motor controller. In order to do this I need to detect when the main board has, in fact, gone down. It occurred to me that I may be able to connect a pin on the Mega to a pin on the Uno. When the Mega powers up and executed it's program it will set that pin high. On the Uno side, as long as that pin is registered high the MC power is applied. When it goes low, the MC power is shut off.

Does this long winded logic sound right? Am I missing something?

Thanks.

Jeffrey Cicolani
Vice President; The Robot Group; http://therobotgroup.org
Chair; Chupacabracon; http://chupacabracon.com

See my most recent geekiness at www.cicolanistudios.com and http://nomadrobot.info

"Power to the people powerful enough to crush the other people" Joss Whedon
"Always be yourself... unless you suck." Joss Whedon

--
You received this message because you are subscribed to the Google Groups "ATXHS Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to atxhs-discus...@googlegroups.com.

Jeffrey Cicolani

unread,
Nov 16, 2016, 12:06:31 PM11/16/16
to atxhs-...@googlegroups.com, The Robot Group Mailing List
Thank you for your responses. All very good ideas.

Andre, I am going to put the serial connection in my back pocket for future implementation. I have a feeling I'm going to want that extra level of communication between the boards. Especially considering the voltage level information I can get from the motor controller through the Jetson and then Mega would be good information to have for the board controlling the power distribution.

For simplicity sake I'll be implementing the countdown watchdog logic Jerry suggested.

Of course, it also occurred to me, this morning, that the Mega is connected to the Jetson board through a powered USB3 hub. So power loss to the Jetson will not, necessarily, mean power loss to the Mega. However, I can time stamp the data from the Jetson in the serial string and simply monitor that for connectivity. When serial connectivity is lost, the ping to the Uno is disabled. Then make sure the connection to the Uno is set up as an interrupt.

I love it when a plan comes together.

Jeffrey Cicolani
Vice President; The Robot Group; http://therobotgroup.org
Chair; Chupacabracon; http://chupacabracon.com

See my most recent geekiness at www.cicolanistudios.com and http://nomadrobot.info

"Power to the people powerful enough to crush the other people" Joss Whedon
"Always be yourself... unless you suck." Joss Whedon


To unsubscribe from this group and stop receiving emails from it, send an email to atxhs-discuss+unsubscribe@googlegroups.com.

To post to this group, send email to atxhs-...@googlegroups.com.
Visit this group at https://groups.google.com/group/atxhs-discuss.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "ATXHS Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to atxhs-discuss+unsubscribe@googlegroups.com.

Jeffrey Cicolani

unread,
Nov 16, 2016, 5:04:23 PM11/16/16
to gray...@yahoo.com, Jeffrey Cicolani via Robotgroup, atxhs-...@googlegroups.com
I'm using the Roboclaw 2x30. The primary communication is through the USB, but, according to the response I just got from the forum, I can use one of the pins as an e-stop. I may use that as a redundancy; send the e-stop then cycle the power. But the more I think about it the more I like the idea of having a separate board managing the power. A wireless transceiver can be added for a separate remote monitor and kill switch. So, that would be another board bound wireless to the power control unit with a display of the current state and a push button that would trigger the shut down.

Jeffrey Cicolani
Vice President; The Robot Group; http://therobotgroup.org
Chair; Chupacabracon; http://chupacabracon.com

See my most recent geekiness at www.cicolanistudios.com and http://nomadrobot.info

"Power to the people powerful enough to crush the other people" Joss Whedon
"Always be yourself... unless you suck." Joss Whedon


On Wed, Nov 16, 2016 at 3:40 PM, Gray Mack <gray...@yahoo.com> wrote:
As Andre said 300 to 1k between the boards, you never know if you are going to accidently load the wrong software on the board. I would add a weak pulldown or pullup on the receiver in case the driver arduino left the line floating on power loss. 
What motor controller are you using and it's connection to the main board? Is there an enable line on it or built in watchdog? Some of them have that built in because of the very reason of runaway risk.

_______________________________________________
Robotgroup mailing list
Robot...@puremagic.com
http://lists.puremagic.com/cgi-bin/mailman/listinfo/robotgroup

Reply all
Reply to author
Forward
0 new messages