Date   

Re: monitoring Dc help

Howard Dutton
 

Ok, and if that's using...

#define STAT_DC_CURRENT_ANALOG A10

I'm out of ideas.


Re: monitoring Dc help

koal01
 

Howard,
I checked the analogic pin and the output it correctly wired on the A10 pin directly on the mega.
I tested with a multimeter the ACS712 output, i can read 2.588 to 2.618 volts  whereas the status panel displays 5 amps...
OCS, Onstep and 2 litghts were on at that moment, i swtiched off OnStep and the lights but OCS still displaid 5 amps

Thank you
Koal01


Re: monitoring Dc help

koal01
 

Ok i'll do that, testing the output with a multimeter will be very instructive.
Thanks
Koal01


Re: monitoring Dc help

Howard Dutton
 

Confirm the correct Mega2560 Analog input is connected.  Again, don't use one of the protected inputs on the OCS PCB use an spare Analog input right on the Mega2560.  Not much in that code to go wrong such that it doesn't return a proportional number of some sort.

If the correct voltage (proportional to the current) is produced on the device output (test with multi-meter) then we'll go from there.


Re: monitoring Dc help

koal01
 

Thank you Howard for having implemented this feature.
So i updated OCS to 2.0 h yesterday and wired the ACS712 output to the A10 pin of the Mega.
Following examples in the web the ACS module is supplied on the negative source of the 12 V DC power on one pin and to let the current cross the module the other pin goes to the ground of the installation.
I can see the red led on the module meaning it is on, ok.
However the values i see in the panel are wrong. When i switch on OCS at the very beginning i can see 4 amps  without activating anything,  after a few minutes it decreases to around 2 amps.
When i swich lights, onstep, heating amps are not increasing or decreasing as if the system does not take anything into account.
My module is 20 A so i changed this line #define ACS712_V_PER_A 0.185 setting it to #define ACS712_V_PER_A 0.100 as described on the datasheet.
I left the systeme running all night long leaving only OCS running without any feature activated and here's the panel, the panel displays 6 A.
I certainly did something wrong but for the moment i have no idea of why it doe not work.

 
Thank you again
Koal01



Re: Inside Temperature Question

Fernando Nino Sr
 

I purchased the items on your list(Stellar Journey) from ali express, they started arriving last thursday,  I had some bme280's sitting around so I had used those for the outside sensor.  The bmp180 and the si7021 arrived today. I added the si7021 code to the temperature tab, will wire it up hopefully tomorrow. I also have the rain sensor as the TSL237 and MLX9061.  Just have to figure out how to mount them in my sensor "birdhouse".  I had a DS1302 RTC laying around, but I ordered the DS3234 without a battery, thought I could find it locally, but no.  I have to order one from amazon or go to Batteries Plus.   
Thanks again
nino


Re: monitoring Dc help

Howard Dutton
 
Edited

Looking at that again it won't work, those are just conversion functions so...

I've expanded the range of allowed Analog ports into the Config.h settings and added the following code to an Misc.ino example in the OCS (master branch)...

// converts a raw analog reading into current for STAT_DC_CURRENT_ANALOG
// return (invalid) if not implemented or if there's an error
#define ACS712_V_PER_A 0.185
double toDCAmps(double d) {
 double V = (d/1024.0)*5.0;
 double A = (2.5 - V)/ACS712_V_PER_A;
 return A;
}

So now just add this code to Misc.ino and specify the analog port in Config.h
to enable it.

Note: this is for the ACS712ELCTR-05B-T, the +/- 5A device.


Re: monitoring Dc help

Howard Dutton
 

Just wire in the device per the examples on the internet.  The ACS712 seems to have isolation so just wire it right into an unused Mega2560 analog input.

The following code should do the trick (add to Misc.ino)

