[TriEmbed] TriEmbed Digest, Vol 20, Issue 11

Dwight Morgan dwight.w.morgan at gmail.com
Wed Jan 21 16:27:25 CST 2015


Yep, the screen shot I sent got stripped. Anyway, my code and a small sample of the SM readout is below:

 

Code:

 

void setup() {

 

Serial.begin(9600);

}

 

void loop() {

 

float average = 0;

for(int i = 0; i < 1000; i++) {

average = average + (.0264 * analogRead(A0)-13.51);

delay(1);

}

Serial.print(average);

Serial.println("mA");

 

if(average > 20.0)

{

  Serial.println("The machine is ON");

}

else if(average <= 20.0)

{

  Serial.println("It is OFF");

}

}

 

Snippet of Readout on Serial Monitor: 

 

12.58mA

It is OFF

3907.43mA

The machine is ON

4092.39mA

The machine is ON

1301.30mA

The machine is ON

-0.22mA

It is OFF

5.29mA

It is OFF

 

Glen:

 

Yes, this version does require cutting the wire on the hot side. I didn’t find a lot of documents either – pieced them together from several sources. After testing this I’m thinking maybe the non-intrusive hardware is probably a better way to go even if it does require more circuitry. 

 

Thanks for any comments!

 

Dwight

 

From: Glen Smith [mailto:mrglenasmith at gmail.com] 
Sent: Wednesday, January 21, 2015 1:43 PM
To: Dwight Morgan
Cc: TriEmbed Discussion
Subject: Re: [TriEmbed] TriEmbed Digest, Vol 20, Issue 11

 

I still don't see a photo, I wonder in the mailing list strips off attachments? 

Is this version one that requires cutting the wire? The pic on Amazon makes it look that way but there isn't a lot of documentation posted. 

Glen

On Jan 20, 2015 8:45 PM, "Dwight Morgan" <dwight.w.morgan at gmail.com> wrote:

Just a follow-up on my efforts to measure current using the ACS712 Hall Effect sensor. I decided to buy a 5 amp model to experiment with, thinking the 20 or 30 would be a little dangerous just for testing. I received it from Amazon via UPS and the package appeared to have been run over with what looked like tire marks and the pins were bent down and over to the side but not touching. So, I made a rig to do some testing at first with a lamp with no success and then DC with no success. Today, while I was looking for more wire I found one of my wife’s old hair dryers with 1200 watt rating. If I turn it on low in “air” mode it produces over 4 amps – perfect. As soon as I connected and turned it on the amps on the Serial Monitor jumped to a little over 4 amps. I couldn’t believe it so I got my clamp-on and surprise it also read a little  less than 5 amps. It’s an old analog so it may be a little off on the low end. Side note: I accidentally ran the dryer way above 5 amps and the reading went erratic all over the place, but came right back. That ACS712 is a tough and forgiving little piece of hardware to be smashed and overcurrented and be okay. 

 

Anyway, I added a little code to the code I borrowed from one of the Arduino forums and did a screen shot of the code and the output on the SM. I’m attaching the screen shot so if anyone wants to please comment on any of it I would be most appreciative. 

 

Again, my application goal ultimately is to track when my hot water heater is on and off. 

 

Thanks from this newbie!

 

Dwight

 

PS: That was fun to get that thing working.

 

From: Martin Brooke [mailto:martin.brooke at duke.edu] 
Sent: Wednesday, January 14, 2015 9:49 PM
To: Dwight Morgan
Cc: TriEmbed Discussion
Subject: Re: [TriEmbed] TriEmbed Digest, Vol 20, Issue 11

 

I used an audio jack breakout on an arduino proto shield with a simple RC circuit to level shift the AC.

 

here is a photo <https://drive.google.com/file/d/0B0lP-6BNGel_a09EbFBkeDJWamc/view?usp=sharing> .  The proto shield is this one from  sain smart <http://smile.amazon.com/SainSmart-Prototyping-Prototype-Breadboard-Arduino/dp/B0079WI2MK/ref=sr_1_4?ie=UTF8&qid=1421289842&sr=8-4&keywords=Prototype+Shield>   although there are many alternatives for this.

 

The break out was from sparkfun <https://www.sparkfun.com/products/10588>   for which you need some headers  <https://www.sparkfun.com/products/116> and the jack <https://www.sparkfun.com/products/8032>   maybe you can find one assembled 

 

There is also two resistors and a capacitor needed to get the AC signal into the ADCs input range.

 

I really just copied the circuit from this intructable <http://www.instructables.com/id/Yun-based-Electricity-Monitor-with-Cloud-Support-T/?ALLSTEPS> . 

 

The instructable goes way further, using an Arduino Yun to make it readable via wifi, very cool, but maybe beyond what you want or need.

 

Cheers,

 

​​

 


_______________________________________________
Triangle, NC Embedded Computing mailing list
TriEmbed at triembed.org
http://mail.triembed.org/mailman/listinfo/triembed_triembed.org
TriEmbed web site: http://TriEmbed.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.triembed.org/pipermail/triembed_triembed.org/attachments/20150121/819f6c31/attachment.htm>


More information about the TriEmbed mailing list