November 23, 2024, 09:42:26 AM

News:

You can now use Vixen to program your Prop-1 and Prop-2 controllers!  Get started quickly and easily, without having to learn PBASIC.  Details in the Library forum.


Candle effect with AC Bulbs

Started by davisgraveyard, June 28, 2009, 08:00:28 PM

Previous topic - Next topic

davisgraveyard

This has probably been talked about before but after a quick search I didn't find the exact answer.   Had an idea to create a flickering candle lighting effect in 4 separate but adjacent windows using a standard AC light bulb or some sort of 110v lighting.   Would like to do it with 1 Prop controller connected to 4 lights that flicker independently  maybe using a FC-4 or RC-4?

What is the best way of doing this and can it be done on a single prop1?

Jeff

JonnyMac

I've done it with both with varying results.  With the FC-4 you generate four random values and send those down the line to the controller; with the RC-4 you just need one value and you send it with the "S" command.  Using incandescent lights helps because the filament is slow to heat and cool so this helps smooth out the digital nature of the code.

I saw a recent project on the internet for a digital candle where the old value was averaged with the new to smooth the transition between values; this could be used wit the FC-4.

Here's a quick demo off the top of my head -- give it a try.  Note that the Prop-1 (BS1) uses a 16-bit internal register for math so it's okay to average the two values the way it's done in this program.

' =========================================================================
'
'   File...... FC-4_Flicker.BS1
'   Purpose...
'   Author.... Jon Williams, EFX-TEK
'              Copyright (c) 2009 EFX-TEK
'              Some Rights Reserved
'              -- see http://creativecommons.org/licenses/by/3.0/
'   E-mail.... jwilliams@efx-tek.com
'   Started...
'   Updated... 29 JUN 2009
'
'   {$STAMP BS1}
'   {$PBASIC 1.0}
'
' =========================================================================


' -----[ Program Description ]---------------------------------------------
'
' Sio     :: Serial IO to EFX-TEK accessories (RC-4, FC-4, etc.)
'            -- clip pin 1 of ULN2803 or replace with ULN2003


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


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

SYMBOL  Sio             = 7                     ' SETUP = UP; no ULN


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

SYMBOL  IsOn            = 1                     ' for active-high in/out
SYMBOL  IsOff           = 0

SYMBOL  Yes             = 1
SYMBOL  No              = 0

SYMBOL  Baud            = OT2400                ' B/R jumper removed


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

SYMBOL  idx             = B0

SYMBOL  new1            = B2
SYMBOL  new2            = B3
SYMBOL  new3            = B4
SYMBOL  new4            = B5

SYMBOL  old1            = B6
SYMBOL  old2            = B7
SYMBOL  old3            = B8
SYMBOL  old4            = B9

SYMBOL  lottery         = W5


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

Reset:
  PINS = %00000000                              ' preset IO
  DIRS = %00000000                              ' define ins & outs


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

Main:
  GOSUB Stir
  new1 = lottery
  new1 = new1 + old1 / 2
  GOSUB Stir
  new2 = lottery
  new2 = new2 + old2 / 2
  GOSUB Stir
  new3 = lottery
  new3 = new3 + old3 / 2
  GOSUB Stir
  new4 = lottery
  new4 = new4 + old4 / 2

  SEROUT Sio, Baud, ("!FC4", %00, "S", new1, new2, new3, new4)

  old1 = new1
  old2 = new2
  old3 = new3
  old4 = new4

  GOTO Main


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

Stir:
  FOR idx = 1 TO 3
    RANDOM lottery
  NEXT
  RETURN

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


' -----[ User Data ]-------------------------------------------------------
Jon McPhalen
EFX-TEK Hollywood Office

davisgraveyard

Thanks!  I'll give this a try.   Far simpler that I thought it would be?   But the bulb characteristics that help it work makes sense.


davisgraveyard

I finally got around to trying this out.  Works GREAT!   I plugged in four 45w spotlights and they all flickered independantly and looked just liked candles in a room.

Used a outlet junction box.  I used 15a sockets with the tab cut so each one is separate.  Used a Prop1 and the RC4 sharing a 500ma 12VDC power supply.   I wired the sockets to the FC-4 with 14g wire.