Announcement

Collapse
No announcement yet.

Arduino current sensing (in car)

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

    #21
    Re: Arduino current sensing (in car)

    Back on this project guys: I've been working hard on the code all this time and I'm half way there....as always, I exaggerated a bit by incorporating all sorts of other (useless?) features like rolling down both windows by double-unlocking the car...anyway.

    I've been thinking of how I'm going to interface the project with the with the rocker switches in the car. What would the best practice be for a project like this, or any project that involves buttons for that matter? Pull the pins high or low to "activate" them ? Up until now, I've been using pull-DOWN resistors on the breadboard, so the pins are LOW when they're "off" and a HIGH when they're "on". However, lately I began switching over to a pull-UP resistor instead, meaning the pin is high when NOT active and low when ACTIVE. I made the change after having a look around the internet and seeing many more schematics in this configurations rather than the one I was previously using with the pull-down resistors. It also allowed me to use a ceramic capacitor in parallel with the button, which is another thing I saw in most schematics involving buttons on microcontrollers, which is what I currently got going on myself and apparently reduces bounce....couldn't really notice bounce issues in practice, though bouncing undoubtedly occurs and it's going to get worse in the car with those big bulky rockers...might have to pull one out to see how it behaves in practice...again, no garage means a lot of the work has to be done beforehand on the bench so I can make it as plug and play as possible...

    As for interfacing a 12v system with a 5v system, there are many possibilities that I see here. One of them is to use a transistor between the arduino and the car, so when you press the rocker in one direction, 12v goes into the base of the transistor and it grounds a pin between C and E....sounds simple enough, though this could be wrong.

    The other method I see is to tap into the 5v output of the DC-DC converter I'll have to install no matter what to power the arduino and send THAT into the rockers instead of the car's 12v. Of course, the most skilled of you out there will immediately notice a caveat with this setup: a car's rocker switches normally ground BOTH the outputs which go to the motor in the door, so if you remember the active-low setup I was talking about earlier, it would mean the pins would be low all the time, which is not what we want. A hack would involve flipping the "power" and GND wires leading into the rocker switch so that VCC is present at the terminals when the button is not pressed instead of GND, which is not ideal for obvious safety reasons. A third method is to combine the two: send 5v into the rockers in place of the 12v and send that to the base of the transistor.....what do you guys think ? Cheers. This is definitely happening now - I'm in it now, no backing up
    Wattevah...

    Comment


      #22
      Re: Arduino current sensing (in car)

      i think the extra feature is good,
      next you tie it to the line between the stereo and the amp in the boot.
      that way you share your beats and reduce sound pressure in the cabin!

      Comment


        #23
        Re: Arduino current sensing (in car)

        next you tie it to the line between the stereo and the amp in the boot.
        that way you share your beats and reduce sound pressure in the cabin!
        Good idea, might do that

        Another question: does anyone know if the arduino returns NEGATIVE numbers in the following scenario ?

        Let me explain so any code-gurus out there can criticise me for doing it wrong It's about a countdown timer again.....we've been through this before. The code looks like this: millis()-X, where X represents a moment a button is pressed for instance. Ok, it's way more complex than that in my setup and it has all the necessary bits and pieces around it to actually function....which it does, but I'm worried about millis() eventually overflowing, in which case the result will return a negative number. Let's say it overflows at 60000 just for the sake of argument. If the last X was "snapped" at 59000, again, let's assume, since there's no way you'd nail it right on the edge like that in practice, that would give us 0 (millis has just rolled over now) - 59000 = -59000. Does that occur ? Do I get a negative number there ? I'm storing the result in a "long". It's important because the result is compared to a static number to determine if it's smaller and if it is it does some stuff, which works perfectly since millis is always higher than X, so I always get a positive result. Any negative result would be mathematically smaller than the fixed value I preset, until millis reaches the same value X was last left at, at which point it returns positive again....hope it's not too confusing Cheers.
        Wattevah...

        Comment


          #24
          Re: Arduino current sensing (in car)

          https://duckduckgo.com/?q=arduino+mi...=1&kh=1&ia=web

          Comment


            #25
            Re: Arduino current sensing (in car)

            An unsigned long seems to be the answer.
            Wattevah...

            Comment


              #26
              Re: Arduino current sensing (in car)

              I got my UT210E today, but it seems to lack one feature I've always wanted and haven't got on any of my meters so far and it's really a pet-peeve of mine: a max-hold function....sounds simple enough: it holds the maximum reading on the display, but no, it doesn't do that unfortunately :|
              Wattevah...

              Comment


                #27
                Re: Arduino current sensing (in car)

                the chipset supports it, you may be able to add an extra button or 2.
                Attached Files

                Comment


                  #28
                  Re: Arduino current sensing (in car)

                  Think I'll open a new thread for that...couldn't find anything on this particular hack.
                  Wattevah...

                  Comment


                    #29
                    Re: Arduino current sensing (in car)

                    that's because it's something usually only used on a handheld meter and not a clamp.

                    Comment


                      #30
                      Re: Arduino current sensing (in car)

                      The A and B versions of this meter do have that function, but they're AC only, which only makes me wonder why they didn't include it on the E model as well for DC amps....
                      Wattevah...

                      Comment


                        #31
                        Re: Arduino current sensing (in car)

                        i often wonder why they and other company's dont simply exploit every function in the chip.

                        look at that datasheet, serial transfer, min/max, loads of good shit!!!

                        Comment


                          #32
                          Re: Arduino current sensing (in car)

                          Had a look at that datasheet. There doesn't seem to be an awful lot on holding min/max readings

                          EDIT: oops, sorry, I was looking at THIS version all along which is shorter than the one you folks provided...
                          Last edited by Dannyx; 04-02-2018, 11:00 AM. Reason: Corrected mistake
                          Wattevah...

                          Comment


                            #33
                            Re: Arduino current sensing (in car)

                            Page 17 shows where that min/max button is, however I doubt simply connecting it will activate the function, given the chip probably doesn't know what to do when that button is pressed....if all it took was a button indeed, then that's some grade-A cheap-ass BS scam right there
                            Wattevah...

                            Comment


                              #34
                              Re: Arduino current sensing (in car)

                              you need the min/max button AND the RANGE button i think.
                              because the datasheet talks about putting it in and out of auto-range in relation to the min/max function.

                              btw, it has 99% chance of working, a russian guy added every button to an Aneng 8002 (same chip) and the only thing that didnt work was the serial transfer.

                              Comment


                                #35
                                Re: Arduino current sensing (in car)

                                Originally posted by Dannyx View Post
                                if all it took was a button indeed, then that's some grade-A cheap-ass BS scam right there
                                keep in mind, you have a 2000count meter, for 3times the price you could have the 6000count model.
                                yet the chip always supported 6000count, and now supports 10,000 count!

                                Comment


                                  #36
                                  Re: Arduino current sensing (in car)

                                  The range button already exists, so should I just go ahead and wire the min/max one as well ? What could possibly go wrong ? Bricking my brand new meter....so worth it
                                  Wattevah...

                                  Comment


                                    #37
                                    Re: Arduino current sensing (in car)

                                    the only way to brick it is to corrupt the eeprom,
                                    given the fact that you *will* want to patch it, you should make a backup before anything else.
                                    if you cant see the print, it's a 24c02

                                    Comment


                                      #38
                                      Re: Arduino current sensing (in car)

                                      When messing with EEPROMs I usually copy the original onto a blank chip and mess with that instead. That way I don't risk messing up the original one. Now about modifying it: not sure WHAT I'm changing though to achieve the desired effect I found some resources on the backlight timeout and auto power-down but nothing on the min/max thing...
                                      Wattevah...

                                      Comment


                                        #39
                                        Re: Arduino current sensing (in car)

                                        min/max is what it is, so nothing in the eeprom for it.

                                        here is my eeprom patching notes:
                                        make continuity>ohms instead of ohms>continuity
                                        8f = 09 (normally 07)
                                        9f = 07 (normally 09)


                                        make Vdc>Vac instead of Vac>Vdc
                                        8e = 05 (normally 04)
                                        9e = 04 (normally 05)

                                        make Vdc>Vac(with mv) instead of Vac>Vdc
                                        8e = 05 (normally 04)
                                        9e = 06 (normally 05)

                                        make Vac support mv (dont use with above patch)
                                        8e = 06 (normally 04)


                                        add NCV field level range
                                        9c = 02 (normally 00)
                                        ac = 1d (normally 00) < wtf?

                                        make 2A range dc>ac instead of ac>dc
                                        87 = 16 (normally 17)
                                        97 = 17 (normally 16)

                                        make 20A range dc>ac instead of ac>dc
                                        8b = 18 (normally 19)
                                        9b = 19 (normally 18)

                                        make 100A range dc>ac instead of ac>dc
                                        8d = 1a (normally 1b)
                                        9d = 1b (normally 1a)

                                        expand 100A range to 600A
                                        07 = 70 (normally e8)
                                        08 = 17 (normally 03)

                                        expand 100A range to 1000A - only DM1106 chip
                                        07 = 10 (normally e8)
                                        08 = 27 (normally 03)

                                        2A Dotless mode
                                        *Copy bytes from 50h and 51h (locations of 2A calibration data) to locations 56h and 57h (2000A/ dotless 2A calibration data).
                                        a7 = 1c (normally 00) - DCA 0000 in 2A mode / SELECT slot 3
                                        b7 = 1d (normally 00) - ACA 0000 in 2A mode / SELECT slot 4

                                        kill backlight timeout
                                        fc = 00 (normally 0f)

                                        make auto-poweroff 1hour
                                        fb = 3c (nomally 0f)

                                        make low battery shutdown 15seconds
                                        fd = 8f (normally 80)

                                        kill low battery shutdown
                                        fd = 80 (normally 80)

                                        Alarms
                                        For each of those, limit = value * 10V, ff to disable warning.
                                        16 = 3d(61) - "OL" limit for DCV. (10V units)
                                        17 = 3d(61) - "OL" limit for ACV. (10V units)
                                        18 = 3c(60) - Alarm/beep limit for DCV. (10V units)
                                        19 = 3c(60) - Alarm/beep limit for ACV. (10V units)
                                        1b = ff(dis) - mA range warning current. (100mA units)
                                        1c = 0a(10) - A range warning current. (1A units)

                                        make 6000 count
                                        10 = 70 (normally 70) default count:6000??? 2000>8000
                                        11 = 17 (normally 17)
                                        12 = 38 (normally 98) upper switch point 2200>6200
                                        13 = 18 (normally 08)
                                        14 = 44 (normally be) lower switch point 190>580
                                        15 = 02 (normally 00)

                                        make 10,000 count <<< only DM1106 chip, will fuck AC readings on DTM0660 chip
                                        10 = 10 (normally 70) default count:6000??? 2000>10000
                                        11 = 27 (normally 17)
                                        12 = d8 (normally 98) upper switch point 2200>10200
                                        13 = 27 (normally 08)
                                        14 = d4 (normally be) lower switch point 190>980
                                        15 = 03 (normally 00)

                                        --------------
                                        motherload!

                                        Comment


                                          #40
                                          Re: Arduino current sensing (in car)

                                          Cool thanks. How'd you come up with those BTW ? I read about part of them and trying finding more, but didn't dig deep enough apparently. I assume it's all optional though - I don't HAVE to modify anything if I'm satisfied with the "defaults" I suppose.

                                          Also, when you say for instance DC>AC, does that mean it starts up in default DC or defaults to DC when x function is selected ? That would indeed be handy in some situations. I reckon mine has the 1106 in it, though I only say this because I've seen some pictures of its guts - haven't opened MINE up yet to know exactly.
                                          Wattevah...

                                          Comment

                                          Working...
                                          X