Skip to main content

Replies sorted oldest to newest

You want a 0-30VAC Volt meter. You can find them in various places and on eBay (search "AC Volt Meter") You might also want to get a current (Amp) meter as well -- 0-15Amp AC Ampmeter. The volt meter is wired between the Hot lead and the common lead, while the Amp Meter is placed on the Hot lead between the transformer and the track. That will give you an idea of how things are running on the line.

I have a TIU using all 4 channels, powered by two 180W Lionel powerhouse bricks. Each brick powers 2 TIU channels. Where is the best place to add the amp and volt meters?

One option is between the transformer and the TIU, on both transformers.

The other option is to add an amp meter to each of the 4 TIU channels, as each one has a fuse in the TIU. If I do this, I think I only need to connect the volt meter to each transformer, as voltage after the transformer will be the same on either side of the TIU

I also have a few auxiliary transformers for uncouplers, switches, building lighting and operating accessories. I could add an amp meter and volt meter to each of these. Is there a benefit to this?

At what point are the meters overkill? I want to monitor the loads that really matter, without having too much information needlessly displayed on a meter panel.

Thanks:

rad400 posted:

Has anyone come up with a digital 0-15 amp AC meter?

thanks,

bob

I bought 0-50 amp AC meters on eBay with red LEDs.  They work to the tenth of an amp.  They use a 50 amp shunt that came with them.  I wasn't thrilled with the seller, because they kept sending messages in broken English asking if I wanted something else, which delayed the shipment from China.  I finally got them.

I would have much preferred to use the Lionel ZW-C meter, but I could not find one.

Assembling a panel with 4 volt meters and 4 amp meters will end up costing almost $90 all in and a lot of time.  Plus, it will take up more space than the ZW-C meter.

George

It seems the original question has been answered pretty well already.  

For what it's worth, I'm putzing around with some cheap modules and an Arduino to build a 4 channel volt/amp meter with built in programable circuit breakers.  I haven't got anything worth showing yet, but so far the theory seems sound. I'm estimating a parts cost around $30 for the finished product. 

JGL

JohnGaltLine posted:

It seems the original question has been answered pretty well already.  

For what it's worth, I'm putzing around with some cheap modules and an Arduino to build a 4 channel volt/amp meter with built in programable circuit breakers.  I haven't got anything worth showing yet, but so far the theory seems sound. I'm estimating a parts cost around $30 for the finished product. 

JGL

Awesome!  You may have a market.  Not sure whether you are making a product or doing a project to share, with instructions for folks to get their own parts?

George S posted:
rad400 posted:

Has anyone come up with a digital 0-15 amp AC meter?

thanks,

bob

 

I would have much preferred to use the Lionel ZW-C meter, but I could not find one.

Assembling a panel with 4 volt meters and 4 amp meters will end up costing almost $90 all in and a lot of time.  Plus, it will take up more space than the ZW-C meter.

George

While the Lionel meter is compact, there are some issues with it as to current reading per output. This report by Dale M is about the Post War ZW meter but the issues are the same for the ZW-C meter.

http://www.trainfacts.com/trainfacts/?p=378

So separate meters as diagramed above, might be a better choice.

In all honesty, I used to have meters but removed them, they amounted to little more than eye candy and they take up a lot of space. And, unless you really, truly understand the electrical theory behind your equipment and meters and circuits, the readings don't mean much, and cause a great deal of needless fret and worry.

I provided test points for track and accessory voltages, and provided wire loops so I can attach a clamp-on ammeter when necessary. That's it!

 

Basically, the reason I thought of using a meter for my one and only main line is that I am running Lionchief Plus locos.  It was pointed out, in another topic, that too high a voltage could be problematic for LC+.  What I have done is to limit the movement of the handle on my ZW transformer, so that it doesn't exceed 18 volts.  

I thought of using the meter just to keep and eye on my Rube Goldberg set-up.  

PLCProf posted:

In all honesty, I used to have meters but removed them, they amounted to little more than eye candy and they take up a lot of space. And, unless you really, truly understand the electrical theory behind your equipment and meters and circuits, the readings don't mean much, and cause a great deal of needless fret and worry.

I provided test points for track and accessory voltages, and provided wire loops so I can attach a clamp-on ammeter when necessary. That's it!

 

