StuffAndyMakes.com

View Original

AC Current Detection with Allegro AC756 Linear Current Sensors

I received an Allegro AC756KCA-050B from my friends over at Element14 (Newark.com) and I wanted to see if this little gadget would make it easy to sense when the doorbell was ringing. As it turns out, it's completely overkill for the task, so I won't use it for my remote brass marine bell door chime thing (mentioned in previous articles). BUT, I did want to experiment with it to see what I could get from it. This is the true story of how I got something useful out of it and how I manage to have fun playing with electronics while being a complete hobbyist. First of all, here is a picture of one:

Picture of Allegro ACS756KCA-050B AC Current Sensor

It totally looks like a micro robot that pierces the fingertips of cheating poker players. You don't see that? OK, maybe the the first things you notice are those big-ass leads at the back. Why so big? Because the datasheet says this bugger can handle up to +/- 50 A of current. Wow. The next thing I noticed was the dot in the corner of the face of the chip. I blame A.D.D. I'm guessing that most people would notice the three little leads (or fingertip piercers). Those leads (from left to right, 1 to 3) are Vcc, GND, and Viout. The output side (non-AC side) runs on 5VDC. With a couple of capacitors and a resistor, it's ready to go. Here's what my little test rig looked like (I labeled it because I am proficient with Photoshop) (no, for realz: I'm pretty good with Photoshop and I can do more than labels with drop shadows):

AC756KCA on Breadboard

When our office expanded AGAIN, we bought a new space that had some cool "jelly jar" light fixtures that were left behind (my electrical supply sales friend told me that was what they're called in the industry). I got a couple of them for fun. I might put a red LED light inside one and mount it above the Man Caveā„¢ door to warn my wife of experiments in progress. Here is the lightbulb connected to the ACS756:

Lightbulb Connected to ACS756 Current Sensor

The first thing I did was hook the output of the ACS756 to one of my AVR microcontrollers. When I read the values via an analog (ADC) input on the AVR, I printed the values every second to the terminal and saw values generally around 510 (on a scale from 0 to 1023). At first, before I turned on my brain, I couldn't figure out why I was only getting that one silly value (or close to it), regardless of the state of the power switch on the lightbulb. What I failed to realize was that the signal coming from the device was an AC wave, of course. I needed to sample a bunch quickly and then plot that out to see the wave.

Next, I connected the output to my oscilloscope. I was able to see a waveform when I powered on the lightbulb. It was a bit more faint than I thought it would be, probably because I hadn't read all the way through the datasheet at this point. I guess an op amp would take care of that if I wanted the wave a bit bigger. I set the scope to see if the frequency was 60 Hz and it looks like it was (60 Hz, 16.7 ms each cycle). So, I assumed that was a good read from the AC current side of the chip. Here's the scope screen with the lightbulb turned on:

Scope: Lightbulb ON

With the lightbulb turned off, the waveform looked like this:

Waveform of lightbulb while OFF

When I turned off the light, the wave went to nearly gone, but, as you can see, some kinda transient something or another caused a tiny little flutter in the scope display when the light was off, which I suppose could be controlled if I read the datasheet more intently. When I turned on the lightbulb, the wave was definitely there and there was most definitely a difference.

Now, as I said in the beginning of this article, my original intent for this device was to sense when the doorbell line was energized and ringing the chimes in the house so as to trigger a Zigbee wireless call to a remote device on our back patio which would then fire a solenoid at a brass marine bell. I think I've said it before in a previous article: Yes, this is total overkill and I could easily run to Home Depot or Lowe's and get a remote doorbell to hack and have it running in a couple of hours. But, where's the fun in that??