PDA

View Full Version : Brand spanking new to this. . .



Mongojerry_2
03-02-2005, 03:55 AM
Ok. An acquaintance suggested Parallax stuff might be able to accomplish what I want to do. So I started to check it out. I made it through medical school and beyond but I'm completely baffled by this. Can anyone help?? I suspect what I want to do is pretty simple but then again, maybe not.

I'd like to be able to program one of these devices as the controller for a small electronic device (a small vibrating device such as that used in silent pagers). In the simplest form of my idea I'd like to be able to program the device, originally controlled by a small battery pack, to turn on for 30 seconds and then off again every 30 minutes. My ideas get more complicated from there but that's a good starting point. Can I do that? How would I attach the electronic device to the new controller? What about battery power?



Post Edited (Mongojerry_2) : 3/1/2005 8:06:30 PM GMT

Pinoy NYC
03-02-2005, 04:07 AM
basic stamp can accomplish more than this, and maybe overkill for you application if this is what it is going to do.

battery is not an issue with basic stamp as it can be powered by a 9v batt. but, what type of devices you want to control? voltage, current requirements, etc?

if you give us more details you would be able to help.



Mongojerry_2 said...
Ok. An acquaintance suggested Parallax stuff might be able to accomplish what I want to do. So I started to check it out. I made it through medical school and beyond but I'm completely baffled by this. Can anyone help?? I suspect what I want to do is pretty simple but then again, maybe not.


I'd like to be able to program one of these devices as the controller for a small electronic device. In the simplest form of my idea I'd like to be able to program the device, originally controlled by a small battery pack, to turn on for 30 seconds and then off again every 30 minutes. My ideas get more complicated from there but that's a good starting point. Can I do that? How would I attach the electronic device to the new controller? What about battery power?

steve_b
03-02-2005, 04:16 AM
Before we help....you have to tell us, being that you were in medical school!....is the appendix really as useless as we're led to believe?!

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·

Steve
http://members.rogers.com/steve.brady (http://members.rogers.com/steve.brady)
"Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."

Mongojerry_2
03-02-2005, 04:18 AM
Pinoy NYC said...
basic stamp can accomplish more than this, and maybe overkill for you application if this is what it is going to do.

battery is not an issue with basic stamp as it can be powered by a 9v batt. but, what type of devices you want to control? voltage, current requirements, etc?

if you give us more details you would be able to help.


Thanks! I'm not sure of voltage, etc, and there is more than this that I'd like to be able to do. . . I'll try to explain. The device in question is a small vibrating motor such as that used in silent pagers. Currently powered by simple AA or AAA batteries. Here is a description of the full ranger of what I'd like this device to be able to do:

