I need to turn on a very small DC motor (3v / 100ma) when light touches it. I know I could use a mosfet and a light sensor (which already comes with my arduino kit), but I am wondering if I can accomplish this pretty simple task without an arduino? Reading the light sensor with analogRead, I would like it to trigger the motor at the value 300 or above (300 is already lots of light coming to it).
Is there such a thing like a mosfet which already turns on when light is detected? I read on google about phototransistors, but I found so many of them and I couldnt find one to my case... Maybe phototransistor is not the best approach then...
What MOSFET comes with your kit? Please post a diagram of the light sensor circuit, as you have already built it. Adding a MOSFET to that circuit might be quite easy. But let's start with what you already have. It's easier.
You could use one of these LDR modules with a built-in comparator and sensitivity setting to drive a MOSFET directly. You will need a 3-ish volt power supply (so you don't fry the motor) and a MOSFET that will work at 3V.
Use the digital output from the module for the Gate of the MOSFET and tune the sensitivity so that the motor comes on at the desired light level.
You guys gave me lots of ideas! I need this to be very light (it will be used in a drone) and I think the LDR/LM393 module will be great!
Then I am thinking: how much current can I draw using the LM393 output pin? Instead running a motor, I am thinking about running a very simple solenoid. Do you know if the output 1 pin of LM393 can run a solenoid?
I am building a payload drop system to use with my DJI drone. Using the remote control, I can control the LED light in front of the drone, so when I turn it on (using the remote control), it will turn on the LDR which will turn on the output 1 pin on LM393. If know I could turn on a solenoid and make it move just a little bit, it could be enought to me release a payload (I just need to move a small needle or metal thing, it will release the payload).
Would you have any idea if the output of LM393 would allow me running a solenoid (home made solenoid, I will wrap copper wire and put a needle inside it)? This way, I wouldnt need to use a mosfet!
The TI LMx93 comparator has a 20 mA Absolute Maximum output. The TI LMx93B has a 25 mA Absolute Maximum output. If your solenoid runs on less than 10 mA (2 to 30 volts) you should be OK.
Most solenoids require more than 200ma... sad news... Do you know any other voltage comparator that allows for more than a dozen miliamps? Or do you have any other suggestion of how can I turn on a motor/solenoid from a light being turned on?
What is that my friend? What does that module do? Is it a mosfet driver? If so, I cant see any advantage of it... it has mosfets and inputs/outputs... In this case, using the mosfet by itself would be lighter (because of usage in drone) and cheaper. Right? If there was already a mosfet driver which would work with light sensor, than that would be really nice!
You can't really. The minimum digital drive circuit is two resistors. MOSFETs come in SMT packages mostly so how are you going to mount and heatsink it without any PCB?
But you could probably get away with a 2N7002 in a TO-3 package with wire leads, for such a small load. Don't forget the flyback diode across the motor. So, three extra components.
Thanks for your reponse. I just didnt understand the resistors... I never used resistor with my mosfets, never fried an arduino controlling the mosfet connected directly to analog/digital pins... the mosfet input is high impedance, right?
Usually there is one to limit the inrush current due to the usually high gate to source capacitance, and sometimes one to keep the MOSFET turned off while the driving pin is still high impedance at boot time.
Impedance is frequency dependant, in any real not theoretical circuit.
Empirical testing ("hey, look, it works") with only one data point, can give you absolutely no confidence about the reliability of a circuit. You could be right in the sweet spot, or sitting right at the margin of operation, you would not know the difference until it fails (which is usually when it matters the most, Murphy's Law).
Thank you all for the explanations! Very clear and indeed, from now on I will use both resistors (pull down and protection).
As @TomGeorge requested: my project is a payload drop system for a drone. I have a DJI MINI 2 (very light drone) and I want to drop things like rice (in a wedding), or colorful/cutted paper over people on celebrations (outdoors, of course). I need a mechanism that is light and that I can control using the LED from DJI DRONE. I can turn on/off a specific LED in the drone using the remote control, so using a LDR in front of that LED I can detect it being turned on and release the rice.
First I was thinking about 3d printing a mechanism that if I turn the drone left/right very strongly, it could release a small pack of rice from a hook on the drone... but I think it would not be very reliable. This idea would be the best, very light, simple... but I still cant be creative enought to create such a mechanism in a way that does not "trigger" on random movements of the drone...
So I was wondering about using small lipo battery +LDR + voltage comparator + Solenoid but any solenoid that I built uses more than 200mah and it's way over the voltage comparator current draw. So I will have to use small lipo battery + LDR + voltage comparator + MOSFET + solenoid... and things start to get a little bit more complicated and heavier...
Would you guys have any other suggestion to release rice or someting light like colorful cutted paper ? Any mechanism that can be implemented that maybe does not need to use electronics?