Circuit & Component Check

Hi all,

Following on from the "Calculating Resistors Required" thread, which went off on a tanget (cos I'd no idea what I was doing!), could you see if all looks ok with the following (inc. resistor values etc.).

I've posted the specs for motor/led/etc. I think might be useful at the bottom.

Thanks :)

VCC + 6V '--------------------o------------------------------o-----------o---- | | | | | .-. .-.Resistor .---. | | | | | |10K | | | Diode 1x .'. .'. 10K | | | | | | 1N4148 | | | | '-' '-' | | | (5.3V?) | | | | | '--------. '---' | | | | | | | | Diode 4x | | Diode 4x| | | o | | | PIC 1N4148 | | 1N4148| | | |=| | | VDD __ VSS (3.2V?) | | (3.2V?) | | | o | | '----o| |o---. '-' '--. | | Switch | '----o| |o---)---------. | | | | '---------o| |o---)---------). | | o----)------------------o|__|o---)---- || _-_ _-_ | | | | || |___| |___| o | | | .-. || - - |=|| MCLR connected | |160R || | Motor Motor o | | to VDD | | | || | | | | | '-' || | | |Switch | | || | | | | | | ')-----)----. | | | | ,---. | | | | | | | | X | | ||-+ | ||-+ | | | '---' | ||-> | ||->

| | | LED '--||-+ '-----||-+ | | | | N-Type | N-Type | | | | | MOSFET | MOSFET | | | | | | | -o----o---------------------------o----o-----------o-------------- === GND (created by AACircuit v1.28.4 beta 13/12/04

formatting link

There's two switch inputs, and 3 outputs - 1 LED, 2 Motors.

MOTORS: 3V DC No load current 0.13A max. Rated load current 0.45A max.

LED: I F (max) 15mA V F (max) 2.8V

PIC: Input 3.0 - 5.5V

I took the diodes as dropping about 0.7V, and calculated the LED resistor as ((6 - 0.7 (voltage to PIC)) - (2.8 (LED voltage))/(15 (LED current)) * 1000 = 166. The 10K resistors were suggested in the other thread, to tie the inputs to 5V or 0V. However, it just dawned on me that I've got 6V, and not 5V! I guess I can stick a diode or two in there?

Also, can the diodes be "shared"? Eg., connect both motors to the same diodes. And even remove one of them, and connect it to the output of the diode in place for the PIC? eg.:

VCC + | 6V '---------| 4.4V 3.7V V Diode Diode Diode - ->|--->|---. | 5.3V | | o--------------' V Diode | - | | |5.3V o------. | __ | |3V '--------o| |o- 3V | | -o| |o- | | -o| |o- _-_ _-_ -o|__|o- |___| |___| - - | | (created by AACircuit v1.28.4 beta 13/12/04

formatting link

--
Danny
Reply to
Danny T
Loading thread data ...

[snip: good diagram]

  1. As you said: the top of the 10k resistors should go to the PIC Vdd rail and not to 6V.

  1. You need a 100nF decoupling capacitor between Vdd and Vss mounted as close to the PIC as possible. This smooths out noise and glitches on the supply; it stops the PIC from crashing when you switch the motors on!
  2. You can share power-supply dropper didoes between the motors, but use a seperate diode for the PIC to reduce noise on the PIC supply rail.
  3. You need back e.m.f. protection diodes across the motors. Inductors (motor, relay ...) generate a large back e.m.f. when you switch them off. This diode should be connected across the motor with the cathode pointing upwards. The diode short-circuits the back e.m.f. to protect other components.

Otherwise, that looks like it should fly!

Reply to
Andrew Holme

  1. You should also have a capacitor between each motor driver fet source and the positive end of its motor, to act as a small local supply, so those high frequency on-off edges don't get back to the battery and then into the PIC. A .1 uf film or ceramic in parallel with a few hundred microfarad electrolytic might be enough. A 1 uf film or ceramic in parallel with a 1000 uf electrolytic would be better.

My favorite kind of film capacitors for this service are the very low inductance, stacked V series from Panasonic, sold by digikey:

formatting link

--
John Popelish
Reply to
John Popelish

formatting link

Keep in mind that motors do not have to run at exactly the specified voltage, but that the speed will be roughly proportional to the voltage (torque held constant) and the torque will be roughly proportional to the current (speed held constant). Picking the right motor is a lot like picking the right gear in a car that matches the motor (speed-torque and efficiency curves) to the driving conditions (speed, climb, weight carried, wind, acceleration needed, etc.)

--
John Popelish
Reply to
John Popelish

The source lead. The caps connect between the positive and negative supply points for the motor and its driver transistor (as close as possible to those points, too). When the drive transistor turns off or on, suddenly, a wave of current would otherwise travel all the way back to the battery, bouncing every circuit connected to it.

Imagine sitting on a large trampoline, trying to read a book of fine print, while a fat kid jumps on it a few feet away, to visualize the effect the motor load will have on the PIC.

--
John Popelish
Reply to
John Popelish

Righto. Just Googled about this, I understand now :)

Right. So am I right in believing 2x3V motors in parallel still only require 3V supply, but probably double the current?

Right, I think I understand that (when stopped, the motor is still spinning, and will cause a spike of power the wrong way?), but don't understand how to wire it. I've already got a string of diodes connecting to the motors - any chance of a quick diagram? Can it be the same diode as I've labelled for the drops?

Thanks again,

--
Danny
Reply to
Danny T

I don't understand the column headings given here:

formatting link

Anyone?

I need my PIC to drive 2x 3V motors... I've got two sets of motors - one set are .45A, the other 1.07A (5240rpm and 13100rpm - I don't know which will suit me best yet!)