// converts a raw analog reading into current for STAT_DC_CURRENT_ANALOG and STAT_BATTERY_CURRENT_ANALOG
// return (invalid) if not implemented or if there's an error
#define ACS712_ANALOG_PORT  A0
#define ACS712_mV_PER_A     0.185
double toDCAmps(double d) {
 double V=0;

 for (int i=0; i<25; i++) { V+=(analogRead(ACS712_ANALOG_PORT)/1024.0)*5.0; delay(1); }
 V/=25.0;
 double A = (2.5 - V)/ACS712_mV_PER_A;

return A;
}


Re: BME280 Sensor

Howard Dutton
 

On Mon, Jan 13, 2020 at 02:11 PM, Fernando Nino Sr wrote:
Also wanted to use relay 7 and 8 in series to use as open/close(relay 7-relay my pushbutton switch) and connect my ir sensors(relay 8- ir beam will shoot between the two walls) to make sure the telescope has cleared the roof before closing, just wondering how that would effect the control panel.
I think what you would want to do is perhaps use relay 7 to press the garage door opener button.

#define ROR_OPEN_CLOSE_MOMENTARY        7 //    OFF, n. Where n=1..14 (Relay#) A momentary switch closure (~1.5 seconds.)     Option

                                          //         To trigger a garage door opener (for example) to either open or close.

Then use relay 8 to control power to the garage door opener and interlock system.  For the interlock system the signal then goes either logic HIGH (5V) or LOW (Gnd.)  Lets say HIGH=ON (OK) for this example.

#define ROR_POWER_RELAY                 8 //    OFF, n. Where n=1..14 (Relay#) This controls roof motor pwr. For DC motor.    Option
                                          //         SSR/MOSFET PWM controls speed. For garage door openers, SW on/off only.

Finally lets have the interlock signal come in on "Sense 1" such that if the open/close sequence was initiated power will remain on until the sequence times out (Config.h setting) or the close limit switch is reached or the interlock signal goes LOW.


#define ROR_CLOSE_INTERLOCK             1 //    OFF, n. Where n=1..6 (Sense#) Roof safety interlock, close allowed when ON.   Option

There is also an option in the Config.h file to display a "Safety override" button which should be enabled.  This is for the user to take manual control in-case something unexpected happens and pressing override then allows manual recovery.  The OCS only presumes to know if an Open press or Close press will actually move in that direction if an opened or closed limit switch shows the roof at one end of the travel or the other.  If, for instance the ir beam interlock detects something and the OCS cuts power to the garage door opener the open/close state is lost and opening and closing are not allowed.  You then go and fix whatever caused the event, press the "Safety override" button, then press "Open" or "Close" .  The roof might move in the wrong direction but you can work that out since it's being closely monitored at this point.


Re: Inside Temperature Question

Howard Dutton
 

Yes, that's the kind of thing those functions are for.

The BMP180 is temperature and pressure only though so I guess you intend to use a BME280?


Inside Temperature Question

Fernando Nino Sr
 
Edited

Since I don't use a warm room, I would still like to monitor the temp & humidity inside the observatory. Reason for this is to set the exhaust fan to kick in at certain temp or humidity range. Could I use the use a BMP180 code in the weather tab to show it on the weather control panel instead of the thermomstat panel?  Temperature(outside) Humidity(outside) and Temperature (Inside) ditto for the humidity?
Thanks
Nino


Re: BME280 Sensor

Fernando Nino Sr
 

Correct. 
Thanks


Re: monitoring Dc help

koal01
 

Hi Howard,
What I meant when talking about measuring intensity it is more a feature measuring all the current drawn from the relays (I’m using 12 v dc), introducing a kind of ammeter.
Affer some research it seems that what I need is using an ACS712 module that would measure the curent consumed by the accessories (camera, lights, onstep, etc...) and display it on the status panel of OCS. My question is if I plug the output of the ACS712 module to the « S » pin of an analogic pin on the OCS board will it work ?
Sorry for this small mini arduino project in OCS but current in my setup is critical.
Nice sky
Koal01


Re: First board +

Howard Dutton
 
Edited

