I think it is nuts for people to go into so much details just to control leds.

Having said that, one of the responders to the first link correctly identified the reason for ringing when switching a mosfet. That becomes a bigger issue when an inductive load (a motor for example) is being switched. I discussed that in one of my posts a couple days ago.

The last post's approach is excessively complicated. You can have a dedicated pwm controller to switch leds - those dc/dc converters with on/off pins are great for this.

Alternatively, you can use your arduino to perform conversion: you can use a sampling resistor + the analog comparator for cycle-by-cycle control; or you can use the sampling resistor + adc for averaging. The 2nd approach is very computationally intensive.

To much detail?Hm, but nobody wants flickering lights in the living room?

Also the cables to my sleeping room ans bathroom will be around 10-20 meters.In the moment everything is open - but when the wallpaper is done it's to late to changesomething. So i need to make sure everything is planed correct and thats the reasoni read allot.

So what will be the best solution for my 12 Volt house lightning where everything can be dimmed?

Some high-power LED power supplies will accept PWM or variable DC as a dimmer-control signal. You can filter PWM to variable-DC, but sometimes it's a 0-10V control so you'd have to amplify the Arduino's 5V output. Most of these supplies are highly efficient.

PWM is 100% efficient (in an ideal world), but in addition to (or along with) dimming, you need current limiting. With low-power LEDs, you normally use a resistor for the current limiting, and that's not efficient, but no big deal if you are only wasting a few milliwatts. In fact, switched current-limiting (very efficient) is usually based on PWM with feedback-control and a "smoothing" inductor.

Quote

Is there a way to modify the "Highly Efficient 0-100% LED Dimmer" and use it withthe Arduinos PWM?

Probably... But, by the time I figure-out how that circuit works and how to modify it, I dunno...

Quote

To much detail?Hm, but nobody wants flickering lights in the living room?

As long as they flicker at a fast rate, nobody can see it. Older flourscent lights flicker at 2 x the 50/60 Hz line frequency. TVs flicker at the same rate. Film flickers at twice the framerate (2x24Hz). Most people aren't bothered by that. Newer flourscents with electronic ballasts flicker at kHz frequencies and nobody is bothered by that. The Arduino's default PWM rate is ~500Hz, and nobody can see that either.

In the moment everything is open - but when the wallpaper is done it's to late to changesomething. So i need to make sure everything is planed correct and thats the reasoni read allot.

I'd say try do make it easy to access the wires or run new wiring. If you have an attic or crawl space, that's not hard to do. Otherwise, maybe you can run some conduit. It's very-likely that something will need to change in the future.

And, it sounds like its a little late to be designing some new-untested lighting concept. For something permanent in your house, I'd consult an electrician and install something tried-and-true. You can buy dimmable and non-dimmable LED home lighting that runs off 12V or 120/240V, and as far as I know it's all highly efficient so you shouldn't need to design something yourself unless you really want to.

If you've only got one shot to run cables then I suggest you run a CAT5 or similar cables 'just in case'. This gives you several twisted pair cables for DC or serial comms, and also makes it possible to run in Ethernet. Once you have power and Ethernet available, almost anything you can imagine becomes possible.

I only provide help via the forum - please do not contact me for private consultancy.

Hm, didn't think of that before.I already run CAT6 SFTP to all my wall switches.

Its AWG 23 so the table says 0,259 mm2 in German size.And the other table from the VDE (in English = Association for Electrical, Electronic and Information Technologies e.V.)says your allowed to run 4 ampere through 0,25 mm2.

So i can power 48 Watt of LED light. And i also can make it PoE and have Ethernet at the lamps if i need it one day.Wow thats a nice idea and i was on my way to use AWG 16 or 13 because thats what you use for normal halogen stuff (3x 35 Watt/12 Volt halogen lamp = 8,75 ampere).Thats the problem if you still think analogue today *lol

But the reason for this thread was more: how to dimm them.Cause i need to order electronic parts and also want to order the FET's.

Edit:My first test LED lamp is here.There is something i forgot. They work with AC and DC and it doesn't matterwhere you connect positive and negative. So there must be some kind of electronic inside the lamp.Somebody know how they work? How does this effect the dimming circuit i need to build?

Test cable runs first and be wary of running 12 near 240 (they should NOT share the same conduit) crossing at 90deg is preferable.

Quote

Everything here is 230 Volts. I don't want that anymore.If i make it 12 Volt i save energy and can power it one day with photo voltaic.

If you come to sell your house, will this effect the price? Will you want the availability of mains in the future.If you have a ring main for the lighting, can you use the existing switch wires and place your 12V controllers above the lights, so effectively re-using the cables and not worrying about sending 12 over long distances? This would allow you to revert to 240V at any stage.

Edit:My first test LED lamp is here.There is something i forgot. They work with AC and DC and it doesn't matterwhere you connect positive and negative. So there must be some kind of electronic inside the lamp.Somebody know how they work? How does this effect the dimming circuit i need to build?

Quote

If i switch from "PWM 1" to "0" it really needs long until my multimeter goes down to 4,5V.

Sounds like you may have a capacitor in there.As to "brightness" your eye's sensitivity may not see much difference between 50 & 100% Have you used a lux meter (digital camera exposure meter? )

I meant the Highly Efficient 0-100% LED Dimmer; it's an interesting project, but is it necessary? You must be the judge of that. It is very easy to get carried away with specifications. I would imagine that one of your main criteria is long life and relative cheapness. It's akin to buying a hybrid car, I've driven a few, they are okay around town, they don't save the environment, they cost a lot to run and to purchase. The product needs to fit the requirements.

I have no lux meter.But what about the 4.5Volt i always have?Why does the Mosfet not totally turn off?

If your fet is partially on, then you may be seeing a small voltage, they require very little leakage before they start to conduct. Try disconnecting the gate from the port and tying the gate with a resistor and see if you get the same result.My suggestion was to use a digital (SLR) in place of a LUX meter as a crude replacement. Illuminate a scene with your LED and check that the exposure changes as you continue to increase the PWM. Maybe your source voltage is too high?You may need to play with the position of the illumination and objects in the scene to get a full range effect. - just an idea.To see how "unreliable" (fabulous) your eye is in this situation, take an exposure reading indoors in a bright room and then try the same outdoors.As to flicker, I would think that the 490K of the Arduino ought to be okay, I can't report that it has ever bothered me when playing with LEDs, But I have not illuminated a room. I have to say that VW tail-lights annoy me, I don't know what frequency they cycle at, but I find the light trails as I move my head distracting.... Maybe they are just flashbacks?

The Highly Efficient thing was just a idea in the beginning when i was reading around and looking for infos.Now i just want to get the dimming working.

Hm, a resistor at the gate? I have the 4.5Volt at the LED even with the gate not connected to the Arduino.

Source voltage? You mean the 12Volt that go to the LED? The IRLU8726PBF is made for up to 30Volt.

I can find allot 220Volt MOSFET circuits but nothing on logic level MOSFET.From my understanding there is no need for a driver if you use a logic level MOSFET andyou can connect it directly to the micro controller.

I have just an 15 year old 2MP digital camera. No need for a new one until i have the luck to visit Disney World