Friday, November 2, 2018

ESP32

I just got my ESP32s from Bangood.

Temperature Sensing I2C IC modules that accurately measure temperature.

2 x 12V 80W Auto Radiator fans to be installed as ceiling fans. Require speed controlled PWM outputs.

Ceiling lights.

Control of reversible motor to drive bed mechanism as well as opto flag to count the revolutions on the lifting winch spools.

Ref: ESP32 #59: ESP32 MOSFET Tutorial (as a Switch)

#214 New: Easier ESP32 installation in Arduino IDE (How to)

Disappointingly I couldn't get the USB port to open either in Ubuntu or Windows and on neither of the two ESP32s. 

 The USB to UART is made by Silabs and I tried using the drivers in Windows to see if I  could get the USB to the PC communicating.  I installed the drivers. No apparent change. I deleted the 210 chip series  USB drivers rebooted and unaccountably the Com ports began to work.  

Dodgy Connector.  Found one USB cable that worked where the others dont. Possibly the OB Micro USB cont quite to spec. Nasty.


Saturday, October 27, 2018

Ultrasonic Water Level / Temp / Humidity Sensor

All this worked swimmingly and still does. The modules is ticking away perfectly.

Problem is 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. 

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

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

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);


}

Wednesday, October 17, 2018

Lovely Spot

Weathered granites and white trees in open bush. Some sign of prior visits from the Clan of the Brown Butterfly but not too objectionably so.


The Garmin 72H is a GPS and no more. No lifestyle "hanging by your testicles from a karabiner in the Rockies" statement or any of the other marketing bullshit. It has a display that can be read on moving motorcycle and has buttons so it will work in the rain. Only cost a cuppla hundred bucks if memory serves.

Wednesday, October 10, 2018

October 2018

The handrails finally fabricated and fitted. Feeling SO safe!!





Gwambygine Ascent

31:58:23.7 S
116:48:40.2 E

A large camping ground where (I assume) the Avon Decent is staged.
It is only 24 H stay and the Ranger will come kick you out despite the place being deserted.




 

Monday, September 24, 2018

Lenovo Yoga

When the touch screen cracks the pointer goes nuts.

xinput disable device

Wednesday, September 12, 2018

Current Sensor

30A New Range Current Sensor Module Board For ACS712

Descrition:

The current sensor chips: ACS712ELC-30A
The module can measure the positive and negative 30 amps, corresponding to the analog output 66mV / A
Pin 5V power supply, on-board power indicator
Using gold plated circuit boards
No test current through the output voltage is VCC / 2
Size: 31 x 13mm


This will hook straight to the ADC GPIOs in the ESP32. 

ESP8266 220V 10A Network Relay WIFI Module.
I have two of these. 

https://ucexperiment.wordpress.com/2016/12/18/yunshan-esp8266-250v-15a-acdc-network-wifi-relay-module/ 

Leveling up with openHAB

The level sensor project has worked and is connected (USB) to a Raspberry Pi which will form the hub.

I need to work out how serial communicate with the Pi so as to be able to hand data traffic to the Pi.

I am using Android devices to get access to the www. This means that I cant get the Pi to access the intranet and apt-get simultaneously. The simplest way to solve this seems to be to use a USB Internet dongle plugged into the router.

The Raspberry Pi in the lighting / power control role is overkill for the job. It needs to be replaced by a ESP32 wirelessly controlled by the single Raspberry Pi.

It would probably be handy to have a monitor to hook directly to the Pi but I havent tried the full range of headless operation. I have a laptop which has a good screen but a knackered keyboard. It might work well to buy a driver board for it and set it up as a low profile monitor.

Display B156XTN02.0 - Ordered. Fleabay.

Thursday, September 6, 2018

Arduino "Hello World"

Well not quite. I did a Morse Code snippet instead.


[code]
/*
SOS

Blinks the On Board LED
Prints out the "Word" on the Serial Port

  modified 6 September 2018
  by Mark Bolton

*/

int var = 0;

void setup() {
  
 Serial.begin(9600);                                         // initialize BAUD 9600 bits per second:
 pinMode(LED_BUILTIN, OUTPUT);          // initialize digital pin LED_BUILTIN as an output.
}

