Announcement

Collapse
No announcement yet.

How to handle a pulse on a 12V line?

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

  • How to handle a pulse on a 12V line?

    I am now on to handling the dimmer control within the car which is described as pulse modulation.

    Basically, it switches the 12V on and off very quickly to control how bright the dash LEDs are. I need to measure this speed so that I can detect the 5 or 6 rates/frequencies that are in use and translate them into a brightness setting on the screen.

    Is this handled by the frequency board?
    Can it be done and how?

  • #2
    It is not a frequency. It is a "duty cycle" - the proportion of ON time to total (on+off) time.
    The frequency is usually constant (from a few hundred Hertz to thousands or millions of Hz).

    The %dimming = %duty-cycle (as a general rule - eg, LEDs, incandescents etc).
    EG - if you want 20% brightness, set the PWM to 20% duty cycle.

    Comment


    • #3
      and how do I measure that using a FusionBrain v4 ?

      Comment


      • #4
        I'd question why you want to measure it instead of reading off the source?


        But to read by any uPC, you need to measure on versus off time.
        Best is probably using +ve edge & -ve edge detection which each start and end a counter. Otherwise you have to poll...

        Comment


        • #5
          I wanted to measure it so that I can control the brightness of the display on the carpc. Sounds like this is beyond the FB so I'll drop it. Shame, as that's the first compromise I have had to make.

          Comment


          • #6
            You can do this really easily; do you have a spare ADC input on the FB?
            Palm sized ainol MiniPC, 8" Transreflective PRO, Win10, Reverse camera, Dual 10HZ GPS RX's for Speed Display & Sat Nav, FM-DAB & Phone Modules, iDrive interface. T-Screen HVAC control, custom microcontrollers, microcode and FE.

            Comment


            • #7
              Originally posted by Petrie View Post
              I wanted to measure it so that I can control the brightness of the display on the carpc. Sounds like this is beyond the FB so I'll drop it. Shame, as that's the first compromise I have had to make.
              Originally posted by Mickz View Post
              You can do this really easily; do you have a spare ADC input on the FB?
              +1

              The basic implementation of a DAC (Digital Analogue Converter) is exactly that. Run the PWM signal through a capacitor to ground. The capacitor "smooths" out the PWM signal. If it is on 10% of the time then if perfectly smoothed you would get a signal that is 10% of the supply. So a 12v PWM signal at 10% duty cycle perfectly smoothed would be 1.2v. 50% duty cycle perfectly smoothed would be 6v. You have to make compromises on how much smoothing you want. The more capacitance, the slower the reaction. Slower to charge, slower to discharge. Since the dimming doesn't change often, this isn't too much of a worry.

              But basically it can be done really easily with 1 capacitor 1 resistor and perhaps 1 more resistor to make a voltage divider depending on the source circuit.
              Fusion Brain Version 6 Released!
              1.9in x 2.9in -- 47mm x 73mm
              30 Digital Outputs -- Directly drive a relay
              15 Analogue Inputs -- Read sensors like temperature, light, distance, acceleration, and more
              Buy now in the MP3Car.com Store

              Comment


              • #8
                Ok. This is good news. I'm not toally sure yet exactly what you mean but am keen to learn.

                The wiring harness just shows that I have two wires + & -.
                I assume that the stock radio was powering the + line with a voltage just like it did for the steering wheel controls.

                Here's what I found in the wiring manual...

                Click image for larger version

Name:	dim.png
Views:	1
Size:	7.0 KB
ID:	2281663

                Comment


                • #9
                  PHEW! Thanks Mickz & Toaster - I was gonna say the FB could...


                  But Petrie, there are many methods. I only explained one - a purely "digital" solution.

                  But add analog filtering - eg, a voltage divider with cap as 2k1Toaster wrote above - is another...


                  Now for Mickz & 2k1, since the PWM input SUPPLY voltage can vary, can the ADC reference voltage be taken off another voltage divider? That means the system voltage is irrelevant (ie, whether 50% at 12V or 14.2V and hence filtered as 6.0V or 7.2V, but they are both 50% PWM Duty Cycle).
                  But if the PWM is off a regulated supply (5V, 8V etc; but not the old "flasher can" mechanical voltage regulators {aka digital}), the above is irrelevant.

                  Comment


                  • #10
                    Originally posted by OldSpark View Post
                    PHEW! Thanks Mickz & Toaster - I was gonna say the FB could...


                    But Petrie, there are many methods. I only explained one - a purely "digital" solution.

                    But add analog filtering - eg, a voltage divider with cap as 2k1Toaster wrote above - is another...


                    Now for Mickz & 2k1, since the PWM input SUPPLY voltage can vary, can the ADC reference voltage be taken off another voltage divider? That means the system voltage is irrelevant (ie, whether 50% at 12V or 14.2V and hence filtered as 6.0V or 7.2V, but they are both 50% PWM Duty Cycle).
                    But if the PWM is off a regulated supply (5V, 8V etc; but not the old "flasher can" mechanical voltage regulators {aka digital}), the above is irrelevant.
                    A 12v 50% signal through a dimmer circuit will be less luminous than a 13.8v 50% signal through a dimmer circuit. So if the goal is to measure how bright, not what the duty cycle is, then that should work.
                    Fusion Brain Version 6 Released!
                    1.9in x 2.9in -- 47mm x 73mm
                    30 Digital Outputs -- Directly drive a relay
                    15 Analogue Inputs -- Read sensors like temperature, light, distance, acceleration, and more
                    Buy now in the MP3Car.com Store

                    Comment


                    • #11
                      Correct! I was fixated on reading the PWM (duty cycle). You are measuring brightness.


                      (Maybe not that badly...)

                      Comment


                      • #12
                        The switch has steps. Something like 5 or 6 positions. All I need to know is what's the value (or range) for each position.

                        As I am out of cables for now I'll have to wait on the mp3 store to send some more. The Brain is now solidly inside the double DIN case so not readily available for testing.

                        Comment

                        Working...
                        X