November 21, 2024, 04:00:14 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.


Multiple voltages off the Prop-1

Started by zeenon, May 25, 2007, 12:13:55 PM

Previous topic - Next topic

zeenon

Jon,

On the old forums I thought there was a neat little schematic of how to use two different voltages off the Prop-1. Do you happen to have that pic or can you post a quick how-to?

Basically, I have 4 - 12V LEDs hanging off outputs #0-3. But I have a 24V valve I want to put on let's say OUT7. I have each - lead going to 0-3 and the +'s tied together on V+ which works fine, but I need to wire in the 24V valve now. I thought I could do it without a relay but I may be wrong and thinking of a different pic.

Z

JonnyMac

Here's what you do:

1. Connect the negative side of your external supply to the Prop-1 GND terminal.
2. Connect the positive side of your external supply to the device to be powered.
3. Connect the other side of your device to the OUTx terminal you want to use.
4. If using an inductor (any kind of coil) connect a 1N4001 diode between the device terminals.
    -- the cathode (band) side connects to the positive terminal

Here's the schematic for your specific project, Z:



DO NOT, under any circumstances, connect the positive side of your external supply to the Prop-1 V+ terminal -- unless you want to buy another....

Jon McPhalen
EFX-TEK Hollywood Office

zeenon

Jon,

See anything wrong with this code? I'm getting weird results off the valve. Sometimes the valve clicks open and stays open even when it hits the valve=isoff.

Should pin1 be cut on the 2803?
What should the P7 jumper be set to?
The V+ LED on the Prop-1 is lit no matter what position the switch is in 0 1 or 2?



' -----[ I/O Definitions ]-------------------------------------------------

SYMBOL  LedSpot1        = PIN1
SYMBOL  LedSpot2        = PIN2
SYMBOL  LedSpot3        = PIN3
SYMBOL  LedSpot4        = PIN4


SYMBOL  Trigger         = PIN6                  ' SETUP = DN
SYMBOL  valve           = PIN7                  ' OUT7 and V+ (24V to valve)

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

SYMBOL  IsOn            = 1
SYMBOL  IsOff           = 0

' -----[ Variables ]-------------------------------------------------------


' -----[ EEPROM Data ]-----------------------------------------------------


' -----[ Initialization ]--------------------------------------------------

Reset:
  PINS = %00000000
  DIRS = %10001111



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


PINS = %00001111                                ' everything on

Main:
  IF TRIGGER = ISOFF THEN Main                  ' wait for pressure switch

  PINS = %00001100
  PAUSE 10000
  PINS = %00000011
  PAUSE 10000
  PINS = %00001100
  PAUSE 10000

  PAUSE 5000
  valve = IsOn

  PAUSE 5000
  valve = IsOff
  PAUSE 2000

  GOTO Main


' -----[ Subroutines ]-----------------------------------------------------

JonnyMac

Nothing jumps out at me as being a problem.  What you might want to do is some simple troubleshooting first; do a quick test loop for the valve using the desired pin -- just to make sure the hardware is working correctly.

Test:
  HIGH 7
  PAUSE 2000
  LOW 7
  PAUSE 2000
  GOTO Test


This should be enough to verify the valve output and wiring.  Note that if you're going to use OUT7 then you must leave the ULN2803A intact.  Remove the P7 jumper for this program as it's being uses as an output (the SETUP jumper is only for inputs).  The V+ LED should only light when you have the power switch in P2.  If it's lighting in P1 (probably dimly) then you're getting voltage fed back onto V+; be very careful of this as you could damage something if you cross-up power supplies.
Jon McPhalen
EFX-TEK Hollywood Office

zeenon

Jon,

I tried the program you posted and same results. I do have a little more info this time around though. The program is working because it opens the solenoid...it's the closing thats the problem. I haven't measured it but there is some very small voltage present holding the valve open. When it hits the valve open command I can't pull the solenoid out, when it hits the valve closed command a little flick with a screw driver and the solenoid releases. All the valves I tried do the same thing so I'm guessing it has something to do with the dual voltage??

