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
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

Comment