### Author Topic: School Project (need help pls) Automatic ON and OFF light using LDR and MOSFET  (Read 1634 times)

0 Members and 1 Guest are viewing this topic.

#### batekoi

• Newbie
• Posts: 5
• Country:
##### School Project (need help pls) Automatic ON and OFF light using LDR and MOSFET
« on: May 26, 2023, 11:20:43 am »
my transformerless power supply on the left side of the volt meter outputs 24V until i connect it to my load circuit on the right. the volt coming out becomes and stays at 1.5V at most and i cannot figure out why, please help thank you.
« Last Edit: May 26, 2023, 11:24:41 am by batekoi »

#### IamSynthetiC

• Regular Contributor
• Posts: 57
• Country:
• White Smoke Activist
##### Re: School Project (need help pls) Automatic ON and OFF light using LDR and MOSFET
« Reply #1 on: May 26, 2023, 11:45:34 am »
Greetings,

I assume LA3 has no internal resistance (or is very small) and when the mosfet switches on you short your power supply to GND. The only thing keeping your supply voltage to 1.5V is (i assume without looking at the datasheet) the zener diode.

You will need to place a resistor between LA3 and the mosfet depending on the current you would like to pass through the lamp. The formula for the resistor R(I) = Vin/I = 24/I, where I is the lamp current.

Hope that helps.

The following users thanked this post: batekoi

#### Psi

• Super Contributor
• Posts: 9840
• Country:
##### Re: School Project (need help pls) Automatic ON and OFF light using LDR and MOSFET
« Reply #2 on: May 26, 2023, 11:46:41 am »
My first question is why are they allowing transformerless power supplies for school projects.
Seems like a terrible idea, unless you're not actually building them IRL

But in any case,  how much current does your lamp need. You wont get more than around 150mA from that transformerless PSU.
So if your lamp tries to pull 500mA for example, that would explain the issue.
Lamps can use quite a bit of current, LEDs are way better.

Also, your zener has to burn off 24V @ 150mA which is 3.6W. There's a reason transformerless PSU's tend to only be used for lowish current stuff, like 50mA and less.
« Last Edit: May 26, 2023, 11:51:06 am by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)

The following users thanked this post: batekoi

#### batekoi

• Newbie
• Posts: 5
• Country:
##### Re: School Project (need help pls) Automatic ON and OFF light using LDR and MOSFET
« Reply #3 on: May 26, 2023, 11:58:34 am »
greetings also, thank you a lot for this reply. we will actually be building this irl, but will take place in school to have supervision. i will be using a lamp that uses around 0.15A - 0.2A. our teacher will not allow us to use LEDs.. I will try lowering my zener to 12V also

#### batekoi

• Newbie
• Posts: 5
• Country:
##### Re: School Project (need help pls) Automatic ON and OFF light using LDR and MOSFET
« Reply #4 on: May 26, 2023, 11:59:12 am »
Greetings,

I assume LA3 has no internal resistance (or is very small) and when the mosfet switches on you short your power supply to GND. The only thing keeping your supply voltage to 1.5V is (i assume without looking at the datasheet) the zener diode.

You will need to place a resistor between LA3 and the mosfet depending on the current you would like to pass through the lamp. The formula for the resistor R(I) = Vin/I = 24/I, where I is the lamp current.

Hope that helps.

greetings also, thank you a lot for this reply. we will actually be building this irl, but will take place in school to have supervision. i will be using a lamp that uses around 0.15A - 0.2A. our teacher will not allow us to use LEDs.. I will try lowering my zener to 12V also

#### DavidAlfa

• Super Contributor
• Posts: 5747
• Country:
##### Re: School Project (need help pls) Automatic ON and OFF light using LDR and MOSFET
« Reply #5 on: May 26, 2023, 12:00:01 pm »
Of course it doesn't work.
2.2uF gives a impedance of 1.21K(60Hz), 1.45K(50Hz).
So when you try to power the lamp, it'll take the power down.

Also R16 shouldn't be there, remove it completely.

Increasing the capacitor to allow more current is not a good idea, the zener will have to cope with a lot of of power when the circuit is off.

Also this aproach to turn the mosfet on is not good, you need a fast transition, avoiding active (Ohmic) region, the fet acts like a series resistor and might heat up depending on the load.

This transformerless circuit is only used for small power devices that are completely isolated, but for DIY stuff it's a very unsafe thing.
Take some old phone charger or whatever, but avoid this.
« Last Edit: May 26, 2023, 12:03:12 pm by DavidAlfa »
Stm32 Soldering FW      Forum      Github      Donate

The following users thanked this post: batekoi

#### batekoi

• Newbie
• Posts: 5
• Country:
##### Re: School Project (need help pls) Automatic ON and OFF light using LDR and MOSFET
« Reply #6 on: May 26, 2023, 12:05:43 pm »
Greetings,

I assume LA3 has no internal resistance (or is very small) and when the mosfet switches on you short your power supply to GND. The only thing keeping your supply voltage to 1.5V is (i assume without looking at the datasheet) the zener diode.

You will need to place a resistor between LA3 and the mosfet depending on the current you would like to pass through the lamp. The formula for the resistor R(I) = Vin/I = 24/I, where I is the lamp current.

Hope that helps.

