Tag Archives: INA219

Litter Robot data acquisition, or “how I made things complicated for myself”

Okay, as per the previous installment, I carted my new current transformer tap upstairs, and plugged in the Litter Robot. It entered its startup sequence, which ran the motors back and forth, and I was able to grab some data. It looked like the following:

Just 28mV peak to peak, and looking nothing like a sine wave…

Using the built in ADC of an Arduino would give me relatively little accuracy, and the shape of the waveform isn’t super pretty. This gives me some pause.

But it was immediately apparent to me that I was amazingly stupid, and I was totally taking the wrong tactic, with the result that I was making things way too complicated.

See, the fact is that the Litter Robot plugs into the wall, but it does so via this little wall wart:

Input is rated at just 0.5A, output is 15V at 1A.

It is nominally rated at 120V at 0.5A, which means that even if it was running flat out, it would generate a voltage of just 50mV. But I suspect that the reality is that the voltages will be quite a bit lower, because the Litter Robot doesn’t actually take that much power, and because the current transformer probably doesn’t operate very well at these very low current levels.

In other words, I’m using the wrong sensor for the job. I went this direction because my inspiration Brian was already going down this path and I was interested in AC sensing, but had I thought about it, the obvious way to implement what I wanted would be to put a current sensor in the output of the wall wart. In fact, I have a perfectly reasonable sensor for detecting current (and voltage) in that kind of situation: an INA219 based I2C current sensor that is identical to the ones I used in my DC current loop for my solar satellite project. These sensors actually have pretty good sensitivity down to the milliamp range, are inexpensive and compact, and I wouldn’t have to tinker around with mains voltage. It is true that I have used them mostly in DC current sensing applications, but it should not be especially difficult to use them to detect AC current. The wart puts out DC of course, which makes it doubly easy. I’ll review the datasheet and start to figure it out.

I really should think these things out first, before I order parts.