I am attempting to capture a 12V DC square wave meant for a tachometer in a vehicle, utilizing pulseIn().
There is plenty of information about people switching 12V with a 5V source using transistors, but is there anything special to consider if the voltages were swapped?
I would prefer to utilize the on board pull-up resistors, so when the switch is tripped by the 12V high, the arduinos input is being connected to ground.
I had considered the voltage divider, but was concerned about the heat generation.
The 12V square wave is output by a stand alone ignition control module, specifically a MSD 6014 LS engine controller. In the spec sheet, it specifies that the tach signal output is indeed a 12V signal as opposed to the typical 5V from factory ECM's.
MarkT:
Heat generation? Why would that ever be a concern?
well i may have sized my resistors wrong in the past, but i have had a divider get very hot before when dividing a 12V supply down to ~6V to power an arduinos Vin. (i think two 1kohms)
All you need:
Simple NPN, with the 12V driving the base thru a 1K resistor.
Emitter connects to Gnd.
Collector connects to Arduino input with internal pullup enabled.
CrossRoads:
All you need:
Simple NPN, with the 12V driving the base thru a 1K resistor.
Emitter connects to Gnd.
Collector connects to Arduino input with internal pullup enabled.
ttommyp:
well i may have sized my resistors wrong in the past, but i have had a divider get very hot before when dividing a 12V supply down to ~6V to power an arduinos Vin. (i think two 1kohms)
What resistors would you select?
But this is a signal, not power. Voltage dividers are never used for power, you use a regulator for power
because you need a voltage source (with low output impedance, ie stiff voltage control).
6V across 1k develops 36mW, barely noticable, and you can use higher value resistors if you want,
unless the bandwidth requirement is very stringent. For 12 to 5, try 3k3 and 2k2 as a divider, total
dissipation 26mW.