The robot that I’m currently building has two brains. There’s ESP32, who is responsible for motor, sensors and other spine cord reflexes. And there is Jetson Nano, who’s kinda a.. brain. Before even thinking about how they could to talk to each other, I had to understand how to power them ON and OFF first.
It’s trivial for ESP32, which I can simply connect to or disconnect from a power source and nothing bad happens. But Jetson Nano, which runs proper operating system, definitely won’t enjoy loosing the power in the middle of some IO.
In some distant future I’d want ESP32 to be responsible for deciding when to turn Jetson Nano ON and OFF. For instance, when I turn the switch, ESP32 would power up and signalled Jetson to do the same. When it turns off, though, Jetson Nano would detect that and gracefully shutdown on its own. One power switch – two affected boards.
However, at this stage I’d be more than satisfied to could control Jetson Nano power state via regular push buttons. It’s already a way better than plugging and unplugging a power cord. And you know what, that’s really easy to implement.
As of today, both of Jetson Nano revisions (A02 with one camera slot and B01 with two) have button pins that control board’s power state. It’s J40 pins header for A02, and J50 for B01. As I’m the proud owner of A02, I’ll focus at that one, but configuring B01 should be fairly identical.
So, here’s how to do that:
- Shorten “auto power ON” pins. It prevents board from powering up every time it sees the power cord. For that I simply scavenged a jumper from one of the older boards and put it on pins 7 and 8.
- After that, shortening pins 1 and 2 with a push button or even a screwdriver will initiate power up sequence. If the board is already running, shortening them for a little bit longer will turn the board off.
- If you want a reset button, shortening pins 5 and 6 will do. The logic is the same as with power on button. Well, except for “a little bit longer” part.
What’s cool is that because the whole power/reset sequences are basically triggered by pulling pins 1/5 low, I could have connected those pins to ESP32’s GPIOs and control Jetson Nano’s power state programmatically! Just as planned.
But for now I just took two push buttons, soldered them to connectors, plugged into a board, and voila! Another small step for a man, a huge leap towards a robot dominated world for a mankind.