Ways to power a large series of Wemos D1 mini boards

Very Feng shui :smiley:

1 Like

And I have another point to consider:
Even if the ESPs as most micro controller has a watchdog implemented it could happen that the cpu hangs in an in between state were the watchdog isnā€™t started or not operating as expected and your esp is halted. Only pushing the reset button or power cycle can bring it up again.

So its a good idea to implement a accessible reset button or a way to power cycle your device (and not have to trip a fuse). Best is to make sure that your soft and hardware does not cause resets at all. I have sonoff minis with my own firmware never resets for more than a year until I had to flip a fuse to do some work on mains. Other devices tend to reset after a couple of days (yes espEasy Iā€™m looking at you).
If your esp resets unintentionally there is something to address. (A memory leak, a flaky power supply or bad code)
There are external watchdog chips available but I havenā€™t found a board where such a thing is implemented.

1 Like

Good point.

Yes, I found problems on ESPeasy and Tasmota over the years. Yet to have any problems (other than self-inflicted) with ESPHome and it lets me run a similar configuration on all manner of devices both ESP8266 and ESP32. All I need to do is make a new top-level config and consume a bunch of sub-config files according to the capabilities of the platform. Everything from a D1-Mini with my own selection of sensors right up to a M5 Basic with mutli-page display, base with sensors and an externally wired light level sensor. Updates are OTA of course.

2 Likes

In my experience the "swiss army knife" with a on size fits all binary is to much for the poor ESP8266. All that dead code eating bit by bit of the limited resources.

As far as I know espHome compiles a custom build depending on your configs. A similar approach I do by linking only drivers or libraries I need and only active code. This way it lives happy on far less than 512k to enable OTA on EPS8285s. I don't need a web interface when I can do the same thing by simply starting a new build (I even don't have to know the ip adress of the device as they are pushed via mqtt faster than via serial). Copy & Paste for imilar devices is also very handy. And enough room for "build in" logic that many things are done directly with in the device in C and not in a quirky script language (i.e. real smooth dimming over hours so simulate sunrise)

I would look into ESPHome if I have not already spent a lot of time writing my own piece of legacy code :wink: .... But if I would start new EPSHome would be the candidate to look into.

And last but not least: Support of the homie convention :wink:

image

This one is build in the suspended ceiling. Only pulling the fuse can initiate a reset. (BTW: uptime is in seconds not milliseconds)

Yes, that is correct. I find it to be the best compromise. I don't want to spend hours creating poor quality C++ code :wink: but I still want something efficient. But the killer is that I'm still retaining the DRY reusability as each piece of config for a specific sensor or output is in its own file and I just compose a bunch of them and set the base variables for each device. All of which can be controlled from a script.

And yet, even so, I can also delve down to C++ code when I need to do something that greater minds haven't already done before. So, for example, I have some standard code for building UI's for small colour screens.

Yes, I've gotten into - and out of - homie several times. In the end I decided that it was vast overkill for everything I'll ever need to do and so I greatly simplified my outputs.

So here is an example of my outputs which all sit under the ESP topic root:

image

None of that needed any code writing in order to produce it. Because this is an M5 basic with a nice but tiny screen, I also gather a bunch of other sensor data from other devices to display on the screen:

image

I don't need to output that to MQTT of course but it is easier to let it do it than it is to stop it so - heck, why not.

Oh, and in this case, a small time runs such that the display backlight comes on for 1 minute out of 5. Or I can press one of the buttons to turn it on immediately.

At least I know who to blame :crazy_face:

I use landscape lighting wire to my outside locations. It's rated for 10 Amps at 12VDC and can be safely buried. Any hardware store will have it.

No motion sensor ? :wink:

I've used ESPHome for a couple of years now and have upwards of 40 ESPHome flashed modules deployed (and about 20 in my motorhome). Most are Wemos D1 Mini's in their various clones, and a few genuine originals.