Double checked the wiring, tried it without the diode, and definetly getting voltage feedback because the LED is lit (full power) as soon as I plug in the 24V. (Prop-1 checks ok and haven't blown a ULN yet). The fact that these are sprinkler valves shouldn't matter, but I did order real 24VDC valves as a future backup.


The program below uses the exact same valve and works flawless (also uses just one voltage though):

' =========================================================================
'
'   File...... Coffin_popup v1.2.BS1
'   Purpose... Coffin pop-up routine (Prop-1, RC-4 , AP-8)
'   Author....
'   E-mail....
'   Started...
'   Updated...
'
'   {$STAMP BS1}
'   {$PBASIC 1.0}
'
' =========================================================================


' -----[ Program Description ]---------------------------------------------
' This program will wait FOR contact switch or PIR to close then trigger coffin
' pop-up and 120V light. After small pause, head will turn 45 degrees, stop, and
' a 30 sec clip will play. Head will turn back, pop-up will drop and light will
' go off.
'
' Prop-1 moded ULN pin 1 cut/P7 jumper OFF/P6 jumper ON/DWN
' Prop-1 P7 is connected to RC-4
' Prop-1 P6 is trigger to start connected to WR
' Prop-1 P0 is connected to head servo
' Prop-1 OUT2/V+ is connected to 24V solenoid
' AP-8 power from Prop-1 V+ and GND
' NOTE: ALL DIP SWITCHES ON AP-8 MUST BE OPEN FOR SERIAL COM


' -----[ Revision History ]------------------------------------------------


' -----[ I/O Definitions ]-------------------------------------------------

SYMBOL  Sio             = 7
SYMBOL  servo           = 0
SYMBOL  Trigger         = PIN6                  ' SETUP = DN
SYMBOL  valve           = PIN2                  ' OUT2 and V+ (24V to valve)

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

SYMBOL  IsOn            = 1
SYMBOL  IsOff           = 0

SYMBOL  AllOn           = %1111
SYMBOL  AllOff          = %0000

SYMBOL  CW          = 100
SYMBOL  CCW         = 180


' -----[ Variables ]-------------------------------------------------------

SYMBOL  relays           = B0                   ' RC-4 relays
SYMBOL  light            = BIT0
SYMBOL  fog              = BIT1                 ' Relays 2-4 not used
'SYMBOL  K3              = BIT2
'SYMBOL  K4              = BIT3

SYMBOL  sfx             = B2

SYMBOL  sweep           = B3                    ' span of movement
SYMBOL  hold            = B4                    ' hold time (larger = slower)


' -----[ EEPROM Data ]-----------------------------------------------------


' -----[ Initialization ]--------------------------------------------------

Reset:
PINS = %00000000
DIRS = %00000100
LOW servo

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

GOSUB Kill_All

Main:
  SEROUT Sio, OT2400, ("!AP8", %00, "P", 4)     ' loop background sound
  IF Trigger = IsOff THEN Main                  ' wait for pressure switch


' Pop up/turn on strobe/play sound
  PAUSE 25
  SEROUT Sio, OT2400, ("!AP8", %00, "X")        '
  PAUSE 25
  SEROUT Sio, OT2400, ("!AP8", %00, "P", 0)     ' play scream sound
  PAUSE 500                                     ' increase this value if pop/sound don't match
  valve = IsOn                                  ' activate valve
  light = IsOn                                  ' activate strobe
  fog   = IsOn                                  ' activate fog
  GOSUB Set_Relays

' Turn head
  FOR sweep = CCW TO CW STEP -1                        ' swing full span
    FOR hold = 1 TO 5                           ' slowly
      PULSOUT servo, sweep
      PAUSE 20
    NEXT
  NEXT

' Play voice clip
SEROUT Sio, OT2400, ("!AP8", %00, "X")
PAUSE 25
SEROUT Sio, OT2400, ("!AP8", %00, "P", 1)       ' play sound 0
PAUSE 19000                                     ' wait for sound 0 to finish
SEROUT Sio, OT2400, ("!AP8", %00, "P", 4)       ' back to background

' Turn head back
  FOR sweep = CW TO CCW
    FOR hold = 1 TO 5
      PULSOUT servo, sweep
      PAUSE 20
    NEXT
  NEXT

' Drop/turn off strobe
  valve = IsOff
  PAUSE 2000
  light = IsOff
  fog   = IsOff
  GOSUB Set_Relays

  GOTO Main


' -----[ Subroutines ]-----------------------------------------------------

Set_Relays:
  SEROUT Sio, OT2400, ("!RC4", %00, "S", relays)
  RETURN

' -------------------------------------------------------------------------

Play_Sound:
  IF sfx > 7 THEN Play_Exit                     ' bad segment #?
    SEROUT Sio, OT2400, ("!AP-8", %00, "P", sfx)

Play_Exit:
  RETURN

' -------------------------------------------------------------------------

Kill_All:
  SEROUT Sio, OT2400, ("!RC4", %00, "X", "!AP-8", %00, "X")
  RETURN

' -------------------------------------------------------------------------

JonnyMac

Bill,

A 24 VAC sprinkler valve should work fine at 12v -- we used to test them that way at Toro.  If it's not closing properly you may have a bad spring in the solenoid.
Jon McPhalen
EFX-TEK Hollywood Office

zeenon

Jon,

I'll give it another go tonight. The spring is good because after I kill the voltage the darn thing launches across the room :)

Somehow, the 12V is feeding in and holding that solenoid. I can faintly hear when it energizes(on/off) to 24V in the program.

Z

JonnyMac

I have no idea where the 12v is coming from -- no from the ULN as it's an open-collector device.  Perhaps you can post a picture of your setup.
Jon McPhalen
EFX-TEK Hollywood Office


JonnyMac

My fault, Bill, I steered you wrong.  There are protection diodes inside the ULN2803A and that is providing a feedback path between OUT7 and V+ (which is common for the internal diodes).  Since you're using LEDs and the internal diodes are of no consequence you can clip pin 10 of the ULN to eliminate this feedback.  I will be very mindful of this in the future and will probably dissuade customer from using mixed voltages.  I'm sorry for my error.
Jon McPhalen
EFX-TEK Hollywood Office

JonnyMac

Just had another thought: if you power the board with 24v and use an external 12v supply then you won't have this problem as the internal protection diodes would be reverse biased.  Right now they've got 24v on the anodes and nothing or 12v on the cathodes so they can conduct.
Jon McPhalen
EFX-TEK Hollywood Office

zeenon

Jon,

You had a drawing of the ULN pinouts that you posted in the old forum. Can you post it here?

What do you use to make those b/w schematics?

So reverse the supplies? 24V on the prop-1 and 12v to the LEDS? Can you post a quick schematic?

Z

JonnyMac

Each ULN stage is something like this:



Remember that the output is open collector, so when the pin is off the output side simply floats.  Note how the protection diode is connected between the output pin and common (which connects to V+); this explains why 24v sitting on your valve was biasing the internal protection diode and leaking through to V+.

I suggest that you reconfigure your circuit like this:



Note that you may see the V+ LED light when you're in OFF or P1 because the internal diodes can still be forward biased; This shouldn't be a problem for your LEDs, however, as the control side is floating (Please let me know if it is....)
Jon McPhalen
EFX-TEK Hollywood Office

zeenon

Jon,

That worked :)!!!!!

Your right, I tested it with the above circuit and also rewired for just 12V (eliminating the 24V PS) and they both operated the same. I don't know if I should leave it at 24v/12v or just go with 12v?? Either way this was a cool lesson!!!!!!

Bill

JonnyMac

Good news! -- and stick with 12v; I think you'll be fine.
Jon McPhalen
EFX-TEK Hollywood Office