void loop() {

  var = 0;                                                           // loop 3 times
  while(var < 3){

  digitalWrite(LED_BUILTIN, HIGH);           // turn the LED on "DIT")
  delay(100);                        // wait
  digitalWrite(LED_BUILTIN, LOW);           // turn the LED off "SPACE"
  delay(200);
  Serial.print("DIT  ");                                     //Print the Character
  var++;
  }
    var = 0;                                                        // loop 3 times
  while(var < 3){
  var++;
  digitalWrite(LED_BUILTIN, HIGH);           // turn the LED on "DAH")
  delay(400);                                                     // wait
  digitalWrite(LED_BUILTIN, LOW);            // turn the LED off "SPACE"
  delay(200);                                                     // wait
  Serial.print("DAH  ");
  }
    var = 0;                                                        // loop 3 times
  while(var < 3){
  var++;
  digitalWrite(LED_BUILTIN, HIGH);            // turn the LED on "DIT")
  delay(100);                                                     // wait
  digitalWrite(LED_BUILTIN, LOW);            // turn the LED off "SPACE"
  delay(200);                                                     // wait
  Serial.print("DIT  ");
  }

  {
  digitalWrite(LED_BUILTIN, LOW);           // turn the LED off "END WORD"
  delay(600);                                                   // wait
  Serial.println("");
  }
}
[/code]

Saturday, July 14, 2018

Temperature Sensor

DS18B20 DC 5V Digital Temperature Sensor Module For Arduino

Features:


It's easy to install with mounting holes, diameter of the hole is 2.5m.
Digital signal output
18B20 Temperature Sensor Chip
Resolution adjustment ranges from 9-12 bytes.
Operating current: DC5V.
Temperature measurement ranges: -55°C to +125°C, be accurate to 0.5°C.
Size: 28 x 12 x 10 mm

Sunday, May 27, 2018

Gabbadah WA 6041

Public Rest Spot Gabbadah WA 6041 https://goo.gl/maps/2aezWAQKG3m

Sunday, May 6, 2018

Solar Panels



6 by 250 w -       4950 x 2000 - 1500 watts

Panels:





240w-250w panels - about 1650mmx1000mm
$90 each


If anyone you know is looking at solar both on and off grid, feel free to contact me.
I mainly do commercial sales, but I know residential off my head anyway.

Vlad Kolman



Vladimir Kolman
Energy Consultant

0407 389 601

Thursday, March 8, 2018

Jan 2018 Snaps




The bed is an appalling structure, bolted to the wall @ 1metre. Inner spring mattress and conventional truss and slat design. Would like something more elegant in terms of padding and more ergonomic in terms of space. Either it folds up @90 against the back wall or gets lifted straight up to the ceiling. The space underneath is reclaimed as living space and the structure of the bed base becomes  ; speaker cabinet , VDU, electronic test equipment etc as appropriate to it's positioning. i.e. overhead or perpendicular against the back wall.

 

View from Bed. 


Sink and Roadside (Starboard) Door.


Top Unit of two stacked Engels in front of the wall separating off the shower compartment.


Aft Head level section of the workbench.


Turn your head 45 Degrees forward to get this view.


The R&D Pi on the bench - look down.



The R&D Pi Entire rig on the bench - look down and 45 degrees forward.


Standing in the Galley looking Aft. The large screen HDMI TV (Monitor) is bolted to the panel affixed behind the bread maker.



The view from the sink looking to the curbside (Port) .


A crisp skinned huwhite loaf freshly beeping and emerging.


The view from the Work bench, at head height, over the HDMI Monitor. You are seeing a Laptop (Lenovo) that is running the network. The Car "Radio" that drives the Audio system - mostly Bluetooth.  And a few Dinosaurs.


Same set from 45 degrees stepping toward to spine of the truck.


Ditto - close up.


Ditto - step back.



Composting Lavatory - Not optimal. Needs reengineering both Bioloical and Mechanical. Still acceptable performance. 


Power board and Pi openHAB module.


Forward Bathroom bulkhead looking Aft



Wednesday, February 28, 2018

Vietnameese Girls are not white enough.

A locals market in Hoi An. It is only a half mile or so from the CBD but is still rural. A typical drive into the country in terms of distance would get you into Thailand.


Vietnamese women love to cultivate white skin. They hide away from the sun with a Nosferatu like obsession and in doing so dress like some Off World Warrior except their Armour is festooned with Hello Kitty, Flowers and Bunnies, leavening the effect. I was told this wasn't some hayseed rural quirk - all Vietnamese women are equally prone to dressing like this during the day.



The food is so fresh that food poisoning would be out of the question.



Even the vegetables seem to be wriggling.

Monday, January 15, 2018

Pi Master

Streaming

 https://www.youtube.com/watch?v=NZP97CtaGiI

raspivid -o - -t0 |cvlc -vvv stream:///dev/stdin -- sout '#standard{acess=hhtp.mux=ts,dst=:8090}'
                                                             :demux=h264


Pushbullet

https://www.youtube.com/watch?v=iwZf02XtVnQ