I don't as a rule distribute that design.  And at this point even I wouldn't build an OCS PCB again.

I feel the eBay relay boards are a better proposition both in terms of cost and for easy implementation.  At some point I plan to design an board that provides some protection to the digital and analog input side but that hasn't been done.  And quite frankly the need for protection is questionable.  After all the Mega2560 is cheap and were something to happen toss it and drop another in.

As I state on my website this system is for capable DIY'ers!


Re: monitoring Dc help

koal01
 

Thank you Howard,

I would say nearly all the features in OCS interest me. LOL
I was wondering if my solar panels 150 Watts X 2 and 2 batteries 100AH could supply OCS and all the equipments that's why i'm interested in monitoring the power.

Just for fun here is my equipments list and max current needs :

#define POWER_DEVICE1_NAME "OnStep_12V-2A"
#define POWER_DEVICE2_NAME "Camera_RAF_12V_4A"
#define POWER_DEVICE3_NAME "Hub_Usb_12V_5A"
#define POWER_DEVICE4_NAME "Heating_IR_5V_0.2A"
#define LIGHT_ORW_RELAY               12 // 12V_1A

Don't know how much amp OCS needs for its on purpose at least 1 A i suppose ?

Again thank you and thank you
Koal01
 


Re: First board +

stefacom1@...
 

I would like to built one version of your solution
http://www.stellarjourney.com/index.php?r=site/observatory_control

Schema , tuto are disponible ?


Re: First board +

Howard Dutton
 

I really don't understand the question; but I don't have anything to do with that sourceforge project nor any interest in it.


Re: monitoring Dc help

Howard Dutton
 

On Wed, Jan 22, 2020 at 01:47 PM, koal01 wrote:
If i want to monitor my external 12 v supply implementing STAT_DC_PS_ANALOG and STAT_DC_CURRENT_ANALOG
i suppose i have to wire the "S" pins on analog pins to the  supply cable 12 V + ?
In my case i chose A0 and A1.
Yes the OCS PCB Analog inputs A0 to A5 can handle measuring 12V DC directly.  The inputs are resistor divided and diode clamped for protection.

Concerning the current i see that we have to complete a function in the misc.ino file ?
Is it a future evolution or do we have to complete the current function ?
Since the individual user must decide on a sensor to measure current there is no one size fits all solution.  Each must be added.  I don't use this feature, nor do I intend to use every feature supported by the OCS, it was designed to be more comprehensive than for just my own use.

For DC the V=IR relationship can easily be used to calculate the voltage drop (V) across a known low resistance (R.)  If you know both V and R you can then calculate (I) the current.
For AC you need a sensor designed for that.

Google is your friend, lots of Arduino projects out there.


First board +

stefacom1@...
 

Hello to all ,

I'm target to build a experimental board for sqm detector for fun, And i have start this tuto .. (electronic in order) , and i have discover this new group by onstep . Than it's more interesting to have a global "Howard solution", and it's so interesting to test develop and debug .. 
https://sourceforge.net/projects/arduinomysqmskyqualitymeter/files/mySQM-v1-Retired/Windows%20App/mySQMGPS_2_2_6_9.zip/download

Do you have some code to distrubate for test it ?

Thanks you very much


monitoring Dc help

koal01
 

Hi Howard,
I'm running the 2.0g and it works fine !
I wired the heater on a relay following you advice and switch it on only in extreme conditions. The rest of the time i switched it off since the box is small, readings can be skewed.

Now i'm concentrating on the status panel and DC voltage/current.
So i have a question.
If i want to monitor my external 12 v supply implementing STAT_DC_PS_ANALOG and STAT_DC_CURRENT_ANALOG
i suppose i have to wire the "S" pins on analog pins to the  supply cable 12 V + ?
In my case i chose A0 and A1.
Concerning the current i see that we have to complete a function in the misc.ino file ?
Is it a future evolution or do we have to complete the current function ?
Sorry if i'm not clear.
Thank you
Koal01

441 - 460 of 528