Reply to
Danny T
[snip]

Correct.

+6V ---->|-->|-->|-->|---+ 4 Diodes | | | 3.2V +-----+-------+-----+ | | | | | | | | | _-_ | _-_ - |___| - |___| ^ - ^ - | | Motor | | Motor | | | | +-----+ +-----+ | | | | ||-+ ||-+ ||-> ||->

----||-+ -----||-+ N-Type | N-Type | MOSFET | MOSFET | | | === === GND GND created by Andy´s ASCII-Circuit v1.24.140803 Beta

formatting link

All inductors (not just motors) produce a "spike the wrong way."

When the battery is running low, and it's internal resistance is higher, the motor will create more noise on the power supply rails. A low-dropout regulator would better isolate the PIC from this than a simple dropper diode; however, I'm 99% sure the diode will work - as long as your not designing life support systems.

Dropper diodes are fine for the motor supply.

The 1N4148 is only rated for a maximum forward current of 300mA. Use the

1N4001.
Reply to
Andrew Holme

formatting link

VDS V = Maximum drain source voltage. They're all well above 3V so any will do!

N chan / P chan = You want N channel.

RDS (on) = Equivalent resistance when FET is on. Ideally, as low as possible. There will be a small voltage drop across the FET due to this resistance. Knowing motor current, you can calculate what the voltage drop will be using Ohm's Law.

ID cont = Maximum current. You need at least .45A or 1.07A depending on which motor you choose.

PD = Maximum power dissipated by the MOSFET ( = V*I). You know the voltage drop across the MOSFET, and the current. Multiply them together to calculate the power.

Reply to
Andrew Holme

Excellent. Thanks :)

Bummer! ;-)

For all 6 diodes? Those dropping the voltage, and the ones connected back over the motors?

Thanks again :)

--
Danny
Reply to
Danny T

That's 1A, correct?

One set of my motors (much higher RPM than the other) have a max current of 1.07A... If I need to use them, am I still ok with these? What about if I use a lower voltage than the max? Or should I find something rated higher just to be safe?

(It's not a life support system ;))

If I destroy up (a diode, resistor, MOSFET etc.), is it easy to detect? Will they stop conducting, or could they potentially blow other things along the way (eg. if a resistor stopped resisting!!!)

--
Danny
Reply to
Danny T

formatting link

You're a star! Thanks (again) Andrew :-)

Gonna order the things I don't have from Rapid and no doubt I'll be posting here in the week complaining! ;)