The amp meter should be your best friend, especially of you have a big layout and you can't see your engines all the time.  Knowing the typical amp draw for your train is good to know and if you see you are drawing 2X, 3X or more amps that normal, you need to check things out, now.  You can be cooking your engine boards without tripping the breaker.

Bob D

They come up now and again, used and old stock. About $125 a few years ago. 

I am wondering, Aside from the access hole to the rear button on the ZW-C, is there any difference between the Post War one and the ZW-C one? They look identical, I'm thinking they are electrically and the physical mounting looks identical also.

Dan Padova posted:

Basically, the reason I thought of using a meter for my one and only main line is that I am running Lionchief Plus locos.  It was pointed out, in another topic, that too high a voltage could be problematic for LC+.  What I have done is to limit the movement of the handle on my ZW transformer, so that it doesn't exceed 18 volts.  

I thought of using the meter just to keep and eye on my Rube Goldberg set-up.  

Dan, I would not worry about it too much.  From what I can tell so far the LC/+ electronics will not be harmed by voltages less than 24VAC/35VDC.  A little variation from your transformer in the 18-20VAC range is not going to hurt anything.  


GRJ, My intention is to monitor both true RMS as well as peak voltages and program the Arduino such that it can turn on a warning light, and/or disconnect track power if either value rises above a set level. I should also be able too have it read instant and RMS current levels and disconnect power in a gradual manner similar to what is done in a PH180 for small overloads, and disconnect instantly if current is ever above some max level.  Ex: remain on for 10 seconds at 1 amp over set level, 5 seconds at 2 amps over, shut off immediately at 5 amps over level, or some similar setup.  

I'm thinking of using an LCD display to show all the "unnecessary" values such as peak voltage and current, average voltage/current, etc.  Then to use large 7 segment displays for the usual RMS current and voltage read-outs.  If I'm understanding the datasheets correctly the set-up should be good for 0.05Amp resolution up to a 30A load, and about the same 0.05 volt resolution up to about 30 VAC RMS.  

JGL

Hey Guys! I would like to add to what JGL mentioned about using an arduino to measure voltage and amps. I have researched this and plan using an arduino to measure the voltage and amps on my layout when I possible build it next winter. I have found that you can use a ACS712 current sensor or ones similar. This one that is listed on Pololu's website is an ASC715 current sensor (Link). The ASC 715 is very similar to the ASC712 and is rated for 0 to 30 amps.

I have also found this great tutorial on the web on how to use an ASC712 and calculate both the voltage and amps with one sensor. This tutorial can be found here.  mVperAmp is the same for the ASC715 that is used in the tutorial (See Datasheet). The calculations noted in the tutorial will allow one sensor to measure the voltage and amps. This means that you can have one arduino with multiple sensors attached for the different tracks on your layout. An Arduino Uno should do the trick, but depending you may want to use a Arduino Mega. 

If you use multiple sensors on one Arduino board, then I recommend that you use arrays to read and store the data. The following code below is for multiple sensors on one Arduino and is modified from the above linked tutorial. I wrote the code, but have not test it yet. Please use with your own discretion. 

int numSensor = 4; //Number of sensors
int SensorPin[numSensor] = {A0, A1, A2, A3}; //Input pins for the ASC715 Sensors
int ReadVal[numSensor]; //The read value for the sensor
int mVperAmp = 185; // mV/A for 30A ASC715 is 185

double Voltage[numSensor]; //Voltage Read
double VRMS[numSensor]; //AC RMS Voltage
double AmpsRMS[numSensor]; //AC RMS Amps

void setup() {
Serial.begin(9600);

for (int i = 0; i < (numSensor - 1); i++) {
pinMode(SensorPin[i], INPUT);
}

}

void loop() {
for (int i = 0; i < (numSensor - 1); i++) {
ReadVal[i] = analogRead(SensorPin[i]);

Voltage[i] = getVPP(i);
VRMS[i] = (Voltage[i]/2.0) * 0.707;
AmpsRMS[i] = (VRMS[i] * 1000)/mVperAmp;
}

}

