I'm don't use Arduinos myself (I use Forebrain boards, which are ARM Cortex-M3 microcontroller dev boards), so you'll have to ask someone else to fill you in with the Arduino-specifics and coding, but I hope this helps. I haven't included resistor values because these depend on the exact optocoupler chip used. The above example requires the GND of the Arduino to be tied with the GND of the 12V system, from what you've described of your system, this seems to be a fairly safe thing to do, however in the even that you need electrical isolation between the Arduino and the 12V side, here's a schematic that uses an optocoupler/optoisolator. If so, the system can then display a low-battery warning message or switch itself off when the battery falls below the minimum required input voltage. ![]() here's a quick schematic for one channel. A battery status monitor is a must-have in this application to prevent deep-discharge of the lithium battery and the brownout of the microcontroller. Measuring whether there is 12V on the "12V return" line is very very simple, since you only need to detect whether the 12V is switched on or not, then simply use a potential divider, this scales the 12V down to 5V, and your Arduino pin just reads this as a digital value, HIGH if 12V is on the line, and LOW if 12V is not. I would have recommended an optocoupled circuit myself for safety reasons (avoids killing your arduino). The 1N4004 diode I think is there for protection in case you get transient spikes from the 12V car side (and the 12V car side is really noisy with all the stuff going on and spark plugs going off, etc.) Even though it's being pulled up to +5V via the resistor, it will see close to 0 volts because the resistance of that resistor is far bigger than the resistance of the wire and transistor. In this case, the Arduino would read a "low" signal on the pin. Programmer: CH340 Operating Voltage 5V Input Voltage (recommended) 7-12V Input Voltage. When the BC547 turns on, it effectively acts like the Arduino pin was connected directly to ground. Gravity Analog Dissolved Oxygen Sensor / Meter Kit for Arduino. The R1 resistor there is there to avoid killing the transistor (and is also necessary since the transistor is a current-controlled device, but that's not important in this circuit). ![]() When the 12V car battery is connected to the circuit, it will turn on the BC547 transistor. When the car battery is not connected, the BC547 will be "off", and so it won't let any current flow, and so the Arduino input will see +5V because it's connected to +5V through a resistor. Hmm, that a bit of a weird way of doing things for monitoring just one channel since you can just use a pair of resistors to do the same.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |