control 12 V fan via Vera/Arduino
-
I want to control a 12 V fan using a scene on my vera. When temp or humidity exceed X I want to be able to turn the fan on and vary it's speed based on the those variables. I have been thinking about this for a while looked at a lot of posts and youtube vids. I can't seem to get my head around the way to do it. Any ideas would be appreciated. I have built several sensors and relay controls for mysensors so I have a rough idea of how his stuff works.
Thanks!
-
@scottdube the key for the speed control is to use a PWM signal. To control the fan, i would either use a mosfet or an h-bridge controller. Use an h-bridge if you at any time think you would want to run the fan in reverse. The mosfet or h-bridge will take the 12v needed for powering the fan and the 3.3v or 5v PWM signal from the arduino to control the fan.
-
@dbemowsk Thanks, I think I get that part. How would I present it (the fan) to the vera so that I could have variable speed? So that it would show up as a dimmer rather than an on off switch?
-
@scottdube that i am a little unsure on. I run an Vera controller, but i have nothing that uses variable control like that. When i get home later i can look a bit and get back to you.
-
@dbemowsk Thanks Dan... It's not critical to vary the speed but it seems like a good feature.
-
@scottdube simple on/off would be done pretty much the same way with a mosfet, or it could be done with a relay module. The mosfet would be a more compact solution over a relay module.
-
@dbemowsk ya mofset is the way to go on this very small fan under .5 amp. I'm just having trouble how to present it to vera so I can change the speed of the fan.
-
Just doing some looking at the serial API pages, I think you would want to present the fan as a S_DIMMER with V_PERCENTAGE. I am not sure if you are on UI5 or UI7 for your Vera, but it looks like you should see something like this (UI5 example)
I don't know if you can change the icon or not though.
-
@dbemowsk that looks interesting! Then I would just map the percentage in the declarations?
-
@scottdube Something like that.