Go Down

Topic: turn on lights AND motor with PWM (Read 943 times) previous topic - next topic

khanfused

great.. I bought an arduino uno... now what do I do with it ?

First

what I need to do is turn on a light..
12VDC.. comes with an inverter that supplies 900-950 Vrms starting voltage then a constant current of 4-9 mA at 40-50Khz.
( designed for input voltage of 5VDC, 12VDC, 15VDC, 24VDC, 110VAC and 220VAC )

I need the lights to stay on for about 5 minutes.. I'll adjust that as I go along.

At the same time...

I want to activate a small 6VDC motor ( similar to what would drive a toy car) at ...let's say 1/10 the normal operating speed.
( not sure what the normal power is of the motor but it's not like I am powering a car starter )

So do I wire these appliances directly to the arduino board or do I have to go to relays etc. to protect from burning something up ?

Then How do I teach the board what I want it to do ?



PaulS

Quote
So do I wire these appliances directly to the arduino board

No. The voltage requirements for the light are too high for the Arduino to supply. The current requirements for the motor, and the voltage, are too high for the Arduino to supply.

Quote
do I have to go to relays etc.

You could use a relay for the light, but you can't PWM a relay. You can PWM a transistor, such as a MOSFET, to control the speed of the motor, but typically an H-bridge is used so you can control both speed and direction. Motor shields are pretty common.

Quote
Then How do I teach the board what I want it to do ?

Long lectures. The Arduino tends to fall asleep during lectures, though, so be sure to wake it up often.

khanfused

The lecture part was uber cute.

Okay.. so let me see if I got this right.

I set the Arduino next to another circuit board.... the pin that tells the light to come on for five or ten minutes feed to energize the relay magnet... or not.

At the same time the PWM pin I tell to control motor speed goes to some kind of motor shield and turns it on and off so fast that it runs at 1/10th speed or whatever speed I decide I like.

Meanwhile.. I have permanently lost my Arduino board if I decide I like what I have and decide to install it in the cabinet ?

PaulS

Quote
I set the Arduino next to another circuit board.... the pin that tells the light to come on for five or ten minutes feed to energize the relay magnet... or not.

The pin is set HIGH or LOW. If there is a wire from that pin to the relay, the relay will be activated/deactivated when this happens. Physical proximity has little to do with it.

Quote
At the same time the PWM pin I tell to control motor speed goes to some kind of motor shield and turns it on and off so fast that it runs at 1/10th speed or whatever speed I decide I like.

Yes.

Quote
Meanwhile.. I have permanently lost my Arduino board if I decide I like what I have and decide to install it in the cabinet ?

No, you can come visit it.

There are plenty of threads about how to build a standalone Arduino, using just the chip, a crystal, a couple of caps, and a voltage regulator so that the Arduino is not sacrificed to the project.

khanfused

Paul,

thanks again... I'm getting a clearer picture already...

1.) the chip activates the relay but doesn't drive it.. ( separate power supply but the ground has to be common).

2.) another pin off the chip tells the motor to come on.... ( through the appropriate transistor, again separate power but same ground ...it's  low draw, one direction and one speed after the appropriate speed is determined so an H-bridge seems like an unecessary expense )

3.) I should definitely put a diode inline with the motor so there is no washback voltage to the chip.

4.) there's mixed reviews on whether I need a resistor in the feed from the chip to the light and motor but it can't hurt.

The lights arrived and include the appropriate inverter that accepts 12VDC input so that should simplify things.

Now if I can find the threads that will help me burn a chip to leave with the system... I've seen references to such .. I even think they call it bootstrapping or something but I have yet to find a clear explanation.. been bouncing around quite a bit.

Again, thanks for your help in making this a positive experience.. ( and your sense of humor )... if I would have tried to power it right off the arduino board like I expect to I would have cried real tears. Spending the money on the board is one thing.. wasting it is a whole other.

( I'm not sure yet if this board isn;t that active with knowledge or I just asked in an uninteresting way .. maybe the next project I'll know better )


Grumpy_Mike

Quote
3.) I should definitely put a diode inline with the motor

No not in line across the motor.

See
http://www.thebox.myzen.co.uk/Workshop/Motors_1.html

Quote
4.) there's mixed reviews on whether I need a resistor in the feed from the chip to the light and motor but it can't hurt.

Yes it can hurt, it can stop it from working. There are not mixed reviews you are just not understanding when and where you need to place resistors.

Quote
Now if I can find the threads that will help me burn a chip to leave with the system

Loading a sketch is easy, you click on the download button.


Go Up