Power wise;
Mine are either locally powered by the use of an old phone charger or, more recently, wall outlets with usb sockets built in.
I have a few outside the house pulling all sorts of duties, such as multi-sensor and PWM lighting.
If running cables is a possibility, then running a higher voltage bus at say 12vdc or 24vdc is entirely possible and is my recommendation.
You will suffer voltage drop over distance, but using little converters at each module drop will ensure you've got the 5vdc needed by each module.

Current is the metric to watch out for. If you're just looking at D1's to host sensors, buttons and small screens then the above will work well provided you account for the circuit total load and add head room of say 20% (Remember, a China watt is roughly half of a real watt).

You asked about cable protection.
Always remember. FUSES PROTECT CABLES. Fuses might be fitted to devices for many reasons but they won't protect the feeding cable. All cables over 500mm in length should in general be fitted with a fuse, and it should be as close to the source of the power as possible; sized to be the weakest link in the downstream circuit.
However, fusing a power rail at 24v with lots of droppers to 5v does become a challenge when working out the weakest link.
But you can rationalise this by fusing the 24v/12v power rail at the transformer rated to protect the power rail length and size, and then add a smaller inline fuse to each high current consumer device after their respective step down modules.

FWIW, I don't bother fusing the micro converters as they will pop fairly safely all on their own if their output is shorted for any reason. I will locally fuse higher current draw consumers on the power rail such as LED strings since their converter will be bigger and thus presents more of a risk back to the rail.

But again; fuses protect cables, not devices, always ensure that the fuse will be the first thing to blow should there be a dead short over the cable.

To determine cable size, and thus capacity and fuse size; start with the total load the power rail needs to support. Once you know the load and distance and permissible voltage drop, you can then determine the size of cable, from that you can assess the fuse size. So you work backwards from the devices.

It can be a complex subject routing DC power safety, but as long as your cable is sufficient and your fuse is the weakest link, it won't be too difficult to do.

3 Likes

