Can arduino do it?

Hello guys..before i start to work on my code i would like to know if my uno can actually do all of the things i need it to do..
In short i need to write a program that:
-reads the data from: PH sensor, EC sensor, temp and humidity sensor, RTC, and water temperature sensor
-based on time and day: triggers water pumps 1-4 (not same time) and controls led lights and a small ventilator
-based on ph readings: triggers pumps 5 and 6 (depends if ph is low or high)
-based on ec : larger or smaller dose from pumps 1-4
-based on signal from contactless water level sensors sends a message for refill

So i guess my question is: can i do this on arduino uno, maybe like a loop for readings and then multiple functions that are called upon at certain time/condition?
Or should i just get a raspberry pi and write multiple programs?

Sounds like a lot for an Uno, but a Mega could probably do all those things.

Advance the project in tiny steps. Get each sensor working, one at a time, for example, and make sure you understand how they work before adding parts together.

Pumps required appropriate controllers and their own power supplies.

I can't count straight for sure, but it seems like you'd have enough I/O pins and

that is the only resource you'd have to worry about and

there are ways around that using an UNO or you could switch to a boad with more pins.

Logic-wise I've seen way more done.

a7

1 Like

I would say, probably, because the question has some ambiguity. Not knowing the particular parts that you want to use and not being able to see he technical data for those parts is a handicap.

How many pins do the sensors, LEDs and motor drivers need?

Each motor will need a driver. If it rotates in only one direction, a logic level MOSFET would be a good driver (one pin for each driver). If it must rotate forward and backward a H-bridge driver will be necessary (2 or 3 pins for each driver).
Pololu has a great line of motor drivers.

To write the code, start by writing code for each part. When you have bits for each part you can put them into functions that the main program can call. Many parts will have libraries to help. Usually the library will come with example code to help get it working.

OK thank you guys..yes when it comes to wiring i will use a uln2003a for the pumps and an external power supply will be no problem at all. I will have just about enough pins for everything, my only concern was the coding part. I can imagine it would be much easier on a raspberry pi and just writing multiple programs but since i have a couple of unos at home i would like to use them :slight_smile:
Thanks for the info guys..

You can use two (2) Uno's ... no law against that.

An uno wont be able to get time by itself. It will need to have access to a time server so internet connectivity is needed. Unless your planning on relying on a real time clock module which is not ideal.

If you are worried about running out of pins, buses are your friend. Lots of sensors use i²c bus, plus RTC, I/O extenders, extra external ADCs etc.

One simple idea to reduce pins required would be to replace your ULN chip(s) with TPIC6B595. Only requires 3 Arduino pins to control many of these chips and they have 8 outputs each variable of switching 150mA each I think. I guess you can gang 2 outputs together for up to 300mA.

1 Like

RTC was the plan yes :sweat_smile: is it not reliable? I have the wifi integrated version of uno, i guess that could work?

will check it out..thanks

If you put your code for each part in a function that is essentially what you are doing. Each function is a small program that the main function (loop()) calls as it is needed. You can pass values to a function and return values from the function.

1 Like

So with a RTC you will have to input the date/time info any time it loses power. So you would have to code that in. With wifi access you can get to a time server and get the correct time/date automatically. Just have that part in setup and periodically check it. So that way it is done automatically and is correct.

1 Like

My DS3231 RTC module keeps good time when disconnected from power with its battery backup. Only need to set it once and I do that off system time when the sketch is compiled.

2 Likes

Raspberry pi's are listed on Amazon (US) for over $100. I know I would have to think twice about buying one for something like this.

Yes, you are correct. So, I would say connectivity is not needed. I don't why I forgot about that.
Senior moment(s)

Hello gvidmar

Take a peace of paper, a pencil and design, based on the IPO model, a program structure plan before start coding.
Identify functions and their depencies. Now start with coding and testing, function by function.
At the end merge all tested function together to get the final sketch.
The basics for coding the project are to be found in the IDE as examples.

Have a nice day and enjoy coding in C++.

1 Like

I have heard of those "senior moments", but I can't, for the life of me, remember where. :slight_smile:

lol, I'd tell you but I can't remember.

1 Like

Hi an answer to what is possible.

I will often answer WokWi.com on such a question. Many sensors and actuators are available,
som may be custom designed by users, and you get into a simulator that keeps getting better every day base on user inputs. I higly recomend all to investigate that services some day, and maybe you even find a project you like made by other giving you ideas. Uno, Mega, Pi, ESP and other controllers are included and you dont need to buy a new on ebay / amazon etc, until you have found out what you like to know more about. And I2C parts are also available in the simulator letting you investigate the features and how it works, and if you even want to simulate a circuit, there is a logic analyzer avaialble. Documentation is include inside the website wokwi.com.

Wit paid service you get aggess to a web-site simulation wit an ESP, and other cool parts.
Basic version gets you a long way. Only issue I can think of right now. I does not simulate analog devices, it simply sets values from 0 - 1023 so it can use the analog ports.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.