offfff

[WiFi Plug DIY (3)] Remaking the plug 본문

프로그래밍

[WiFi Plug DIY (3)] Remaking the plug

offfff 2018. 1. 18. 21:29

A. Preface

 

1. I reused some parts from disassembled extension cord. Need modify parts, that is hard.

2. You may understand easily if you have little knowledge of electronic circuits.

3. Prepare : relay(Working under 5Vdc), diode, transistor(2N3904), perfboard, nipper, pliers, jumper cable

 

B. Little comment about parts that I used

1. Relay : If you drain the electricity, it changes the way the electricity flows by the power of the magnet inside.

2. Diode : Makes electricity to flow in one direction.

3. Transistor : Amplifies an analog electrical signal, or switches a digital electrical signal(Refer.)

4. Perfboard : Which is needed when soldering the parts on.

5. Jumper cable : For easy connection between raspberry pi and my module.

 

 

C. Cuircuit

I made this circuit with reference from B-3.

On below diagram, relay should be located on the part named R1.

I wanted to simulate relay with PSpice, but cannot because of error. So, 100Ohm resister was used.

Roughly, the current from GPIO pin on raspberry pi was 5mA.(Searching on google).

That wasn't enough to operate relay.

Using the amplifier circuit from reference, the current became 48.63mA(Almost 10 times).

Implemented on the breadboard, it works well.

 

Refer to the the notation on the picture, connect relay and amplifier circuit.

1&2 operate electromagnet inside of relay.

3&5 was connected when electrical signal didn't flow through 1&2.

So, I used 4 for the plug's switch. Use 1, 2, 3 and 4.

 

D. Implementation

It was extremely hard work for me. Really need muscles and the sense of reusing parts from plugs.

 

 

I used 5 jumper cables for connecting relays and GPIO pins.

Total 6, 2 cables for 5Vdc and Gnd from raspberry pi, 4 cables for relays and GPIOs of raspberry pi.

In the yellow circle, relay 3&4 connected

Did work well.