/* Arduino control for (ex) server PSU * Andrew Elwell <andrew.elwell@gmail.com> 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() { 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) ; } }
The one gotcha that I needed to get it working was to also bring PS A0 low (I2C address) and suddenly green led and 12v out!
No comments:
Post a Comment