Thursday, June 11, 2020

Forbes NSW



openHAB Documentation

Ref : https://www.openhab.org/docs/installation/openhabian.html


Ref : https://www.openhab.org/docs/installation/openhabian.html#raspberry-pi-prepackaged-sd-card-image


Ref : Youtube Channel BK Hobbies

Software

Download openHABian  .img.xy

Image Writer send Image to SD Card.

Fire up in Ethernet connected Pi  and wait for autosetup to complete.

OR

(Use text editor to setup Wi Fi in openhabian.conf in the SD card boot partition before you install it in the Pi so autosetup has internet access.)

Fault : April 4 Did autosetup 3 times and got a system error each time. failed install.

Fix : I run sudo openhabian-config, then option 3 - install stable " and it’s up and running.

Notes : First time i setup openHAB I used the reconfiguration install since the whole process seemed daunting. After this it just work so I concentrate on the sitemaps.   I wanted to set up the OS so as I could use the pi for other things like monitoring voltages etc.  This work around amounts to a separate install on a Linux machine so I need to experiment with doing a manual install.

Checking IPs on network

from router  :

http://192.168.1.1/     pass e..........wif

Fixed IP : 

(Not sure that this is setup - router doesn't seem to reassign IPs anyway )
Using the TL-MR3420 Manual C 8.4 Bind the MAC and IP. This serves an unchanging IP with DHCP.

SSH into the Pi :


mark@mark-HP-15-Notebook-PC:~$ ssh openhabian@192.168.1.103


@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @


Follow the prompts to generate a new passkey. 

pass openhabian

Run openHABian setup and configuration tool for openHAB sudo openhabian-config: (Should work without this  step .... ? Timezone and Password and update.)




Configure  from Paper UI :

Web Interface http://192.168.1.103:8080/start/index

*GPIO Binding - GPIO Binding binding-gpio1 - 1.13.0
*NPT Binding


GPIO Hardware layout.





Relay Board 1


GND                  GRN

GPIO 26 - IN1   BLU

GPIO 19 - IN2   PUR

GPIO 13 - IN3   GRY

GPIO   6 - IN4   WH

VCC                   RED

Relay Board 2


GND                   GRN

GPIO   5  - IN1   BLU

GPIO   9  - IN2   PUR

GPIO  22 - IN3   GRY

GPIO  27 - IN4   WH

VCC                    RED



-----------------------------------------------------------------------------------------------------

Items and Sitemap

etc/openhab2/items/home.items
-----------------------------------------------------------------------------------------------------

 /etc/openhab2/sitemaps/demo.sitemap


Text Editor

SUDO NANO is good for getting it going.

I setup Visual Studio Code with the openHAB extension.

Fault : I still havent got SVC working properly with SAMBA.

I couldn't get it to connect directly by entering in a host IP.

Instead I accessed the files using SAMBA and opened them from my remote Computer using Visual Studio Code.  

to setup the password in VSC





It will Save provided I browse with file manager to Open - it will only Save at the last Save as location .

Parent Folder : smb://openhab.local/openhab-conf/sitemaps



Automation

I have built a new Raspberry pi / relay box and will mod the existing openHab to run the new wiring layout.  Meantime I will prototype hass.io. I will probably have two SD cards in operation alternately.

The Epever Controller  has available  RS 485 / WI FI  and runs modbus.




  1.  GPIO ....... 8 ......... Reading Light (normally on) 
  2.  GPIO ....... 10 ......... Galley (normally on) 
  3.  GPIO ....... 12 ........ Pantry (normally on) 
  4.  GPIO ....... 16 .......... Function (normally off) 
  5.  GPIO ....... 18 ........ Function (normally off) 
  6.  GPIO ....... 22 .......... Function (normally off) 
  7.  GPIO ....... 24 .......... Function (normally off) 
  8.  GPIO ....... 26 .......... Function (normally off) 
  9.  GPIO .......  32 .......... Function (normally off) 
  10.  GPIO ....... 36 .......... Function (normally off) 
  11.  GPIO .......  38 .......... Function (normally off) 
  12.  GPIO ....... 40 .......... Outside Lights (normally off)

//June 11 2020

sitemap home label="Uberboltonwagen Zwei"
{

// Light Switching June 11 2020
Frame label="Lights"
{
Switch item=channel1 label="Reading"
Switch item=channel2 label="Food Prep"
Switch item=channel3 label="Pantry"
Switch item=channel4 label="TBA"
Switch item=channel5 label="TBA"
Switch item=channel6 label="TBA"
Switch item=channel7 label="TBA"
Switch item=channel8 label="TBA"
Switch item=channel9 label="Frontspace"
Switch item=channel10 label="Bathroom"
Switch item=channel11 label="Bed Space"
Switch item=channel13 label="Outside"
}

// Date and Time June 11 2020

Frame label="Date"
{
Text item=Date
icon=time
}
}



//Light Switching June 11 2020

Switch channel1 "Channel 1" { gpio="pin:8 activelow:no" }
Switch channel2 "Channel 2" { gpio="pin:10 activelow:no" }
Switch channel3 "Channel 3" { gpio="pin:12 activelow:no"}
Switch channel4 "Channel 4" { gpio="pin:16 activelow:yes"}
Switch channel5 "Channel 5" { gpio="pin:18 activelow:yes" }
Switch channel6 "Channel 6" { gpio="pin:22 activelow:yes" }
Switch channel7 "Channel 7" { gpio="pin:24 activelow:yes"}
Switch channel8 "Channel 8" { gpio="pin:26 activelow:yes"}
Switch channel9 "Channel 9" { gpio="pin:32 activelow:yes" }
Switch channel10 "Channel 10" { gpio="pin:36 activelow:yes" }
Switch channel11 "Channel 11" { gpio="pin:38 activelow:yes"}
Switch channel12 "Channel 12" { gpio="pin:40 activelow:yes"}

//Date and Time 3 April 2020

DateTime Date "[%1$tH:%1$tM : %1$tA, %1$tB %1$td, %1$tY]" 
{ channel="ntp:ntp:local:dateTime" }
 

Sunday, May 31, 2020

Battery Storage System

24 volt x 260 Ah = 6.2 kWh

12 volt x 220 Ah = 2.6 kWh

The charge controller is the epsolar tracer 4210A.

Batteries in series - charge equalisation

Coil32 (Coil64) - freeware coil inductance calculating app.



Have installed :

4 x C 145 deep cycle wet cells. 6 volt 260 Ah. Specifications. Right Hand side. Only 2 shown.

6 x UXL220-2FR  Spec Sheet . 2 volt 220 Ah Left Hand side.

The YUASA set is configured as a second 12 volt system and is running the diesel heater.. it will be configured as a backup lighting supply.

These are a premium UPS battery with a design life of 15 years. They are AGM design and are no where designated as "deep cycle". They have a maximum charge rate of .1C . The batteries are available at 60 bucks for a 500 odd dollar list price battery apparently ex Telco, in the original packaging and with no witness marks on the terminals.

Solar Panels Installed.


1.5 kW of panels installed. Overkill on the solar perhaps but it barely suffices in overcast locations. Jn Melbourne on a Partly Cloudy day in June the Controller is Metering 1 - 2 kWh/day. This is not really enough to run anything but rather just stops the batteries running flat. 

Update : Note the woefully inadequate mounting hardware on the solar panel roof fasteners. The rearmost offside panel has been replaced where that one panel flew off. More brackets were added to fasten down the inboard section. (Not shown) ..



240w-250w panels - about 1650mmx1000mm


Replacing missing panel and reinforcing the mounting hardware on the rest.


Solar PV References

Australian Irradiance Data BOM

Sun Path Chart University of Oregon

Tuitional :

Jim Pytel youtoob

Will run the numbers once I have a chance to gather some data. 

Elektor Six Digit Nixie Clock (150189-71)

Ref : Elektor. 

       : Incredible (I mean REALLY) CRT and Nixie clocks.     

I built the clock and made one stupid mistake. I failed to ensure the nixies were snugly seated on the back board before soldering them. They are a little bit cock eyed. To fix them would require some really serious custom building of esoteric soldering hardware and the risk of damaging the nixies.

"Perfection is the Enemy of Good Enough. " we concluded. 




Power Usage..



240Volts  the epEver 24 volt inverter


12 Volts : LED Lighting draws 70 - 100 watts flat out. The shower pump is 12v but uses negligible energy. Both of these can use a DC - DC converter at destination.

12 / 5 volt SENSITIVE Pi USB ... nixie clock, router etc. Negligible draw. Might be an idea to have a 12volt line with buck converter run off 24v set at 12.8 ie a battery UPS setup to protect this critical and expensive equipment from spikes and noise.

The 12 Volt heater
draws 10 amps on start and 2 amp? continuous. This Runs off a separate 12 volt pile. .

24 Volts.
Water pump. Fridges. Inverter.  The Engels fridges will run in either 12 or 24. 1.5 amp.

19.5 Volts Computer / monitor draws 100 watt.

I want to use a 24 volt to 19.5 volt DC to DC converter but am reluctant to trust the Bangood units - there is 1000 bucks worth of equipment hanging off that and I DO NOT want to blow it up.  I need to design something much more reliable. In the mean time I can use the 240 volt inverter (600mA no load) and power bricks. (I don't know how much power is lost).

In Melbourne Winter I am struggling to keep the batteries from going flat.

Interior Views

 Work bench.



 Workbench.
Top Right partially built control box for hass.io

Monday, May 25, 2020

The Lord is my Park Ranger

I don't look to the Earth Sciences to cast light upon Grey's "Elegy" or Kipling's "Recessional" nor would I go to ancient scrolls for questions of  Geochronology. The story of Jonah isn't a proto wildlife documentary. Science and thinking like a Scientist has only been a part of human culture for a couple of hundred years.

Science and Poetry deal in different notions of time and veracity. They are two completely different tools we use to perform two completely distinct tasks.

The Bible is a divinely inspired text from the dawn of modern human ethical consciousness, attested to by many individuals from many times and cultures. Theologians like Thomas Aquinas and St Augustine have provided guidance concerning apparent inconsistencies and temporal knots arising from what we in the 20th Century might call the "Science VS Religion" debate. A hypothetical showdown between Batman and Anne of Green Gables would give rise to a far more coherent, and likely far more interesting, contest of ideas.

I don't acknowledge that such a "debate" can even arise from the under pinning axioms of either sphere of human endeavour. .

I found this image this morning and I liked it, probably for the opposite reasons Young Earth Creationists do.

Jesus .... yup .... Dinosaur .... hhhmm sure. Whats not to like ? 






Saturday, May 23, 2020

Ultrasonic Water Level / Temp / Humidity Sensor



Project will measure the level of water in my 300 Litre tank and the Temp Humidity in the Boltonwagen. 



Sensors:

JSN-SR04T-2.0 

AM2302 DHT22 Temperature And Humidity Sensor Module For Arduino SCM

Specification:

Electrical properties:
Operating voltage: DC 5V
Total current work: 40mA
Acoustic emission frequency: 40khz
Farthest distance: 4.5m
Blind: 25cm

Resolution: about 0.5cm
Angle: 70 degrees
Working temperature: -10 ~ 70 ℃
Storage temperature: -20 ~ 80 ℃

 
Wiring:

 
+ 5V (positive power supply)                  RD
Trig (control side) RX                D 11     WH
Echo (the receiver) TX               D 12     GY
GND (negative)                                       BLK

Principle of Operation:


(1) using IO port TRIG trigger location, to the high level signal of at least 10us;
(2) module automatically sends 8 40KHz pulse, automatic detecting whether a signal return;
(3) a signal return, a high level is output through the IO port ECHO, the time duration of the high level is
ultrasonic from launch to return. The test distance = (high level time * speed of sound (340M/S)) /2;


Software & Refs :

Library for  Ultrasonic Sensor

https://github.com/daPhoosa/MedianFilter


https://www.youtube.com/watch?v=wb0sTy_26XM&ytbChannel=null 

http://www.ardumotive.com/how-to-use-dht-22-sensor-en.html#


https://www.banggood.com/DC-5V-Waterproof-Ultrasonic-Module-Distance-Measuring-Transducer-Sensor-p-1094462.html



Tank Dimensions:

W 2109 x D  185 x H 770 (Measured Dimension)   300 Litres

____________________________________________________________

/* How to use the DHT-22 sensor with Arduino uno
  ---------------------------------------------------------------------------
 Project will measure the level of water in my 300 Litre tank and Temperature and humidity.
---------------------------------------------------------------------------
   More info: http://www.ardumotive.com/how-to-use-dht-22-sensor-en.html
   Dev: Michalis Vasilakis // Date: 1/7/2015 // www.ardumotive.com

 Mark Bolton
 7 September 2018

 Two sketches are combined.   //water   and  //temp

  */
 
//Libraries

#include <dht.h>        //temp
#include <NewPing.h>      //water
#include <MedianFilter.h>
#include <Wire.h>


#define TRIGGER_PIN  12  // Arduino pin tied to trigger pin on the ultrasonic sensor.
#define ECHO_PIN     11  // Arduino pin tied to echo pin on the ultrasonic sensor.
#define MAX_DISTANCE 800 // Maximum distance we want to ping for (in centimeters). Maximum sensor distance is rated at 400-500cm.

dht DHT;

//Constants
#define DHT22_PIN 8     // DHT 22  (AM2302) - what pin we're connected to

//Variables
float hum;  //Stores humidity value
float temp; //Stores temperature value

int tank_Depth = 18;                    // Tank Depth (cm)
int tank_Width = 211;                   // Tank Width (cm)
//int US_ROUNDTRIP_CM;                  // Tank Height (cm) from sensor.
int water_Volume;                       // Amount of water in the tank. (Litres)


NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE); // NewPing setup of pins and maximum distance.

MedianFilter filter(31,0);

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

void loop()
{
    int chk = DHT.read22(DHT22_PIN);
  
  //Read data and store it to variables hum and temp
    hum = DHT.humidity;
    temp= DHT.temperature;

    
  delay(100);                          // Wait 50ms between pings (about 20 pings/sec). 29ms should be the shortest delay between pings.
  unsigned int o,uS = sonar.ping();   // Send ping, get ping time in microseconds (uS).

  filter.in(uS);
  o = filter.out();
  
  //Print temp and humidity values to serial monitor
  Serial.print("Hum: ");
  Serial.print(hum);
  Serial.print(" %, Temp: ");
  Serial.print(temp);
  Serial.print(" C. ");

  //Print level and Volume to monitor
  Serial.print("Level: ");
  Serial.print( o / US_ROUNDTRIP_CM);
/* Convert ping time to distance in cm and print result (0 = outside set distance range)*/
  Serial.print("cm.");

/* calculate volume .001 to convert to Litres / cm. * D * W * H (77) - distance from surface of the water to the sensor. */
 
  water_Volume = 0.001 * tank_Depth * tank_Width *  77 - o / US_ROUNDTRIP_CM;
 
  Serial.print(" Vol: ");
  Serial.print(water_Volume);
  Serial.print(" L");

// CSV file
  Serial.print("  ");
  Serial.print(hum);
  Serial.print(",");
  Serial.print(temp);
  Serial.print(",");
  Serial.print( o / US_ROUNDTRIP_CM);
  Serial.print(",");
  Serial.println(water_Volume);


}

Problem. dht.h not a valid library. I removed all DHT Libraries and reinstalled the  zip file included in the tutorial.

I built a replica Prototype Unit to clean up the code and get some more sensors and setup a proper Python controller in the Pi but none of the Sketches would verify. I cant identify the issue but clearly it is a problem with the Libraries. The best approach under these circumstances is to go back to scratch and set up the system again.

Fixed. Just gradually rebuilt the other few libraries and now the Water Level Sketch works too.

BUT : Pulled the unit to bits (for unrelated reasons) and will revisit later... 

Might want to double check the formula on the  Height to Volume calculation.

The Heater Fuel Sender needs monitoring as well.

Tuesday, May 19, 2020

Melbourne

A week of sub zero mornings. We are still under "lockdown".

Friday, May 1, 2020

Neon Indicators.


Fault : One one Neon in each of the three panels lit up. The actual one moved a few times. Likely only enough current was flowing to light one neon after which there wasn't sufficient current to keep the voltage above the strike voltage. I must have miscalculated the resistances erring on the high side.  I wonder if the variation in the current draw / strike voltage is such that there is a limit to the number that can be run off a single dropper resistor? Might have to break each segment into separate zones?
_______________________________________________________________________________
Recalculate : Each indicator uses 0.2 mA so at 240 - 80 = 160  volt :

4 = 24 indicators or 5mA 32 k Ohm

2 = 25

0 = 33 or 6 mA or 27 k Ohm

240 = 32

at about 1.0 watts or about 4 1/4 watt resistors... might have to mount them artfully on the circuit board to get it done. I don't want to go shopping for 3 resistors. 
_______________________________________________________________________________

Each indicator uses 0.2 mA so at 240  volt :

4 = 24 indicators or 5mA 48 k Ohm

2 = 25

0 = 33 or 6 mA or 40 k Ohm

240 = 32

at about 1.5 watts or about 8 1/4 watt resistors... might have to mount them artfully on the circuit board to get it done. I don't want to go shopping for 3 resistors.  



There will need to be a 330 Ohm resistor in the GPO where the wiring comes from as a fuse in case of a short.


Thursday, April 30, 2020

New Computer

LG 32 inch Monitor 32MP58HQ-P Switching between HDMI ports will be fussy.

ASUS - PN60 Mini Computer  Manual.   ; This thing is blisteringly fast.

OS : Ubuntu

Raspberry Pi 3 OpenHab. 

Rebuilt OS. 

Raspberry Pi 3 OpenHab Spare. 

Needs  building.   Is it possible to incorporate headless torrent box ? 

Raspberry Pi 4 Media Centre / NAS :  Raspbian. Works plenty fast enough for a desktop.  Needs building. 

Fault ; Will scan to the Bluetooth speakers but "Connection failed - Use audio menu to connect to this device. 

Fix :  You have to right click on the speaker symbol in the top right corner that way you can choose the audio output device. Have to rediscover device.  

Thursday, April 23, 2020

Vietnamese Folk Music

When I was a young man I was involved in the reception of Vietnamese Refugees in Greylands Migrant Centre Perth. I later worked as First Mate / Diver on a Pearl Boat based in Exmouth and farming pearl shell in the Montebellos Islands. All the crew were recent arrived refugees. I was blown away by what great guys they were. My biggest problem was they were reticent to treat me as an equal. I out ranked them for sure, but I need to trust them to countermand me if I asked them to do something stupid by mistake. We soon worked out how things stood.

At night they listened to incredible female vocals which were initially strange to my ear. I grew to love those songs - the style of music at any rate. I never found out who the actual performers were.

I recently decided to research up on this subject.

Here are some names suggested by  Vietnamese Community in Australia: Victorian Chapter. 

Lòng mẹ -  This seems quite western.

Chiều Tây Đô Lam Phuong- This is more like it.

I would be interested in helping with Cultural Research in this field. 

I have qualls in Electronics and Geology.

Experience in Community Radio and TV doing Technical Production , Research and Voice overs.  

I am currently traveling around as a Grey Nomad in my converted truck. I will be setting up a voice recording studio.





Amplifiers

CRATE (SLM Electronics.) BX - 160

Got lights and +/- 45 volts. Not connected to signal. Searched for schematic.