Home

Welcome! Log in or Join us

Forums SEGmeter Have I killed my arduino?

Subscribe to Have I killed my arduino? 11 posts, 2 voices

Reply to topic
 

 
Icon_missing_medium
May 31, 2011 6:45am
48 posts

Last weekend I breadboarded a single channel sensor using a 30 amp CT clamp and a Freetronics ELEVEN.

Using the analog test sketch, this was giving values of 17-20 from the analogread, and at 4.88mV per step worked out to about 70-75 mV from the sensor. This was about the value I was getting when I checked it with a multimeter on the AC range.

So far so good.

I then got into the v16 SEGmeter sketch and configured it for the SCT 30 amp clamp on analog 2 (A2) and watched the serial monitor. I noticed that A0 and A1 were producing highish values (no circuitry on it, just open inputs), and A2 was producing higher values than I expected. I also had a wattmeter in line on the power cable I was using to check the current and power draw as a reference point.

This wasn't what I expected. I at least expected A2 values to be zero when no current was being drawn, and I wasn't sure what the other open inputs would pick up. I also noticed in the serial monitor that I was getting a reading about every 45 seconds for the first 3 sensors, then just an empty segmeter node header segment. Looking into the code I notice that the poweroutputhandler is sending a message, then the last thing in the loop also is sending a message, and at this stage the message is empty. IS this normal?

Now, to my real issue. I reloaded the analog test sketch again and now find that I am getting very high values back (around 470 or so) - much higher than before. If I add an analogreference statement for the internal reference, I get back 1023, so it seems like the A/D converter is stuffed.

Has anyone seen this type of result before? I was hoping for a better test of the v16 sketch, because if that looked promising I was going to order the segmeter bits I needed.

However, this has set me back a bit, and I don't know whether I need a new arduino chip, or whether there is some way I can resurrect the board and continue on. Things looked good after the initial analog test, but now I am rethinking the design if I can't get the arduino working.

Any suggestions?

Grant

 

 

 
Samotage_300_medium
May 31, 2011 7:11am
555 posts

Hey Grant,

What tpe of SCT 30 sensor are you using, voltage or current output?  

How many channels had you configured the SEGmeter sketch for?

Also, try this, make sure the A-ref is set to internal (its in the setup part of the sketch)

Then, take a breadboard wire from ground to the Analog pin, say A0.  This should result in a 0 Analog to digital signal.  You can test this with the analog input or just with the SEGmeter sketch.

Then after that, take the 5V, and connect it to the A0 pin, this should read 1023 (max clipping conversion)

If that works, get a potentiometer, and rig up a variable voltage divider and check your analog readings make sense.

If all the above is fail, perhaps you have upset your ATmega328?  

Let us know how you get on?

Sam,

@samotage

 
Icon_missing_medium
Jun 1, 2011 12:29am
48 posts

Thanks for the help Sam.

Not real sure what happened, but after removing the breadboard components and testing all the analog inputs with 5v, 0v, and 3.3v, the analog read function seemed to be working fine, so at least the Arduino wasn't dying after all.

Then put the breadboard back together, reconfigured the v16 sketch for just 1 channel (A0) and it produced reaonable results. I'm suspecting a dodgy pin on a jumper cable or an intermittent break somewhere, but all seems to be good now.

The CT clamps I have are SCT-013-30 which I got from Seeed Studio in China. I presume they are the same ones as you have got calibration data for. There is not a lot of information known about them, but I assume they put out a voltage that is proportional to the current flowing in the wire.

Now for my next 'problem'. I am testing using a wattmeter (the $20 Jaycar one) which tells me my appliance is drawing 4.65 amps and just under 1200 watts. Segmeter was showing about 480 watts, so I need to review the calibration parameters, but I think once I work through that we are looking good.

Future Plans - I have purchased 2 of the CT clamps and my intention is to monitor my whole of house power usage and also the solar panel production and plot them against each other. I have 2.8kW of panels installed about 18 months ago, and have tabulated data from the import/export meter and the inverter weekly for that time. Most weeks we produce more power than we take off the grid, so with the current export tariffs I am currently about $600 in credit with the power company and haven't had to pay out for power in about 12 months. Now I want to more closely look at what is happening during the day to see if there are other power consumers in the house that I can turn my attention to. I am thinking of using the Segmeter to capture at least these 2 sources (maybe I'll add more later), and feeding into the webservices using a Wifly shield rather than using a segbox. I already have wireless infrastructure, so this seems a sensible way to go, but requires more development. An alternative is to send the data using the 433MHz radios to another arduino with ethernet next to the router, or instead of 433MHz radios use zigbee. I think the design is flexible enough for that, jsut requires some programming and more development work, which is part of the fun anyway. I'll possibly also put an OpenLog serial to SD card logging feature in as well (until i sort out the comms bits).

I am also intrigued by the hall effect sensors. These should measure both AC and DC current in a wire shouldn't they? I have another project to do with a hearing loop which passes a current through a large loop of speaker wire around a hall, and the magnetic field can be picked by a hearing aid on the T coil setting. Silicon Chip had a meter for this a few months ago, but I haven't got it working yet, but if the hall effect sensor can measure a DC current then it might give me another way to measure the field strength of the loop and finish tuning the set up.

