-
• #2
That's a bit of a broad question :)
Most microcontrollers (Espruino included) can only measure analog voltage... So if you want to measure something you'll have to convert it into either a voltage, or interface digitally to a device that will read what you want.
For current, the easy solution is to connect the GND wire of what you're measuring via a resistor (1 ohm? it depends on the amount of current). Then you can measure the voltage on the other side of the resistor and work out current based on that.
For more serious applications, you can get these really neat hall effect current sensors like the ACS712 that convert current into a voltage and isolate as well.
-
• #3
Hrm, interesting. My question had risen from my curiosity about how vaporizers (ecigs) measure the ohms, wattage and etc of its coils.
-
• #4
For vapes? Probably just drop across a shunt, measured on the low side.
-
• #6
I'm sure plenty of people have - I think that's how the current fancy vapes were probably prototyped ;-)
At it's essence, you're just dumping power into a resistor with a fet, and watching the current through a shunt, and even that's optional.
-
• #7
Hi there !
I was ( and am still ) looking for the most practical ways to sense voltage, current & wattage, and ended up using the "Power Gauge" from Adafruit ( provides an nice TTL output to read from )
if it's of any use, I wrote the following Espruino code for it https://github.com/stephaneAG/Espruino_tests/blob/master/currentMeasurement/powerConsumption.jsWhile this is nice ( & I still have to code stuff to connect directly to the Power Gauge A0 pin - directly connected to the INA169 "Current Shunt Monitor" ), I'm still looking for alternative ways to doing so, starting with:
a custom implm of the circuit that uses an INA169 https://123d.circuits.io/circuits/2078847-current-measurement-circuit-ina169-version ( not yet tested - code should be close as below one )
a custom implm of a circuit that does nearly the same job https://123d.circuits.io/circuits/2045597-current-measurement-circuit-ad623-version ( to be tested soon - code related ( converted from Arduino ) not yet tested here https://github.com/stephaneAG/Espruino_tests/blob/master/currentMeasurement/getAmps.js )
using a hall effect sensor to be able to take measurement while not directly connected
have a clean hack to know exactly how much a power supply provides ? ( I know we gotta digg the specs for that, but I'm still wondering, convinced that the reason I don't know is my lack of knowledge on this, if there's some trick out there to doing so ;p )
Any thoughts ? :)
-
• #8
@stephaneAG very cool and thank you for your contribution :-) My current project is on hold at the moment, but I will definitely look into using that chip in the near future.
Is it possible to read volts, wattage, current and resistance of whatever I'm wanting to read the values from?