--
Danny
Reply to
Danny T

The 1N4001 is fine for 1.07A as long as you only run one motor at a time. You should find something heftier, or use seperate dropper chains, if you need to run two 1A motors at once. The .07 is negligible.

Resistors can go short circuit if you subject them to enough abuse, but they tend to smoke and become discoloured in the process - which is a bit of a giveaway. You can test diodes with your multimeter. The best way to tests the MOSFETS would be in-circuit: disconnect the gate; connect a 1M resistor from gate to ground; lick your fingers; put a wet finger on the gate; put the other finger on +5V or GND: you should be able to switch the motor on and off.

BTW some MOSFET gates are static sensitive - observe handling precautions.

I forgot to mention - on rapidelectronics - you want a MOSFET marked * for "Logic level device with optimised design for 5V drive"

Reply to
Andrew Holme

Of course, I should've realised that!

Motors will run together most of the time (when I get to it, it'll be a little "robot" on 3 wheels, two driven, like a trike) except for turning, so I'll just do two chains of diodes from the power :)

LOL!!

Yep, I figured that :-)

Thanks!

--
Danny
Reply to
Danny T

Final question....

formatting link

Would that allow me to test without using batteries? It does 6V, which is about the same as 4AA batteries. I don't entirely understand the current though - does 3A mean it can produce 3A without blowing a fuse, but it'll run small things fine, or will this just fry things that don't need such a high current?

Thanks,

Danny

Reply to
Danny T

No. The positive end of the electrolytic and one end of the film cap connects to the positive lead of the motor. The negative end of the electrolytic and the other end of the film capacitor connect ot the source lead (grounded lead) of the mosfet driving the motor. This acts as a small, 3 volt battery as close as possible to the motor.

The electrolytic is good at dumping a big current for a long time, but it has the aluminum wound up inside it, so that there is a bit of inductance in series with the capacitance that doesn't allow it to have this current change in an instant. The smaller, low inductance capacitor supplies the current during this brief time.

Since you have two motors and two motor drivers, there should probably be a set o capacitors for each (especially if you use a separate voltage regulator for each motor), unless the two mosfets are right together and the positive leads to the motor are also very connected directly together.

--
John Popelish
Reply to
John Popelish

No. The caps keep the supply voltage from bouncing around when there is a big load current change when the motor turns off or on very suddenly.

Remember that trampoline visualization I told you about? The height above ground represents the voltage the battery supplies to each load. If you place a big lead ring around the spot where the fat kid jumps, it isolates his impact from other things resting on the trampoline. Place another lead ring around the reader (the small capacitor across the supply pins of the PIC) and you isolate the vibration a bit more, and if the reader shifts his weight, it keeps that disturbance local, also.

The diodes across the motors keep the drain lead of the mosfets (not a power supply connection) from seeing a big positive voltage each time the mosfet turns the motor current off. This is a purely an effect of the motor storing energy in its magnetic field and that energy has to go somewhere when the magnetic field collapses as the current goes to zero. This big spike can damage the mosfet, and couples noise capacitively, to any conductors nearby. The diodes suppress the action that makes an ignition coil produce such great sparks.

If the mosfets drove resistors instead of something inductive, there would still be the power supply bounce, but no extra voltage spike on the drain at turn off.

--
John Popelish
Reply to
John Popelish

That link doesn't work for me but I assume it's some sort of mains power supply.

You need a REGULATED 6.0V supply. A wallwart may *not* be suitable (excessive ripple, peak > 6V).

Yes, it means you can draw anything from zero up to a maximum of 3A.

Power supplies can regulate the voltage or the current - but not both at once.

Reply to
Andrew Holme

If you mean order code 85-1820 then, yes, that would be fine.

Reply to
Andrew Holme

Nor me!

Yep, guessed this. I had to buy an unregulated 300mA supply for my pic programmer (why, I don't know!), but this one has regulation figures, so I assume it is. It is the one you found (85-1820), but before I order my stuff, I'd like to ask you to check "Miles Harris" reply in my "Calculating resistors required" thread :-\

Ta,

Danny

Reply to
Danny T

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.