5

Suppose I have a mobile charger connected to an electric switch and I want to switch the charger off when the mobile battery is fully charged. How can I do that? Would I need smart switches to do so?

4 Answers4

5

Using something like a Belkin Wemo switch and an app like tasker on Android this should be totally possible.

You might need to go via IFTTT

hardillb
  • 12,553
  • 1
  • 20
  • 34
4

There are various power strips and in wall power plugs now that can be controlled via smart home controllers.

In this particular application, I am confused. Intelligent float charging is required for lithium ion batteries in cell phones. The charging circuit in the phone already senses the battery is full, and stops charging, until the battery drops to a predetermined level (usually %97) and then starts charging automatically. The amount of power used to monitor the charge state is trivial, and so is the consumption of the charger at rest (plugged in circuit, battery charged) and I would wager to bet less that the power consumption of using the android software stack to monitor the charge level.

This circuit is also active if the phone is off.

NiMH batteries from my youth normally had to be watched by the user and unplugged when charged. That generation of batteries had a lot of ways they could easily be damaged. overcharged, overdrained, underdrained, etc. . .

Lithium batteries don't suffer from under drain (develop a memory). The overcharge circuit had to be developed because if we overcharge a lithium ion battery it burns (violently). Since it was there, early developers set up the charge controller so that they also prevent too deep discharging, which can damage a LI battery.

The only things to be done with LI batteries for best lifetime are:

Use the correct charger characteristics. For most of us, that means using a USB block with the same output characteristics as the original. iPhone chargers are 1w, and you can get away with up to 2w. iPad chargers are 12w. They look like they charge the phone really fast, but really they destroy the battery. Android devices are similar.

Don't let batteries completely die. The circuit will shut your phone off at ~%3, but if you then let it sit for several days it will hit the bottom and this will impact the longevity and charge depth of the battery.

Oh, and don't charge them directly, without a proper protective circuit. They burn and explode.

Sean Houlihane
  • 10,504
  • 1
  • 25
  • 61
Mack Allison
  • 101
  • 2
  • 1
    This may be relevant, but it does not answer the question about how to implement the control. – Sean Houlihane May 18 '18 at 07:51
  • 1
    "iPad chargers are 12w. They look like they charge the phone really fast, but really they destroy the battery." - This is questionable advice. The charger isn't actually the block that plugs into the wall, the charger is inside the phone. Why would they put a circuit in the phone that destroys the phone? (and I'm not talking about planned obsolescence) – user253751 May 21 '18 at 01:47
  • You make a valid point. The charging circuit is in the phone, and it's power supply is the AC-DC converter that plugs into the wall outlet. That being said, the charging circuits in the phones still only work properly with 1-2w output power supplies. – Mack Allison May 22 '18 at 12:15
4

In addition to the other methods already given, I use Home Assistant on a Raspberry Pi3, WeMo switches, and OwnTracks on my phone.

The Raspberry Pi is also running hostapd to provide a wireless access point for the WeMo switches*, and Mosquitto MQTT server to receive the messages from OwnTracks.

  • OwnTracks sends location data but also sends battery level.
  • The battery level appears in Home Assistant as a 'sensor' (basically a dynamic value from a device).
  • A Home Assistant 'automation' (a script which is run when a trigger is fired) can react when the sensor's value is above, below, or equal to a specific value.

*hostapd is not required! One reason I have it configured is so that I can have my internet connection automatically reset when there's a connectivity issue: Home Assistant pings Google every minute and if it doesn't respond, then it turns off the WeMo switch that the router's plugged into, waits ten seconds, then turns the switch back on.

Aaron F
  • 191
  • 5
3

As the other answers have pointed out, there are a few aspects here:

  1. Having a switch that can be controlled remotely.
  2. Having a system that can send a command to the smart plug/switch (this might be a 'smart hub', or just a router in other cases, depending on how the plug works).
  3. Being able to determine when your phone should send the signal to control the remote.

The first bit is relatively easy; there are hundreds of them on the market of varying quality. You can find some comparisons at sites like Pocket-Lint, and you should be able to search for plenty of others on the Internet.

The second bit might be easy if you have a Wi-Fi controlled smart plug, or might require some more bits and pieces like a SmartThings hub if the plug uses another protocol like ZigBee. Depending on how much automation you plan to do, a 'smart hub' + ZigBee/Z-Wave devices may be a better investment than just buying Wi-Fi devices (which are sometimes more expensive or less convenient).

The final aspect is probably harder. My initial thoughts were something like IFTTT, which has an 'Android Battery' channel, but that can only send a message on 15% battery power. Hardilib's suggestion of Tasker's Battery Full Alert seems like the most convenient option unless you wish to develop a new app yourself (which seems to be overkill). You can apparently trigger WeMo switches directly from Tasker according to a Reddit thread.


Something to think about in your specific example though: is there any benefit to turning off the charger using this complicated logic? The charger is unlikely to overcharge your phone battery, or else there would be dangerous consequences (i.e. catastrophic failure!). The actual issues with 'overcharging' are detailed in this TIME article:

Even though a charger turns off the juice when your phone reaches 100%, the charger will continue to top off the charge during the night, says Bradshaw. Such a “trickle charge” attempts to keep it at 100% to compensate for the small bit of charge that your phone just naturally loses on its own. So your phone is constantly being bounced between a full charge and a bit below a full charge. These trickle charges can lead to higher ambient temperatures for your phone, which can reduce capacity over time.

Aurora0001
  • 18,490
  • 13
  • 53
  • 168