Announcement

Collapse
No announcement yet.

Modular Shutdown Controller with USB Interface

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Modular Shutdown Controller with USB Interface

    First off, I am primarily documenting this project on my website at:
    http://eegeek.net/content/view/40/32/
    So, there may be better (or at least more concise) information there.

    This project is the next revision of my original shutdown controller. It's been in the works for quite a few months now, primarily due to the very long, steep learning curve associated with interfacing USB on a PIC microcontroller.

    The central premise of this project is that the SDC has all of the 'traditional' SDC features, but adds two important factors: USB interface, and a modular architecture.

    USB Interface: This serves several important purposes.
    -The most important purpose is that it gives the SDC an unprecedented level of control over the power state of the PC. 'Regular' SDC's use the PC's power button only and as such have limited control over power states. With the USB interface, the SDC can order the PC into any power state through software(standby, hibernate, shutdown). The most interesting application (IMHO) is that the PC can be placed into standby, and if left alone for too long, booted back up, and then put into hibernate.
    -The USB interface also provides interface opportunities - allowing settings to be viewed and changed through a software interface, as well as monitoring voltages/temperatures, perhaps controlling some auxiliary outputs, etc. All my interfacing has been in C# .NET 2.0 and in the end should be compatible with other languages via a DLL or similar.
    -The USB interface also allows a bootloader to be used, allowing firmware to be easily updated through software without a programmer or any other hardware required.

    Of course, as a failsafe, the SDC is designed to operate just fine as a traditional SDC when the USB interface is not available (cable unplugged, software crashes, etc)

    Modular Architecture:
    The main idea here is that although it would be convenient to have some simple hardware control over the SDC (LCD display/LEDs, buttons, etc), shutdown controllers are typically hidden away in the trunk, under a seat, or other inaccessible areas, and having to run a bunch of wires to mount these remotely would not be ideal. By using a second board with another microcontroller, which communicates with the main SDC board with a type of serial interface (I2C), all of the user-interface functionality can easily be mounted in a convenient location, while keeping the SDC itself in the PC where it belongs - and it only means running a small cable of 3-4 conductors (such as cheap telephone cable)
    This also means that different user-interface boards could be used depending on the desired level of control - from complex, to simple, or none at all.

    General Features - (This is a list adapted from my website, from the above link)

    In addition to the features afforded by the USB interface, a list of the general features I am planning on:

    * Configurable modes, from basic timed power-down, to multi-step sequenced shutdown involving multiple power modes
    * Configurable delay times, allowing flexible control of power use
    * Voltage monitoring, including configurable warning/alarm thresholds where the system can be automatically powered down for safety
    * Temperature monitoring, on-board and optionally remote sensors, also including similar protection modes as for voltage
    * Auxiliary output(s), configurable with certain delays to control additional devices during startup/shutdown, such as amplifiers for anti-thump
    * Status LEDs on-board, providing basic status information, particularly for debugging purposes during setup
    * Fused Input, reverse-voltage, and over-voltage protection
    * Connector to allow manual use of existing PC power button as well


    Additional features which I plan to implement (most likely on the auxiliary board):

    * Stay-On button, for those instances where you just need to shut off your car for a couple of minutes and would rather your PC stayed on, such as while pumping gas or visiting a convenience store. Configurable timeout as a backup.
    * Stay-Off (Valet) switch, for when you want your PC to remain off even with the car running, such as when it's with a valet, or in the shop, or being borrowed by a friend. This switch could be in a hidden location, or use a switch requiring a key, for security.
    * Emergency-Off button, just in case. This would be to immediately kill the power, no shutdown procedure involved.
    * Reset button (to reset the PC), just in case.
    * Status LEDs
    * LCD display


    A basic, preliminary block diagram.

    A picture of the current state of the project. A bit of a mess, with the in-circuit debugger and logic analyzer in there...

    Currently, quite a large chunk of the important functionality is working - USB (plus software interface), I2C, LCD, state-machine cycling through power states, etc.
    I've got printed circuit board layouts designed for both boards, and will be etching and building cleaner prototypes once I finish adding the most important circuitry.
    Since all the foundational functionality is operational, my primary focus at the moment is the real grunt work - setting up menu systems on the LCD, cleaning up the software to a more useful state, streamlining the interface between PC, SDC, and auxiliary board for viewing and changing settings, etc... In other words, getting it out of the "purely developmental" stage and into the "useful prototype" stage.

    Down the road, I do fully intend to streamline the whole PC-side SDC interface to a DLL that can be implemented in other applications - but that will have to wait until the interface is in a more finalized state.

    Anyway - any questions/feedback/etc appreciated - I'll keep adding info as I make more progress (and find time)
    But don't take it from me! here's a quote from a real, live newbie:
    Originally posted by Viscouse
    I am learning buttloads just by searching on this forum. I've learned 2 big things so far: 1-it's been done before, and 2-if it hasn't, there is a way to do it.
    eegeek.net

  • #2
    Im definitely very interested in this... Keep up the good work
    "Mess with the best, die like the rest."
    Work Log --> Old Car (Totaled)
    Work Log v2 --> New Car (Totaled)
    Work Log v3 --> GMC Suburban K2500 (Engine died)
    Work Log v4.5 --> 05 Toyota Tundra DC SR5

    Comment


    • #3
      This is exactly what I was going for as far as functionality, looks like you are further on your way. Your issues with PC to PIC communication is just what I have jumped into. After reading through your website documentation just now I really gotta give you props for your progress and effort.

      Nice hackaday entry, I debated for awhile whether or not to jump into that at the last minute, I was going to do a surface mounted SSC like I made. Just didn't have time. I love that site, it started me on microcontrollers and electronics in general.....

      I like your fab style too.....
      May all your dreams come true.....unless your dreams are nightmares ~ L.S.

      http://www.mp3car.com/vbulletin/showthread.php?t=67759

      Comment


      • #4
        Thanks for the interest. The USB interfacing really has been a ton of work, but it has been fun and if nothing else, has been worth it for the experience.

        I'm really looking forward to getting the rest of the essential circuitry in there so I can get everything on PCB's - I hope to do it by this weekend. It should be much nicer to look at after that.

        Yeah, Luwe, I love hackaday too... though I'm anxious to see the results of the design contest, as it's been over a month since the entry deadline...
        But don't take it from me! here's a quote from a real, live newbie:
        Originally posted by Viscouse
        I am learning buttloads just by searching on this forum. I've learned 2 big things so far: 1-it's been done before, and 2-if it hasn't, there is a way to do it.
        eegeek.net

        Comment


        • #5
          wow, that hackaday site is pretty cool, haven't seen that before...

          this looks cool, nice work so far & a great idea
          MY NEWEST INSTALL:modded infiniti fx with big screen

          first windows carpc install........my liquid cooled LVDS screen :D

          Comment


          • #6
            Very interesting project. I was having somethig similar on my maind for some time, but no knowledge. I will be watching.

            You could monitor temp and if it is too high or too low you could postpone the booting of PC.

            Comment


            • #7
              Originally posted by stric View Post
              You could monitor temp and if it is too high or too low you could postpone the booting of PC.
              Yep, that's one of the things I was planning on - one on-board temp sensor and possibly one remote temp sensor - both for general-purpose monitoring, and keeping the PC within safe temp limits.

              My website article had a list of the general features, such as this one, that I plan to implement - I've updated my original post to include it.

              On another note, the PCB layouts are coming along. Today I etched the auxiliary board, which was the biggest mess in my initial breadboarded setup. I don't plan to etch the main SDC board until I finish adding more of the desired features; it would be a bit of a waste to just have to etch a new one soon after.

              There's a header for in-circuit programming/debugging, a header for 3 external menu buttons, a connector for I2C, and a bunch of free holes for prototyping on the remaining free pins.
              But don't take it from me! here's a quote from a real, live newbie:
              Originally posted by Viscouse
              I am learning buttloads just by searching on this forum. I've learned 2 big things so far: 1-it's been done before, and 2-if it hasn't, there is a way to do it.
              eegeek.net

              Comment


              • #8
                Hey maybe you could triger some event if temp is not "safe". Like if it is to hot just start some vents (or what ever is there to cool down the PC).
                And when you come home once a week or month you could start antivisrus scaning (I mean computer would do this) and tell the SDC to wait and not shut down yet. So scaning would be done when you are not using your carPC.
                Very nice evandude

                Comment


                • #9
                  Evandude

                  Nice work you got there, keep it up. I have some nice features on my old (very old dating back in 2004 I think) SDC design that you might wanna add on yours.

                  Mainly those are the aditional trigger inputs which alot may find useful.

                  Door lock trigger - this can startup and shutdown the PC if the central locking is open or closed. The startup and shutdown time delay can be adjusted.

                  Remote trigger - this startup or shutdown the PC immediately via the car alarm auxilliary button. Useful for turning on/off the PC while updating files through the wireless connection. Cell phone trigger can also be used for this.

                  Car alarm trigger - this startup or shutdown the PC when the car alarm is activated or off.

                  Of course all those have startup and shutdown delays as well as priority. For example, a door or ignition triggered shutdown will be overide by the remote shutdown. A low battery or overheating will initiate an immediate shutdown or terminate any pending startup triggered by any one of those inputs.

                  Its been a while since I designed mine and cant even remember what other funky stuff it can do. But like I mentioned in the other thread you may want to add a watchdog timer. A little apps giving a heartbeat pulse, monitored by the SDC, if that SDC cannot find this hearbeat due to a locked up OS then it will do a proper shutdown, if still no reponse then a hard reset is performed on the PC.

                  It sometmes worry me giving out design ideas, had a commercial seller who copied and call it their own and even put trademark name, what a joke some of these guys.

                  Anyway good luck with your SDC, unfortunately Im not as active with my electronics these days due to work and life changes so I cant help much. But any qs, no worries Ill try my best

                  Comment


                  • #10
                    Thanks for the advice, Chris31. It's good to hear from people with different ideas of what would make useful features, because everyone's setup is different, and things like you just mentioned are things I may not have even thought of.

                    I'm trying to make the SDC relatively easily accessible for programmers on the PC side, without them having to delve into the USB-related details which can be a bit hairy. I've been working more on encapsulating all the functionality into a single class, with the intent of eventually making it into a DLL. Again, I'm working in C# .NET 2.0. I would appreciate if any of you more experienced programmers could offer some advice on what you'd like to see on the PC interface side.
                    But don't take it from me! here's a quote from a real, live newbie:
                    Originally posted by Viscouse
                    I am learning buttloads just by searching on this forum. I've learned 2 big things so far: 1-it's been done before, and 2-if it hasn't, there is a way to do it.
                    eegeek.net

                    Comment


                    • #11
                      Just having one negative trigger button that can handle car volts works for the door unlock or car alarm aux output as well as a normal button. Did that on mine, but I like knowing what triggered it too. The heartbeat is useful, but should be enabled by the software just in case you have to reinstall windows or something and the software side can't be run.

                      I could tell you a lot about USB and standby. The computer may or may not keep USB power on depending on how it's configured so using that to determine if it's on can be a problem. Oh it also helps to have something to turn the monitor on/off, amp remote like you have and external USB power or other POL.

                      Comment


                      • #12
                        Well, just a little update, I'm still quite active with this project, just haven't had much 'eye candy' to share, as I've been working entirely on the software/firmware side of things. Multi-threaded C# software communicating through a C++ DLL via USB to the SDC board, which runs firmware in C and (among many other things) communicates via I2C to the auxiliary board, which runs firmware in C (using a different C compiler, naturally), and handles the LCD. As you might imagine, it's been a headache, to say the least.
                        But, things are coming along very well - I'll probably post up a screenshot of the current software soon, once I clean things up a bit.

                        I'm definitely looking forward to diving back into the more fun and 'glamorous' hardware side of things, and will probably be throwing the main SDC board onto a PCB before long.
                        But don't take it from me! here's a quote from a real, live newbie:
                        Originally posted by Viscouse
                        I am learning buttloads just by searching on this forum. I've learned 2 big things so far: 1-it's been done before, and 2-if it hasn't, there is a way to do it.
                        eegeek.net

                        Comment

                        Working...
                        X