About me
I'm an air soft gun player. In case you don't know, it's a game where you dress up as a solider and shoot other soldiers with a replica gun. The gun itself shoots little BB bullets. As you might imagine, each player needs eye protection. One of the most common types of eye protection are goggles. The problem is that the game requires a lot of running which makes you perspire. The sweat often causes your protective goggles to fog up. I want to design a solutions for this problem.
The project
My idea is to attach 2 small fans to my goggles that would be connected to an Arduino, a power supply (simple battery), and a moisture sensor. The fans would activate upon the sensor detecting a certain value of moisture on my head.
Programming
Even though I know close to nothing about Arduino programming I believe the coding process should be the least of my worries. I know some Python and SQL so I know what's it's like to write simple software. I imagine my code to be a simple loop in which the sensor would detect the moisture value in 30-second intervals. Upon measurement, some if statements would be called to determine whether the fans should be turned on or off. The only problem I see here is that I doubt the Arduino programming language has a build-in moisture sensor library. I will probably have to download a library for my specific sensor if such a thing exists at all.
Tinkering
I'm not an electronics guy so it's hard for me to visualize all the socket-cable-resistor-transistor combos, but I bet it's not rocket science. My project doesn't need to be super efficient. It just needs to work. My only concern is the moisture sensor. It has to be a skin sensor, not a soil sensor. I'm not sure if such a thing even exists.
My questions
First of all, is such a project even achievable for a novice like me?
Does a skin moisture sensor described above even exist? If yes, could you drop me a link? If not, can you think of any alternatives?
Are there any libraries for the aforementioned sensor that would produce the values I'm looking for? Links would be appreciated.
You could try a humidity and/or temperature sensor in the goggles. The conditions that cause condensation are humidity and a significant difference between the air temperature inside the goggles and the lens (which is determined by the ambient air temperature). The common DHT11 or DHT22 sensors are for both temperature and humidity. One of those in the goggles might be enough or you might want an additional temperature sensor outside the to determine the exact conditions that cause fogging. There are libraries for the DHT sensors.
I think the basic concept of the project is definitely achievable. The difficulty is in making something that won't be super inconvenient to wear.
The key to accomplishing a project is to break it into a series of small steps, only moving on to the next step once you've verified that the current one has been completed successfully. If you wire up a pile of parts and write a bunch of code there is a very good chance you will find it doesn't work. It's normal to run into some problems, no matter your skill level, but the problem is that you won't even know where to start troubleshooting. Is the problem with the hardware, the wiring, or the code? Did you do something wrong or were you sold a defective part? Is there a bug in your code or in the library or Arduino IDE? If you do things methodically, testing at each step along the way, you will be able to pinpoint the source of the problem. Once you know where the problem is it's much easier to find a solution.
A microprocessor is overkill. Analog circuit would be plenty sufficient. But then again a fan is overkill, imo. A decent dual-pane goggle with antifog treatment won't fog. You can find cheap ski goggles that'll work.
But if your project also has the side effect of you learning about electronics, then great. Just realize you may be throwing more money trying to make cheap goggles work for you instead of getting a decent pair.
pert:
The key to accomplishing a project is to break it into a series of small steps, only moving on to the next step once you've verified that the current one has been completed successfully. If you wire up a pile of parts and write a bunch of code there is a very good chance you will find it doesn't work. It's normal to run into some problems, no matter your skill level, but the problem is that you won't even know where to start troubleshooting. Is the problem with the hardware, the wiring, or the code? Did you do something wrong or were you sold a defective part? Is there a bug in your code or in the library or Arduino IDE? If you do things methodically, testing at each step along the way, you will be able to pinpoint the source of the problem. Once you know where the problem is it's much easier to find a solution.
Thanks for the advice! When writing Python scripts I often use a similar method to what you suggested. After writing a couple of lines of code that make up a function I always test it out in various ways before moving on to the next step.
About the sensors you suggested. How do I write code for them? Are there any libraries out there that have built-in functions that return values? How do I know that a specific library will work with my type/brand of sensor? You see, I'm a bit confused since I haven't done anything like this before. If you have any specific examples of such libraries I would appreciate a link - I'm curious to go through the technical documentation.
DanteeChaos:
Are there any libraries out there that have built-in functions that return values?
There are multiple libraries for the DHT sensors. Here's one:
It includes example sketches that will be available at File > Examples > DHT sensor library after you install the library. There is also a link to a tutorial.
DanteeChaos:
How do I know that a specific library will work with my type/brand of sensor?
It will say so in the documentation. If you have a DHT11 sensor and the library says it's for DHT11 you're good. If you want to use a different sensor you might need a different library. The one I linked above will work for DHT22 also but that sensor is larger so probably would be even more of a pain to have cluttering up the inside of your goggles. If you use a different sensor like BME280 you will need to use a different library. One of the great things about Arduino is that you will find a library for pretty much any common device. If you don't find a library it probably just means that the sensor is so simple to interface with that no library is necessary.
The BME280 is tiny at 2x2.5x0.95 mm. The DHT22 in it's standard housing is big enough to cover your eye.
Note that the SprakFun and Adafruit breakouts for the BME280 have lots of extra components making up for most of the bulk. The sensor itself is the little shiny metal box.
seems like wiring a fan batteries and on off switch would be the way to go, or wire mesh goggles, or nice goggles. but it is absolutely doable the way you describe.