Shop OBEX P1 Docs P2 Docs Learn Events
Internet Controlled Holiday Display using a PINK — Parallax Forums

Internet Controlled Holiday Display using a PINK

BottleBottle Posts: 15
edited 2007-09-04 19:55 in Robotics
The inspiration for this project started after seeing a Web Enabled Christmas Tree on MakeZine.com.

Credit too to EFX-TEK·for the inspiration behind the "Fireflies" code.

The BoE is designed to run 8 channels of "fireflies" via a ULN2803 connected to P0-P7, and 12 additional channels of hard-switched AC lighting via three RC-4 modules. In addition there is a an LCD for debugging and of course the PINK module. Code structure uses all but 5 bytes of program memory!

Construction-wise, have not really got as far as I would like, but I can purchase 24V and 240VAC lights for the UK quite cheaply - plan to hack a 24V Icicle set to run the "fireflies" via the Darlington driver (conveniently, they are wired in a series-parallel arrangement, with 10 x 2.4V bulbs in a sub-string). The RC-4s will be in a waterproof enclosure with IP44-rated connectors for outdoor use; these will control 12 identical sets of 240VAC strings.

' -----[noparse][[/noparse] Program Description ]---------------------------------------------
'
' Several influences in this program; mostly Jon Williams' Fireflies and RC-4
' test code, with BS2 syntax. Also of use was Scott Edwards' LCD code, which
' has been updated for the Milford Instruments LCD package (#6-140 & #6-201).
' Finally, Parallax's PINK application notes have been expanded upon.
'
' Inspiration from Makezine.com - Web Enabled Xmas Tree
'
' Originally designed to run "Fireflies" sequence on up to 8 connected lamps
' via O/C stage (PWM) and an additional 12 AC channels hard-switched via RC-4.
' Expanded interface with Internet capability utilising the PINK module and a
' serial LCD (for debugging purposes).
'
' The PINK module hosts the target webpage - radio buttons select an action,
' and the "Go" button updates the register NB0R01 and sets the Status flag.
' This action causes the program to exit the "Fireflies" loop, and proceed to
' the comparison action, where the contents of the NB0R01 register are compared
' with the stored ASCII data in the EEPROM.
'
' Depending on the result of the comparison stage, the program loops through
' one of five patterns, or a sequence of all five. These are output to RC-4s.

' -----[noparse][[/noparse] Revision History ]------------------------------------------------
' 0.a - First issue - mostly to get the PINK & LCD code to flow correctly
' 0.b - Import "Fireflies" and established RC-4 code/EEPROM data & optimise


Having the necessary bits around me, I decided to have a bash at it, using a BS2IC on a BoE and a Parallax Internet Netburner Kit (PINK).

Getting to grips with the PINK has been a challenge, but I think the end result is worth it. I can now control the BS2 via a simple HTML Radio Buttons interface.
<html>
<HEAD>
<TITLE>Radio Buttons</TITLE>
</HEAD>
<body>
Current Selection (Variable 01): <FONT Color="RED"><B><Nb_var01></B></FONT>
<FORM name="myform"
action="/Buttons.html"
method="post">
<P>
<br>
<div align="left">
<Input name="Nb_var01" type="Radio" Value="0" checked>(0) Do Nothing<BR>
<Input name="Nb_var01" type="Radio" Value="1">(1) Run Single<BR>
<Input name="Nb_var01" type="Radio" Value="2">(2) Run Pairs<BR>
<Input name="Nb_var01" type="Radio" Value="3">(3) Run Tail (CW)<BR>
<Input name="Nb_var01" type="Radio" Value="4">(4) Run Tail (CCW)<BR>
<Input name="Nb_var01" type="Radio" Value="5">(5) Run Wrap (CW)<BR>
<Input name="Nb_var01" type="Radio" Value="6">(6) Run Wrap (CCW)<BR>
<Input name="Nb_var01" type="Radio" Value="7">(7) Run Wash<BR>
<Input name="Nb_var01" type="Radio" Value="8">(8) Run All<BR>
<p>
<input type="submit" value="Go!!!"><br>
</div>
</P>
</FORM>
</body>
</html>


Picture·and code attached. Feel free to use it for inspiration for your own holiday display. Obviously heed any warnings regarding mains AC electricity!!! Apologies for the quality of the image - was using my cellphone's camera!!


Next step of the project is to build into an enclosure ready for the November/December holiday season; maybe Santa will be kind enough to bring me a Prop-2.....tongue.gif


Best of Luck

Bottle


▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
B.·· ;-)


