November 22, 2024, 12:10:30 PM

News:

Got VSA?  Want to use your Prop-SX?  Now you can!  See the VSA section of the Library forum for Prop-SX code that works with VSA.


Running motor on separate 5V with power switch set to 1

Started by mnewmanholden, October 25, 2010, 07:27:04 AM

Previous topic - Next topic

mnewmanholden

Hi All,

I am relatively nes to this.

I have Prop1 and power switch set to 1. I am running a wiper motor on a 5V power supply (separate to the Prop 1 power). I am using a modified compuer power supply. I have the +ve from the power supply to the motor - grnd from power supply to grnd on Prop1 and Out0 from Prop1 to motor.

Q: When using 5V no power is switched to the motor by the Prop 1 program. When connected to 12V on the power supply it runs as expected. What am I doing wrong?

Code is:

'======================================================================
'   File..... HeadSpinTest.bs1
'   Author... Mark NH
'   {$STAMP BS1}
'   {$PBASIC 1.0}
'
' -----[ Program Descripton ]------------------------------------------
' Testing time to spin one revolution on 5v power, using wiper motor
' and computer power supply.

'   *****CONNECTIONS*****
'   Connect Prop1 GND to ground on power supply
'   Connect Prop1 OUT 0 to -ve on motor
'   Connect +ve on motor to 5v on power supply
'======================================================================

' -----[ Constants ]---------------------------------------------------

  SYMBOL HeadMotor = PIN0     ' PIN0 connected to motor attached to head
  SYMBOL reps = B2         ' FOR..NEXT loop counter

  '       76543210         ' bit positions
  DIRS = %00111111         ' make P7-P6 inputs, P5-P0 outputs
  PINS = %00000000         ' all outputs off


' -----[ Program Code ]------------------------------------------------

Main:

  PAUSE 5000               ' wait 5 seconds
      reps = 0
  FOR reps = 0 TO 10        ' repeat the following 5 times
  HIGH HeadMotor           ' make head spin
  DEBUG "motor"
  PAUSE 5625               ' wait 6 seconds  -  NEED TO TEST THIS TIMING FOR ONE REVOLUTION

  LOW HeadMotor            ' stop head spinning
  PAUSE 2000               ' wait 2 seconds

  NEXT

  ' GOTO Main                ' COMMENTED OUT TO ALLOW LOOP - repeat forever

END



Follow on question...

Q: The code states OUT0 yet I have to connect to OUT1 for this to work. The trainer even seems to confirm that it is OUT1 that is being triggered. Am I reading this wrong?

Any help would be appreciated. Thanks!!!

Mark

JonnyMac

WAIT!  If you needed a separate power supply for the motor it probably requires more current than you can run through the ULN.  What are the specs on the motor?
Jon McPhalen
EFX-TEK Hollywood Office

mnewmanholden

OK. That might make sense...

The motor is from Monster Guts...not sure on the specs. Is the current still running thorugh the ULN even with Switch set to 1?

JonnyMac

October 25, 2010, 09:31:41 AM #3 Last Edit: October 25, 2010, 10:08:35 AM by JonnyMac
Of course, the ULN is the switch allows you to activate the motor from the Prop-1.

Get the specs from Monster Guts -- they owe you that.  

IF -- note that's a big IF -- the current draw on the motor is less than 500mA AND that's the only thing connected to the ULN then do this:

1) Connect a 1N4001 diode (get at RadioShack) between the motor terminals; the cathode (has a band) side goes to the positive connection, the anode (no band) goes to the terminal that will connect to OUT0.

2) Connect the ground side (only the ground side) of the external power supply to the GND terminal of the Prop-1 (this is why it doesn't work now).  You see, the ULN switches the ground side of the circuit and your ground (external supply) isn't connected to be switched.

[ Edit ]

If this is your motor:
-- http://monsterguts.com/index.php?act=viewProd&productId=4

...the DO NOT connect it directly to the Prop-1.  You must use a relay to switch the motor voltage.  If you try to switch this motor with the ULN you will blow the top off of it, perhaps literally (heat builds up inside and the top can pop off, sometimes with a very loud "crack!").
Jon McPhalen
EFX-TEK Hollywood Office

mnewmanholden

I already have 2) configured that way. Just need the diode right?

Any ideas on why PIN0 in the code is causing the switxh to be on PIN1?

Thanks,

mnewmanholden

Thanks Jonny..

can you elaborate on the incompatibility. The documentation would indicate that it is OK.

JonnyMac

October 25, 2010, 05:13:16 PM #6 Last Edit: October 25, 2010, 05:14:48 PM by JonnyMac
QuoteThe documentation would indicate that it is OK.

Really?  The specs on that motor state that it uses 1080mA at 5v which is more than twice what an output on the ULN is rated for (500mA on a single channel, when only one is active).  

You really need to put a relay in between the Prop-1 and the motor.
Jon McPhalen
EFX-TEK Hollywood Office

JackMan

QuoteThanks Jonny..

can you elaborate on the incompatibility. The documentation would indicate that it is OK.

You DEFINATELY need to connect this with a relay from the Prop-1.

mnewmanholden