Help wiring Electron to Udoo x86 Board with a 20ms low pulse

I’ve really enjoyed working through the tutorials for the electron, I’ve been a programmer for many years but still feels like black magic :slight_smile:

I’d like to perform some power management on a board I have and I need some help with producing a 20ms low pulse in order to trigger the board.

I’ve got some instructions here using a switch and I’ve followed these and it works (mostly)

https://www.udoo.org/docs-x86/Arduino_101_(Intel_Curie)/Braswell_Power_Management_From_Arduino_101.html

I’ve tried a few things but the board just goes to sleep straight away. I think this is because I need to keep the voltage high and somehow only make the power go low using the Electron.

I can almost imagine the solution but not quite, case of running before I’ve finished walking.

Could anyone give me some tips or ideas ?

All the best

John

We don’t quite know what else you want to do with the Electron, but this would be my first thought to do for what I got from your description

void setup() {
  pinMode(D0, INPUT_PULLUP);
  ...
}

void pullLow(uint32_t ms) {
  pinResetFast(D0);
  pinMode(D0, OUTPUT);
  delay(ms);
  pinMode(D0, INPUT_PULLUP);
}

If you want to have your device to deep sleep, you’d need to use an external pull-up.
If you want to use Standby Sleep, you could use the wake pin with FALLING edge, as this also will have a pull-up resistor attached.

Thanks @ScruffR!

Too be honest the code was the least confusing this for me (I’m a code guy :slight_smile: ) or though it’s good to know I was thinking along the right lines, it was getting the wiring right which I was worried about.

Would it be a simple as connected the respective grounds together from the Electron and the board and then connecting say D6 into IO9 ?

I was a bit confused because in the diagram from the board manufactures they are supply their own power where-as I’m guessing that not required when integrating the Electron.

I wish I had paid more attention in electronics classes now in college :slight_smile:

Yes, common ground is something you need here (= tie GND together)

Disclaimer: When dealing with higher voltages you need to take extra care and should go for galvanica isolation where possible.

Thanks @ScruffR, apologies in advance for the newbie questions.

I’ll look up the isolation point. I was thinking about your point about having to hold the voltage high and not being able to allow the Electron to deep sleep.

Is there such a component or pattern I could use which would mean that the boards own power was used to keep the voltage high and then allow me to use a signal from the Electron to action the low power pulse.

I guess I’m asking if I could make the Electron a straight replacement for the mechanical switch in the circuit diagram.

All the best

If you just need to provide a HIGH level but not drive any (significant) current, then a pull-up resistor of any sort (e.g. 10k) would be enough and you can let your device sleep just fine.

Isolation is something to consider when you are dealing with potentially harmful voltages. With mere 3.3V/5V you won’t have any issues - any higher might be a problem for the Electron as its pins can only tolerate up to 5V. So for anything between 5V and 65V you will need a transistor, for 65V+ I’d go for galvanic isolation.

Does this still apply or could I design something which support deep sleep, sorry for lot's of questions @ScruffR, I just want to see how far I could go with possible features and limitations.

In deep sleep all pins (except WKP which will have a 40k pull-down) will go hi-Z and hence will not actively hold your signal HIGH.
To provide a HIGH level during deep sleep you need a pull-up to a HIGH level source.