float getVPP(int i){

float result;

int readValue;

int maxValue = 0;
int minValue = 1024;

uint32_t start_time = millis();

//Sample for 1 second
while((millis()-start_time) < 1000){

readValue = analogRead(SensorPin[i]);

//See if the max sample was obtained
if (readValue > maxValue) {
maxValue = readValue;
}

if (readValue < minValue){
minValue = readValue;
}
}

//Subtract min from max
result = ((maxValue - minValue) * 5.0)/1024.0;

return result;
}

Please note the following on the code:

  1. numSensor variable is the number of sensors attached to the board. This is used to easy use the code on other boards that may have more or less sensors attached. This just makes the code easier to change. 
  2.  The SensorPin and ReadVal are arrays. 
  3. The for loop in the void loop function runs until it reads all the sensors and will start at the beginning once it has gone through all the sensor readings. 
  4. The getVpp function is there to do all the readings. 

 

Again, please note that this code has not been tested yet. I'm sharing it to show an example. 

Also, as JGL mentioned you can also hook-up LCD screens to the arduino to display the results at your control panel or any other location. 

I like the idea also that JGL mentioned about having the Arduino kill power to the tracks if the amps reach a certain value. What is also great about the Arduino if you are controlling your power with Legacy/TMCC. You can use the Arduino with a LCS SER2 to actually kill power, buy using serial on the arduino to send a TMCC command to the Legacy base for example, such turn power off to a track or do I system halt. 

Please note that I'm a Civil/Structural Engineer and not a Electrical Engineer. I myself am trying to learn a lot more about electrical circuits and stuff. I'm just sharing my research with the rest of the O scale community. I love the Arduino for model railroading and planning to use it on my layout for several things. 

Chris

A couple of months ago I added 3 pairs of analog 5A ammeters and 20V voltmeters to my control panel and have learned quite a bit about how my layout behaves from them.  I opted not to use digital meters as I don’t think the sampling frequencies on the ones of modest cost are fast enough to record many of the slight variations that occur as you are running.  This might be something to consider while trying to roll your own using Arduino. Having the needles able to dance in response to small changes is where I’ve learned the most.  And as much as I’ve learned about my engines, I’ve probably learned more about my accessories.  Total cost was around $50 - money well-spent IMHO.

On the downside, they do take up some space on the control panel.  The wiring was trivial – the majority of time was spent routing out holes of the right size and shape to hold the darn things!

Crood58,

