Kategorien
home automation

Pool Controller

At my parents‘ house in the garden there is a pool with an older controller for filter pump and solar heating. Via underground pipes the water is pumped from the skimmer and floor drain into the house, pumped through the sand filter, heated if necessary (depending on the availability of solar heat) and then pumped back into the pool via a few meters of pipe and the inlet nozzles.

The old controller has a very simple design and includes a mechanical timer, an input for a temperature sensor, an output for the circulating pump of the heat exchanger and of course a (contactor) switched output for the filter pump. Most of the time, however, the pump is switched on manually, which means that a walk into the basement is necessary.

Old Controller
Filter and filter pump

At first I created a draft concept. The new controller should be WLAN capable and be able to map the previous functions.

DIN Module Concept
Pump, Filter and Heat Exchanger

The concept was then „translated“ into a circuit schematic and a circuit board was designed for it. Actually there are two circuit diagrams and boards, one is the basic module and the soldered-on board is the DCDC voltage converter (6-35V –> 5V)

I ordered the two circuit boards to be manufactured and partially assembled in China. But of course I made a mistake with the first version of the circuit, which I already changed in the schematics above: the two optocoupler isolated inputs were wrongly connected to the wemos board, so the board reset itself continuously (D3/D4 via pulldown to ground).

After assembling the two boards and other components like connectors the wemos board was flashed with a tasmota firmware build. Then the module was packed in a DIN-Rail case and installed in a small distribution box with two auxiliary relays, a contactor and a 24V power supply. On the photo you can see the „fix“ of my error with D3 and D4 with enamelled wire near the two optocouplers.

Module without housing cover

The display, a button for switching the display on and off and a potentiometer for setting the target temperature were installed in the drilled and cut-out sections of the housing. The display flickers with high frequency, so there is always one line black on the pictures – the human eye does not notice anything. A button for manually switching the filter pump on and off was installed in a cable entry of the distribution box.

ready-to-install unit

The filter pump can now be switched on manually by push button, via the web interface and also schedule-controlled with Tasmota. Depending on the temperature of the water and release from the solar system (excess heat), the circulation pump of the heat exchanger is switched on as well.

WebInterface
Kategorien
automotive

Oil Cap Wrench

On my BMW motorcycle (R1150R) there is a not original oil cap installed. It has 4 holes to open and was probably delivered with a suitable tool. Because I bought the machine used and the tool was not delivered with it, I have drawn a suitable key, printed it out and added 2 pcs. M3x8 stainless steel hexagon socket screws. This key is now included in the tool kit.

The files for the wrench are on Thingiverse: https://www.thingiverse.com/thing:4549882

Kategorien
home automation

DIN rail I/O module

Sometime in 2018 i created an I/O module with 8 (optocoupler isolated) inputs and 8 (mosfet) outputs. The controller is an arduino pro mini clone with an attached MCP2515 CAN-Bus controller. For the overall 16 in- and outputs i used a MCP23017. Thereby i used the SPI bus for the CAN controller and the I2C bus for the I/O expander. The can bus can be used for communication with the outside world.

assembled module with the DIN rail housing

Unfortunately, I have not yet found a useful application for the module – that can still happen… but overall it was a nice experience to design a whole module on my own.

space was a bit tight

The circuit boards are made in china and assembled by myself. If i would redesign the module i would probably put an ESP32 controller instead of the arduino on the controller board – wifi, bluetooth and can bus integrated and a bit more power.

Kategorien
handicraft work

spot welding #3

Today the last blog about my self-made spot welding machine. The ordered parts from china arrived these days and i could assemble the whole machine.

two connectors and the new frontpanel

With the additional parts it becomes very tight in the old housing. But some time later all holes and the frontpanel cutout were made and the parts mounted.

safety feature: upper left a resettable 10A fuse, on the left a bimetallic switch
The 9V auxiliary transformer is mounted under the circuit board
the new front: for the display unit the right distance bolts are missig…

All i had to do now was to connect the electrodes to the plugs and equip the foot switch with a hollow plug. Afterwards the first battery packs could be welded, equipped with a battery management system and packed in heat shrinkable tubing.

foot switch and electrodes
battery packs, made from old laptop cells
before i assembled the packs i checked the cells with a imax b6 balance charger
Kategorien
handicraft work

spot welding #2

