Adding Inline Ammeter to Project

Hello all,

I currently have a setup that allows me to input various voltage levels ranging between 0 - "5" on two PWM pins on an Arduino Uno using a keypad. I have an LCD screen to display voltage information as well as which channel (A or B, or Both) have been set. The goal I now have is I would like to add is an inline ammeter to display current values alongside my desired voltage levels.

I would like to know:

  1. Is this possible?
    If yes,
  2. What ammeters could I use?

I would like to display the current for both channels, and I've looked at a couple different ammeters. It doesn't need to be exactly precise.

Approach #1
Approach #2

  1. How would I implement one of these devices into my current project.

I went ahead and for my what overall goal is which is to use a specific output voltage on one of my channels, or both across a load measured current using a multimeter, but I would like to package a current display on my project already.

Another idea would be to implement some could of current regulator to display/keep a current constant, but also allow it to be adjustable.

I am not trying to exceed current values greater than 100mA. I am looking for ranges of 500 microA - 80 mA, but anything in that range will work.

If this was not clear, please ask me questions and I will elaborate.

Attached is my code as it exceeded post length.

LCD_v5.ino (20.8 KB)

Just connect your #1 approach ammeter in series in the PWM line. Like between the data pin and whatever uses the PWM signal. Though the PWM signal might confuse the ammeter, if the meter expects a constant current. The ammeter in your #1 link has an internal shunt, which probably means you can keep the meter on or off and your Arduino won't notice, it works in either way.

Johan_Ha:
Just connect your #1 approach ammeter in series in the PWM line. Like between the data pin and whatever uses the PWM signal. Though the PWM signal might confuse the ammeter, if the meter expects a constant current. The ammeter in your #1 link has an internal shunt, which probably means you can keep the meter on or off and your Arduino won't notice, it works in either way.

I think I will try to use the first option ammeter, but let me run by you the circuit setup I was thinking of using for this to make sure what I want to do will work. Note I am using two for both outputs.

Vcc --- to both Ammeters (Thin power wires for device) ---- Gnd

Output 1 (D10) ---- "thick" red wire of ammeter ---- then "thick" black wire of ammeter ---- load (+) ----- Gnd

Output 2 (D11) ---- "thick" red wire of ammeter ---- then "thick" black wire of ammeter ---- load (+) ----- Gnd

Does it work just like measuring current in series with a multimeter?

If I have my Output ----- Multimeter ---- Load ---- Gnd?

I honestly don't know what you are trying to do but I can tell you your ammeter idea is not going to work.

Just what is your current project? Could you please elaborate so we can get a better sense of the end goal? I ask in a open ended way because you've said several things in your first post that are, well, flat out wrong.

PWM from an Arduino is not a variable DC voltage. It is a zero to five volt square wave that changes its duty cycle based on the data when you call the analogWrite() function. It might look like a variable DC voltage, based on what you measure with a digital or analog voltmeter but if you displayed the signal on an oscilloscope, you'd see it is really an AC signal, with the exception of the data points 0 and 255. In those cases, 0 gives you zero volts DC and 255 gives you 5 volts DC, every other data point, from 1 to 254 is an AC, variable duty cycle waveform that is, by default, at approximately 490 hz.

Another issue with your arrangement is that an ATMega328 processor digital output pin is good for about 20 milliamps, maximum. There is a absolute maximum for each pin of 40 milliamps. Allow more than that amount of current to flow and it's goodbye output pin. Keep going past 200 ma for all pins combined and it's goodbye processor.

Now, on to your ammeter. Let's assume for a second that you had a real DC voltage source. The Adafruit meter is good for zero to 9.99 amps. That means the smallest change that can be detected is .01 amp. That's 10 milliamps and you're looking to resolve microamps? You need a different ammeter for that. Further, if you read the Adafruit wiring description, you'll see the ammeter shunt negative terminal is connected to the common of the power supply. This is called "low-side" sensing and is a common way to measure current. What it means connection wise, is that the red ammeter lead is connected to the "low end" of the load, the other end of the load is connected to the positive of the supply. If you wire the meter per your description, you'll short your power supply into shunt directly with very unhappy results.

I also have to mention the sketch you posted. As I said in my first sentence, I really have no idea of what you're trying to do and unfortunately the sketch did not provide any hints. What I do see is some rather tortured logic and several misunderstood data types. Suffice it is say you don't need floats, division by 5 and the number of digits to get from a direct voltage input to a pwm output value.

I think we really need to start this project over with a clean sheet of paper... care to explain what you're looking to achieve?

Must the ammeter use the same power supply as the load, which it measures? Must the thin minus or ground wire be connected to the thick minus cable even if the thin wires were connected to a power supply of their own? Shouldn't a proper ammeter work in a way that the measured current through the thick wires would be completely independent of the power supplying thin wires?
It shouldn't make any difference for a proper ammeter if the current is measured at the high end or the low end.

Hi,
I think its to do with this;

https://forum.arduino.cc/index.php?topic=488615.0

Electrical Stimulation on Eradicating Bacteria/Biofilms

Tom... :slight_smile:

TG: thank you for the link. Good grief, three pages of detailed information and the OP starts a new thread?

Never once in all of the discussion and the technical papers presented, is the resistivivity of the samples or the required voltages ever detailed and now the OP thinks it can be done with 0 to 5 volts? That a pretty big assumption/leap of faith. These questions were asked but there was never a response, perhaps there are yet more threads that tie to this discussion?

The research papers make it quite clear that the stimulation is constant current from 20 to 2000 microamps. This could require hundreds of volts, who knows? 2000ua at 5v says the sample has to be 2500 ohms or less, the lower currents are two orders of magnitude less meaning the applied voltage and current range needs to have at least 100:1 span. Not exactly general purpose stuff. What's the probe spacing? The salinity of the soultion? Where's the constant current regulator? None this appears to to known/understood/given. But, here we are, being asked if a 10 amp scale, 2-1/2 digit ammeter will work.

If we know the parameters, the supplies for this experiment may not be difficult. But, as the unknowns appear to outnumber the knowns at this stage of development, I don't see how we can help.

It shouldn't make any difference for a proper ammeter if the current is measured at the high end or the low end.

Johan_Ha: The meter mentioned is not an "ideal" ammeter. Rather than making making assumptions, why not follow the link provided by the OP to learn about the very common digital ammeters that are available in todays market?