How can I do that

There are 3 inputs and these inputs are read on Arduino according to the adjusted voltage. As a result of this reading, it turns the system on and off with relay control with certain voltages.
When a voltage of more than 65V is read from IN1, relay1 turns on and an IN1 high voltage alarm is given to the user.
When a voltage above 220V is read from IN2, relay2 turns on and an IN2 high voltage alarm is given to the user.
When a voltage below 210V is read from IN3, relay3 turns off and an IN3 low voltage alarm is given to the user. and IN1,IN2 and IN3 inputs will read maximum 380V AC

How do You intend to detect those voltage levels?
AC or DC?

Rectify with a bridge, small R/C filter, resistor voltage divider and perhaps a zener protection diode for good measure - that should cover signal conditioning. Dimension the R/C filter thus that you have sufficiently fast response, but minimum hum on the signal. You didn't mention the required response time, so can't comment on this further.

For the relay outputs, any generic Arduino-compatible relay board will do. Alternatively a bare relay with a suitable driver, such as a small signal mosfet (think 2n7000) + freewheel diode across the relay coil. If the relays need to be very heavy ones switching enormous loads, you may have to scale things up a bit. Depends on the load that's being switched, but it's not specified.

The code is straightforward and is simply based on analogRead's and if-statements. You could account for hysteresis in your code to prevent the relays from chattering if the voltage fluctuates around its limit. To an extent the R/C filter after the rectifier will also serve this function.

As you can see, your approach will depend on a number of yet unknown specifications, two of which I've highlighted above, but there are more, such as space constraints, presence of electrical supply for relays & control circuitry etc.

Same post (basically)
Was posted yesterday.

Voltage divider so highest value is below the board voltage.

Simple logic based on level.

Is the class about logic and programming or about circuit design?

essentially both

Inputs specified as IN1, IN2 and IN3 are between maximum 380V AC
It will be used to read voltage. Here with a circuit between uC and input
the circuit to be triggered will be set manually. Also the uC side is set
It will see a value of 1 or 0 according to the voltage. (for example ~260V in the set circuit
and it will see 0 under ~260V seen on it.) These are in a function
can be kept and called in the code when necessary.

SWITCH1, SWITCH2, SWITCH3 will be controllable by uC(atmega 328)
and they will be able to switch 250V 15A. These operations are controlled by a function.
will be feasible.

Communication will be provided with the processor via USB and USB computer
It will be detected as COM PORT by

The data received from the sensors will be kept in a function and
will be used when necessary.

The circuit will receive its power over the 220V AC line.
Please help
Thanks

Hi @mhmt0614

Which prof. did you have this project done?

RV mineirin

Welcome mnmt0614, start by showing us what you have accomplished including a prototype schematic, not a frizzy picture and the code you have written so far. I am willing to help but I do not want to do another school project. The project has many solutions so do not get stuck in one path.

No, I haven't done it yet, there are deficiencies, I have a defect in the relay part

in hardware design i did all but relays

OK mhmt0614, did you get that?

i am sending the circuit i drew in altium

Probably smarter to post a JPG or PDF of your schematic.. only maybe 5% of forum users have Altium or would risk downloading files.

I made a pdf, it says new users cannot upload files

It may be pulling your leg.

@mhmt0614, do not cross-post. Threads merged.

I couldn't open it.

altium.pdf (487.6 KB)
I send my Altium draw

I only looked at the schematics for a minute or so, but there are immediately visible problems with it.

You seem to have an excessive number of pullups on the I2C bus to the point where it may not function anymore. A quick count suggests you're around 1k in total, which means you're right on the edge of the I2C spec which, if memory serves, outlines a max. of 3mA sink.

In the voltage detection circuit, there's no GND reference. I also doubt the effectiveness of zeners as input protection for the uC and would suggest using two Schottky's per channel, one to prevent against negative pulses and one protecting against pulses higher than the uC's Vcc.

Capacitors around the CH40T's (you mean CH340T?) crystal oscillator are missing; try 18 ~22pF.

The micro-SD interface is mysteriously powered through a 4k7 resistor; I'm not aware of any need or benefit in limiting the current to an SD interface to <1mA and I would expect to render it dysfunctional.

Decoupling capacitors around the 328P are missing.

I'd protect the BC548 by placing a freewheel diode across the unspecified buzzer in case a type is installed that causes back-EMF problems. It's a $0.01 insurance.

I'm surprised at the lack of any in-system programming provisions for the 328P, either through SPI or Serial. On the other hand, I'm also surprised at the presence of a CH(3?)40T linked to a MAX232, creating an onboard USB-Serial interface...that doesn't interface with anything else on the board??

So a lot is happening that raises questions. What's going on here?

I will arrange the I2C communications with Bus, there will be a single line and I will use a 4.7k pull-up resistor on this line.
I used 32,768 Khz crystal for CH340T now I see that I didn't connect capacitors
The voltage reading circuit was wrong, I realized later, there is no GND line, no frontend, no inamp, so many shortcomings
I put the CH340T in the project requirements as USB to Rs232 conversion is required.
Atmega 328 has some shortcomings, I couldn't complete it yet
Do you have a chance to read the project requests and tell me what to do?
proje_EN.pdf (106.3 KB)