I am using an Arduino Uno R3 and an Adafruit anemometer to measure wind speed. Once the wind speed hits a certain speed, the program will close a loop via a relay that will in turn open a driveway gate.
To conserve power of the project, I power down the Uno and wake it up once every 10 seconds. The anemometer is powered as well by a 9 volt battery. I am using a MOSFET transistor to power down the anemometer as well, again to conserve power.
Here are my questions:
When I measure the power at the anemometer, my voltage reads 7.25 volts. I'm wondering why it isn't the full 9 volts that I get if I measure the battery.
When the MOSFET is open, meaning no power is being sent to the anemometer, the voltage meter reads 1.14 volts. Why is there power at all?
As a side question, there are several Ground pins on the UNO. Are they all connected? Or are there times I would use the Ground on the digital side of the board vs using the ground on the Power side of the board?
Here is how things are wired:
Anemometer Ground --> MOSFET Ground Out
Anemometer Power --> MOSFET Power Out
Anemometer Signal --> UNO A0
MOSFET + --> UNO Vin
MOSFET - --> UNO Ground (On the Power Side)
MOSFET Ground In --> UNO Ground (on the digital side)
MOSFET Signal --> UNO D7
Relay DC + --> UNO 5V Power
Relay DC - --> UNO Ground (On the Power Side)
Relay CO --> UNO Ground (On the Power Side)
Relay NO --> LED (I light this up signifying a closed circuit that will eventually be the gate)
UNO Power 5V --> Resister and then to other side of LED
Please post a schematic, the language of electronics is a schematic, not a list of connections, which is ambiguous. For example you refer to a 'MOSFET ground', there is no such thing. Hand drawn and photographed is fine.
Okay. Thank you for the tip on checking my grounds with the DVM. Not sure why I didn't think of that.
My MOSFET is an N-channel.
I've attached a schematic of what I have. I am measuring my voltage at the points labeled with an "A" in the upper right corner.
I'm not sure what you mean when you ask "source or drain" in respect to my Vin and Gnd pinouts.
Thank you, good start but I suspect you have a module with a MOSFET mounted it along with some other bits. A MOSFET has 3 terminals called Source, Gate and Drain, which is not what seem to have shown. Please show what you actually have.
An IRF520 is not logic level, so not suitable for using with a 5V supply. Try IRL520.
And for more context, because maybe there is a more elegant/efficient way to do what I am trying to do.
The motherboard for my gate has two pins on it that when connected together, will open the gate. The gate will close when those pins are once again disconnected.
My circuit uses the relay to connect those two pins. The MOSFET module was my idea to conserve power as the gate has no commercial power, but runs on 12V battery, charged by solar.
I intend to power my project from the gate's motherboard's 12V output. I am using a 9V currently for testing only.
I'm not in a position to give a proper answer at the moment, but even if I was I would struggle because I don't know what the circuit is of the module you have, so I don't know how it relates to what you have done. All I can say at the moment is an N channel MOSFET works as a low side (negative wire) switch, which is not, I suspect, what you want. I also don't know anything about your anemometer as you've not supplied any information about that. All the anemometers I've seen have 2 wires, which just have a contact across them, the consum no power and don't need to be switched on and off.
Please read my tutorial at the top of every forum category about getting the best out of this forum.
What I hope is a better answer than I could give yesterday. The biggest problem in replying is not knowing how the MOSFET module is constructed, by which I mean its internal circuit and what the various connections really are, and not knowing anything about the anemometer, so what power it needs and what its output is doing. I directed you to my tutorial because really you need to supply this information up front, otherwise I and others are guessing and you don't get the answer you want.
Based on what I can tell and what I know generally I can tell you:
An IRF520 is not suitable for use with an Arduino because it is not logic level, which means it will not turn on properly with 5V. Try IRL520 (the 'L' signifies logic level). In any case, you can't do what you want with an N channel MOSFET because that can only switch the negative, or ground. If you were to switch the negative then when you disconnected the negative from the anemometer you'd still have 9V or 12V or whatever connected to the anemometer, which would find its way to A0 on the Uno and you'd soon be ordering a new Uno. If you really want to switch the power to the anemometer you need a P channel MOSFET as a high side (positive) switch. Somewhere on the forum there's a nice little diagram showing all the different ways to switch things connected to output, one of them is what you need, but I can't find it. If someone reading this knows what I mean please can you post a link to it?
Finally, if you want to conserve power you won't do it with a Uno. Powering it down every now and then leaves its regulator drawing power. There are better boards for power saving, but this isn't something I'm expert in, I've never tried to get minimal power consumption. There are lots of topics on here about it though, do some searching.
You need a P-channel MOSFET and another transistor (NPN or N-channel) to trigger it, like this schematic. Replace the motor symbol with your anemometer and 30V with 9V.