May 18, 2024, 07:59:22 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.


Cheap RC interface?

Started by John Wohlers, October 21, 2008, 07:55:36 AM

Previous topic - Next topic

John Wohlers

Jon,
I recently came across a handful of R/C cars at a discount store for $1 each.  I figured hey, they might be useful for simple remote operations with the prop-1.   I dismantled the transmitter, and found it is quite a simple circuit.  Out of the box, the circuit is powered by 3.0V from two AA batteries.  I found the spec sheet (http://www.silan.com.cn/english/products/pdf%5CTX-2B(RX-2B)AY.pdf) for the chip used, and it says its maximum operating voltage is 5.0V.  Wouldn't that mean I should be able to hook it directly to the R and B header on one of the prop-1 outputs to power it or would I need to drop the power down to the 3V the whole transmitter circuit is expecting?
Also, the inputs to the chip currently are switches that pull the pin to ground.  Could I then tie the appropriate W pin on the prop-1 to that input pin on the transmitter chip to perform the same function, or would I need to do this via a transistor, or would it be best to go through the ULN? 

If this is beyond the scope of the forum, I apologize.  I'd just rather not burn out the prop-1, while still preventing myself from resorting to some combination of relays, and a separate power supply for the transmitter.   

John
John \/\/ohlers

JonnyMac

In theory that's all correct, just be very careful with connections.  To activate an input where there once was a button you'd want to pull the pin LOW, then release by making the pin an INPUT.
Jon McPhalen
EFX-TEK Hollywood Office

John Wohlers

Thanks Jon for the help.  I'll post here once I get a chance to try it out.   I have one prop where a wired connection is impossible, (A floating ghoul that travels back and forth down a rope once activated. )  and another where wired connections are inconvenient. (small squawking crow who's photo cell sensor is useless)
John \/\/ohlers

BigRez

I'd love to know how this worked out. 

I would like to turn off the street light in front of my house just prior to starting some events.  I thought if I could get a small RC unit at the top of the streetlight, I could then trigger it to turn on a small bulb which fools the streetlight's daylight sensor making it turn off the light.  Feasible?

John Wohlers

October 29, 2008, 03:34:46 PM #4 Last Edit: October 29, 2008, 07:34:39 PM by cap60552
Jon,
This is what I ended up doing for interfacing the RC board, this way I could stick to using HIGH and LOW in the program and not confuse myself later.   Do you see any problems with my design? So far all of my tests have worked perfectly.  The prop is able to control the RC triggered props with a simple High / Low pulse.  I'd hate to put it into production Halloween night only to find out it will burn out my prop-1 part way through the night. 


John \/\/ohlers

John Wohlers

Quote from: bigrez on October 29, 2008, 09:54:46 AM
I'd love to know how this worked out. 

I would like to turn off the street light in front of my house just prior to starting some events.  I thought if I could get a small RC unit at the top of the streetlight, I could then trigger it to turn on a small bulb which fools the streetlight's daylight sensor making it turn off the light.  Feasible?

It seems to me like it might be possible, Perhaps a high intensity LED for the light o conserve battery.  I'm not sure if the distance would be ok, I seem to get about 15 to 20 feet line of site on these cheep transmitter / receiver pairs. 
John \/\/ohlers

JonnyMac

John,

Your circuit looks fine to me; and very clever use of the inline LEDs to indicate what's active.
Jon McPhalen
EFX-TEK Hollywood Office

John Wohlers

Quote from: JonnyMac on October 29, 2008, 04:57:06 PM
John,

Your circuit looks fine to me; and very clever use of the inline LEDs to indicate what's active.

Thanks, for checking it over, and thanks a lot for the compliment.  I got REALLY tired of listening to the various props scream, crow, and moan... I figured the LEDs woudl help save my sanity, and make debugging a lot simpler. :-)
John \/\/ohlers

John Wohlers

Quote from: bigrez on October 29, 2008, 09:54:46 AM
I'd love to know how this worked out. 

For the most part it worked very well.   I had a few problems with signals not being seen by the props at first.  In my test environment in the house, with the props to be controlled sitting about 10 feet away from the transmitter I was able to use very short pauses (PAUSE 300) between HIGH and LOW and props triggered perfectly.  Once I got things outside and in their proper distances I had some problems with reception.  I ended up running out 3 hours before "showtime" laptop in hand and reprogramming the code.   I ended up changing the pause to 500 on the closer props, and 800 on the farthest prop.   It seems the receiver/transmitter required a bit longer transmit time depending upon the distance.  I'm not really sure why, but thanks to the flexibility of the Prop-1 I was able to make the change in short order and still had everything up and running in time,  and even had time to eat before getting dressed. (First time in 3 years)

My code, based heavily upon code Jon has provided in other posts.  Thanks again Jon for such GREAT support!

