This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
projects:sysmon [2016-01-24 13:33] robert [Introduction] |
projects:sysmon [2016-02-03 11:34] (current) admin |
||
---|---|---|---|
Line 16: | Line 16: | ||
==== Circuit and Components ==== | ==== Circuit and Components ==== | ||
The system monitor is built around a [[http://www.microchip.com/wwwproducts/Devices.aspx?product=PIC16F1455|PIC16F1455]] - a 14-pin microcontroller with a USB device peripheral and two PWM channels, which is exactly what is needed for this application. | The system monitor is built around a [[http://www.microchip.com/wwwproducts/Devices.aspx?product=PIC16F1455|PIC16F1455]] - a 14-pin microcontroller with a USB device peripheral and two PWM channels, which is exactly what is needed for this application. | ||
+ | |||
+ | {{ :projects:sysmon.png?direct&600 |}} | ||
+ | <WRAP centeralign> | ||
+ | //Schematic of the system monitor.// | ||
+ | </WRAP> | ||
The two PWM outputs of the PIC are used to drive the meters. In order to get a nice DC voltage for driving the meters, the PWM is first passed through as simple RC lowpass. Because the RC time constant is quite slow (~300ms), the response of the meters is also slowed sown a little, which I find visually more pleasing than an instant response. This DC voltage is then buffered by a LM324, and applied to the meter through a series resistor. The purpose of the series resistor is to scale the 0-3.3V range of the PWM output to the 0-100mV range of the meter. | The two PWM outputs of the PIC are used to drive the meters. In order to get a nice DC voltage for driving the meters, the PWM is first passed through as simple RC lowpass. Because the RC time constant is quite slow (~300ms), the response of the meters is also slowed sown a little, which I find visually more pleasing than an instant response. This DC voltage is then buffered by a LM324, and applied to the meter through a series resistor. The purpose of the series resistor is to scale the 0-3.3V range of the PWM output to the 0-100mV range of the meter. | ||
Line 24: | Line 29: | ||
Apart from that, there is not much else to the circuit: A LED shows the USB status, and several headers on the board provide for USB, ICSP and meter connections. The USB connector on the outside of the case is a [[http://www.farnell.com/datasheets/1699375.pdf|Bulgin PX0443]] Mini-USB to Molex KK assembly. | Apart from that, there is not much else to the circuit: A LED shows the USB status, and several headers on the board provide for USB, ICSP and meter connections. The USB connector on the outside of the case is a [[http://www.farnell.com/datasheets/1699375.pdf|Bulgin PX0443]] Mini-USB to Molex KK assembly. | ||
- | ==== Firmware ==== | + | ==== Firmware and PC Software ==== |
- | + | ||
- | ==== PC Software ==== | + | |
The system monitor hardware is simply a box with two panel meters that shows values sent via USB. All the magic that turns it into a system load monitor is in the Python script that controls it. | The system monitor hardware is simply a box with two panel meters that shows values sent via USB. All the magic that turns it into a system load monitor is in the Python script that controls it. | ||
- | I believe the software is pretty self-explanatory: It uses [[https://pypi.python.org/pypi/psutil|psutil]] to get the system information and sends it out to a specified (virtual) serial port. Since the firmware uses custom manufacturer and device ID strings, it is possible for the script to auto-detect the system monitor under Linux. Annoyingly, this doesn't work under Windows, because Windows insists on reading these strings from the INF file that's needed to install the driver. Since the firmware still uses the Microchip CDC demo VID and PID, Windows will only ever see the ID strings provided in Microchip's signed INF file. | + | I believe the PC software is pretty self-explanatory: It uses [[https://pypi.python.org/pypi/psutil|psutil]] to get the system information and sends it out to a specified (virtual) serial port. Since the firmware uses custom manufacturer and device ID strings, it is possible for the script to auto-detect the system monitor under Linux. Annoyingly, this doesn't work under Windows, because Windows insists on an INF file from which it reads the device ID strings (despite it being a CDC device). The whole trouble of a custom VID and PID and getting a signed INF is just not worth it, but I might look into a more active way of identifying the system monitor (''*IDN?'', anyone?) |
+ | |||
+ | The firmware running on the PIC is a very slight modification of Microchip's CDC demo project, which accepts messages containing numeric values and sets the PWM outputs accordingly. Again, it should be pretty self-explanatory once you take away the code that implements the CDC device. | ||
+ | |||
+ | The GitHub repo containing the firmware and PC software is located [[https://github.com/kitsune-denshi/sysmon|here]] | ||
+ | |||
+ | ====Pictures==== | ||
+ | {{ :projects:sysmon-inside.jpg?direct&400 |}} | ||
+ | <WRAP centeralign> | ||
+ | //Not a whole lot of room in the box, thanks to the meters.// | ||
+ | </WRAP> | ||
+ | |||
+ | {{ :projects:sysmon-board-top.jpg?direct&400 |}} | ||
+ | <WRAP centeralign> | ||
+ | //Looks like there is plenty of room on the board...// | ||
+ | </WRAP> | ||
+ | |||
+ | {{ :projects:sysmon-board-bottom.jpg?direct&400 |}} | ||
+ | <WRAP centeralign> | ||
+ | //...if it weren't for those connector on the bottom.// | ||
+ | </WRAP> |