Thank you for posting your Arduino current sensing information. Looks very interesting and might be a good learning project (probably with help from the fine folks here on the forum of course, so please don't go away). You have done all the legwork on the parts and provided a good program example and some good links. That takes care of some of the things I still have trouble with. I have some 20x4, I2C Arduino displays and need to do some more learning on those as well. And also a big thanks for your efforts in putting this all together.

rtr12 posted:

Crood58,

Thank you for posting your Arduino current sensing information. Looks very interesting and might be a good learning project (probably with help from the fine folks here on the forum of course, so please don't go away). You have done all the legwork on the parts and provided a good program example and some good links. That takes care of some of the things I still have trouble with. I have some 20x4, I2C Arduino displays and need to do some more learning on those as well. And also a big thanks for your efforts in putting this all together.

rtr12, 

You are very welcome and I hope you can use what I shared. Don't worry I'm not going anywhere and I would be glad to help. I usually try to check the forum once a day. A 20x4 display is great to use with arduino. I2C is not very hard, but can look very confusing when you first look at it. I'm still learning I2C myself. I2C is a great way to communicate with other devices. The one downside is that there is a distance limitation, but the be overcome with range extenders. 

Chris 

Thanks. There are several folks here on the forum that I would be lost without. They are a lot of help in trying to learn around here.

I might have misstated the I2C, the display I have is wired, but only uses 4 wires as opposed to the serial or whatever that uses several more wires? I found the correct library for my display and had things working. Then I changed computers, reloaded the Arduino stuff and couldn't remember which contributed library I had used. I think I got the wrong library on the first try and the display had problems. Memory ain't what it used to be. I think I may once again have the correct one, but haven't tried it. It's in the LiquidCrystal library anyway, just not the in the included Arduino library.

Should have added that I am also interested in JGL's project that he mentioned above and I hope he posts his progress from time to time. He's also one I follow and learn from that I mentioned above being lost without.

 

Last edited by rtr12

Crood58,  I finally had a moment to look over the code you posted and such and it looks pretty straight forward, but upon really getting into it, I don't think it will work as intended.

Before I forget, RTR12, the 4 wire interface is likely SPI which uses a clock, MOSI, MISO, and chip select pins.  SPI is easier to use for most folks, and also often runs faster than I2C, but it requires an I/O pin for every device's chip select.  This is easy enough to work around with shift registers such as the popular 74595 if you have many devices on the SPI bus from a hardware end, but requires changing the SPI library.  The easier solution for many projects is just to use a Mega2560 if you need more GPIO pins.  

Ok, so I started writing this post an hour ago, and had several paragraphs explaining each bit of the code that Crood58 posted… with some issues I had…As I picked apart the code, however, I just don't think it would work as intended.  It seems like code for DC current that is modified for AC in a way that will produce inconsistent results.  There are two main problems I see;

The first is that the method for determining RMS values is only good on pure sine wave transformers.  shark-fin waves  produced by chopped wave transformers like a ZW-C, Z-Controller, or CW-80, or modified sine waves produced by something like a Z4000, will not report correct readings with the simple peak*.707 (peak/1.4141) method.  

The second is this line right at the bottom:  

result = ((maxValue - minValue) * 5.0)/1024.0;

As best as I can tell this is intended to calibrate the value so that readings that should be zero are treated as zero.  The problem is that this will skew the value toward reporting less current than it should, possibly much less if the arduino happens to never call a read at the zero crossing of the sine wave.  

In the end, I would look into code intended for the ACS712 modules, as these are made for AC where as the ACS715 is intended for DC.  There are plenty of working examples that provide True RMS readings, and that would refresh the displays more than the once every 4 seconds that the code here allows for.  

Some thing to remember is that to get a true RMS value you have to take a large number of readings over an exact period of one wave, or multiple there of.  1 second works, but is much longer than needed.  You also need to know exactly how many readings you are taking.   the math is really pretty simple then.  you set a variable  as a running total, and every time the sensor is read, you add the square of the reading to the total.  once you have all the readings you divide by the number of readings, then you find the square root of that value.  This gives you a true RMS value, rather than the only somewhat useful values given by (peak*.707) method.  

With the ACS712 you just have t o remember that a 2.5 volt reading is 0 amps.  voltages above are current on the positive half of the wave and voltages below 2.5 are the current on the negative half of the wave.   I've seen code samples where only one half of the wave is looked at, and I've seen those that read from both halves.  

Anyway, I think you'll find the needed information just doing a google search for "arduino ACS712 RMS"  there are a number of threads on this on instructables as well as the Arduino forums, and several videos on youTube.  I suggest reading as many as you can and getting a good idea of what is going on.  Most of the examples are for monitoring mains power, but any that compute a true RMS level will work just fine at lower voltage for monitoring track power.  

Whatever route you decide to take, start with code intended to read AC current, not DC.  

 

JGL

Last edited by JohnGaltLine

JGL,

Thank you very much for that detailed explanation. I truly appreciate it. As I mentioned in my previous post that contains the code that I am still hashing this out and posted to share what I have found this far. I apologize for linking to the wrong sensor, I didn't pick-up that it was just for DC current. As we all know in the O scale, we need an AC sensor such as the ASC712.

I will do so more research. 

Thanks again, 

Chris 

Thanks JGL, I haven't gotten it all that back out again, but I looked at the display and it uses the SCL & SDA and 5v & GND pins from an Arduino Uno (I don't have a Mega). I have a couple of other displays that use more pins, but they have a small adapter board to convert to the same pins listed earlier. So whatever that is? I was thinking the literature said the display was I2C, but I may have that mixed up with the additional library needed or something?

Last edited by rtr12

RTR12,

If you look on-line there is a ton of info on how to wire the displays. They are very common with Arduino and you should be able to use a uno. The uno can only have on I2C connection, but can handle multipe slave devices. If the display is I2C it should be setup as the slave on the bus. The uno would be the master. You need to find the displays I2C ID in order to have the uno send data to it.

 

Add Reply

Post

OGR Publishing, Inc., 1310 Eastside Centre Ct, Suite 6, Mountain Home, AR 72653
800-980-OGRR (6477)
www.ogaugerr.com

×
×
×
×
Link copied to your clipboard.
×
×