May 03, 2024, 07:54:28 PM

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.


Recent posts

Pages 1 ... 8 9 10
91
AP-16+ / Re: AP-16+ relay operation
Last post by Jeff Haas - October 08, 2019, 07:21:39 PM
Not a problem. The AP-16+ is a pretty complicated board, it's got a lot of settings.
92
AP-16+ / Re: AP-16+ relay operation
Last post by aquawilly54 - October 08, 2019, 06:57:44 PM
Ha!  Yep you called it Jeff.  I woke up around 2 am that night thinking the same thing, so of course I hooked it up properly last night and it works as advertised. 

Thanks much for the response and for not laughing too hard.
I appreciate it. 

Steve
93
AP-16+ / Re: AP-16+ relay operation
Last post by Jeff Haas - October 07, 2019, 11:48:04 AM
Steve,

I looked at the docs for the AP-16+ again to refresh my memory.  Page 2 of the PDF shows that V+ and GND are alternate power inputs, used to power the board instead of the barrel jack.  They are right next to the relay connections, but they are not part of the relay circuit.

Remember that the relay is just an on/off switch.  You will have it controlling a different circuit, which will need its own power supply.  The relay connections do not provide any power.

Where you might be mixing things up is that on the Prop-1, Prop-2 and HC-8+ boards, you can power external circuits with the controller - those boards have three-position power switches.  If you flip the power switch all the way to the right, they send power out the V+ and GND connections.

Jeff



94
AP-16+ / AP-16+ relay operation
Last post by aquawilly54 - October 06, 2019, 08:18:59 PM
Hi all.
  I'm confused again.  I was just thinking I might use the AP-16+ as a stand alone with a PIR for sound and wiper motor operation. 

  I was under the impression from the documents that when the sound file plays, the relay becomes active for the length of the file.  Well, my file plays just fine, but the relay outputs don't output.  I've tried all three of my APs and I get the same results. 

The plan was to just run a wiper motor from the NO terminals to another relay.  I have measured for both volts and amps with a multimeter on the NO and NC outputs on the AP while the sound file plays, but I get nothing.  The V+ and GRD output terminals measure 18.5 volts.  I can hear the relay click, so do I need to supply voltage to the V+ on the AP?   That would seem like back feeding and smoke release to me.  I'm using the barrel connection with an 18V 3A supply already.

Am I doing something wrong? 

Steve
95
Prop-1 / Re: LED Dimmer
Last post by Jeff Haas - September 26, 2019, 10:43:26 PM
I also found this tutorial that might be useful for you:
https://www.youtube.com/watch?v=wCsDZK0tJvU
96
Prop-1 / Re: LED Dimmer
Last post by Jeff Haas - September 26, 2019, 09:40:09 PM
The docs show that Basic Stamp 1 (the microcontroller on the Prop-1) can control 0 - 5V via the TTL pins.  The terminal blocks on the Prop-1 are designed to turn power-hungry devices, like solenoids, on and off, so you can have them supply 12V.

However, usually LEDs don't need more than a few volts to run.  Even 5V is too much without resistors cutting down the voltage.  What LEDs are you using?  Do you have a link?  I've seen them where they come with resistors that let you use 12V, but the LEDs don't actually need that to work.
97
Prop-1 / Re: LED Dimmer
Last post by gneirynck - September 26, 2019, 09:14:27 AM
Jeff - Thanks again for looking at this.  I was trying a lot of different things last night so I didn't get my code cleaned up, but agree with everything you said.  And yes, I only needed it to go one way.

I don't have the controller in front of me right now, but I was doing some research on the Internet and it looks like the PWM command only works for 0-5V.  So basically 'HIGH led1' would apply 12V to the LED, but 'PWM 1, 255, 1' would only apply 5V.  This is why LED 1 jumps down in brightness at the beginning and also why LED 2 jumps up in brightness once the fade is done. 

Do you or anyone know of a way to make this voltage use the full 12V range?
98
Prop-1 / Re: LED Dimmer
Last post by Jeff Haas - September 26, 2019, 12:07:46 AM
Hi Gary,

First, there's a bug in your code that could be causing issues.  On these lines:

      PWM 6, level1, 1

The "1" on the end specifies the cycle of the step.  So you can change this section from:

      PWM 6, level1, 1
      PWM 7, level2, 1
      PWM 6, level1, 1
      PWM 7, level2, 1


to:

      PWM 6, level1, 2
      PWM 7, level2, 2


This keeps you from having to repeat the command.  That could be causing the issue you're seeing with the voltage drop, but I'm not sure.  One of the other members here may know more than I do.  For more details on the PWM command, look in the Basic Stamp Help File (Help menu > Basic Stamp Help > PBasic Language Reference > PWM)

I updated the code to make it a bit more readable.  Note that I named the pins at the top, which lets you change them around without having to dig through the code, and I also put in the initialization commands - these are important to have.

Also, you should do 255 - 0, not 255 - 1. 

Try this out and see if it makes a difference.  It looks pretty good on the Prop-1 Trainer.  I am using pins 0 and 1 instead of 6 and 7, because the Prop-1 Trainer doesn't have an LED on pin 7.  That's easy to change at the top if you need to.


' =========================================================================
'
'   File...... LED_Fader.BS1
'   Purpose...
'   Author.... gneirynck
'   E-mail....
'   Started...
'   Updated... 25 SEPT 2019
'
'   {$STAMP BS1}
'   {$PBASIC 1.0}
'
' =========================================================================


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

SYMBOL  pin              = B2
SYMBOL  level1           = B3
SYMBOL  level2           = B4

SYMBOL  Led2             = 1
SYMBOL  Led1             = 0

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

Reset:
  PINS = %00000000                              ' clear all
  DIRS = %00000011                              ' set outputs 0 and 1


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

Main:

    HIGH  Led1        ' Turn on LED 1
    LOW   Led2        ' Turn off LED 2
    PAUSE 2000

    ' Cross-fade LED 1 to LED 2
    FOR level1 = 255 TO 0 STEP -1
      level2 = 255-level1
      PWM Led1, level1, 2
      PWM Led2, level2, 2
    NEXT

    ' Keep LED 2 on for 3 seconds
    HIGH  Led2
    PAUSE 3000

  GOTO Main



One thing I noticed is that you've got the fade only going one way, the final version is shown for three seconds, and then the lights reset back to the beginning.  Is that what you want?

99
Prop-1 / Re: LED Dimmer
Last post by gneirynck - September 25, 2019, 09:02:05 PM
Hey Jeff,
Thanks for the links.  This did help.  I mostly have this working.  Here is the code I have with the LEDs connected to Out 6 & Out 7.

SYMBOL  pin              = B2
SYMBOL  level1           = B3
SYMBOL  level2           = B4

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

Main:

    HIGH 6
    LOW 7
    PAUSE 2000

    FOR level1 = 255 TO 1 STEP -1
      level2 = 255-level1
      PWM 6, level1, 1
      PWM 7, level2, 1
      PWM 6, level1, 1
      PWM 7, level2, 1
    NEXT

    HIGH 7
    PAUSE 3000
  GOTO Main

I added the PWM lines twice to slow down the fade.  Using a PAUSE only makes it blink.  The problem I am having is that when the LED is set to HIGH has 12V applied.  However, as soon as the fade routine starts, the brightness drops and the voltage seems to drop to 5V and then fades to 0.  How can I make this fade from 12V to 0.
Pages 1 ... 8 9 10