' =========================================================================
'
'   File...... New Popup Jumper-master.BS1
'   Purpose...
'   Author.... John Wohlers, based heavily on code by Jon Williams, EFX-TEK
'   E-mail.... john@wohlershome.net
'   Started...
'   Updated... 31 OCT 2008
'
'   {$STAMP BS1}
'   {$PBASIC 1.0}
'
' =========================================================================


' -----[ Program Description ]---------------------------------------------


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


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

SYMBOL  Sio             = 7                     ' SETUP = out; no ULN
SYMBOL  PIR             = PIN6                  ' SETUP = DN
SYMBOL  Trigger         = PIN5                  ' ULN acts as pull-down
SYMBOL  Turbo           = 4                     ' transmit turbo command
SYMBOL  Fwd             = 3                     ' transmit Fwd
SYMBOL  Bkwd            = 2                     ' transmit Bkwd
SYMBOL  Lights          = 1                     ' Eyes / Floods
SYMBOL  Jumper          = PIN0                  ' Jumper
' -----[ Constants ]-------------------------------------------------------

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

SYMBOL  Baud            = OT2400


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

SYMBOL  idx             = B0
SYMBOL  last            = B2
SYMBOL  mask            = B3
SYMBOL  check           = B4
SYMBOL  playList        = B5
SYMBOL  pirTimer        = B6
SYMBOL  btnTimer        = B7
SYMBOL  delay           = W3
SYMBOL  idle            = W4
SYMBOL  timer           = W5
SYMBOL  lottery         = W6

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

Reset:
  PINS = %00000000                              ' clear all outputs
  DIRS = %00001111                              ' make P0-P4 outputs

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



Main:
  RANDOM lottery                                ' stir random #
  idle = lottery // 15                          ' Random retrigger
  idle = idle * 1000                            ' delay
  idle = idle + 30000                           ' 30 - 45 sec
  DEBUG "pausing for ", idle, CR
  PAUSE idle                                    ' Retrigger delay
  DEBUG "retrigger delay ended", CR
  timer = 0                                     ' reset timer

Check_Trigger:
  RANDOM lottery                                ' stir random #
  idle = lottery // 60000                       ' Pick a random number,
  IF idle > 59990 THEN Run_Ghoul                ' Trip the ghould about .01% of the time
  IF idle > 15 AND idle < 20     THEN Run_Crow  ' Trip the crow about .008%

  PAUSE 5                                       ' loop pad
  timer = timer + 5 * Trigger                   ' update timer
  IF timer < 100 THEN Check_Trigger             ' wait for 0.1 sec input

  timer = 20000
  DEBUG "triggered", CR

Select_Event:
  RANDOM lottery                                ' re-stir random #
  idx = lottery // 2                            ' select, 0..2
  IF idx = last THEN Select_Event               ' no repeats
    last = idx                                  ' save for next cycle
  READ idx, mask                                ' convert to bit mask
  check = playList & mask                       ' check play list
  IF check <> %00000000 THEN Select_Event       ' try again if played
    playList = playList | mask                  ' mark play list
    IF playList <> %00000011 THEN Run_Event     ' finished?
      playList = %00000000                      ' yes, reset

Run_Event:
  BRANCH idx, (Run_Jumper, Run_Bust)
  idx = 0


  GOTO Reset


' -----[ Subroutines ]-----------------------------------------------------
Run_Bust:
  DEBUG "Triggering Bust", CR
  HIGH Turbo
  PAUSE 800
  LOW Turbo

  DEBUG "also Triggering Ghoul", CR
  HIGH Bkwd
  PAUSE 500
  LOW Bkwd
  GOTO Main

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

Run_Crow:
  DEBUG "Triggering Crow", CR
  HIGH Fwd
  PAUSE 500
  LOW Fwd

  GOTO Check_Trigger

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

Run_Ghoul:
  DEBUG "Triggering Ghoul", CR
  HIGH Bkwd
  PAUSE 500
  LOW Bkwd

  GOTO Check_Trigger
' -------------------------------------------------------------------------

Run_Jumper:
  DEBUG "Jumper Triggered!", CR
  Jumper = IsOn                           ' Activate Solenoid
  HIGH Lights                             ' Turn on eyes, and spots

  PAUSE 5000                              ' Wait 5 seconds

  Jumper = IsOff                          ' turn off solenoid

Fade_Down:                                ' fade the eyes and led spots,
                                          ' as jumper drops

  FOR idx = 255 TO 0 STEP -5              ' make dimmer
  RANDOM lottery                          ' re-stir random #
    PWM Lights, idx, 3
  NEXT
  DEBUG "Faded", CR

  LOW Lights                              ' fully deactivate eyes / spots
  GOTO Main
' -------------------------------------------------------------------------


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


' -----[ User Data ]-------------------------------------------------------
Bit_Mask:
  EEPROM (%1, %10)


John \/\/ohlers

rott

WOW that is exactly what I was wanting to do for next year maybe one of the Jons will come up with a way to trigger prop-1 this way and sell them

Dale