November 24, 2024, 04:36:33 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.


magic smoke?

Started by ChrisBartram, October 22, 2012, 09:05:09 PM

Previous topic - Next topic

ChrisBartram

Building a new prop and when I go to program the PROP1, if the power switch is in position2 the PC can't "see" the controller; no devices found - yada yada.
If I switch it to position1 it sees the controller and downloads the code just fine... but as soon as I switch it back to "2" it freezes. (I need position 2 for the prop since I'm controlling two 12V solenoids via Out0 and Out1).

Did I release the magic smoke? Is my PROP1 fried?

Thanks,
Chris B

bsnut

From what I can tell, the switch may have gone bad and isn't making contact in position "2"
Can you answer this question. Does the red LED next to the "V+" terminal light up?
William Stefan
The Basic Stamp Nut

ChrisBartram

Yes; when I move the switch to position 2 the red led near the outputs does light up.

JonnyMac

QuoteYes; when I move the switch to position 2 the red led near the outputs does light up.

If this is the case the switch is not bad.

QuoteDid I release the magic smoke? Is my PROP1 fried?

If you can download to it then, no. I suggest removing the valves and ULN then trying to download in position 2. If this works, replace the ULN and try again.

Definitely check the valve load. If your valves draw too much current from the ULN it can break. With two valves you don't want them drawing more that 250mA each. Find the wattage (could be marked VA) on the valve and divide by 12 (voltage used). If the result is greater than 0.25 then you may have to use a relay or code differently, depending on the result.

For example: 3W / 12V = 0.25A (a-okay)
Jon McPhalen
EFX-TEK Hollywood Office

ChrisBartram

Indeed. I tried an un-marked valve on the PROP1 earlier that didn't work. Highly likely I overtaxed the ULN. Live and learn :-(
Will test without, then swap with the one spare controller I have and see if that does the trick.

Thanks!

ChrisBartram

Replaced the ULN and got it to recognize and download from the PC.
Unfortunately the valve I need to trigger is 12V/6W/500mA... And I have no RC4s available... :-(

bsnut

That's good to here that you got it working.
QuoteUnfortunately the valve I need to trigger is 12V/6W/500mA... And I have no RC4s available
The only way around this is use a relay to control this valve.
William Stefan
The Basic Stamp Nut

JackMan

Yep, just use a small relay, it'll work fine.  ;)

JonnyMac

October 24, 2012, 11:04:32 AM #8 Last Edit: October 24, 2012, 11:15:48 AM by JonnyMac
If you're only running one valve at a time then you're just in spec -- though the valve inrush could be a problem for the ULN when using just one channel.

Advanced tip: Switching two outputs at once

You can use a process called masking to modify two or more outputs at the same time. A mask is a bit image applied to all outputs. To activate the outputs you must write a "1" to the output register.  Let's say you want to attach the valve to OUT0 and OUT1 to spread the load. To activate the valve you would do this:

Valve_On:
  PINS = PINS | %00000011


This uses the OR (|) operator to set both OUT0 and OUT1 on without affecting the other pins. The last part of that statement is why masking is a good trick to know.

Of course, you'll want to be able to turn off those outputs without upsetting the other pins. There is a special operator called AND-NOT (&/) in PBASIC 1 that we can use -- again, without affecting the other pins.

Valve_Off:
  PINS = PINS &/ %00000011


These are the basics. There is another operator called XOR (^) that we can use to toggle one or more outputs. I'm assisting a haunt in Santa Monica, CA (House of Restless Spirits) and they have a lightning simulation that is part of the show. When lighting strikes there is a black-out and then flutter on two circuits that control the lights on the front and back porches (this is a walk-around attraction rather than a walk-through attraction).   This is the code that does the black-out and then flicker back on -- as you can see, I'm using a bit mask to affect two channels at the same time.

Flash_Lightning:
  Strobes = IsOn                                ' activate strobes

Black_Out:
  PINS = PINS | LightsOut
  delay = lottery // 100 + 100                  ' 100 to 200ms
  PAUSE delay
  timer = timer - delay
  Strobes = IsOff

Flicker:
  RANDOM lottery                                ' stir random #
  PINS = PINS ^ LightsOut                       ' toggle lights
  delay = lottery // 96 + 32                    ' delay 32 to 128ms
  IF timer <= delay THEN Flicker_Finish         ' prevent overrun
    PAUSE delay                                 ' hold
    timer = timer - delay                       ' update timer
    IF timer = 0 THEN Flicker_Done              ' expired?
    GOTO Flicker                                ' no, keep flickering

Flicker_Finish:
  PAUSE timer

Flicker_Done:
  PINS = PINS &/ LightsOut                      ' lights back on


In this program there is a SYMBOL definition for the LightsOut pins.  Note the logic here: When the Prop-1 outputs are on, the porch lights are off -- this is why I called that constant LightsOut.

Jon McPhalen
EFX-TEK Hollywood Office

ChrisBartram

Thanks so much!
Didn't have time to try this before our opening night (which is tomorrow night) but still might give it a try before the big night in case I can squeeze it in!
Doubling up the outputs to get 500mA is a neat trick! I'll remember that.

The other 6 PROP1 controlled props are working beautifully though! :-) I'll try to get pictures this weekend of some of the new ones.

-Chris B
www.creepynights.org

livinlowe

Quote from: ChrisBartram on October 25, 2012, 09:27:14 PM
Thanks so much!
Didn't have time to try this before our opening night (which is tomorrow night) but still might give it a try before the big night in case I can squeeze it in!
Doubling up the outputs to get 500mA is a neat trick! I'll remember that.

The other 6 PROP1 controlled props are working beautifully though! :-) I'll try to get pictures this weekend of some of the new ones.

-Chris B
www.creepynights.org

Please do post some pictures!
Shawn
Scaring someone with a prop you built -- priceless!