hello, greetings also and thank you for your reply. i tried putting a 2k resistor in between the mosfet and lamp and the current is still the same..

#### batekoi

• Newbie
• Posts: 5
• Country:
##### Re: School Project (need help pls) Automatic ON and OFF light using LDR and MOSFET
« Reply #7 on: May 26, 2023, 12:16:15 pm »
Of course it doesn't work.
2.2uF gives a impedance of 1.21K(60Hz), 1.45K(50Hz).
So when you try to power the lamp, it'll take the power down.

Also R16 shouldn't be there, remove it completely.

Increasing the capacitor to allow more current is not a good idea, the zener will have to cope with a lot of of power when the circuit is off.

Also this aproach to turn the mosfet on is not good, you need a fast transition, avoiding active (Ohmic) region, the fet acts like a series resistor and might heat up depending on the load.

This transformerless circuit is only used for small power devices that are completely isolated, but for DIY stuff it's a very unsafe thing.
Take some old phone charger or whatever, but avoid this.

Hello, sir. Thank you for your reply. Tunfortunately the transformerless ps is instructed by our teacher so we can't not use it, along with it c9 is in the given circuit. Also I did try removing the capacitor and the lamp worked except the voltage is not stable and mosfet and C11 explodes when luxx is at maximum..

• Super Contributor
• Posts: 1268
• Country:
##### Re: School Project (need help pls) Automatic ON and OFF light using LDR and MOSFET
« Reply #8 on: May 26, 2023, 02:27:22 pm »
Your teacher should be fired immediately and reported to relevant authorities.

The following users thanked this post: Ian.M

#### tunk

• Frequent Contributor
• Posts: 958
• Country:
##### Re: School Project (need help pls) Automatic ON and OFF light using LDR and MOSFET
« Reply #9 on: May 26, 2023, 03:00:00 pm »
R16 is far too high - in many designs a ~10ohm fusible resistor is used.

Edit: Maybe the point is that it doesn't work, and that you should find out why.
« Last Edit: May 26, 2023, 03:05:52 pm by tunk »

#### DavidAlfa

• Super Contributor
• Posts: 5747
• Country:
##### Re: School Project (need help pls) Automatic ON and OFF light using LDR and MOSFET
« Reply #10 on: May 26, 2023, 03:51:22 pm »
It seems your teacher is going on the cheap or has little to no idea!
You should never remove C9, it's what limits the current! Adjust its value to get more or less power.

There's no practical way of doing this, the capacitor has to be large enough to provide power to the lamp, but without load (Lamp off), the voltage will rise to very high levels, easily 200-300V.

To overcome this you'll need to add some voltage clamping or regulation:
- Clamping wastes a lot of energy and generates heat when the load is off.
- Regulating would need high voltage parts, normally not easy to source. Ask in the store for 300V linear regulator

Of course, just for demostration purposes, you can make it. Here're both examples.

« Last Edit: May 26, 2023, 04:08:17 pm by DavidAlfa »
Stm32 Soldering FW      Forum      Github      Donate

#### Psi

• Super Contributor
• Posts: 9840
• Country:
##### Re: School Project (need help pls) Automatic ON and OFF light using LDR and MOSFET
« Reply #11 on: May 27, 2023, 05:30:00 am »
Just in case it needs to be said.
You CANNOT touch any part of this thing when it's connected to mains, no matter if its on or off.

This is the problem with transformer-less PSUs. It may only be making 24V but that will kill you, unlike a 24V battery which is safe.
The reason is that it's not actually 24V it just appears to be.
It is, in fact, moving up and down as the 230V mains cycles up and down.
So at one point in time the ground (0V side) will actually be 206V and the 24V side will actually be 230V.   206 - 230 = 24V.
You do have 24V across the circuit but you also have 230V from the circuit to your body.
It's 24V but its moving up and down to 230V and back.
It's non-obvious to people starting out in electronics and can be deadly.
Newbie: "It's only 24V, it's safe to touch..."  Zap.
« Last Edit: May 27, 2023, 05:37:00 am by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)

The following users thanked this post: Ian.M

#### PCB.Wiz

• Super Contributor
• Posts: 1416
• Country:
##### Re: School Project (need help pls) Automatic ON and OFF light using LDR and MOSFET
« Reply #12 on: May 27, 2023, 05:52:25 am »

Hello, sir. Thank you for your reply. Tunfortunately the transformerless ps is instructed by our teacher so we can't not use it

Of course you can not use it.
Tell the teacher it is unsafe, and ask them to show you the electrician safety sign-off on this design.
Write to the school Board, and ask them how much personal liability insurance each teacher has, and what the school has.

What school is that and what age student ?

#### Psi

• Super Contributor
• Posts: 9840
• Country:
##### Re: School Project (need help pls) Automatic ON and OFF light using LDR and MOSFET
« Reply #13 on: May 28, 2023, 12:33:23 pm »
It can be taught and demonstrated safely.
It just seems like a bad idea to teach school students that it even exists as an option.
Uni project sure, school project no.

The chances are too high that they might attempt to use it for a power supply on home projects.
School kids know enough to understand that 24V is safe, but not enough to understand that this is an unusual exception.
« Last Edit: May 28, 2023, 12:38:17 pm by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)

Smf