Anyway, things are now looking positive. I'll do some more testing tonight with different appliances to see if I can fine tune the calibration of my sensors. Then its off to the segshop I think!

Thanks,

Grant

 
Samotage_300_medium
Jun 1, 2011 1:02am
555 posts

Hey Grant,

Great to hear your Arduino is good!  I was talking to Luke Weston last week about breadboarding - which we both dislike, we prefer to commit solder!  All those dinky litle wires often have fail that masks other fail, leading to a fail hunt, though I digress!

Segmeter is perfect for what you want to do, and yes, the hall sensors measure DC and AC - though we haven't implemented a DC measurement routine, it's easy enough though.

We have calibrated the 13mm sensors that we sell, the ones you have aren't calibrated at all, and I suspect you may have some fun making them work with realistic values.  One option may be to tell the SEGmeter codes they are 60 Amp sensors, then adjust the output multipler to 0.5 - that way the nonlinearity should still kick in properly.

There are heaps of options out there to wirelessly or otherwise connect things all up!  Try and experiment!

After lots of testing, we settled on OpenWRT or Zigbee as being very robust, and something we can provide our customers with free of headaches, by running  24x7 all day every day connected to the innertubings.

Keep hacking!

Sam,

@samotage

 

 
Icon_missing_medium
Jun 1, 2011 3:44am
48 posts

thanks Sam. I'll check tonight with the 60 amp sensor setting and see what I get.

I would have thought that a CT sensor marked SCT-013-30 would have the same characteristics as any other sensor with the same markings. There aren't that many of them on the market that are easy to locate, so if you were a manufacturer you would want to differentiate your product from another and give it a different number I would have thought.

Notice that Sparkfun (and LittleBird) now has a 30 amp CT sensor - wonder if it is the same? Where did you source the ones you calibrated? Mine look the same, and is marked with SCT-013-30. You must have run many tests to get the calibration data.

 
Samotage_300_medium
Jun 1, 2011 3:56am
555 posts

Hey Grant,

We import all ours direct from the manufacturer, and make sure that when they leave the shop they work!  There is a natural fail rate with the ones that come in large boxes.  Also we like to make sure everything we sell works together, hence our SEGmeter code does the magic to make them all uniform together.

That said, the art of experimentation is trying different thigns, and something we encourage! 

Sam.

@samotage

 
Icon_missing_medium
Jun 2, 2011 12:44am
48 posts

Sam,

Ran some tests last night using the settings for the 60 Amp CT clamp you sell. It was reading a bit low when compared to the wattmeter, so I fiddled with the multiplication factor a bit until I got it reasonably close. Increased the value from 25.8 to 29.1. This is a bit unscientific and not tested on other devices yet, so I'll need to repeat with some different loads to see if it is still close.

When I first got the clamps I measured the voltage it was producing with a multimeter and also recorded the wattmeter values as well and tried to fit the data to a straight line. I'll need to review the calculations in your sketch to see how it works and see whether I can make any sense of it.

I'm also tracking what they are doing at the openenergymonitor site, and they have some information on how they work out the power from the number of turns in the coil in the clamp. I'll see if I can work out something from their information as well.

Grant

 

 
Samotage_300_medium
Jun 2, 2011 2:13am
555 posts

Hey Grant,

The value you increased will cause all sorts of fail for the subsequent linear mathematics.  Adjust the output OUTPUT_MULTIPLIER to suit, which will give you a proper linear response :D

Sam.

 

 
Icon_missing_medium
Jun 2, 2011 2:40am
48 posts

Sam,

OK, I'll look at that.

Also I meant to ask for more details of all the other sensors referenced in the code. I guess the Jaycar ones should be easy enough to find in their catalogue, but can you provide some more details on the others?

Thanks,

Grant

 

 
Samotage_300_medium
Jun 2, 2011 2:56am
555 posts

Hey Grant,

The others are all available in our shop!

Sam.

 
Icon_missing_medium
Jun 3, 2011 4:50am
48 posts

Sam,

Here is a link to the CT sensors that I have: http://www.australianrobotics.com.au/products/non-invasive-ac-current-sensor-30a-max

There is a specification sheet in the middle of this page with some data on it, and it is definitely a voltage sensor (it says voltage/1v). What this seems to mean is that it will produce a 1V AC signal at 30A. This is 33.33 mV AC per amp. I have logged some data for 4 different domestic appliances from 3A to 10A, and the reading from the multimeter is fairly close based on this, so I am fairly confident that this is the right data for this clamp.

For the SEGmeter interface, you are essentially only seeing the +ve part of the AC waveform, so if we halve the values this is what we should expect from the analog pins on the arduino. Each step in the A/D converter works out at 4.88mV per step. The maths works out fairly close in this case.

How similar are these results to your 30A CT sensor with the same product code?

I also checked the code in regards to changing the output multiplier, and I don't think this is a good idea as changing this will impact all sensors, so if I ever add one of your sensors at a later stage it would also scale that reading up as well. I think I would be better off explicitly adding a new sensor definition for the CT clamp I have and using the calibration data that I have. I'll see if I can find some time over the weekend to do this.

Cheers,

Grant

Log in to reply to this topic

Forums SEGmeter Have I killed my arduino?

copyright © 2008 Smart Energy Groups pty ltd