Using the p40 basic stamp with a 555 timer (or similar chip)... and another que
rev
Posts: 27
I have a project wherein I'll be controlling 5 DVD players simultaneously. I need to have a common time reference that is a little more accurate than the basic stamps built in clock. Can someone point me in the direction of some basic documentation?
What I am trying to do is reset the DVD players on a periodic basis so they won't go out of sync. All players will be operating at all times, at any given time 4 of them will be displaying a still 'slug' and one will be playing a moving image. For example, if the total DVD length is 10 min, there will be 2 min of video and 8 min of still image per DVD.
Also I need to start each player as simultaneously as possible. Is this achievable using the ULN2803?
Thank you,
Revel
What I am trying to do is reset the DVD players on a periodic basis so they won't go out of sync. All players will be operating at all times, at any given time 4 of them will be displaying a still 'slug' and one will be playing a moving image. For example, if the total DVD length is 10 min, there will be 2 min of video and 8 min of still image per DVD.
Also I need to start each player as simultaneously as possible. Is this achievable using the ULN2803?
Thank you,
Revel
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
·Component values for the 555 actually start to get really big if you want it to run at one pulse per minute or slower. The longer the period the bigger the values and therefore there is a bigger impact on accuracy because of the components tolerances. The two resistor + capacitor setup of a 555 is inaccurate compared to a real time clock chip that uses a crystal for precision timing
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"The man who smiles when things go wrong has thought of someone to blame it on."
-Lucky[size=-1][/size]
Post Edited (Lucky) : 4/9/2010 11:36:30 PM GMT
Exactly what?
With a 7555 (which is·CMOS)·you can use R up to 100MΩ and C up to 100uF (maybe more?) and you can do some major time constants that way and come up some slow one-shots and sub-Hz oscillators.· With a plain ol' bipolar 555, not nearly as much.· But still, RC will vary·given R & C will likely vary, to some degree,·with temperature, whether you're using tweak components or run of the mill.·
What's your·uncertainty threshold?· If nth degree repeatability is going to bust your gut then this is not the way to go anyway.·
You can order an RTC like the DS1307 and a crystal for less than $5 with first-class shipping (maybe eighty cents) and prob. have it from digikey in a few days.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
startup:
simultaneously play all dvd players #1 - #5
main 1:
pause 18 min
simultaneously reset all dvd players #1 - #5
pause 18 min
goto main 1:
What would you expect to be gained by having the external '555?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
Or, you could set up the 555 for a (relatively) slow square ware and count edges to estimate time (i.e on each pin state change, increment a counter). This may be close enough within 18 minutes -- you'd have to try it and see. See the datasheet for timing equations (essentially choosing your R and C values to generate the square wave in the range you'd like).
Or use an RTC and get very tight timing to within a second, plus the advantage of knowing human "clock" time, if you wanted to shut all the players down at the end of the day, etc. This has the advantage of being fairly plug n play with the BS2p series, along with lots of demo code for setting and reading the time.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
I have about 4 days, and am not sure if I can acquire anything other than the 555 on such short notice. Am in NYC, so could be possible around Canal St I suppose, but not a sure thing. Now, if it isn't already apparent, I'm not an accomplished programmer. But could it be as simple as re syncing the DVD players every 18 min by implementing an 18 min pause between each play reset cycle? the way I would do this is by putting 18 1 minute pauses between the reset and play relays firing, and create a loop. (since the stamp cant pause for more than 68 seconds at a time right?)
I suppose I should describe the purpose of the project in a little more depth: Basically I have 5 dvd players. Each DVD player has a dvd of the same length in it. 4/5ths of each dvd's length is a single still image, 1/5 th of each length is a moving image. The dvd's differ only in the order of moving image vs still image. The goal is to ultimately run 5 TV's simultaneously such that only 1 TV has a moving image on it at any given time. So let - = still image and 0 = moving image for TV's 1 - 5, the playback sequence would look something like this:
1:0----
2:-0---
3:--0--
4:---0-
5:----0
I can do this by having 1 track on each dvd that cooresponds to the above sequence, or by having 2 tracks on each dvd, 1 moving and 1 still. It all depend on how quickly the players go out of sync, and whether or not it is acceptable to have all monitors briefly blink simultaneously were the 1 track solution to be implemented.
I have some 555 timers, but no idea how to go about using them. I have a bunch of uln2803's too, but am not quite sure how to get them to close multiple circuits at the same time. It has to be some way other than firing multiple pins at the same time, because the stamp is not capable of that, right? (even the BSp40?) Is it as simple as having 1 pin trigger multiple legs of the ULN2803?
I also have 1 TIPIC6595N, and a bunch of 74HC595N's, but I don't think either of those will be necessary.
If your still following along, then thanks for the help! [noparse]:)[/noparse] It is much appreciated
The it stands to reason that if, during a given iteration of the main loop, x does NOT equal y, the loop will take much longer to execute.
A Stamp can set more than one pin at time, it just can't execute more than one statement at a time:
So if you just want to fire your five pins staggered every 18/5 minutes, you could probably just pad with pauses and a counter to extend the count. The pause and the if/then statements themselves take time to execute, so you may want to just time how long you actually get and back off a little on the total count (hook up leds only to your pins to see it, then take working code and hook into your full circuit).
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
the universal remote controls all of the players and keeps them in sync. A few questions:
-is this more or less reliable than controlling all dvd player's buttons? It would seem to me that there is less probability that something would go wrong since the system is relying on 3 relays, 1 IR trasmitter and 5 IR recievers instead of 18 relays, what do you think?
-Are ULN 2803's more reliable than reed switches?
-is there a good way to introduce some redundancy ie. if 1 dvd plaver did not power up by some fluke, the Stamp would pause the 'POWER UP cycle and turn it on before proceeding? I understand that not subroutines are possible during the long 18 min play, but this would be in main:
The IR will only be a problem if there is interference somehow (fluorescent lights, bright sunlight, etc). Test it in place to make sure.
Reed relays can wear down and/or fuse if subjected to over-current conditions, abuse, etc. Again, if they are working and if they are rated for enough current for what you are doing with them, then it will be fine (presuming this project doesn't need to run uninterrupted for ten years straight or anything ).
Glad you are getting it running. That's a clever solution to fire a remote at all the players rather than brute force switching them on and off.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
The IR is working out nicely for now, however, I am also going to use a relay system as a backup in case the IR fails. This thing has to be fairly permanent. A few amateur questions regarding relays, darlington arrays, and basic stamps:
It seems that the basic stamp can safely drive a reed switch with a coil resistance of about 250 ohms (5V, 20mA). In my case I am triggering 5 relays at once, so I am using some ULN2803's to pull the load, especially since I am also driving some 1050 ohm (12V, 11mA)reed switches, which seem to work fine on 5V. Can 1 5V, 250 ohm (or 1050 ohm) reed switch turn 5 dvd players on? Can 1 leg of a ULN2803 trigger 5 reed switches? I am trying to find a way to minimize the components, especially the mechanical ones, to minimize the potential for failure. In total I am triggering 15 buttons on 5 dvd players, 5 buttons at a time.
Also, just to double check, if I am using a ULN2803 to drive the reed switches, then I don't need to wire a switching diode across the relay coil, right? Thanks!
No way to know. What matters here is the max voltage and current the relay/switch can handle. See the device's datasheet.
Almost definitely. Each pin of the '2803 (and the device as a whole) can handle 500ma max. That doesn't mean all pins at once -- that's the max on any given pin AND all pins put together:
1 pin on = max 500ma
2 pins on = max 250ma each
4 pins on = max 125ma each
etc
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
You're close...each pin can sink a maximum of 500mA, however once you start using multiple pins it doesn't divide 500mA by 2. At this point what matters is the total power dissapation of the driver, which is 1W and the power dissapation of the entire package. So many factors will decide this, including the voltage being switched at each output as well as the current.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering
·
At 5v / 1w = 200ma max per pin, 2 or 3 pins on at most
At 12v / 1w = 83ma max per pin, 2 or 3 pins on at most
At 5v / 100ma per pin = .5 w = 5 pins on at most
etc
Y'know, I've got some 12v projects where I'm probably overdriving the 2803's but they hardly get warm to the touch. Probably because I'm almost always using PWM, and I always stagger PWM so that some pins are always off while others are on.
In any case, Rev, you should be fine driving the relays as you want (at 250 ohms the current on each coil at 5v would be about 20ma). In re-reading your post are you talking about using relays to switch the AC outlet power to the DVD players or just the remotes? If the latter, again, see how much current the remotes use and how much current/voltage your relays can safely tolerate. If the former, STOP and get expert advice or use commercially produced after-market AC modules. AC power can kill you if not handled correctly.
If this is meant to be permanent or semi-permanent, and you are committed to breadboards, get everything mounted solidly, make sure your wiring is need and tied down where possible, etc. You don't want fragile and loose wires coming undone six months down the road.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering
·
And Digikey can next-day deliver a 1307 with a 32 Khz crystal -- the 555 timer chip is really not stable nor reliable enough for what you're trying to do.
For that matter, I kind of like these: http://www.rhombusinc.com/co-processors.html#Multi-Function
Their "CP_SAR" can generate a 'tick' for you, that you can then use to synchronize the tasks on your BS2p-40. And it's only $10 (with an 8-pin DIP and resonator)
Given that I do want to allow for the possibility for individual button automation, but also want the most reliable system, it made sense to wire a relay across each group of 5 buttons as well as a dedicated relay per button, ie. bridging legs A and B of each group of 5 buttons, (PWR, PLAY, STOP, etc) and wiring a relay across that (see pic). However this didn't work. Bridging leg A of the power buttons was fine, bridging leg B resulted in the button switches closing. This a ground issue?
1 in 15 reed switches is more prone to failure than 1 in 3, so three is all I need if possible. And, is there a more reliable relay?