Hydroponics Project with High Power LED control system - Page 1
Forum section: electronics / beginners

author: Pariston
author_rank: Contributor
timestamp: July 18, 2020, 07:16:21 am
content: Hi,I would really appreciate some electrical engineer to take a look at my circuit.There is easyeda link, as well as, last screenshot.https://easyeda.com/editor#id=|dfa4e1af68304c6eaf1bb91488e08489|892cd2b274124761828b4d0120da1232Thanks :3

author: Ground_Loop
author_rank: Frequent Contributor
timestamp: July 21, 2020, 10:38:14 am
content: Could you explain what the system is intended to do. I see a fairly high powered uC in between what looks like four switches controlling four LEDs. Also, the uC is capable of controlling intensity, but you have pots directly in line with the LEDs. Adjusting the POT will change Vgs of the FET. Similar for the pump. I also see a 32.768 KHz primary clock that should probably be in the 32 MHz range. I assume this is divided down to 1 second intervals for on-off time setting the LEDs. Nonetheless, I have not looked at the data sheet for this uC, but many of the PICs have RTCC peripherals that can be driven by a secondary clock source. Also, how is the on off time set? What is the purpose of U5? I’m baffled.

author: Pariston
author_rank: Contributor
timestamp: July 21, 2020, 01:48:28 pm
content: Hi,Thanks for replying. i will try to answer your questions first, and then explain how circuit works in general.1. Mcu is powered from buck converter (U3) when there is power and from battery - boost converter(U2) when power goes off.2. High power leds are running at 144mA. Potentiometers are there to have some manual control over the led current and assumed to drop 1.5 Volt at it worst, so Vgs of the fet should still work. i think...3. Yes, 32.768 kHz crystal is there for RTCC controls of this pic. I could use internal 32 kHz clock but this one should be more accurate.4. U5 is a constant current source of 100 mA to recharge battery. Also, there is a ADC input connected to that point, it is there just to measure voltage of the battery to charge and discharge it properly.

author: Pariston
author_rank: Contributor
timestamp: July 21, 2020, 02:41:01 pm
content: Circuit is designed for tiny hydroponics syste.External controls:At first, I would like to explain all possible ways that person can communicate with a system. There are four tactile switches in total, and all of these have something to do with controlling High Power LED.SW1: responsible for setting how many groups of LEDs are active, which is basically a way to control brightness (yes, there is a reason why we are not just controlling current through the LEDs...). When pressed, activates next group of LEDs. Initially set as LED1 ON others off, but every next touch will activate another FET until all four groups are ON, if you press switch again it will go to initial state (yes, you are not able to turn all LEDs off with this switch).SW2: This is a very important switch which defines how many hours of light, plant is going to receive in a day cycle. Initially system is set as 12 Hours On 12 Hours off (state 1). Once SW2 is pressed, cycle increases by 2 hours, so if you press it first time, it is 14 hours on and 10 hours off(state 2). In total, there are 5 states from 12 to 20 hours, next touch sets it to initial conditions. Note: when cycle is changed, signal led is going to indicate change in cycle. Ex. if changed from state 5 back to state 1, led should blink once, twice from state 1 to state 2 etc..SW3: This switch initializes a moment in time when day cycle begins. Ex. if system is set to 14 hours on & 10 hours off(cycle state 2), and you press SW3 at 8 am, then at 10 pm lights will turn off, until turning back on tomorrow at 8am.SW4: ON/OFF switch.System has two states of operation. We will use "Power" pin to consistently check incoming voltage. State of this pin defines operation of the system.Power Mode ON:Step 1: We turn off BoostCE and pump2, turn on MainFET and pump1. Check voltage with "battery" pin and if battery is charged we turn "charge" pin off. If battery wasn't charged, turn on U5 until charged.Once battery is charged and pump running, it is a regular condition of this system. Mcu consistently checks "Power" and "Battery" pins to keep track of situation.Power mode OFF (goal is to save power without killing a plant):Immediately turn on U2 (supplying mcu from battery). Turn off MainFET and pump1, turn on pump2. Consistently check "battery" pin:At 50% start blinking signal led.At 30% turn off pump2.At 20% turn off BoostCE - shut down(trying not to damage battery itself).Once power is back on, system should recharge battery and work normally.Thanks for reading. Hope you are having a great day :3

author: Ground_Loop
author_rank: Frequent Contributor
timestamp: July 21, 2020, 05:01:34 pm
content: Quote from: Pariston on July 21, 2020, 01:48:28 pmUse the 32.768K oscillator as a secondary clock to run the RTCC, SOSCO and SOSCI pins. Use the internal 32MHz clock as the primary clock source. Both are easy to configure in MCC. Your uC will be running horribly slow otherwise. I would also recommend that you run the loads and adjustment pots on the drain side of the FETs instead of the source side.

author: Pariston
author_rank: Contributor
timestamp: July 21, 2020, 05:53:43 pm
content: Yes, I've just moved loads on the drain side recently. Everything that you said about the clock is basically the way i wanted this to be, but i didn't realize i've connected them wrong. Thank you for pointing this out.