📜 ⬆️ ⬇️

The smart REDMOND Smart plug SkyPlug RSP-100S (Part 2). The main drawback of the outlet and its elimination

So, finally, I “finished off” the second part of the Redmond SkyPlug RSP-100S Smart Socket.

As I told in the first part - the article “Smart Redmond SkyPlug RSP-100S socket. Analysis of the design and circuit of electrical principle. Identifying flaws, ” I had to draw a diagram of this outlet in order to finalize it. I didn’t really like another one, in my opinion, the main drawback of this smart outlet, which I didn’t talk about in the first part. In general, I like to modify something, my colleagues at work even joke that if something is not finished by me, then this is something - not mine. :)

So, we will announce this disadvantage, and this, if many have not guessed, looking at the scheme, is the absence of an autonomous power source. The fact is that in the composition of the IC nRF51822 there is a real time clock, and they work, i.e. time is counted only when there is power from the network, because There is no internal power source, neither a battery, nor a battery, nor even an ionistor. This means that if a power outage occurs, even for a short time, the clock will be reset and previously stored on / off programs will become irrelevant. Using a smart outlet, I almost immediately drew attention to this shortcoming, and gave it great importance, because electricity in my city is cut off often. Especially often there are shutdowns during a thunder-storm, etc. And another drawback is that the socket does not save the current state, and if it was in the “On” state during a power outage, then after the electricity was applied, it starts to work in the “Off” state.
')
Somehow I had to leave home for a couple of weeks, and I asked one wonderful person to come to my house to feed aquarium fish. And one day, she calls me and says that the lighting does not burn in the aquarium. I asked to see if the clock on the microwave oven showed time, to which I received the answer — no, and this is my power outage indicator. I immediately realized that there was a power outage, and when the power supply was restored, the smart socket did not turn on, because it did not provide for the storage of the latter state in the firmware. But even if the state was stored, then due to the lack of accurate time, this state could be irrelevant, for example, if the electricity was turned off during the day and restored in the deep night, when lighting in the same aquarium is no longer required. Here the idea arose to modify the smart socket and introduce some kind of self-contained power source into it. For this, I needed to find out the principle of operation and, as a result, to know the electrical concept of the smart socket: what are the supply voltages, what components, what Bluetooth controller, where are the on / off programs stored and where the time and days of the week go, and dates. The countdown of all logic in the outlet should have been built in, since the on / off programs via the smartphone are set by the days of the week and for a certain time, and the Bluetooth connection with the smartphone is not always supported and, therefore, the smart socket has no constant synchronization of time and programs. As a result of the work done, described in the first part, I determined that the on / off programs are stored in the memory of the Bluetooth controller itself and it also has a real-time clock, and the clock is synchronized when the smart socket is connected via Bluetooth to a smartphone, i.e. time is taken from the smartphone with each connection.

As a result, it became clear that protection against loss of electricity in the electric lighting network, at least for a couple of hours, is necessary, and this can be solved only by introducing the above described devices: a battery, battery or ionistor.

1 SEARCH FOR AUTONOMOUS FOOD METHOD

To begin, I decided to try the simplest - the ionistor, since this device does not need to enter any charging schemes, and it is enough to connect it in parallel to the power supply terminals of the Bluetooth controller, and the ionistor would be charged from the power supply to the voltage of this source. I soldered to pins 1 and 4 of the footprint for the XP1 plug (I remind you that this plug is not on the board, but there is a place for it and holes, the extreme terminals of which 1 and 4 are pins connected to the power supply of the Bluetooth controller, and there must be present voltage 3.3 V). The ionistor was charged to the power supply voltage of the Bluetooth controller, but after disconnecting the smart outlet from the mains, the ionistor was discharged in about a minute. The accumulated energy of the ionistor was not enough to maintain power for a couple of hours, because There are cases of power outages for 1 - 2 hours. I must say that I put the ionistor not very large capacity, only 0.33 F, because the larger capacitance of the ionistors was already fairly decent in size and it would not be easy to put them inside the outlet. And, as practice has shown, even if you put the ionistor at 1.0 F, it would also not be enough for as long as we would like, but, of course, it would be quite suitable for short-term power outages.