Q: Why do you need a "large number" of ESP modules?
Once you get into them, and especially using a DEV platform like ESPHome and MQTT, you'll be surprised how many integrations you can force into a single ESP8266/32. Most i2c devices will sit on the same 2 pins, so screens, sensors and many other modules in the i2c bus won't eat up all your pins (GPIO's), SPI is greedy on pins for sure though, but you can add 40+ temp sensors onto a single pin if needed (Dallas DS18B20).

It's easy to get carried away with splattering loads of modules around your house where each one is only doing one function, but it's entirely possible to group together many functions into a single module. For example, in my ensuite bathroom, I've a single D1 32 Mini hosting:
Motion sensor,
Temp sensor,
Humid sensor,
PPM2.5 sensor
Contact sensor.
Rotary Data encoder,
Button,
OLED Screen
Extract fan relay
and a data line for a couple of strings of Pixel LED's (Fast LED).

Remember, each ESP Module will present to your network as a WiFi client on the 2.4ghz band so you will eventually come up to a limit of your WiFi network. There are options for Ethernet connections, but these are rare and add significant cost to a module.
It's worth thinking about what you need in each room and form a plan before diving in.

3 Likes

Haha, I do have a spare sensor but no, it is on my desk in the office with the light sensor on the window frame. So having it come on every now and again shows me it is still working and I can glance at the temperature and humidity across the house. The light sensor informs decisions on lighting elsewhere in the house.

Phew! That's a lot :grinning:

:rofl: how true.

Any wiring/power that involves outdoors should always be protected by an RCD at the supply end. This will trip if there is a short. Any external wiring that I use - both temporary and permanent - have RCD's and this stops the house RCD tripping if water gets into anywhere.

I don't have loads but for me, the number depends on position rather than load. With a device being only a few $, it is easier and generally better to put a device in each place you need a sensor. Typically, I have one in each room or space that I want to monitor.

2 Likes

Hi @dougle03,
Thanks for taking the time to respond here!! Back on topic finally :wink:

Well I wanted to add fuses, to protect my central power supply to be shortcircuited when the outdoor cable is somewhere damaged:

image

Was thinking to use inline fuse holders (see ali):

image

So a fuse per wemo, to avoid that one failure breaks my entire system.

Well that is due to the construction of our house. We renovated the farm of my grandparents, so as a result the devices are quite a long distance from each other. So I will end up with multiple wemos each measuring a single metric. But that is not a problem for me...

1 Like

In the garden ... Have you thought a system power with solar panel/converter/battery ?

True! but remember this will not trip if there is a problem with the low voltage cables...

It sounds like I'm in line with @dougle03 as I'm not happy until I've used every GPIO pin on my ESPs :wink:

As you are planning on running cables to these locations for power, perhaps you could just run the sensors back to a smaller number of ESPs acting like "hubs". What type of sensors will you have at each location ?

I know that sometimes you can have too much feedback, but perhaps if you sketch out a "site plan" with equipment / sensor locations, then feedback can be more focused on your needs. :crazy_face:

If could of course measure the same sensor N times via N different GPIO pins, or add a dummy sensor to every unsed GPIO pin... But I know what you mean: I feel sorry for every unused GPIO pin :wink:

It are mainly analog sensors, so I like to keep the ESP close to the sensor. And of course by buying some extra wemos, I get a very simple setup with "wifi" sensors that all communicate to my central Node-RED.

Yes that is absolutely true. But you will understand that I am not going to publish a floorplan with locations of PIR sensors, IR beam transmitters and receivers, and so on :wink:
The mailman delivered a box with lots of Wemos today. There is no way back now...

1 Like

Great let us know when the first one is online :smile:

1 Like

In-line fuses are ok, but they tend to be very cheap and mostly fall apart in my experience. However, they will do their intended job of being the weakest link to PROTECT the CABLE. :smiley:
Multiple fuses (One on each line as in your diagram) are fine so long as they are close to the power supply. Remember, place fuses as close to the source of power for maximum effectiveness.

Fair enough. Worth remembering that old buildings tend to have thick walls, so spend some time on your WiFi network to ensure good connectivity from all your ESP modules.

1 Like

This is an option, but most sensors are working on 3.3v signalling, so voltage drop over longer lengths could bring in more problems. Could always add in level shifters, but now we're spending $2 to reduce the number of $3 ESP's... diminishing returns starts to kick in.

1 Like

Hahah, yes it is, I'm slowly reducing them by combining more functions into fewer units. But when I started I scatter gunned them everywhere, very proud of myself.. :joy:

This is true for AC, but 'presumably' the transformer will be indoors/protected, whereas only DC is going outside. this being the case then anything that happens to the external DC won't trip the RCD as it requires reference to neutral that is not present on an isolated switched mode power supply on the output side (Normally, but some very cheap Chinese supplies do seem to have this 'feature' of live on the output :thinking:)...

This is what I'm aiming for too. We're moving house soon, so it's a golden opportunity to start again with multiple-sensor packages in each room.... At least that's the goal. It's going to be odd being in a house for a short period that does not just 'do stuff' without being directly commanded... :disappointed_relieved:

1 Like

I donā€™t want to disturb the party here but ā€¦ have you considered the environmental impact @ total of all your mains powered sensors always powered from some source (including solar panels). I mean all the sand-by wasted power of having some voltage regulators, transformers cable loss and what not or producing a solar panel + LiPo battery. A simple AA battery powering your sensor for over a year is not only the best power source for a sensor as the voltage match. Take a zigbee humidity temperature sensor with a nice LCD for convenience runs on one double AA for now two years and counting. And yes we have battery recycling in germany and yes I use it. For 15ā‚¬ i have a nice small case I can stick wherever I like. Installation 5min, done. No cables = I can place it wherever I like or get good results and if not I can move them in seconds.
For example powering smoke detectors via mains seams a good Idea, or?

In my opinion a DIY Esp is totally fine where there is simply no or no affordable alternative like a water pressure sensor (where this discussion started) - and by the way I pass the 10 years old meter of my heating system at least 5 times a day. No need here. But I canā€™t look into my water filters and having saturated filters costs more energy in pumping through clogged membranes.