Posts

Showing posts from 2023

Wago is down - 500mah lasts 13.5 days reading the temp every 240s.

Image
  The blue line is the AZDelivery device, measuring the temperature every 240s on a 500maH ecig battery. It lasted 13.5 days. Its now going into production with a brand new 3000maH battery pack.

Man down...

Image
  Lithium is down after about 5 and a half days. This is the AZDelivery board with 70K potential divider, measuring every 60s. Ladybird (Firebeetle with 1M potential divider) isnt far behind. Wago (same as Lithium but measuring every 240s) is still on 3.78v after 8 or so days. These are all on a 500maH cell. conclusion so far: The Difference made by moving from a AZDelivery board and lower resister values doesn't make a huge deal of difference (half a day on about 5/6) The difference between measuring every 60s and every 240s is huge (not yet concluded) I will let this finish, then re-measure lithium and ladybird on a 240s schedule to see how they fare. edit: Ladybird is also down now, so the Firebeetle didn't really make a notable difference (nor did the higher resisters in the voltage measurement hack). We got an extra 5 hours on top of 5.5 days. It will be interesting to see if in a more sleepy (ie, every 240s) configuration the famed low power consumption of the Firebeetle

Race update

Image
Running the firebeetle (ladybird) and the AZDelivery boards, update every 60s (and also Wago which I didn't recharge before this). After 48h

Measuring the firebeetle

Image
Results (unscientific - should have done multiple tests)               Awake (ma)           Asleep (ua) AZDelivery board 70K dividers 130ma 115ma Firebeetle without low power link broken 70K dividers 130ma 462ma Firebeetle with low power link broken 70k dividers 132ma 84ua Firebeetle with low power link broken. 1M dividers 132ma 59.7ua So.. on the AZDelivery board I was seeing (at the battery input) Running current: 130ma Deep sleep current: 115 μa Measuring the firebeetle: Running current: 130ma Deep sleep: 462μa?????? Im not sure I trust my multimeter - i am inexperienced in measuring currents, and I suspect it breaks the circuit when it goes out of range, which makes it hard to measure micro and milliamps in the same rig. Trying another way - connecting a 4.7 ohm resister in series with the battery, and measuing the voltage across it, (measured reister = 5.1 ohms) Running: 660mv so I=V/R = 0.660 / 5.1 = 0.129a which isnt miles out from the 115ma above Deep sleep: 2mv so I=V/R = 0.00

Passing though a USB3 PCI card in hyper-v so I can do full JTAG debugging in a VM

 By far my most powerful build box is my Dell R720 which im using as a Hyper-V  host. Ive got a lovely Wrover Kit dev board, which has on-board JTAG debugging, but to use it ive historically had to plug it into my laptop, and build there. The laptop is a 4 core i5, so it takes forever to build and deploy, and the progress is no fun. Ive managed to successfully pass though a PCI USB card to the virtual machine I usually use for ESP32 dev, and it works brilliantly https://community.spiceworks.com/how_to/189969-hyper-v-pcie-including-usb-pass-through-not-just-graphics-devices?from_category=22 PCIROOT(0)#PCI(0200)#PCI(0000) Dismount-VMHostAssignableDevice -LocationPath 'PCIROOT(0)#PCI(0200)#PCI(0000)' -force Add-VMAssignableDevice -LocationPath 'PCIROOT(0)#PCI(0200)#PCI(0000)' -VMName 'v-dev' This gives me full remote control of the device via both serial and JTAG. The only thing I cant do is see the screen, but I dont use that much.

The firebeetle arrives... ive called her Ladybird

Image
First impressions are very good. I wasn't expecting USB-C  (and its proper USBc that accepts PD or USB-A-C cables). Its also flashing an unexpected RGB LED at me. Its also got nice little pads for taking VIN from the USB and battery. How thoughtful :) And its even got an unexpected GDI display connector (not I hadn't heard of that either - something for wiki'ing tonight) Its flashed with empty ESPHome... looking forward to playing with it tomorrow. Even if the power thing is not true, this is likely to be my go-to board for production use from now on.

Wago current measurement

Wago seems to be drawing a lot more power than I expected in deep sleep mode.. Measuring on the battery input, im getting around 115  μa The accepted leader in the low power ESP boards, the firebeetle, is said to draw 15 μa (likely at the 3.3 rail, not battery input), so I am losing 100 μa somewhere... (It seems to draw around 130ma during its waking phase, which is what I was seeing before. Removing the voltage divider brings it down to 88 μa , so this is still 70 μa more current (although I suspect the measurements for that were done on the 3.3v, not before a battery circuit. So im wasting about 20-30% of the energy on the voltage divider. Time to look into being smarter than that. Im reading 0.01mv across the pull-up, so using ohms, we are wasting sod all with the 47k (unless my calculations are out, its 2.12 x 10 to the minus 13...)

And so "Wago" was born. A repeat of the last device, held together with Wagos so I can measure things...

Image
 One I found today Opened with pliars These things are smaller than I thought - only 550mAh Good old leaded solder   The trusty USB iron What could possibly go wrong? Building up

Introducing Easynow - an ESPHome component to make sensor proxying via ESPNow easy in ESPHome.

Image
I think my ESPNow proxy components are now working well enough to release. https://gitlab.com/ripnetuk-public/espnow/ripnetuk-esphome-easynow It can be used in ESPHome simply by adding YAML, since ESPHome can pull external components direct from a Git repo - well done ESPHome :) Initial tests are good - using the same device that I was getting roughly 8 hours out of (from a discarded [popular device] - 700maH),  On previous measurements, I was timing the main part of the discharge curve, from 4v down to 3v, and was getting approx. 8-9h of runtime. This was taking a reading every 60s and passing to HomeAssistant via the regular API (ie, using the built in ESPHome stuff) BEFORE Easynow So it was taking between ~18:00 to ~02:45 to discharge from 4v to 3v. Thats about 8/9 hours. WITH Easynow Well, this is awkward. Its worked so well that after 8 hours, it havent even yet got down to the 4v ive been testing at: yet its still successfully reading the temperature every 30s: So far, id call th

Emergency safe mode on ESPHome and ESP32 (re-using EN button on GPIO0)

 The GPIO0 'enable' button is usually only used at boot to put the device into flash mode. After it has booted, we have a spare physical button on most dev boards. We can use this to flag that ESPHome needs to go into safe mode (ie, not run any components other than wifi and ota). We need to add an ID to the ota component: ota :   id : theota   password : "(readcted)" Then add the following YAML globals :   - id : press_ms     type : int binary_sensor :   - platform : gpio     id : failsafe     pin :       number : 0       mode :         input : true         pullup : true       inverted : true     on_press :       then :         lambda : !lambda |-           id(press_ms) = millis();     on_release :       then :         lambda : !lambda |-           int press_duration = millis() - id(press_ms);           if (press_duration < 3000)           {             ESP_LOGD("FAILSAFE", "******* <3s -  Enter OTA Mode set.");             id(theota)->

Now thats what I call ESP...

 These ESP devices feature a wireless tech called ESPNow. It basically lets you send a UDP type packet from a ESP to another ESP (by MAC address) up to (i think) 256 bytes, but its low power, since it doesn't need to establish a connection to a Wifi base station. So.... my goal is to create 2 ESPHome components, called something like ProxySensorReveicer and ProxySensorSender. On the battery powered device, you you run ProxySensorSender, and have a config like sensor:     - id mySensor       platform: adc (etc) ProxySensorSender:     -  receiver: 11:22:33:44:55:66     - sensors:         sensor:             proxy_id: battery_voltage             sensor: mySensor then on a grid powered receiver you would have ProxySensorReceiver:     senders:         - mac: 22:33:44:55:66           sleep_period: 10m           sensors;             -sensor:                 proxy_id: battery_voltage                 name: "Battery Voltage"                 units: "V"                   Th

Lucky tac-tac box size moment...

Image
 Board with battery sensor added

Solar Fail...

 Experimenting with a pair of solar panels connected in parallel has not yielded fruit. I bought a pair of these: https://www.amazon.co.uk/dp/B073XKPWY7?psc=1&ref=ppx_yo2ov_dt_b_product_details and neither one on its own, nor both in parallel are enough to power up the device in southern UK in January at 3pm... One (or both) do power it if put directly in front of a 1500 lumen floodlight. This one will have to wait until summer...

Discharge with 60s update instead of 10

Image
 

Logging results

 Google sheets https://docs.google.com/spreadsheets/d/19-Kt2w943iOmKBSE3WLt_KgMJZE2o_svyXJnUlgYrjw/edit?usp=sharing Recording time to drop from 4v to 3v (since that covers most of the time and is simple)

Full charge with 'no effort' running

Image
 

Full discharge on "no power saving effort" ESP32

Image
 

Experiments with running ESP32 on a upcycled [popular device] battery

Image
 In the UK there is a ready supply of 3.7v 700maH lithium cells discarded by the roadside after the [popular device] has run out of juice. I want to see how long these things can power a ESP32 for as a simple temperature reader. Then I want to see if I can improve on this... Kit 1. ESP32 Lolin kit from AZDelivery with an in-built lithium charging circuit and connector. https://www.az-delivery.uk/en/products/esp32-lolin-lolin32 2. Dallas waterproof temperature sensor (from ebay) 3. 700maH lithium cell found in the street I connected a simple resistor divider between the battery terminals, and connected the middle to a analog in pin on the ESP32 so I can read the voltage with the device ESPHome is the platform im using for these experiments, along with Homeassistant to read and graph the data Notes 1. The battery polarity on the Lolin board disagrees with both the random ebay connector, and the spare 3.7v cell I bought on ebay. 2. Connecting 4.2v the wrong way causes the magic smoke to e