[DISCUSSION] How to signal Arduino the Atom Side is on/off

A place to talk about all the Operating Systems, Software & Hardware
Forum rules

- Posts are to be made in the relevant forum. Users are asked to read the forum descriptions before posting.

- Members should post in a way which is consistent with "normal writing". That is users should not post excessive numbers of emoticons, large, small or coloured text, etc. Similarly users should not SHOUT or use excessive punctuation (e.g. ! and ?) in topic titles or posts.

- Members should use an appropriate, descriptive subject when posting a new topic. Examples of bad subjects include; "Help me!", "I'm stuck!", "I've got an error!", etc. Examples of good subjects include; "Getting an TABLE FULL error upon login", "Cannot restore a backup".

- Members are asked to post in English only so that posts can be well received and properly monitored.

- Spam is not tolerated here under any circumstance. This includes offering hosting services (charged and free), installation services, solicitation etc. Recruiting members for your own projects (moderators, designers, professional MOD work, etc.) is not permitted and is also considered spam. Users posting spam will be warned and their post removed.

- Members should post in a way that is respectful of other users. Flaming or abusing users in any way will not be tolerated and will lead to a warning. Vulgar language and inappropriate material is not allowed and will be removed. We try to maintain a family friendly atmosphere whenever it is possible within the main subject matter of this community. Please keep this in mind when participating.

- Each user is allowed to create one account. If you would like to change your username, please contact us and, most likely, we can do it for you while you can keep all of your profile data, posts, and other content.

- If a user violates our guidelines and shows a disregard for them, our staff and our community, they run the risk of losing their account. We reserve the right to deactivate any account and to edit or remove any content without warning. These guidelines are subject to change at any time without notice.

Thank you for visiting LattePanda.com!
Post Reply
User avatar
Boring
Posts: 88
Joined: Sat Apr 16, 2016 7:14 pm

Thu Aug 25, 2016 5:35 pm

Recently I have been thinking on how to signal to the arduino the atom (Windows) side is on or off.

First I thought to send a hartbeat signal through the USB connection to the Arduino. However that will occupy the com port.

Another method I tested today is to use the 1.8v (pin10) from the U1 connector. This one gives 1.8V as long as the atom side is running. With some delay between screen off and 1.8 low. You can connect this pin through a diode to an analogue pin on the arduino side. I didn't write a sample code yet, I just used a LED and a 220ohm resistor to check the operation.

Does someone else have any other suggestions on how to check if the atom side is running?

User avatar
Lutz
Posts: 214
Joined: Mon Apr 18, 2016 4:30 am
Location: Germany, NRW

Thu Aug 25, 2016 6:43 pm

Boring wrote:Recently I have been thinking on how to signal to the arduino the atom (Windows) side is on or off.

First I thought to send a hartbeat signal through the USB connection to the Arduino. However that will occupy the com port.

Another method I tested today is to use the 1.8v (pin10) from the U1 connector. This one gives 1.8V as long as the atom side is running. With some delay between screen off and 1.8 low. You can connect this pin through a diode to an analogue pin on the arduino side. I didn't write a sample code yet, I just used a LED and a 220ohm resistor to check the operation.

Does someone else have any other suggestions on how to check if the atom side is running?
Very good idea !

User avatar
Boring
Posts: 88
Joined: Sat Apr 16, 2016 7:14 pm

Thu Aug 25, 2016 8:21 pm

ok below is some sample code

Code: Select all

/* this sketch reads on/of status of the atom processor

  if the atom is on a LED will be switched on if the atom is of the LED will go off

  using the 1.8V input from the Atom as input on analogue A0 pin16
  outputting a high signal on digital output D4 pin10*/

int AtomStatus = 0; // init variable to read the status of the Atom processor
//it is a value of 0 to 1023  corresponding to 0 to 5V.

void setup() {
  // put your setup code here, to run once:
  //init input and output pin
  pinMode(4, OUTPUT); // this is connected to the LED signalling atom on/off
  pinMode(A0, INPUT); // this is connected via a diode to the 1.8V of the atom gpio

  //init serial comms  to see what happens on serial console
  Serial.begin(9600);
}

void loop() {
  // put your main code here, to run repeatedly:

  AtomStatus = analogRead(A0);

  if  (AtomStatus > 100)
  { //Atom is on
    digitalWrite(4, HIGH);

    // send  AtomStatus value to serial monitor
    Serial.print ("Atom Status value is: ");
    Serial.println (AtomStatus);
    Serial.print ("Atom Voltage is: ");
    float calcValue = AtomStatus;
    Serial.print ((calcValue + 1) / 1024*5,2);
    Serial.println("V");

  }
  else
  { //Atom is off
    digitalWrite(4, LOW);
  }
  delay(2000);
}
and here is how i hooked up my test setting.
because i use a diode and resistor the voltage level you read with the arduino will be about 0.27V

Edit:
Made a small mistake in the code
Changed Serial.print((calcValue + 1) / 1024,2)
To Serial.print((calcValue + 1) / 1024*5, 2)
This gives a read voltage of about 1.35V, which is more logical than the earlier stated 0.27V

http://i.imgur.com/UomaTl4undefined.png

Post Reply