When i wanted to continue with the zero cross detector and a triac i quickly realized that the zero crossing was not detected well enough. So i search in the net and found another circuit on https://www.dextrel.net/design-ideas-2/mains-zero-crossing-detector.html (08.06.2020). I altered the circuit a little bit (see schematic) and checked the signal with the oszilloscope.

zero crossing detector schematic
perfect edge at the zero crossing

Perfect! With the triac circuit below i am now able to dim a light bulb or some other resistive load.

triac circuit
Arduino, zero crossing detector and triac circuit
dimm to 25%

The next step would be to design a printed circuit board – or to buy the almost same controller circuit board on aliexpress, with two poti, a stm microcontroller (STM8S003F3P6), a seven-segment display, a really powerfull triac (BTA100): The NY-D01 Board.

NY-D01 Board

With the two potentiometer you can adjust the welding time in 20 ms steps (full sine wave) and the power between 30 and 99% (dimmer). An old 9 volt transformator, a foot switch and electrodes from ebay and i start welding the first lithium cells.

First welding points
3S2P Battery Pack with 3D printed spacer

For the board is also a fitting frontpanel available which i have ordered on aliexpress (not yet delivered…). Connectors for the electrodes are also ordered.

Kategorien
handicraft work

spot welding #1

To build and repair battery packs with lithium cells I want to build a spot welding machine. So I looked into my basement and found an old electrode welding tool. After disambling the machine this is the new main part of the spot welding machine, the high current transformator.

high current transformator with the new windings

Because the transformator has about 48 volt no-load voltage and only about 100 ampere welding current i removed the secondary winding (made from aluminium). Then I winded up about 8 turns 16 mm² (about 2,5m – Thanks Rainer for the cable) on the transformator. The no-load voltage is now at about 6 volt – and the current should be much higher than before.

the old remove aluminium windings….

The first try with a tasmota wifi plug and the commands:

pulseTime1 1
Backlog Delay 100; Power1 On

(0,1 second pulse time, then wait 10 Seconds before pulse the relay)

The electrodes are made from 2,5 mm² copper wire and two old clamps from an electrical cabinet. The testpiece is a laying around angle and a piece of nickle band.

Not so bad for the first try! The welding points are so strong that the nickle band around yielded.

try to remove the nickle band

Next step: the control circuit. To control the power of the welding machine i want to control the power of the transformator with a dimmer circuit and timer. The circuit should consists of an arduino nano, a display, two potentiometer (time and power), a zero cross detection and the triac circuit.

schematic figure

