Time Fountain

Ok, Mosfets are for DC current, what is the equivalent for AC current? I have been searching but don't know what to search for because I don't know the name.

what is the equivalent for AC current?

A triac.

But why? You can't switch AC current at the rate you need for this project.

Well what would my options be then? How would I pulse that many LEDs controlled with Arduino?

twychopen:
Well what would my options be then? How would I pulse that many LEDs controlled with Arduino?

Hi

I think the best thing to do is break this project down into smaller pieces, you'll then arrive at answers to each individual challenge. This is an extension of what PaulS suggested when he posted you should hold off on the Bluetooth bit until other aspects are sorted.

For example how rapidly do you need to pulse your LEDs, do they get pulsed all at the same rate or individual different rates, or in independently pulsed groups? If there's just one pulse rate for all, then you'll most likely be able to do this all from just one pin of the Arduino. Think of the Arduino as the signal that runs the pulse, not the source of the power and it will make more sense perhaps. Also does the pulsing of the DC pump to create the drips need to be varied/controlled by the Arduino independently, or could it be a known constant pulse and the lighting pulses are varied only?

Your Uno has 20 digital pins that can be used to generate your pulses, two of which are usually reserved for serial communications and are useful for debugging (and could be used by your bluetooth later) leaving 18 for directly controlling your LEDs and/or pump. It is possible to generate pulses external to the Uno that are varied by the Uno so all is not lost, but you'll need work out the specifics of your requirements before making any of those decisions.

Geoff

Ok, Mosfets are for DC current, what is the equivalent for AC current?

Would that be AC for your 6V DC motor? Or AC for your LEDs?

how rapidly do you need to pulse your LEDs

I don't know the exact speed. I want to change the speed of the pulsing of the lights while keeping the pump at a constant speed.

do they get pulsed all at the same rate or individual different rates, or in independently pulsed groups?

All at the same rate

Also does the pulsing of the DC pump to create the drips need to be varied/controlled by the Arduino independently, or could it be a known constant pulse and the lighting pulses are varied only?

It can be constant. Actually, I have an AC pump and a DC pump. I thought I would be able to handle everything from the Arduino when I first started so I got the small DC pump. I think the AC pump will be the one I am using though because of the power requirements.

I know I can't power either the lights or the pump from the arduino but I want to control the lights.

twychopen:
I know I can't power either the lights or the pump from the arduino but I want to control the lights.

One pin with a MOSFET will control your bank of LEDs then, and either another to control your DC pump or maybe you could use some kind of solenoid valve setup to have the pump running constant pressure, but regulate the flow?

Either way it appears you're back to needing only 2 pins from the Arduino Uno, the rest is details :slight_smile:

Cheers ! Geoff

Grumpy Mike was saying I can't pulse the LED's fast enough using AC.

Just found this as another example where they use the arduino to control both pumps and lights. Water Droplet Sculpture Using LEDs And Arduino | Hackaday

What I don't know is how I can control AC current through arduino to flash the lights at the speed I need. I have to go back and look at my code for the exact speed I set on the 4 test LEDs that I set up.

What I don't know is how I can control AC current through arduino to flash the lights at the speed I need.

You can't.

AC has a cycle time of 50 or 60 Hz, with a triac once the power is on it remains on for the rest of the cycle. If you feed an LED with AC then it is already flashing at 60Hz (I assume you are in the U.S.) Therefore you can't get it flashing faster than this because you can't turn it off until the next half cycle. You can't use an incandescent light because you can't get it to flash fast enough because of the thermal time constant. So why the obsession with flashing lights with AC?

Using a triac (when packaged up is called an SSR) you can turn your AC pump on and off but not control the speed.

So why the obsession with flashing lights with AC?

Because I want to be able to plug it into the wall and have the fountain turn on.

I need to convert the AC to DC then, then control it with the Arduino? (Which still I don't know how I'd do that).

twychopen:

So why the obsession with flashing lights with AC?

Because I want to be able to plug it into the wall and have the fountain turn on.

I need to convert the AC to DC then, then control it with the Arduino? (Which still I don't know how I'd do that).

LEDs are low voltage DC devices. Using mains AC to power them directly does not really make sense. The more sensible approach is to convert your AC to low voltage DC using a suitably rated power supply, and then use a transistor controlled by the Arduino to switch them on and off at whatever frequency and timing you want. The transistor would probably be a MOSFET as already mentioned.

then control it with the Arduino? (Which still I don't know how I'd do that).

Look at the blink LED sketch that comes with the Arduino IDE

LEDs are low voltage DC devices. Using mains AC to power them directly does not really make sense. The more sensible approach is to convert your AC to low voltage DC using a suitably rated power supply, and then use a transistor controlled by the Arduino to switch them on and off at whatever frequency and timing you want. The transistor would probably be a MOSFET as already mentioned.
[/quote]

Ok, thats what I was looking for! I am not sure why I hadn't just thought of it this way as it is a very simple idea, but for whatever reason I hadn't. Thanks! I will get started researching this method!

Grumpy_Mike:

then control it with the Arduino? (Which still I don't know how I'd do that).

Look at the blink LED sketch that comes with the Arduino IDE

Sorry, I worded that sentence wrong. I know how to do the Arduino programming. I didn't know how to get the AC to power and control the lights.

The arduino controls the lights not the AC power.
To get AC power to power the LEDs you have to convert it into DC power with a wall wart.

thanks everybody

Ok, maybe another simple solution but I would prefer to just plug in 1 plug, not 2 (one for the lights and one for the seperate AC pump unit that just has to be on with no controlling.) How would I do that?

You could design your own power supply but I suspect you are not up to that.
You could wire the two units together in a box and have one lead comming out.
But basically you need AC and DC and these are two different things.

Grumpy_Mike:
You could design your own power supply but I suspect you are not up to that.
You could wire the two units together in a box and have one lead comming out.
But basically you need AC and DC and these are two different things.

No not up to designing my own power supply haha :slight_smile: I just will wire the two units together in the box as you said and have one cord for the wall. Thanks a lot!

Look at the blink without delay LED sketch that comes with the Arduino IDE

There. That's better. Start off not using delay(), then you won't have to figure out later how not to.