Friday, 28 February 2025

Crimping large lugs

 I ordered a cheapo lug crimper to do a 50mm2 lug. The seller turned out to be a scammer. Got my money back, but I still needed to crimp the lugs. I looked at the tool and decided that my vice would give enough force. I ordered the jaws for 3€ and made a small jig


The small bit of 0.5mm sheet steel shrinks the die a bit, as it's a 50mm lug and 1 awg cable (43mm2)

Tuesday, 25 February 2025

Generic Tuya thermometer module

direct match https://www.elektroda.com/rtvforum/topic4098816.html

Desoldered the battery to get at the programming pads.

Flashed with open beken.

No voltage regulator. Chip BK7231N is rated 2.3 to 3.6V max





{

  "vendor": "Tuya",

  "bDetailed": "0",

  "name": "Full Device Name Here",

  "model": "enter short model name here",

  "chip": "BK7231N",

  "board": "TODO",

  "flags": "1024",

  "keywords": [

    "TODO",

    "TODO",

    "TODO"

  ],

  "pins": {

    "6": "CHT83XX_SCK;1;0",

    "9": "CHT83XX_SDA;1;2",

    "16": "dInput_n;0",

    "17": "BAT_Relay;5",

    "20": "dInput;43",

    "23": "BAT_ADC;40",

    "26": "WifiLED_n;37"

  },

  "command": "// start some drivers\r\nstartDriver CHT83XX\r\nstartDriver battery\r\n\r\n// hold button 20 to get into safe mode\r\naddEventHandler OnHold 20 SafeMode\r\n\r\n// battery\r\nBattery_Setup 2350 3000\r\nBattery_Measure\r\n\r\n//cal temp sensor, temp then humi\r\nCHT_calibrate -5 19\r\n\r\n// 20s timeout to deep sleep for 600s if following events never complete\r\naddRepeatingEventID 20 -1 1337 DeepSleep 600\r\n// wait until wifi is connected\r\n//waitFor WiFiState 4\r\n// wait for MQTT to connect\r\nwaitFor MQTTState 1\r\n\r\ncancelRepeatingEvent 1337\r\n\r\n// wait 5 seconds\r\ndelay_s 2\r\n\r\npublishChannels\r\ndelay_s 5\r\n\r\n// Deep sleep (shut down everything) and reboot automatically\r\n//DeepSleep 30s\r\n//temp diff, ignore humi, sample time, fault q\r\nCHT_Alert 0.5 0 60 2\r\n//20 min sleep. should wake up if large change as above\r\nPinDeepSleep 1200",

  "image": "https://obrazki.elektroda.pl/YOUR_IMAGE.jpg",

  "wiki": "https://www.elektroda.com/rtvforum/topic_YOUR_TOPIC.html"

}

 

Monday, 24 February 2025

LSC wifi socket

Well, this would have been an easy convert from Tuya to esphome, but just as I was taking the programmed wb2s off the test rig I think it got fried. I had previously put the device in the scrap bin and replaced it with a ESP-05. However, this wouldn't play - I've had problems with all of these devices in that batch.

Aliexpress had a compatible looking ESP-02s for 1.65€ so that got my vote. Usual gp0 to 0v, reset, program with esphome.

button 14

relay 12

led 4

The pcb is marked with these numbers, even though a wb2s was fitted (wb2s IO was P26/P24/P7 respectively)

Friday, 3 January 2025

CPI update

 It's funny how decisions you make linger, when you should have bitten the bullet and just changed it.

For years I've lived with a PCB I made with a scrap of copper clad, some really old ferric chloride, some clanky software that limited the size, a inkjet and some veggy oil. It housed a 8 way 1W mux master and the corresponding 8 way IO 1W device. It worked just fine until a few years ago when 1 channel in the 8 way IO reset itself randomly. Then the mux played up. I changed that but the replacement never worked. I'd also had to patch opto couplers around spare IO on the ESP32. It was starting to look a mess



On top of that I had various UPS and regulator designs that had used a toroid which also gave a Vref to AD power meter, then a modified 12V psu to waste minimal energy whilst keeping a lion battery charged weekly.

Finally I'd had enough and bought a MCP23017. That matured for a couple of years then it got to the top of the development pile. That was straight forward. But the UPS function lacked a lot. The battery was now too old, and I could only monitor the battery current through 1W. Enter the INA3221. I'd used one for a quick and dirty UPS for the RPI and I'd found that a single 3.7V lion cell could happily sit on a cheap usb charger, and be boosted back to 5V with really very good efficiency.

Now I have a PCB that I made as a UPS and 4 way IO, but could be cut to provide the remaining 4 IO.




That's better. I also tidied up the wiring, but not that much. Krone blocks are so useful.