![]() Current limiting resistors on both are necessary. You’ll want to connect the LED to a PWM pin on your Arduino, I used pin 3, and the LDR to an analog pin, I used pin 0. ![]() ![]() A little bit of scotch tape over where the leads exit the tube probably couldn’t hurt either to keep things in place. I just used a fingernail to crumple and bunch the edges of the foil downwards by putting the tube on end and nudging the stuff down. There is a hazard of creating a short circuit by using tinfoil, if the leads touch them, but it was the quickest solution I could come up with for closing the ends opaquely and still make the cover easy to take off and see inside. Then use a couple of squares of tinfoil to seal up the ends. Then do just that… LDR on one side, LED on the other and bend the pins down the side so that the components are generally facing each other inside. Really, it’s pretty simple… poke two pairs of holes opposite each other into the sides of the cardboard tube, with the holes narrow enough to allow the leads of the LDR and the LED to pass through to the outside easily. Why? Why the hell not? DIY Opto Isolator Components I’m going to make one with a light dependent resistor (LDR), a white LED, a paper towel roll, and some tinfoil – a DIY Optoisolator! On Digi-Key, the cheapest one available is a combination LED / Phototransistor from Lite-On that costs $0.37 in single quantities. As you’d expect, the opto-isolator page at Wikipedia is a great place for info. Typically, it is a combination of an LED, near infra-red I think, and either a photoresistor, phototransistor or some other optical technology I’m really not familiar with. That way your ADC can keep reading merily along, and you can adjust the motor speed by flashing a light, rather than having a direct copper connection that could allow all those horrible inductive spikes to flow back into the rest of your circuit. The optoisolator separates the two by using some photosensitive substance and a light source, the light source increasing or reducing the conductivity of the photosensitive substance in a predictable fashion. You need to use the values of the ADC to change the output of the motor, but can’t risk all the voltage fuzziness of the noisy circuit interfering with the carefully laid out analog stuff. Say you’ve got a noisy part of a circuit, full of magnetic coils like relays or motors, stuff like that, and then you have an ADC in another part of the circuit that’s measuring some super low voltage sensor signal. An optoisolator is used to electrically isolate one part of a circuit from another.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |