[Server-devel] smooth shutdown for 12V-DC powered XS

Kévin Raymond shaiton at fedoraproject.org
Thu May 10 04:20:57 EDT 2012

> It might not be necessary to calibrate, if the raw value is sent to
> the computer, the computer software can be calibrated instead.
> It is still be necessary to ensure the values are within the range of
> the analog to digital converter.  If you only see 1023, the voltage is
> out of range.

It's exactly what I meant, I haven't checked yet but the input should
be on the range 0-5V, and we need to define the average threshold in
order to get an accurate measure.
I'll see with Xavier about the power expected values.

>> I don't really know Arduino, neither how to put the board asleep, it
>> could consume less???
> avr/sleep.h
> See also
> http://www.arduino.cc/playground/Learning/ArduinoSleepCode
> http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?action=print;num=1289769139
> http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1256298397
> http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1286856144
> However, you face an important problem, which is how to wake from
> sleep.  You might configure it to wake on serial input, and have the
> computer software wake the arduino to take a reading.  I did that a
> few weeks ago with a fridge power monitor.
> You might still have power to the USB chip, U4.

What, there is no internal timer, to awake it?
Ok, I'll dig around this.
PICs only consume few uAmps when sleeping…

I still think that building our own board could be better as it will
be smaller and more robust (no unuseful I/O, no wasted components…)

>> At the analog input I just have a voltage divider (passive is best,
>> but more current is drawn???).
> The current drawn by a voltage divider is related by ohms law to the
> total resistance of the divider, from top to bottom.
> Increasing the resistance has a bad side effect of increasing the
> noise on the reading.
> Adding a capacitor from the centre of the divider to ground will
> decrease the noise.  But too large a capacitor will slow the response
> to rapid changes.

Yep I know, thanks

> I suggest a 100k potentiometer with a 1uF capacitor.

I would prefer to choose only resistances, not potentiometer, as
people won't try to change settings! (And the threshold would be
updated on the host software).

> C?  I guess that has the lowest power cost.  I have used Python, or
> Bash.  Fast to develop.

Sure, I've already done something similar in bash and perl, but this
time I wanted to do it properly with system libs :).
This to have only one code and not hand made udev script calling the
monitoring one.
What is really ugly with Arduino is the USB management through the
ftdsio chip, we can't choose the VID/PID…
I need to catch the right tty port, and be sure to handle
Oh, I know how to do it with bash and udev, but a single binary would fit best.


Kévin Raymond

More information about the Server-devel mailing list