After the ionistor, the idea was to put something like a lithium battery, the type of CR2032, like on computers, but not that size, but smaller - CR1620. But, this idea almost immediately dropped out, because the battery is short-lived - it will sit down quickly and cannot be charged, and it is also difficult to connect it - soldering the conductors to it is not a good idea, because You can overheat and it will fail. I did not find small-sized batteries with welded leads in my city, but even if I did, I had to disassemble the socket each time, or put them outside, which would increase the dimensions of the smart socket and the aesthetic appearance would be lost.

When I was looking for ionistors and batteries, I noticed small Li-Pol batteries in one of the radio shops in the storefront, in the form of a rectangular parallelepiped and, importantly, suitable, in my opinion, dimensions. The store had batteries with a capacity of 20, 40, 65 and 100 mAh. I then figured that it seemed to be the most suitable for 65 mA • h in overall dimensions, but I still had to look inside the outlet again and evaluate the space under the battery so as not to get disappointed when I bought the wrong one, and the price is rather big: from 200 up to 350 rubles and, as for evil, 65 mA • h - the most expensive.

2 PROCESSING AUTONOMOUS POWER SUPPLY ON THE BASIS OF THE BATTERY

Since it was decided to put the battery, now there was a problem in applying the charging circuit of this battery and organizing the power supply from it to the Bluetooth controller chip, since the operating voltage on it is 3.6 V, according to the datasheet, and a fully charged Li-Pol battery produces a voltage of 4.2 V. A small current is required to charge the battery, especially with such a small capacity, and it was necessary to make a charge circuit with current limitation . Immediately came to mind the scheme on the IC TP4056. Ready-made handkerchiefs - chargers for Li-Ion batteries, based on this chip, I ordered a well-known site not so long ago, and when they arrived, they were not immediately used, and they were safely sent to the box, where they waited for their fate. They did not have to wait long for at least one of them. The board looks like the photo below, there is an IC TP4056, mode indication LEDs and the rest of the strapping. Although this chip is for Li-Ion batteries, but I think it will do for Li-Pol too.



Figure 1 - Battery charge controller based on IC TP4056

According to the description on the seller’s website, this instance is designed for a charging current of 1 A, this is explained by the applied resistor nominal value installed between the common wire (IN-) and the output 2 of the chip, in the photo this resistor is below - 1.2 kOhm, which is according to the datasheet 1 A charge current. According to the datasheet, in which a table of charge currents was given depending on the resistor rating, I could not find a resistor that would give a charge current of less than 130 mA, which is twice the battery capacity, and the batteries usually charge with a current not more than 0.2 from C (where C is the battery capacity). In this case, I assumed that the battery with a capacity of 65 mA • h is suitable for me, i.e. C = 65 mA • h, from where we determine the charge current 13 mA. To ensure such a current limit, it was necessary to choose a resistor between the common wire and the output 2 of the chip. Based on the existing resistor ratings and the corresponding currents, I made a graph, on which I conditionally continued the line in the direction of increasing the resistor resistance and approximately determined the required rating at the required current, I chose a resistance of 62 kΩ. Then, according to the datasheet, the resistor, going from the power source to the IC 4040 power output (pin 4), should be from 0.2 to 0.5 ohms, but since there was a 0 ohm resistor (jumper) on the board, I decided to follow the datasheet and of the available small surface resistors, I found one for 1 Ohm and two for 1.5 Ohm, soldered them all in parallel and thereby gained a resistance of about 0.43 Ohm. Honestly, I don’t know why, this resistor, judging by the scheme, this resistor is not a shunt, but perhaps it is in the case of a short circuit in the battery to limit the current.

