I am doing a school project using Arduino and I just cannot find the right route to take when writing the code. I have tried a few different sketches but they all failed. What I am intending to do is make a sketch where a temperature sensor and a solenoid valve are involved. What will happen is the temperature sensor will be touching flowing water through a pipe and if the water is below 50 degrees f the solenoid valve will have electricity run through it therefore switching the flow of water from one pipe to another, what the basic three way solenoid valve would be like. If it is over 50 degrees then it will just stay regular. I got the solenoid arrangement without the temperature sensor from an Instructables tutorial, link here http://www.instructables.com/id/Controlling-solenoids-with-arduino/
Thank You!
n8thano:
I just cannot find the right route to take when writing the code.
Understand what you want the code to do.
Divide it up into simple tasks that are capable of being implemented independently. For example: for each external device you need to interact with, you need to know how to interface with it.
Have you figured out how to connect the temperature sensor? Can you get an accurate temperature reading from it? Have you figured out how to connect to the solenoid/valve? Can you switch the valve to each position that you need it to switch to?
Once you have all the parts working you can join them up by using the temperature to decide what position to switch the valve to. That part sounds as if it should be very simple, but there's no point trying to do that until you have the fundamental parts working.
As Peter suggested , devide it up. Google the topic with the word "arduino" at the beginning and look for the Playground tutorials on how to do that task.
We're not going to write your assignment for you but we'll guide to the information you need to do it.