Created
August 28, 2017 14:17
-
-
Save Elwell/841c5f92536a25258676e322c03cc51f to your computer and use it in GitHub Desktop.
Arduino PSU control
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Arduino control for (ex) server PSU | |
* Andrew Elwell <[email protected]> August 2016 | |
* Released under BSD licence | |
*/ | |
/* Controls / Pins based on data sheet available at | |
* https://belfuse.com/resources/PowerSolutions/SFP1050/bcd20031_ab_sfp1050-12bg.pdf | |
* | |
* A6/B4/C4/D4 +3.3 standby (power to arduino) | |
* A3/B1/B3/C1/C3/D3 Return | |
* B5(SDA) / C5(SCL) I2C | |
* B6 Bring low for PS ON | |
* C6 AC OK (if high) | |
* D6 PWR OK (if high) | |
* | |
*/ | |
#include <Wire.h> | |
int ACOK = 2; | |
int PSON = 3; | |
int PWROK = 4; | |
int LED = 13; | |
void setup() { | |
// put your setup code here, to run once: | |
Wire.begin(); // join i2c bus (address optional for master) | |
pinMode(ACOK, INPUT); | |
pinMode(PSON, OUTPUT); | |
pinMode(PWROK, INPUT); | |
pinMode(LED, INPUT); | |
digitalWrite(PSON,HIGH) ; // Stay off until ready | |
} | |
void loop() { | |
if (digitalRead(ACOK) == HIGH) { | |
digitalWrite(PSON,LOW) ; | |
} | |
if (digitalRead(PWROK) == HIGH) { | |
digitalWrite(LED,HIGH) ; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment