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
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