To achieve this, take care of these options: - Use a flat head WHITE bright LED (or make it flat head, to reduce the distance and fit the LDR better). Most important for many things is to get the lowest resistance possible. I struggle for a while with these things and did similar like you did. Here's a couple of links for those who want to learn more about optocouplers An optocoupler can be used in many applications such as synths and sound effect circuits, input/output switching, and a bunch of other applications. If you build circuits then at some stage you will come across a weird schematic symbol that is a optocoupler. So what is an optocoupler and why do you need to know how to make one. This homemade version uses a small piece of heat shrink. The shop brought ones will be enclosed in plastic. Both the LED and the LDR are enclosed so no light can reach the LDR. Others include vactrol, Opto-isolator, photocoupler and optical isolator.Īn optocoupler allows you to transmit an electrical signal between two isolated circuits with two parts: an LED that emits infrared light and a photosensitive device (LDR) which detects light from the LED. There’s a whole bunch of names that this little electric component comes under. I hope this instructable helped you out and if you have any questions or need some help just leave a comment and ill get back to you ASAP!!!.This is a short ‘ible on how to make an Optocoupler. If everything is working properly your fan or motor should be spinning, just remember if your starting from zero (fan off) you will probably need to enter a number of 20 or higher to get the devise spinning. Now that you have the code load it onto your arduino then open the serial monitor, Type in a number between 0 & 255 and hit enter. Int fan = 9 //fan on pin 9 int spe //fan speed void setup() Now that you have the circuit built lets upload the code and try it out, just copy the code below and paste it into your Arduino ide. Just use a rectifier diode with the positive end connected to the negative of the fan or motor and the negative side of the diode to the positive side of your devise. If you are using a big fan or motor you might want to place a diode between the positive and negative of your devise so if the power gets cut the power generated by the fan or motor does not exceed the reverse voltage of your transistor (if the power is cut and your motor is still spinning it will act like a generator until it stops spinning). The transistor I recommend for this instructable is a 2N2222 but any transistor that will handle the voltage and amps of your fan or motor will work fine, If you are going to be using a motor or devise that has high current pull I suggest using a Darlington transistor like the TIP120. The second 220Ω resistor limits the current flow through the phototransistor in the chip, the SHARP PC817 will handle 35 volts at 50mA but it will get very hot and not last long under those conditions so I put a current limiting resistor in the circuit to keep it way under those conditions. If you use a different optocoupler than the SHARP PC817 you may need to adjust this resistor to compensate, the PC817 has a Max led input voltage of 1.4 volts and the resistor brings the arduino 5 volts down to 1.25 volts. The first 220Ω resistor is connected between pin 9 on the arduino board and the positive side of the optocouplers led in the chip, this resistor cuts down the voltage from the board so it does not over power the led and burn it out. a 12 volt power source or a 9 volt battery will work if you don't have one. 1 X PCfan or motor you want to control (make sure it will handle the power supply your using). 1 X SHARP PC817 optocoupler (or any similar one will work). 1 X 2N2222 transistor (or any similar one that will handle the current of the devise you want to power). The picture above shows the circuit you will need to build.
0 Comments
Leave a Reply. |