Air solenoid project

So first and foremost I would like to state I am a bit of a noob to arduions but do have some experience coding, though Im certainly no expert and its mostly in Python. I went back to school last year to finish off an Electrical Engineering degree I wanted to do for quite sometime, so I rather learn and have things explained as apposed just just some one pasting some code down.

Also, I had a profile on here before but couldn’t remember what email i used so i made i new one.

So to the point,

What I am trying to achieve is to create a system that till take inputs by touch screen that will tell the code to pause, start or reset the time and change the timer setting. This will basically send a signal to a relay that will open or close a solenoid to regulate airflow. The timer will count down a charge time(and show it), once “0” is hit it will reset the number and start the discharge timer and open the solenoid, ‘0’ again = reset and close solenoid. “Hold/Stop” will cause the device to either hold the valve open or closed.

Generic layout:

[“Button_1”] = Start/Pause #Pressing it each time should cycle it between holding the valve open or closed

[‘Button_2’] = Reset #Will wait for “Button_1” input to start again

[‘Button_3’] = [‘Button_5’] = Increase Timer Value #For Charge and Discharge time respectively

[‘Button_4’] = [‘Button_6’] = Decrease Timer Value #For Charge and Discharge time respectively


Now If I can get a handle on the above's code and get it to work, I would like to try and have UI of the actual number used so that when the user touches one of the timer number/counters they can manual input the desired number as apposed to just pressing an up or down arrow key 20 times (unless theres a way to hold it to have it climb/fall quickly). Also would like to have the "Start/Stop" change color between red and green. Attached a ruff image of what i was thinking.

If everything ends up working smoothly I plan on having the battery percent displayed in the corner and maybe even a temp/humidity sensor thrown in. I saw a man (educ8s.tv) on youtube do a nice build I was thinking of following: [link](https://www.youtube.com/watch?v=MWKAitSXv3g).

I guess what i was thinking was to write several 'def' functions for each of the timers, then have the 'stop/start' its own function that would reference the timer? The 'Reset' I think would clear the loop function's current setting back to default (10|5) and hold. The up and down arrows for each timer would also have their own function that would be called in the main? Ill forget about the extra stuff until I have a handle on the main concept.

The gear I think Im going to used, based of some videos and suggestions would be [UNO R3](https://www.amazon.com/gp/product/B008GRTSV6/ref=ox_sc_act_title_3?smid=AA57DDZKZUZDL&psc=1) and [
ELEGOO UNO R3 2.8 Inches TFT Touch Screen](https://www.amazon.com/gp/product/B01EUVJYME/ref=ox_sc_act_title_2?smid=A2WWHQ25ENKVJ1&psc=1). The raspberry pi setup in the video looks clean and straight forward but looks like a little more expensive route. Ill hold off on buying stuff for a day or two to see if i get any recommendations here. Ill need something to work with because as far as my Google-Fu is concerned I cant find a software online to simulate the components well.

So I appreciate the help and the knowledge any of you have to offer; I hope to learn a lot.

Thanks!

![Custom MP10 layout.png|552x317](upload://li9MisYMsxyqI0co9Gs0214euD9.png)

Sounds like a pretty big first project. If you do decide to tackle it. Do it in steps. There are lots of examples that come with the Arduino IDE so try those out on your Uno and get them working.

Figure out how to measure elapsed time so you can do your countdown timer (or google it - been done before)

Get some physical buttons and figure out how to wire them up and make a variable go up/down and display on the Serial Monitor

Get your tft working so you can write information onto the screen and detect touches.

Start wrapping it all together.

If/when you get stuck, post your problem, your code, the issue and people will help. They will be MUCH more inclined to help if you read the sticky post at the top of the forum about how to do all this properly.

Good luck.

blh64:
Sounds like a pretty big first project. If you do decide to tackle it. Do it in steps. There are lots of examples that come with the Arduino IDE so try those out on your Uno and get them working.

Figure out how to measure elapsed time so you can do your countdown timer (or google it - been done before)

Get some physical buttons and figure out how to wire them up and make a variable go up/down and display on the Serial Monitor

Get your tft working so you can write information onto the screen and detect touches.

Start wrapping it all together.

If/when you get stuck, post your problem, your code, the issue and people will help. They will be MUCH more inclined to help if you read the sticky post at the top of the forum about how to do all this properly.

Good luck.

Appreciate the the info. I had a similar layout for my plan so its good to see Im on the right track. Ill be grabbing an uno this week to begin tooling around. Ill update after I have some more code that actually works, haha.