Running a microcontroller in car - power supply aspects

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • stj
    Great Sage 齊天大聖
    • Dec 2009
    • 30906
    • Albion

    #121
    Re: Running a microcontroller in car - power supply aspects

    lol
    i'v seen an arduino power-up and run through it's own pullup resistors/protection diodes.

    Comment

    • Dannyx
      CertifiedAxhole
      • Aug 2016
      • 3912
      • Romania

      #122
      Re: Running a microcontroller in car - power supply aspects

      The power LED glows faintly on the Mini even with no power connected to the VCC pin, if a CH341 programmer is attached and plugged into an USB port. I ran into this issue a couple of times when I was playing around with this project and thought it died because the code would not upload, but then noticed the 5v power brick was not connected to my breadboard
      Wattevah...

      Comment

      • Curious.George
        Badcaps Legend
        • Nov 2011
        • 2305
        • Unknown

        #123
        Re: Running a microcontroller in car - power supply aspects

        Originally posted by stj
        lol
        i'v seen an arduino power-up and run through it's own pullup resistors/protection diodes.
        Yes, but very low power devices are now commonplace. In the 70's, they weren't. You burned power to do damn near anything! A dinky little 1702 (256x8 EPROM) consumed 300mW! The idea that a "signal" could power a circuit was (obviously) anathema to us.

        Comment

        • Dannyx
          CertifiedAxhole
          • Aug 2016
          • 3912
          • Romania

          #124
          Re: Running a microcontroller in car - power supply aspects

          Progress

          It works and draws 4mA without the Arduino plugged into the headers and without the current sensors (wanted to make sure it actually generates 5v there before I plug anything in...come to think of it, I should probably make the current sensors removable too...

          Back to the bench now
          Attached Files
          Wattevah...

          Comment

          • redwire
            Badcaps Legend
            • Dec 2010
            • 3900
            • Canada

            #125
            Re: Running a microcontroller in car - power supply aspects

            With no MCU, 4mA drain seems a bit odd? LP2951 uses 0.1mA and I did not see anything else in your circuit using current.

            Comment

            • Dannyx
              CertifiedAxhole
              • Aug 2016
              • 3912
              • Romania

              #126
              Re: Running a microcontroller in car - power supply aspects

              Originally posted by redwire
              With no MCU, 4mA drain seems a bit odd? LP2951 uses 0.1mA and I did not see anything else in your circuit using current.
              Caps perhaps ? Maybe some leakage on those diodes and optocouplers ? It'd sure be great if I could trim down the power draw even more...
              Wattevah...

              Comment

              • redwire
                Badcaps Legend
                • Dec 2010
                • 3900
                • Canada

                #127
                Re: Running a microcontroller in car - power supply aspects

                It just seems weird, I would go after it because it's high.
                You can try pull IC's out of their sockets and see if that narrows it down? But remember the cap has a charge before putting the IC back in. The diode under the Arduino, if it's 5.1V zener maybe or the tantalum is leaky?
                The big 680uF cap would have mA leakage if it's a CapXon lol.

                Comment

                • Dannyx
                  CertifiedAxhole
                  • Aug 2016
                  • 3912
                  • Romania

                  #128
                  Re: Running a microcontroller in car - power supply aspects

                  Originally posted by redwire
                  The diode under the Arduino, if it's 5.1V zener maybe or the tantalum is leaky?
                  The diode is indeed 5.1v, though the voltage across it (the VCC of the Arduino) is 5v exactly and I heard zeners actually take a bit more than their nominal value to break down and start conducting. I could try pulling it off to see if it makes a difference, though it's soldered in really well...it will be a nightmare to do. Same goes for all the other non-socketed parts thanks to my "patented" method of bending the leads to form tracks - it's one of the huge downfalls of this idea >_>

                  Originally posted by redwire
                  The big 680uF cap would have mA leakage if it's a CapXon lol.
                  It's a 1000uF Samwha WL series, now that you mention it...not sure what to say about it. I read it's slightly "over" the RD series, but inferior to the WF series, if this is at all correct or relevant...
                  Wattevah...

                  Comment

                  • redwire
                    Badcaps Legend
                    • Dec 2010
                    • 3900
                    • Canada

                    #129
                    Re: Running a microcontroller in car - power supply aspects

                    Just try pull the Vreg IC out of the socket, then you can see if it is ahaed or after, the current drain.
                    I find chinese electrolytics have high leakage currents.

                    Comment

                    • Dannyx
                      CertifiedAxhole
                      • Aug 2016
                      • 3912
                      • Romania

                      #130
                      Re: Running a microcontroller in car - power supply aspects

                      Originally posted by redwire
                      Just try pull the Vreg IC out of the socket, then you can see if it is ahaed or after, the current drain.
                      I find chinese electrolytics have high leakage currents.
                      I'll remove the IC and supply 5v directly with an adapter or something and measure the current draw on that. It'd be great if it's just the cap, since I can easily remove it and replace it (hopefully with something better quality)....
                      Wattevah...

                      Comment

                      • stj
                        Great Sage 齊天大聖
                        • Dec 2009
                        • 30906
                        • Albion

                        #131
                        Re: Running a microcontroller in car - power supply aspects

                        it's probably going through the pullup-resistors

                        Comment

                        • Dannyx
                          CertifiedAxhole
                          • Aug 2016
                          • 3912
                          • Romania

                          #132
                          Re: Running a microcontroller in car - power supply aspects

                          Originally posted by stj
                          it's probably going through the pullup-resistors
                          Yes, but they aren't connected to the Arduino ATM (because it's not inserted)...unless the optocoupler + the ceramic cap has leakage, which is to be expected...
                          Last edited by Dannyx; 05-09-2020, 03:40 AM.
                          Wattevah...

                          Comment

                          • Dannyx
                            CertifiedAxhole
                            • Aug 2016
                            • 3912
                            • Romania

                            #133
                            Re: Running a microcontroller in car - power supply aspects

                            I came up with an idea to try and track down the part that's drawing spurious current without having to tear the traces apart: I started by removing the IC and optocouplers from their sockets, since it was the easiest thing to do. I then supplied 5v to the "regulated" output of the IC from an external PSU and measured the current draw on that - 4mA are still there, so it's not the IC, nor something on the 12v side.

                            I then tried out each type of component individually with the power supply, by using an identical one from my parts bin and placing it in series with the bench supply and my ammeter, including the three types of caps and the 5.1v zener diode. None drew any current at all. The zener diode starts breaking down at around 5.5v, as a side note, which is great news because that's the maximum the Arduino's VCC pin can take.

                            I then supplied 5v after those pull-up resistors, to confirm whether it's those ceramic caps that draw current, since they were the only part remaining on the board, but no they're not: I get no current draw here at all ! With all said and done, my money is on the small 10uF electrolytic or tantalum cap on the 5v rail (on the output pin of the IC), although I tested these individually and neither drew any current at all ! I must admit the idea of placing two types of caps of the same value (10uF) on the output of the IC is an undocumented/unfounded idea of mine that I came up with on my own, fearing a single electrolytic may fail due to the hot environment and result in the output overshooting (having seen what the IC does with NO cap at all >> 10v on the output !), so the more professional folks out there may be quick to pan this, but hey - learning
                            Wattevah...

                            Comment

                            • Dannyx
                              CertifiedAxhole
                              • Aug 2016
                              • 3912
                              • Romania

                              #134
                              Re: Running a microcontroller in car - power supply aspects

                              Sorted. It turns out the zener diode ZD7 was clamping too low for some reason, causing excess current drain. I removed it and replaced it and it's now working as it should

                              I also installed the polyfuse, so this whole thing is ready to be tested on the car now
                              Attached Files
                              Wattevah...

                              Comment

                              • redwire
                                Badcaps Legend
                                • Dec 2010
                                • 3900
                                • Canada

                                #135
                                Re: Running a microcontroller in car - power supply aspects

                                Ahhh much better current drain You need that extra 4mA for the MCU

                                I made a car key-off timer with ATtiny85 with LP2951, to charge phone or listen to stereo for 3hrs if you push a button or key-off. If I stall and restart my engine, it would always reboot the stereo (which takes a long time) so I wanted a battery-power feed to stop that. IGN wire always cuts out when you crank.

                                What I do is wake up the MCU when the ignition key goes on, and after, I wait 30 seconds and put the MCU to sleep. This saved a lot of current. The A/D I don't use but that section draws a lot of current so I switch it off.
                                MCU running at 1MHz (A/D off) it was 2mA (plus LED) and going to sleep 0.02mA plus the LP2951, which gives 0.12mA when sleeping. I mention it because it could be something to consider adding to your code, the sleep function. Or shutting off the A/D and Hall sensors when you are not using them.
                                But maybe your current drain numbers will be good enough. Just giving ideas.

                                Comment

                                • Dannyx
                                  CertifiedAxhole
                                  • Aug 2016
                                  • 3912
                                  • Romania

                                  #136
                                  Re: Running a microcontroller in car - power supply aspects

                                  I'm planning on using the sleep feature as well. This thing is listening for a lock/unlock signal and acting accordingly, so why not have the MCU sleep when it's doing nothing ? I hope it can be done, that is, "wake" the MCU when one of its pins acts (car is locked/unlocked).
                                  Wattevah...

                                  Comment

                                  • stj
                                    Great Sage 齊天大聖
                                    • Dec 2009
                                    • 30906
                                    • Albion

                                    #137
                                    Re: Running a microcontroller in car - power supply aspects

                                    it's in the cpu, not sure if arduino language has it - but it probably does.
                                    or just hit the registers directly to lower the clock or shutdown sections of the chip

                                    Comment

                                    • redwire
                                      Badcaps Legend
                                      • Dec 2010
                                      • 3900
                                      • Canada

                                      #138
                                      Re: Running a microcontroller in car - power supply aspects

                                      Here are snippets of my Arduino code. There is an AVR sleep library.
                                      First, I have a pin change interrupt (on IGN and pushbutton input) to allow wakeup even though the MCU is asleep.

                                      To go to sleep, I shut off the A/D and analog comparator to save power, and enable the pin change interrupt.

                                      Code:
                                      #include <avr/sleep.h>
                                      // these snippets for ATtiny85
                                      
                                      //------------------------------------------------------------------------
                                      ISR(PCINT0_vect) { // Pin Change Interrupt
                                      // GIFR automatically cleared here; hope timers don't use them
                                      // clear the pin change interrupts and turn them off
                                      // good to wake and run now; or no change during normal interrupt
                                      
                                       GIMSK &= (0 << PCIE); // no more Pin Change interrupts; mask them off
                                       sleep_disable(); // now that we've woken up, stay up; 
                                       DEBUG_PRINTLN("**int WAKE ***");
                                       state=sWAKE_FROM_SLEEP; // duplicate - in case we (return) wake up in lala land
                                      }
                                      
                                      //------------------------------------------------------------------------
                                      void SleepSession(void) {
                                        
                                       // configure and enter sleep mode, only pin change interrupt (ign switch or pushbutton press) wakes us
                                       ADCSRA &= ~_BV(ADEN); // disable ADC and save power ~0.3mA at 5V; _BV is a macro
                                       // not sure if BOD (fuse) is used, analog comparator if used may need to disconnect too to save power.
                                      
                                       // config pin change interrupts 
                                       cli(); // disable global interrupts as we are reconfiguring them
                                       PCMSK = 0b00011000;  // unmask pin change interrupts on pins PB3, PB4- the switch inputs
                                       GIMSK |= (1 << PCIE); // unmask Pin Change interrupts; Interrupt source
                                       // not sure if timer interrupts happen on Arduino with Attiny85, leave otehrs alone
                                      
                                       set_sleep_mode(SLEEP_MODE_PWR_DOWN);
                                       sleep_enable();
                                       sei();         // re-enable global interrupts, sleep is set up now
                                       sleep_cpu(); // go to sleep
                                       
                                       //---------------------- W A K E ---------
                                       /* Upon waking, the program will continue from here. */
                                       state=sWAKE_FROM_SLEEP; // ensure we go to the correct next state
                                      }
                                      //------------------------------------------------------------------------

                                      Comment

                                      • Dannyx
                                        CertifiedAxhole
                                        • Aug 2016
                                        • 3912
                                        • Romania

                                        #139
                                        Re: Running a microcontroller in car - power supply aspects

                                        Looks awfully complex...haven't looked into it yet, so maybe I'll pull it off...registers and in-depth stuff go a bit over my head
                                        Wattevah...

                                        Comment

                                        • redwire
                                          Badcaps Legend
                                          • Dec 2010
                                          • 3900
                                          • Canada

                                          #140
                                          Re: Running a microcontroller in car - power supply aspects

                                          It is easier to write software by breaking it down into little pieces. You can write out pseudo-code as it is called, just to nail down the big picture.
                                          Then, you drill down into each piece, and do the hard work of coding a little chunk at a time. (in all truth, I only use 'state-machine' code for all Arduino projects now, it's what the pro's use, so much less pain)

                                          Comment

                                          Related Topics

                                          Collapse

                                          • CG2
                                            Meaco Arete One / Deye Dehumidifier not working
                                            by CG2
                                            I've got a dehumidifier that has stopped working. Plug it in, press the power switch, and it beeps 5 times. Nothing showing in the display (which is just two 7 segment displays) apart from the two decimal points flashing. The model is a MeacoDry Arete One 18L, which seems to be a rebadged Deye (all the boards are marked Deye). Here's what I've got so far (details in case anyone else in future should need them).

                                            Starting with the power board. Mains power comes in at the red connector top left. The compressor is powered by the orange connector to the right of that and is switched by...
                                            08-17-2024, 07:47 AM
                                          • Kambi13
                                            Samsung NP370E4K No backlight running on battery
                                            by Kambi13
                                            Hi all, need some help. I have a Samsung NP370E4K-KD2BR, which as a 5th Gen Intel CPU that works fine when running with the charger plugged in, but has soon as I remove it and it's running on battery the screen backlight goes off.

                                            Tried different battery - no change
                                            Tried different screen - no change

                                            Removed the plastic film from the screen inverter and looked for pwm signal which as about 3.3v when running with the charger plugged in, when I take it off the voltage drops down to 2.232v, so my best guess is that the EC is not providing the correct voltage....
                                            09-04-2023, 11:06 AM
                                          • Dannyx
                                            "Kinetic" 433Mhz transmitter/receiver discussion
                                            by Dannyx
                                            Good day folks.

                                            TL;DR: has anyone tried pairing one of THESE "kinetic" battery-less switches with THESE generic remote modules ?

                                            Details: I recently got hit by this craze of wanting to add remote controls to the lights around my house, so I went with those generic 433Mhz remote relay modules found everywhere, which are really basic, easy to use and work well, since I used them before in other projects. What I like most about them is they accept all kinds of 433Mhz remotes that float around Aliexpress, since they're all the same under the hood, save for the...
                                            03-08-2022, 11:01 AM
                                          • Skgod
                                            Asus Rog strix g15 g513ih hn0865 and it's having display issues while running on igpu
                                            by Skgod
                                            Hey I am having Asus Rog strix g15 g513ih hn0865 and it's having display issues while running on igpu. Works fine when I open any game or whatsapp windows application. The issues are :
                                            Black screen, freeze
                                            The weird thing is that when as long as the laptop is running on igpu the problem keeps happening. But as soon as I open any game or whatsapp windows application, the laptop works completely fine.
                                            When the screen freeze or black screen I used to move the display lid up and down and it usually works like that.
                                            So can anyone tell me what would be the possible cause?...
                                            10-16-2024, 08:11 PM
                                          • FALKLAN
                                            Running Line Voltage and Integrating LED Pods - Automotive
                                            by FALKLAN
                                            Howdy everyone! I hope all is well where ever you are!

                                            I'm attempting to integrate a couple of LED pods into an automotive reverse lamp circuit. The problem being, while the vehicle is running there is a 8.5v current present on the reverse lamp power wire. Needless to say is that all LED pods and lights dimly illuminate while the 8.5v is present, so the LEDs are always powered on while the vehicle is running. When the vehicle is shifted into reverse, the voltage changes to 12 volts.

                                            I am uncertain how to convert this line into a switched 12v output line for the LED pods....
                                            02-05-2025, 12:30 AM
                                          • Loading...
                                          • No more items.
                                          Working...