Now, when the resistors were selected and soldered, it was necessary to cut off the excess charge from the charge controller card, namely the area where the mini-USB connector was soldered, this area would not allow the board to be inserted into its intended place in the case, and if it was cut off, then The board is clearly placed where I determined it. So, dismantle the mini-USB socket, so that it is more convenient to cut off the excess with metal scissors. Below in the picture you can see what the board looks like after the revision.



Figure 2 - Modified Battery Charge Controller

But in this picture you can see where the charge controller board can be located in the smart outlet housing:



Figure 3 - Placement of the battery charge controller in the smart socket box

Then, the following problem occurred. Now you need to power the charge controller with something, because the transformerless power supply of the smart socket was designed for 12 V, in the mode when the relay is off, and the TP4056 charge controller, according to the datasheet, is powered with a voltage of no more than 8 V. Therefore, the charge controller cannot be directly fed , and it was necessary to lower the voltage to ensure proper operation of the TP4056. But it is best to feed on 5 V, because This is a more common voltage, and besides, there was a mini USB socket on the board, which meant power supply from 5 V. The simplest and small-sized one I could think of to get 5 V was to install a linear stabilizer in the SOT-23 or SOT-89 package, because load currents (charging) will not exceed 100 mA, which is usually designed for such small-sized stabilizers. From the existing arsenal, there was a L78L05ABUTR microcircuit in the SOT-89 package, which I decided to use, but it had to be put somewhere and mounted on a small piece to solder - you could break the conclusions, and there was a risk to close something Because there is not so much free space on the smart socket board. Therefore, quickly made a scarf for this chip, which also provided for the installation of ceramic capacitors.



Figure 4 - Linear voltage regulator at 5 V

Now, when there was a charge controller and a charge controller power board, I was able to estimate the place of their installation, and now it was already visible - where one of the attracted batteries would stand. I visited that store again, looked at everything again, and yet chose the one that was 65 mAh, you can see it in the picture below.



Figure 5 - Li-Pol Battery LP451124

3 ASSEMBLY OF AUTONOMOUS POWER SUPPLY SYSTEM

Now there is a battery, charge circuit, voltage regulator for the charge circuit, we connect it all in the appropriate sequence and we get the construction as in the picture below.



Figure 6 - Battery with charge controller

We check this assembly in work. We supply a voltage of slightly more than 5 V to the stabilizer and look at the voltage at the output of the stabilizer and then on the battery. In my case, everything worked right away, a charge current came to the battery, while a red LED was on. Having a little endured and controlling the charge current, I concluded that the loading was slow, that it would be necessary to increase the charge current. I looked again at the datasheet on the battery and it was said that the standard charge current of this battery is 0.5 • C, which corresponds to a current of 27.5 mA. Then I reduced the resistance of the resistor, which sets the charge current to 47 kΩ, with the result that the battery is charged faster and the green LED on the controller lights up, indicating the end of charge.

There is a battery, a charge controller and a voltage regulator for the charge controller, now we need to consider the nRF51822 Bluetooth controller power scheme in order not to exceed the 3.6 V supply voltage, and even better not exceed 3.0 - 3.3 V, at which the manufacturer guarantees normal operation. To do this, the simplest and most compact one can think of is to apply voltage from the battery through two series-connected diodes of type 1N4148, on which 0.5 - 0.6 V falls on each, eventually we will get voltage 3.0 - 3 after the diodes , 2 V, which is permissible for operation of the IC nRF51822. Also, the diodes will not allow the battery to discharge when the voltage is present in the network, the output of the linear stabilizer DD1 will contain 3.3 V voltage in the output of the native smart socket, as a result of which the diodes will close and the voltage will not flow to the battery and also from the battery the voltage will not flow to the nRF51822 while the supply voltage is present. Even in the datasheet on nRF51822 it is said that the minimum operating voltage is 1.8 V, which, when the battery is discharged to 2.8 - 3 V, will allow us to support the operation of the nRF51822 in the absence of electricity in the network, which means that the real-time clock will not reset to this time will be maintained in the “On” or “Off” state - as before the power outage, and this state will be maintained until the program is triggered, if the time comes, if it has been set, or until the battery is dead.

