Hi I am new to programming and I need help with controlling vent on a greenhouse.
My arduino expert moved to Argentina:/
I have 5 motors of 160w each that push open vents. I want them to open and close at a certain temperature and also close when it rains. I now use a button that I hold for about 10 sec to open and close.
I now have
arduino uno
wifi shield (to be able to open with iphone)
temp and humidity sensor
rain drop sensor
relay for 220v control
but I dont know how to program it:)
I would be very thankful for any assistance
for photos of the greenhouse dome
www.naturhuset.blogg.no
Thats a good idea, I have got the temperature sensor working with a code I found. It collects data every second
this is the hardware I have
The temperature sensor http://www.miniinthebox.com/no/dht21-am2301-kapasitiv-digital-temperatur-og-luftfuktighet-sensor-svart_p657174.html
Key Features
Model DHT21/AM2301
Quantity 1
Color Black
Material Plastic
Power source: DC 3.5~5.5V;
Humidity range: 0~100%RH;
Temperature range: -40~80'C;
Precision: 3%RH / 0.5'C;
Monobus digital output
Application Capacitive Digital Temperature & Humidity Sensor
Packing List 1 x Temperature & Humidity Sensor (20cm-cable)
Ok, that's step 1
I would make the next step to process that data coming in.
I guess displaying that data doesn't do it for you, and am imagining you want to do something with it.
So, see if you can have the LED on pin 13 of your Uno turn on when some temperature you are aiming for is met.
Following steps would be to have an upper and a lower threshold (and so create a hysteresis you will without doubt need ).
You can use a single LED to display multiple statuses, for instance by having it blink.
But first of all you need to make a simple plan, indicating your goals for this project.
Try to set it up so that you can work on different goals in case one of them gets stuck (like perhaps while waiting for parts).
Work out each of them (as Terry King already pointed out), after which you can combine them into you final goal.
The parts:
Those relay boards might be able to control a single motor.
Do you have a single one for the 5 motors, or do you have or plan to use a relay per motor ?
Switching on 5 motors at the same time isn't a very good idea, not even if that relay tells you it can handle 30 Amperes.
That same source also has a similar board that has 4 of these relays on board.
Personally, i found a display with 2 lines of 16 characters very helpful for debugging.
If you plan to have a display in your setup too (there are lots of possibilities here), you might want to get that working with some priority.
It would be good to know more about the 'motors' - they have an existing controller
that limits the movement perhaps? The usual scheme for actuators is there are two
switches to detect end-of-travel of the actuator to stop the motor when going in
that direction.
Ideally you want to be able to just talk to the existing motor/actuator controller, in effect
pushing the buttons - otherwise you have to take responsibility for this.
Part numbers, photos, any details of the existing vent control unit and actuators may be
useful to post here.
You may also have to consider cable-length issues with the sensors - if you can locate the
Arduino close to the sensors life may be simpler.