The full extent of what I'd like (and I'd take even a fraction of my overall dreams) is to supply potentially varying intensity (though I'd like to be able to set it to vary the intensity or not) and duration of activation at varying intervals, with each variable determined randomly--for example the burst might come anywhere from 5 to 30 minutes after the last one (and the best would be that these limits would be adjustable by me, or at least have a few different "programs" from which to choose) and range in intensity from barely there to full force and range in duration as well (again programmable would be best, say from 10 seconds to 30 seconds or perhaps a full minute). Lastly·I'd love it to·have the ability to be paused on the fly without losing its settings but without the possibility of inturrupting an activation in the middle (in other words the timing program can be paused between activations only).

Perhaps it could have a feature that could be activated·during any given use session or not (or included in some available "programs") that would include a small chance (very small? Moderately small?) of a more sustained (like 5 minute) high intensity vibration Maybe an even smaller chance of an even longer setting.·But ultimately it's the basic idea I'm after--short duration long interval teasing pulses at either predictable or somewhat variable intervals.

·

Mongojerry_2
03-02-2005, 04:19 AM
steve_b said...
Before we help....you have to tell us, being that you were in medical school!....is the appendix really as useless as we're led to believe?!



Yes

steve_b
03-02-2005, 04:24 AM
Are you looking for a 'period' programmable silent pager/alarm?!

You could use dip-switches to program the interval/mode that you want to operate in.

I believe most pager motors (I'm generalizing) run on 3Vdc...or 1.5Vdc....the smallest voltage you can get away with will let the motor last longer.· Go too high a voltage and it'll spin like mad, sure, but will die sooner than you'd like.· Sort of like a doctor telling me I need more exercise...I explain to him I have a finite number of heartbeats...so to sit still and do nothing will mean a long life!! haha

It's like this: "everytime I get the feeling to exercise, I lay down until it goes away!"



Sorry....working on my standup routine! :p

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·

Steve
http://members.rogers.com/steve.brady (http://members.rogers.com/steve.brady)
"Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."

MacGeek117
03-02-2005, 04:41 AM
Good idea! We all have only about 3 billion heartbeats, so your idea sounds good.
bugg

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Geordi: "It's like the laws of physics went right out the window!"
Q: "And why shouldn't they, they're so inconvenient!"

Geordi LaForge, Chief Engineer, USS Enterprise, NCC 1701-D
Q, Omnipotent Prankster

Mongojerry_2
03-02-2005, 05:03 AM
steve_b said...

Are you looking for a 'period' programmable silent pager/alarm?!

You could use dip-switches to program the interval/mode that you want to operate in.



Ok, I'm listening. . . How would that work? (Remember, I know absolutely nothing.) And yes--I guess what I'm looking for is something like a programmable silent alarm. If I'm understanding you correctly, I might have a situation where, for example, one switch position would mean it activates for 30 seconds every 30 minutes, another switch position might mean 10 seconds every 10 minutes and a 3rd position might be yet another variation?

What about variable programs--for example a switch position that would mean 5-30 seconds every 5-30 minutes with a small random chance of 5 straight minutes? Could I set the likelihood on that occurance (for example a 1/100 chance checked for once every 2 hours)?

Let's just say I want to set a program running and give the device to someone else. Could I have an override switch/button included so that person could pause the program temporarily? Could I have that button functional only during a dormant period but not during an activation already in progress?

Stream of consciousness questions follow: What would I need to do to design all this? (I'm motivated enough to learn but I wonder--could I perhaps pay someone to design the device for me?) How durable would the device be once set up? How big/heavy is it? Could I put it into a clip on casing such as an empty pager box for example? What would I purchase to do all this? What does it take to connect it to the pre-existing silent alarm electronic device? Someone said these things are powered by 9-volt? If I try it out at 1.5V and decide I really need 3V could I change that?

MacGeek117
03-02-2005, 05:08 AM
Or have a N-position dipswitch and have it go like 60, 50, 40, 30, 20, 10,9, 8, 7, 6, 5, 4, 3, 2, 1.
bugg

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Geordi: "It's like the laws of physics went right out the window!"
Q: "And why shouldn't they, they're so inconvenient!"

Geordi LaForge, Chief Engineer, USS Enterprise, NCC 1701-D
Q, Omnipotent Prankster

Mongojerry_2
03-02-2005, 05:11 AM
bugg said...
Or have a N-position dipswitch and have it go like 60, 50, 40, 30, 20, 10,9, 8, 7, 6, 5, 4, 3, 2, 1.
bugg


What do you mean?

MacGeek117
03-02-2005, 05:15 AM
You can select more than 1 fixed interval. the exampel is in minutes.
bugg

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Geordi: "It's like the laws of physics went right out the window!"
Q: "And why shouldn't they, they're so inconvenient!"

Geordi LaForge, Chief Engineer, USS Enterprise, NCC 1701-D
Q, Omnipotent Prankster

Mongojerry_2
03-02-2005, 05:31 AM
bugg said...
You can select more than 1 fixed interval. the exampel is in minutes.
bugg


Could I have more than one such switch such that one controls interval and one duration? What about variable intervals/durations so that within preprogrammed limits one would not be able to predict when or for how long the device would activate? Can I also control the intensity of the activation, and potentially vary that as well?

steve_b
03-02-2005, 06:09 AM
Have you ever used the old external modems?!· They had something called dipswitches on them to set their different modes!

Basically, on startup, the unit would go read the status of those switches (on/off) and decide from there what it should do.

So with your stamp you could use some dipswitches to set it's running state.· So, if you want it in mode 1, then flip the first dipswitch.

Then in your program you would have your program look to see what that switch is doing.

To be honest....although you are starting properly (baby steps) you really should take a gander at some of the literature that Parallax provides...which just so happens to be free!!· The first manual ppl will tell you to look at is the "What's a Microcontroller" text.· It gives you some ideas on how to connect switches and such to a stamp and how to begin programming.

Guys can drop a quick bit of code and tell you how to hook it up....but that doesn't help you understand how it works....OR, when it' stops working, how it's supposed to work so that you can troubleshoot it!



▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·

Steve
http://members.rogers.com/steve.brady (http://members.rogers.com/steve.brady)
"Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."

steve_b
03-02-2005, 06:21 AM
Sorry, missed some of this reply the first time!!

Mongojerry_2 said...
Ok, I'm listening. . . How would that work? (Remember, I know absolutely nothing.) And yes--I guess what I'm looking for is something like a programmable silent alarm. If I'm understanding you correctly, I might have a situation where, for example, one switch position would mean it activates for 30 seconds every 30 minutes, another switch position might mean 10 seconds every 10 minutes and a 3rd position might be yet another variation?

What about variable programs--for example a switch position that would mean 5-30 seconds every 5-30 minutes with a small random chance of 5 straight minutes? Could I set the likelihood on that occurance (for example a 1/100 chance checked for once every 2 hours)?

Let's just say I want to set a program running and give the device to someone else. Could I have an override switch/button included so that person could pause the program temporarily? Could I have that button functional only during a dormant period but not during an activation already in progress?

Stream of consciousness questions follow: What would I need to do to design all this? (I'm motivated enough to learn but I wonder--could I perhaps pay someone to design the device for me?) How durable would the device be once set up? How big/heavy is it? Could I put it into a clip on casing such as an empty pager box for example? What would I purchase to do all this? What does it take to connect it to the pre-existing silent alarm electronic device? Someone said these things are powered by 9-volt? If I try it out at 1.5V and decide I really need 3V could I change that?

You can have the dipswitches set to however you want to change your program.· The dipswitches are just status lines.· The stamp looks at the status of those lines and based on code, it will make the appropriate decisions based on how you've set the dipswitches.
You would essentially have the stamp read the status lines upon startup and run the appropriate block of code.·
If you wanted to change the MODE that it runs in....then just change the switches and reset the stamp and it'll reread the status lines and run the appropriate block of code!
As far as being able to turn it off or disable it....you could have the stamp look to see if ANY dipswitches are set high..or low...and not do anything.·
As far as the contruction....to do your demo project...get the BS2 and the Board of Education (BOE demo board).· I don't remember the name of the kit....but this will give you a quick setup so you can start playing.· Now, this stuff isn't small by any means....you could get the interpreter chip (one of those ICs on the stamp itself) and build your circuit around that....but I won't comment on how easy or hard this is!).· Even if you worked with just the Basic Stamp 2 footprint, you may have troubles fitting it in to a pager case!· It might be slightly bigger....depends on the motor size and how you have the dipswitches in there.· You'll definately want to put the stamp IC in a socket of some sort so you'd be able to easily pull it out and pop it in your BOE for reprogramming!

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·

Steve
http://members.rogers.com/steve.brady (http://members.rogers.com/steve.brady)
"Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."

The Dead Bug
03-02-2005, 09:50 AM
Mongojerry_2

First, let me say welcome to a great community and source for good information on how to work with the Basic Stamp.
It is always good to see newcomers with enthusiasm and great ideas.

The Stamp is eminently capable of doing what you want .

Now, let me second Steve_b's last posting suggesting that you explore the lessons in What's A Microcontroller with a BOE on the table in front of you. Before you can benefit from code or wiring diagrams or construction hints offered in this forum, you will need to be a little familiar with the language and techniques of both programming and electronics. Please don't misunderstand me; I am not discouraging your questions or exploration here, I encourage that. Just realize that when you ask " How would that work? (Remember, I know absolutely nothing.)" it is akin to me asking you to explain to me the process of operating on Steve_b's useless appendix :) . If I don't have a firm grounding in basic anatomy, medical terminology, the tools of the trade, and medical procedures, a lot of your efforts will be wasted.

The Basic Stamp is one of the simplest and most user friendly microcontrollers on earth. But it is still a microcontroller which means that it is intended to control other electronics through proper interface circuitry. A well designed system is a synthesis of sound logical program design working in harmony with electronic components that are selected to operate within the current and voltage parameters of the Stamp and the devices it is controlling. The processes and technique of actual construction is another layer of skill on top of that. When you are given a pointer such as "You would essentially have the stamp read the status lines upon startup and run the appropriate block of code," you need to have enough basics to translate that pointer into code and try it on a breadboard or the suggestion won't be valuable.

Give yourself some time to learn the basic operation of the Stamp, a little basic electronics, some of the relevant PBASIC commands, component identification, breadboarding, soldering. Ask questions, scour these archives, and you will soon see the potential of the Stamp and you will have a much more fertile basis on which to make decisions about how you can do what you want to do. I teach a college class every semester that covers basically what "What's a Microcontroller" covers. It takes the students at least that much understanding before they begin to synthesize their knowlege and can really benefit from forums like this.

Sorry for the long post, but I tend to wax philosophical about the process...I'm a teacher and I love what I do.
Best wishes,
-Bruce

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Name: Bruce Clemens

Work:· Clemensb@otc.edu (mailto:Clemensb@otc.edu)
Good Stuff on my Bolg: http://theDeadBug.journalspace.com (http://theDeadBug.journalspace.com)

Mongojerry_2
03-02-2005, 10:46 AM
I appreciate all the replies today--thanks, all. I've spent a bunch of time reading through the What's a Microcontroller guide and the New Basic Stamp Manual. I recognize the wisdom in the advice that to pull this off I would need to invest some time learning how to make these things tick. I'm not convinced, though, that in the end I'll have what I'm looking for. I have yet to see anything that talks about controlling an external device using a PBASIC program in a Stamp Microcontroller. What is the command that would activate/deactivate the device? What would be involved in connecting the device to the Stamp module?

I·think if I could envision how that would go I would have a pretty good sense of how to learn to design the programming I have in mind.

Several people here have mentioned dipswitches. I understand how that would work but how do the switches get onto the unit? I may suddenly learn this programming language but I'm not likely to suddenly learn soldering.

How long would the 9v be likely to last doing what I've described? I'd like it to run for hours at a time, spending the bulk of its time counting and checking the state, perhaps, of a few random numbers, intespersed with short bursts of activating the vibrating unit I'm envisioning.

steve_b
03-02-2005, 01:51 PM
Mongo,

I'm glad you're taking the time to go through the manuals....there are many pages and I know the urge just to flip to what you need and get on with it....but each page is one more page you didn't know before!

The dipswitches act like any normal switch.· Just that these ones are in a nice small form for small devices.

Basically you would tie one end of the switch to +5V then through a resistor (unsure of value) then in to a stamp pin.

When the switch is closed, you will have that +5V on that input, so when you tell the stamp to 'look' at that pin, it would see a logic value of 1.· When the switch opens, you drop to 0V and you get a logic value of 0 on that input.· (someone will say that you need to 'pull' the pin to ground when it doesn't have the 5V on it so that it doesn't 'float'....but we can get to that later!

So that's how you might read a switch state.· To operate your motor, you might tell a stamp pin to go "high" which puts it to +5V.· Now, this 5V shouldn't be used to power the motor as it would draw too much current from the stamp....so you might use that 5V to trigger a transistor or a small relay that would trigger the motor to go.· I'm sure this is all in the manuals.· Here's a quick image of how to hook up a relay....



▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·

Steve
http://members.rogers.com/steve.brady (http://members.rogers.com/steve.brady)
"Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."

Pinoy NYC
03-03-2005, 12:37 AM
hi steve, just a quick question, what software do you use to create the schematic?... I"m using Eagle, but I think yours can produce a better schematic.

steve_b
03-03-2005, 01:55 AM
This was something that Jon Williams created (he's the main voice on these forums) and I've been trying to keep an archive of them....but have missed many.
I use....uh oh....took too many robaxicets!!· ORCAD.· I've used AutoCAd but that's more structural, in my opinion...but I use ORCAD at work and find it to be alright.·

I've used paint in the past just to throw something together.· I've included a quickie that I worked in Micro$oft Paint.·

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·

Steve
http://ca.geocities.com/steve.brady@rogers.com/index.html
"Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."