I found this example in the web ( https://www.aeq-web.com/230v-ac-arduino-dimmer-pahsenanschnitt/ , 04.06.2020 ) and because all parts are available in my small laboratory i could build the zero cross detection.

Zero-cross detection schematic
the zero-cross detection on a circuit board
checking the circuit with the oscilloscope – good enough?

But that was it for now because i don’t have the other parts in stock…

Kategorien
home automation

Smart RGB CCT LED Bulb

For a comfortable ambiente at home when watching tv I bought a few LED bulbs. My intention was to flash them with tasmota and integrate them into my domoticz smart home system.

WiFi Bulb with packaging

After about 2 weeks the lamps were delivered (I ordered them on aliexpress) and I tried to flash the new firmware using tuya-convert. Because tuya-convert didn’t work after several attempts I had to go the hard way…

only clipped cover

I opend the bulb with a small screwdriver and removed carfully the led circuit board. In the figure you can see the LED board with the RGB, cold white and warm white leds.

the LED circuit board was fixed with some silicon

Then I soldered a few wires to the marked testpoints on the back of the wifi circuit board. For flashing the ESP8285 we need RX, TX, IO0 and the power supply pins 3.3V and Ground.

USB – Serial Adapter and soldered wires

Flashing over the serial connection was no problem. I reassembled the bulb and screwed it into a suitable socket. The next step was to find out which color is controlled by which gpio pin. I tested every gpio pin with the setting pwm1 in tasmota and slowly the table filled up:

Color	| GPIO		| PWM
---------------------------------
R	| D1 / GPIO5	| PWM1	
G	| D2 / GPIO4	| PWM2	
B	| D5 / GPIO14	| PWM3	
CW	| D6 / GPIO12	| PWM4	
WW	| D7 / GPIO13	| PWM5	

Finally i only had to enter the settings in tasmota and create a suitable domoticz device.

tasmota settings
domoticz settings, type „Color Switch – RGBWWZ“
bulb lights up with the settings above

Kategorien
home automation

cloud-less vaccum cleaner

I own a robot vaccum cleaner from eufy (RoboVac 30C), but what i hate are chinese cloud applications. So one of the first steps of the cleaner was on my table. In parts.

Vaccum bot in parts

The main controller of the bot is a STM microcontroller with sensorcontroller, motor controller, … The interessting part is the 4-wire cable to the ‚TYWE1S‘ WiFi Modul. This module, based on the ESP8266 microcontroller, is tasmota capable. And fortunatly all pins are labeled. So at first, i soldered a ribbon cable to all interessting pins and place the connector in the battery box. You can see the grey ribbon cable and the connector on the pictures above and below also.

WIFI Module with soldered ribbon cable
All pins are labeled!
debugging connector in the battery box

I debugged a while with the original app and firmware and map the following commands at 115200 Baud:

ESP commands to the STM (And corresponding Tasmota TuyaMCU commands, if available):

55 AA 00 00 00 00 FF -> Heartbeat

55 AA 00 1C 00 08 01 14 01 03 0E 1E 0F 05 7C 
--> Time and Date, Example:
55 AA 00 1C 00 08 01 14  01  03  0E  1E  0F  05   7C
Preamble........... 020 001 003 014 035 015 005 Chksum
->	              20/01/03    14:35:15 Friday

55 AA 00 06 00 05 05 04 00 01 00 14 
-> Auto -> TuyaSend4 5,0 

55 AA 00 06 00 05 05 04 00 01 01 15 
-> 30 min -> TuyaSend4 5,1

55 AA 00 06 00 05 05 04 00 01 02 16 
-> Spot -> TuyaSend4 5,2

55 AA 00 06 00 05 05 04 00 01 03 17 
-> Edges-> TuyaSend4 5,3

55 AA 00 06 00 05 02 01 00 01 00 0E 
-> Stop -> TuyaSend1 2,0
-> Start -> TuyaSend1 2,1 

55 AA 00 06 00 05 65 01 00 01 01 72 
-> Home -> TuyaSend1 101,1

55 AA 00 06 00 05 67 01 00 01 01 74 
-> Find Start -> TuyaSend1 103,1

55 AA 00 06 00 05 67 01 00 01 00 73 
-> Find Stop -> TuyaSend1 103,0

55 AA 00 06 00 05 03 04 00 01 00 12 
-> Forward-> TuyaSend4 3,0

55 AA 00 06 00 05 03 04 00 01 01 13 
-> Backward-> TuyaSend4 3,1

55 AA 00 06 00 05 03 04 00 01 02 14 
-> to the left -> TuyaSend4 3,2

55 AA 00 06 00 05 03 04 00 01 03 15 
-> to the right -> TuyaSend4 3,3

If the robot is controlled with the ir-remote, the stm sends the following commands to the WIFI module:

55 AA 03 00 00 01 01 04 
-> Heartbeat, every 15 sec

55 AA 03 1C 00 00 1E 
-> Heartbeat #2, every 4 heartbeat ( =60sec ) 
-> actual time is requested

55 AA 03 07 00 05 02 01 00 01 01 13 
55 AA 03 07 00 05 0F 04 00 01 00 22 
55 AA 03 07 00 05 05 04 00 01 00 18 
-> Start (last Program)

55 AA 03 07 00 05 02 01 00 01 01 13 
55 AA 03 07 00 05 0F 04 00 01 00 22 
55 AA 03 07 00 05 05 04 00 01 00 18 
55 AA 03 07 00 05 66 04 00 01 01 7A 
-> Start (Auto)

55 AA 03 07 00 05 02 01 00 01 01 13 
55 AA 03 07 00 05 0F 04 00 01 00 22 
55 AA 03 07 00 05 05 04 00 01 01 19 
55 AA 03 07 00 05 66 04 00 01 01 7A 
-> Start (30 min)

55 AA 03 07 00 05 02 01 00 01 01 13 
55 AA 03 07 00 05 0F 04 00 01 00 22 
55 AA 03 07 00 05 05 04 00 01 02 1A 
55 AA 03 07 00 05 66 04 00 01 02 7B 
-> Start (Spot)

55 AA 03 07 00 05 02 01 00 01 01 13 
55 AA 03 07 00 05 0F 04 00 01 00 22 
55 AA 03 07 00 05 05 04 00 01 03 1B 
55 AA 03 07 00 05 66 04 00 01 02 7B 
-> Start (Edges)

55 AA 03 07 00 05 02 01 00 01 00 12 
55 AA 03 07 00 05 0F 04 00 01 01 23 
55 AA 03 07 00 05 05 04 00 01 04 1C 
-> Stop

55 AA 03 07 00 05 65 01 00 01 01 76 
55 AA 03 07 00 05 0F 04 00 01 05 27 
-> Home

55 AA 03 07 00 05 65 01 00 01 00 75 
55 AA 03 07 00 05 0F 04 00 01 01 23 
-> Home interrupted

55 AA 03 07 00 05 65 01 00 01 00 75 
55 AA 03 07 00 05 0F 04 00 01 03 25 
-> Home successful

55 AA 03 07 00 05 0F 04 00 01 02 24
55 AA 03 07 00 05 0F 04 00 01 01 23 
-> ?

55 AA 03 07 00 08 68 02 00 04 00 00 00 5B DA
-> Battery percentage -> 5B = 91%

How can I now control the robot via WIFI and my Domoticz installation without the Tuya cloud?

I have started flashing Tasmota to the WIFI module. Unfortunately tasmota only supports Tuya devices with 9600 baud. So i need a custom tasmota build for the bot. In the tuyamcu code (xdrv_16_tuyamcu.ino) i set the baudrate to 115200 (i probably will fix this problem with a new command, because i want one build for all my devices…) :

// In function TuyaInit:
...
//if (TuyaSerial->begin(9600)) { // comment out this line
if (TuyaSerial->begin(115200)) { // add this line
...

Another problem is the battery percentage value of the bot, there i have two options: change the tasmota code or recalculate the percentage in domoticz. I choose the first option and changed the following line (because i map the battery percentage later to the active_power value with the tuyamcu command):

// In function TuyaProcessStatePacket
...
//Energy.active_power[0] = (float)packetValue / 10;
Energy.active_power[0] = (float)packetValue; // my line
...

After the code changes i build the firmware and flash the controller. Here are my tasmota settings:

Tasmota device settings
Tasmota domoticz parameter

In the console the following commands are executed to map from fnId to dpId:

CMD: TuyaMCU 11,2
-> Map 'Relay1' (fnId 11) to dpId 2 (Start/Stop)

TuyaMCU 31,104
-> Map 'Power' (fnId 31) to dpId 104 (Battery Percentage)

In domoticz a simple switch device control the bot now, the ‚action when off ‚ is for homing the bot when you ’switch off‘:

Domoticz switch definition

For the battery percentage i add a ‚general, percentage‘ device:

Domoticz battery percentage

And finally i can control the robot without any cloud with my smartphone and the domoticz app, even when i’m not at home (via OpenVPN).

reassembled vacuum cleaner

Kategorien
home automation

fingerprint and RFID reading system

A while ago i purchased a fingerprint reader module called dy50 or fpm10a on aliexpress. A PN532 RFID module has also been lying in the tray for some time. So i decided to build a combined fingerprint and RFID reading module with a self developed and self printed housing.

The controller inside is a wemos d1 mini (esp8266 wifi module on-board). On the controller is a tasmota version with fingerprint module driver from adafruit. As soon as possible i will commit and push my changes on github I have published my code on github: https://github.com/dhumpf/Tasmota . The software is still in development, but the basic functions adding a fingerprint, deleting a fingerprint, send the fingerprint data over mqtt to the home controller (domoticz installation) works already.

The total printing time of the enclosure was about 7 hours on the 3D printer. The 3d files will also be published soon I have published the files on thingiverse: https://www.thingiverse.com/thing:4362609.

But now some pictures of the whole thing:

3D Printed enclosure from the inside with the voltage regulator, controller board wemos d1 mini, PN532 RFID reader and fingerprint module DY50
Enclosure with RFID tag
Pinheader description on PCB and connections between the components

Kategorien
Common

it’s going international

So that my posts reach the rest of the world i will try to write everything further in english.

Why is this blog created with WordPress?

Simple question, simple answer:

As a hobbyist i thought about the documentation of my projects. Because i would like to documentate my projects and not an other project called „documentation system“ i choose the popular wordpress blog system.