4 SCHEME ELECTRIC PRINCIPAL CLEVER SOCKETS WITH AUTONOMOUS POWER SUPPLY

We are building a new basic electrical circuit with a modified smart socket, an autonomous power source based on a Li-Pol battery. The scheme is shown in the figure below.



Figure 7 - Electrical schematic diagram of the refinement of smart sockets

In the diagram, the additional diodes of type 1N4148 have reference designations D1 and D2, for convenience of searching, they are also circled in dashed lines within the A1 board.

5 INSTALLATION OF AUTONOMOUS POWER SUPPLY SYSTEM ON THE BASIS OF THE BATTERY. ASSEMBLY OF A NEW CONSTRUCTION OF A SMART SOCKET

According to the scheme, additional diodes should be installed on the smart socket board, then install the battery, charge controller and stabilizer in the smart socket case to the designated places and unsolder all inputs and outputs.

We put the charge controller and stabilizer as shown in the picture below. The charge controller board is simply inserted into the space between the stand under the screw and the protrusion of the socket under the plug, it is inserted there relatively tightly - it does not hang out and does not pop up, and we put the voltage regulator board for the controller on the hot-melt glue with the elements towards the socket. You can also see that I have half-glued the grounding bracket with heat-resistant adhesive tape, for which it will become clear below.



Figure 8 - Installation of charge controller

Install the battery in place, as shown in the photo below:



Figure 9 - Install the battery

The picture shows that the battery is installed in the opening of one of the corners of the outlet housing on one side of the grounding bracket. To isolate this bracket, I pasted two layers of heat-resistant tape, first, it isolates the battery leads, and secondly, there will be additional phase and ground insulation, since unbound phase voltage present on battery. Conductors of appropriate polarity, which run from the charge controller board, are soldered to the battery terminals, and the conductors go from the charge controller board to power the Bluetooth controller through the diodes to the socket board, as shown in the circuit diagram. I insulated the terminals of the battery with soldered conductors with a shrink tube, while bending the terminals and part of the shell gently without sharp movements, bend at an angle of 90 ° to the base of the socket where the grounding bracket is installed.

Unsoldering of the power supply circuits of the stabilizer and the battery output, as well as the installation of additional diodes D1 and D2 can be made as shown in the photo below.



Figure 10 - Wiring of battery circuits and additional diodes

This installation of the battery, charge controller and voltage regulator for the charge controller allows you to easily assemble an outlet, i.e. The battery and additional boards after assembly do not in the least interfere with the main board: nothing rests or touches. But still, for reliability, I insulated with heat-resistant tape the place of soldering the ground wire leading to the load grounding bracket from the network grounding bracket. And you should also pay attention to the flexible conductors, which, when assembled, must be refilled so that they do not cross the contact holes for the power supply plug. Perhaps, as in my case, you need to grab them somewhere with hot melt. , -0,12, .



11 –

, , , , , , , , , .



12 –

, , , .

6

, , , .. , , , – , – .



13 –

, , , , , «» / «», , , «». , «», VT2 , , , VD6 «», , , 12 5 – 6 , . , «», – , .

7 .

, C3 C5 , . , 0,47 , 1 . , , 400 500 . 500 , , Murata , 220 , , . , , . , , 10 – 20 , . , , 400 . 450 0,47 .



14 – 450 – 0,47 .

, , , .



15 –

, – C3 C5, .

-0,2, . C3.




16 –

, «» , , , 4 9 , . , , , , 2,2 . , , , , , , «» «». , 10 – 11 , , .. .

8

, :



17 –

, C3 C5, Cb .

, , , - . , , .
Thanks for attention!

Source: https://habr.com/ru/post/395883/


All Articles