Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 22:39 26 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : MM/DM Caravan Power Monitor

Author Message
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1101
Posted: 02:34am 12 Oct 2012
Copy link to clipboard 
Print this post

Hi all,

I have been working for some time on a hardware/software package to provide a Caravan Power Monitoring system. I have included my work to date below and am happy if Hugh would like to add it into the library. It is a work in progress and I'm happy to take any questions/suggestions.

Regards,
Doug.
2012-10-12_123415_CVanBM.zip
... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
shoebuckle
Senior Member

Joined: 21/01/2012
Location: Australia
Posts: 189
Posted: 01:11pm 12 Oct 2012
Copy link to clipboard 
Print this post

Doug,
It will be in the next MMLib update.
Cheers & thanks,
Hugh
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6098
Posted: 01:26pm 14 Oct 2012
Copy link to clipboard 
Print this post

An interesting project.
I am in the early stages of something similar.
Instead of shunts, I am using hall effect devices - ASC758
I went for these modules on ebay:
"50A/100A/150A/200A Bi/Uni AC/DC Current Sensor Module (arduino compatible)"
Being isolated makes them easier to connect to the Maximite. I also use LM324 op amps so I can run a single supply rather than split.
Inputs at this stage are:
DC amps X 2
AC amps
Indoor, outdoor and fridge temperature (LM335Z)
Electric brake monitor - DC amps on each axle and if they are not the same - panic.
(I went down Macquarie Pass south of Sydney with one axle not working and it was not nice!)
I might also have a GPS so I can align the satellite dish.

I want to use the AC current to control load shedding - turn the hot water of when the BOSS starts the hair dryer.

Jim

VK7JH
MMedit   MMBasic Help
 
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1101
Posted: 09:01pm 18 Oct 2012
Copy link to clipboard 
Print this post

For anyone interested, I have ordered a 9" VGA LCD display so when I get home in a couple of weeks, I will start work on a pixel level graph of voltages and currents.

I had a look at the single supply op-amps but came to the conclusion (just me, not necessarily fact) that because I wanted to work down to to the millivolt level for low currents, I needed the ability to zero the offset and calibrate so I could read voltages within a few millivolts above zero.

I also had a problem of how to read both input current and load current independently and where to reference both readings hence I took (for me) the easy way out and used the battery neg as the reference zero thus with a shunt on the input current negative path and a shunt on the output negative path, I could read a negative millivolt value for input current and a positive millivolt reading for the output current.

As well as amplifying the millivolt levels to voltage levels, I scaled the input to be within the 3.3V levels of the MM ( in fact, 50A thru the shunt gave 50Mv and after amplifying, 2.5V at the MM input pin.

Battery charge or discharge then became the difference between the two.
I haven't looked at hall effect devices for this project - how are they for reading down to 1 Amp DC currents?

Interesting thought about the AC monitoring - might have a go at integrating that as well.

As I'm getting toward memory limits, I am going to see how Jim's short strings go - my only concern is timing in the interrupt routines.

Regards, Doug.

... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
graynomad

Senior Member

Joined: 21/07/2010
Location: Australia
Posts: 122
Posted: 01:22pm 20 Oct 2012
Copy link to clipboard 
Print this post

  panky said  how are they for reading down to 1 Amp DC currents?

The ASC712 has a 5A version, presumably it works OK down around the 1A level.Edited by graynomad 2012-10-21
Rob Gray, AKA the Graynomad, www.robgray.com
 
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1101
Posted: 02:32pm 20 Oct 2012
Copy link to clipboard 
Print this post

Thanks Rob, I might try to have a play with Hall Effect when I get a chance.

What I needed when I started was to read currents from 0 to 50 amps with a resolution to .1A and an accuracy of around +- half an amp. So for me, the simple solution was the current shunt and dc amp config - not saying it's the best but easiest for me (I also liked the challenge of playing with the op amps for dc amplification ;-) )
Cheers, Doug.
... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6098
Posted: 02:37pm 20 Oct 2012
Copy link to clipboard 
Print this post


Doug,
I have the 50A bidirectional ACS758 which outputs 40mV per amp.
zero amps is at 50% supply voltage.

Regarding saving program memory,
Rather than go to the overhead of my "short string" routines, you could fit 5 minutes of readings into one string.
That would make the LogFileArray$ a lot smaller without too much work.
You can save a few more string variables by reusing (without making the code unreadable)

The 3 string variables debug_mode$, getdate$, and gettime$ appear to get used once and the result saved as a numeric variable.
You could use one string variable for the answer and reuse it.

This code:
MinTurnover$="59"
Do While MinTurnover$ <> "00"
MinTurnover$=Mid$(Time$,7,2)
Loop

could be changed to:
MinTurnover=0
Do While MinTurnover <> 0
MinTurnover=val(Mid$(Time$,7,2))
Loop

to save another string.

The next release of MMEdit will have a command to strip out comments which means you can develop code with comments and deploy to the Maximite with the leaner code.
The next release also has a working VT100 screen which I have been testing with your code (amongst others).

Jim
VK7JH
MMedit   MMBasic Help
 
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1101
Posted: 08:14pm 20 Oct 2012
Copy link to clipboard 
Print this post

Jim, That's really helpfull - much appreciated. You are certainly right in that I have not optimised my variable usage and I should be able to prune a lot of rubbish and/or redundancy. My initial work was just getting the sucker to work!!!

I was particularly interested in the elegance of your short strings idea so couldn't help myself in wanting to have a play with that ;-)

I like the idea of the REM strip function - I was thinking of some way of creating a program to strip REM's from a program myself so I look forward to the new version of MMEdit, a really, REALLY neat program. Within my limited coding capabilities or as a tester, anything I can do to assist with MMEdit development - just ask.

Cheers, Doug.

... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
James_From_Canb

Senior Member

Joined: 19/06/2011
Location: Australia
Posts: 265
Posted: 08:26pm 20 Oct 2012
Copy link to clipboard 
Print this post

There should be a StripComments program written in MMBasic in the library. I wrote one while I was developing the LCD.LIB and ran out of memory. I can't confirm the name because I'm out of town for a couple of days.

James

My mind is aglow with whirling, transient nodes of thought careening through a cosmic vapor of invention.

Hedley Lamarr, Blazing Saddles (1974)
 
shoebuckle
Senior Member

Joined: 21/01/2012
Location: Australia
Posts: 189
Posted: 04:48pm 21 Oct 2012
Copy link to clipboard 
Print this post

  James_From_Canb said   There should be a StripComments program written in MMBasic in the library. I wrote one while I was developing the LCD.LIB and ran out of memory. I can't confirm the name because I'm out of town for a couple of days.

James

James, I can't see your StripComments programs in mmlib and I don't remember having ever come across it. Why not send it to mmlib@geoffg.net and I will add it.
Cheers,
Hugh
 
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1101
Posted: 03:32pm 09 Jan 2013
Copy link to clipboard 
Print this post

Hi All,

Have finally gone live with the VGA version of my Caravan Battery Monitor program. Seems to go OK so I have taken the liberty of a 1.00 version.

Any/all comments appreciated. Hugh, feel free to put up in the library and delete previous.

For all interested, please note the comments/caveats in the readme file.

Regards,
Doug.
2013-01-10_013139_CVBM10.zip
... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024