There are 10 types of people in the world - those who can count in binary, and those who can't...
1152 x 864 - 157K

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-05-29 15:21
    Bottle,

    Very nice! I like the simplicity of your web page interface. Not a lot of stuff to deal with. Your BS2 must handle this easily since all you need to do is watch for a change to a single variable. All the work is in the patterns themselves. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • BottleBottle Posts: 15
    edited 2007-05-30 09:36
    Chris

    Yep, had some fun with the code, I can tell you. Spent a bit of time last night just making a few tweaks, for instance, removed the read from the EEPROM for the comparison stage, so that I could free up more room for the patterns, Have also streamlined the Read EEPROM data into a single subroutine that is called from multiple points within the Case statement (just parsing different variables).

    Next job will be to port to EFX-Tek's Prop-2 so that I have the ULN2803 drivers on board with terminals - I'll let you guys know how that pans out.

    Have fun

    Bottle

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    B.·· ;-)


    There are 10 types of people in the world - those who can count in binary, and those who can't...
  • WhitWhit Posts: 4,191
    edited 2007-05-31 20:06
    Bottle said...

    There are 10 types of people in the world - those who can count in binary, and those who can't...

    Nice.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Whit+


    "We keep moving forward, opening new doors, and doing new things, because we're curious and curiosity keeps leading us down new paths." - Walt Disney
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2007-06-02 09:41
    Seems you could adapt it easily to other signs in remote locations - like the Vacancy/Full signs for a hotel billboard.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "Everything in the world is purchased by labour; and our passions are the only causes of labor." -- David·Hume (1711-76)········
    ···················· Tropically,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
  • BottleBottle Posts: 15
    edited 2007-06-02 12:18
    Kramer

    Yep, there's lots of applications for this sort of interface - remote control where direct human·intervention is not possible or necessary. The only downside is that the responses have to be pre-programmed into the Stamps' EEPROM, so it does limit the amount you can do. It would be nice to have an HTML interface where you could do some whizzy stuff directly, like a massive scrolling billboard or somesuch (letting my imagination run wild!!)

    Hope to have this project in an enclosure soon, and who know, might be able to get a webcam set up to view the box in action - wouldn't that be neat??

    Anyway, hope that this project has inspired you, and if you have any questions please feel free to email/PM me

    Take care

    Bottle







    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    B.·· ;-)


    There are 10 types of people in the world - those who can count in binary, and those who can't...
  • BottleBottle Posts: 15
    edited 2007-09-03 14:36
    All

    Project is now running sporadically on the Internet - plan to have it running 16:00 to 22:00 BST (GMT+1) for a few days.

    Here's the link: http://86.6.7.245:8880/Buttons.html

    user: bottle
    pw: newbie

    Let me know if you have trouble getting the interface to work.


    Regards

    Bottle

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    B. wink.gif


    There are 10 types of people in the world - those who can count in binary, and those who can't...
  • Shawn LoweShawn Lowe Posts: 635
    edited 2007-09-03 15:05
    Poll_Pink:
      SEROUT 12,396,[noparse][[/noparse]"!NB0R01"]                             ' Request contents of location #1
      SERIN  11,396,[noparse][[/noparse]STR NBVAR\16\CLS]                      ' Read location #1
      PAUSE 500
      DEBUG "PINK Register 01: ",STR NBVAR,CR               ' Output to debug screen
    

      SEROUT 13,N9600,[noparse][[/noparse]ctrc,128,"Returned Value:"]          ' Write a string to the LCD
      SEROUT 13,N9600,[noparse][[/noparse]ctrc,144,"  "]                       ' Clear line first
      SEROUT 13,N9600,[noparse][[/noparse]ctrc,144,STR NBVAR]                  ' Output string to LCD
      PAUSE 1500
      GOTO Comparison
    

    Just wondering, do you need that GOTO Comparison? Since its the next routine down, wont the code just automatically go to comparison?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Shawn Lowe


    Maybe I should have waited to do that......
  • skylightskylight Posts: 1,915
    edited 2007-09-04 08:15
    Hi Bottle, your url doesn't seem to work? "Can't find webpage"
  • BottleBottle Posts: 15
    edited 2007-09-04 08:36
    Hi All

    @ Shaun Lowe

    Yep, could tidy the code up a bit. I believe I had another subroutine in between the two lines of code, but I removed it sometime earlier...


    @ skylight

    I'm currently still debugging the interface, and I only intend to have it running for a few hours each day. Any feedback would be helpful.
    Bottle said...
    Project is now running sporadically on the Internet - plan to have it running 16:00 to 22:00 BST (GMT+1) for a few days.


    Thanks

    Bottle

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    B. wink.gif


    There are 10 types of people in the world - those who can count in binary, and those who can't...
  • skylightskylight Posts: 1,915
    edited 2007-09-04 08:56
    redface.gif·oops 100 lines for me
    I must read posts fully
    I must read posts fully
    etc
    ·
  • BottleBottle Posts: 15
    edited 2007-09-04 12:10
    skylight said...
    oops 100 lines for me
    I must read posts fully
    I must read posts fully
    etc

    No Problems!!! lol.gif

    Should be up and running in a few hours - I'm currently at work, but I can remotely monitor it, for debugging



    Regards

    Bottle

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    B. wink.gif


    There are 10 types of people in the world - those who can count in binary, and those who can't...
  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2007-09-04 19:45
    Bottle

    ·When to your site ·http://86.6.7.245:8880/Buttons.html and it seem to be working ok

    Nice project.............................................smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ··Thanks for any·idea.gif·that you may have and all of your time finding them

    ·
    ·
    ·
    ·
    Sam
  • skylightskylight Posts: 1,915
    edited 2007-09-04 19:49
    Works a treat! Can't wait to see it actually working onscreen.

    Good work, Havn't managed to get my pink working across the net yet, your project gives me hope.
  • BottleBottle Posts: 15
    edited 2007-09-04 19:55
    skylight

    yep, I hope to either get a webcam set up or maybe video it in action

    there's still someway to go, and more work needs doing on the enclosure - i'll be sure to post bits up here when stuff happens

    regards



    Bottle

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    B. wink.gif


    There are 10 types of people in the world - those who can count in binary, and those who can't...
Sign In or Register to comment.