Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] Switch doesn't react on astable oscillator turning off (555, 5s/1s pulse)

Status
Not open for further replies.

TriggerHappy

Junior Member level 3
Joined
Sep 7, 2011
Messages
30
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,706
EDIT: To make the story short:
When I use a transistor to open and close a switch, I can't just leave the collector hanging, right? And I shouldn't ground it nor the emittor, right? What I need is a big resistor between emittor and collector, which is short circuited when the base gets high. Am I onto it here?



BACKGROUND
I've soldered wires onto a tact switch (of a hands free bluetooth device) in order to replace physically pressing its on/off button, with a way of switching which I control electronically. I can manually turn it on and off by short circuiting the wires I've soldered onto it, no problems. But when I connect them to my astable oscillator, it doesn't work anymore.

Three things can be done with the button physically.
A) Holding it pressed in 3 seconds switches it on (if "off" to begin with).
B) 4 seconds switches it off (if "on" to begin with).
C) 8 seconds puts in "search mode" (if "off" to begin with).

And this works just like that when I manually short circuits the wires I've soldered onto the switch and let go when the LED of the device indicates that it has entered the state change I want.

Now, my goal is to repeatedly turn it on and off, to have it go between A and B above, but never C. That way, it repeatedly sends a hello bluetooth signal which I can capture with code in my mobile phone. So I've put together an oscillator to open the switch for about 6 seconds, and then close it for X seconds (I've tried with from about ½ up to a about 2 seconds).

PROBLEM
But my astable oscillator only makes it go into "search mode". It never stops in "on" mode without going on to enter the "search mode". And this is not because the pulse length of the oscillator is too long. I've tried with a LED and it is definitely not lit as long as 8 seconds.

And I've decreased the "on" time (mark time, high time) of the oscillator, but then I just hit the level where the bluetooth never even goes into "search mode". The window between 4 and 8 seconds doesn't seem to exist when it's connected to the oscillator. Either it never switches on, or it goes all the way into "search mode".

SOLUTION?
One theory is that maybe the resistance between collector and emittor doesn't go down low enough fast enough for the device to recognize that the "the button has been released". I measure that resistance and it oscillates with about the right timing. But my multimeter doesn't momentarily change its display from "infinite" to 0 ohm. It counts down and up, especially the fall is displayed sequentially and never hits 0 ohm before rising again. Is this simply a measuring error of my multimeter, or is it possible that my astable oscillator has leaning flanks as large as in the order of a couple of seconds?

- This is the tact switch I've soldered on:
https://www.edaboard.com/threads/244644/

- My transistor is the one in optocoupler 4N36 DIL. I just use the transistor part of it pins 4, 5 and 6.

- The oscillator is built around an NE555P on a solderless board. And as I said, itself it seems to work well on a LED. But my mutlimeter doesn't indicate (by its design I suppose) how fast its pulse flanks fall.

- I have a 1 uF capacitor, so I use timing resistors in the order of 1 Mohm to a few Mohm. I've tried different configurations to vary timing. Again, timing seems okay when indicated by a LED.

- My VCC is 5.1v from batteries (when in service it will be USB powered with 5v).

SPECIFIC QUESTIONS
What resistance should I really have between the 555 output and the base of the transistor? I used 3800 ohm. Collector is grounded without resistor. Is this where I screw up?

What could I measure in order to find useful information about what's wrong?

I see know that some example circuits have a 0.01 uF capacitor to ground from the control pin of the 555. Is that important for the time scales I work with? What is it for really?
 
Last edited:

sorry, it is not clear. You have a 555 with pin 3 driving the base of a transistor ? is it NPN type ? or are you talking about the output transistor integral within the 555 ?
ok,i see mention of 4N36, why your not using a discrete transistor, like BC547

I think the first thing you should determine with the switch is whether the common contact of switch is to +V or to GND.
If the switch is closed, measure the voltage at the switch, is it +V (pull-up) or 0V (pull-down). If its a pull-up your assumption of the transistor
connection currently is wrong.
I suspect it could work by connecting 555pin3 direct to the switch non-common contact, that is if the 555 VCC is the same value
as the device, in any case a resistor > 2kOhm in series would diminish any problem.
Still need to know whether you need to switch it high or low.


BTW, the transistor in the 4N36 is NPN, the Emitter should be grounded.
 
I think now that my fault was that I left the collector hanging in nowhere, connected only to one pole of the device's switch. The base connected to the output pin of my 555, and the emitter grounded to my batteries, which have no connection with the device. Isn't that's why the collector-emitter resistance doesn't go low enough?

What if I do like this:
- I put a 4.7 Mohm resistance between the collector and the emittor, i.e. between the two poles of the device's switch.
- I use the optocoupler part of the 4N36, instead of its transistor base. With an IR LED instead of an electrical transistor base, there's no need to join the ground plane of the two circuits, the device and the oscillator. Is that right?

Although I do can find the ground and VCC of the device itself through the USB cable which is used to charge the devices battery. And of course both my oscillator/transistor circuit and the device, would actually be fed from the same power source in any case. So I think I'd better cut that cable and integrate VCC and ground of the two.

I'll try it in about 10 hours from now and post what happens. Unless I see better advice posted by then. I must go to bed now. Thank you very much for your helping comments!

(This is such so typical newbie: "What is ground?" type of problem. Sorry for bothering you!)
 

It works beautifully now! Thanks to me reading your post again today, xaccto.
Of course one must connect the negative pole of the switch to the emitter and the positive to the collector. I just thought of it as a matter of switching between high and low resistance, ignoring the direction of the current. This is the connection which works:
- Base driven by 555 output pin via 3300 ohm.
- Emitter grounded via 3300 ohm, and connected to the to one of the switches poles.
- Collector only connected to the other pole of the switch, so that voltage is positive +3.3v from collector to emitter. 3.3v is the device's voltage across the switch, from its internal battery.

Now, could there be any general improvements to that circuit? I want it to work for several days in a row, repeatedly switching it on and off. Do you think I'm stressing the device somehow and that it will break?
 

good work!
If you use a CMOS 555 and power it by the 3.3V, you can do away with the extra transistor, i'm fairly certain of that. I expect the switch is a digital input for the device and as such
those switches only pass fraction of mA, no stress at all. Just connect pin3 direct to the contact side of the switch. Of course you will need to invert the on-off, because a high on pin3 produces a low between C-E of transistor.
Though I still not sure from your description whether the switch is pull-up or pull-down.
 

Thanks, and I'm myself impressed how fast I improve my skills! A letter a day soon makes the analphabetic go away.
But still much is a mystery. I feel like an early egyptologist traveling among hieroglyphs and sphinxes...

I don't quit get it, what you mean by connecting to the contact side of the switch? Shouldn't I let a transistor switch on and off the transfer of the 3.3 volt, which the device itself provides for that purpose, between the poles of its switch, by connecting my oscillator output to the base of the transistor? But then of course, the ground of the switch must be the same as the ground of my oscillator-to-base connection.

EXPANSION OF MY PROJECT
The device has a switch, and also a separate charge connector for its internal battery. I need to both keep turning its switch on/off AND charge it enough to keep it going. My idea for tomorrow is to check if GND of the device's switch has 0 Volt potential relative to the GND of the device's charger. If so, which seems likely, I should join GND of the device with GND of my oscillator, wouldn't that be a good idea? I have 4 connectors to the inside secrets of the device:
- Switch's GND
- Switch's 3.3 volt (relative to above GND)
- Charge's GND
- Charge's 5 volt (relative to above GND)

And I've discovered today that the device doesn't respond to the switch when it is charging. While charging, it does nothing else at all. It isn't on and it cannot be turned on by the switch. So I thought I'd charge it while it is off, like about one second at a time. By combining my astable oscillator with a monostable one which is triggered by the astable one going low. The astable oscillator's output is connected to both the base of the switch controlling transistor, and to the trigger pin of the monostable oscillator. And the output of the monostable oscillator is in turn connected to the base of a transistor which controls the charging of the device. (This is potentially a 500mA USB current, so at least here a transistor will be necessary)

Like this time schedule:
0s Astable oscillator goes high ("starts pushing the switch").
3s Device powers up (due to its built in delay of 3s of "switch pushing").
4s Astable oscillator times out and goes low.
4s That triggers a monostable 555 to go high which starts charging the device.
4s When the device starts charging, it automatically turns itself off.
5s Monostable oscillator times out, goes low and device charging stops.
6s Astable oscillator turns high again. (4s high, 2s low = 6s period)
9s Device powers up after its built in 3s switch delay. And so on.

I need the monostable oscillator in order to create the "offbeat" third point in period time to stop the charging before the astable oscillator starts to turn the switch on again (otherwise the switch won't respond). I had time to try my double oscillators on 2 LEDs today, and it looked good.

Well, this little project just goes on and on!
 
Last edited:

- Switch's GND
- Switch's 3.3 volt (relative to above GND)

ok so you have pull-down switch.

here this diagram summarizes what pull-down and pull-up switches are, and what I think you have done.
sw-pull.jpg

essentially what the transistor is doing can be replaced by just connecting pin3 of 555 to the switch (where C of Q1 is)
In other words the 555 has the same ability to switch as the transistor. However the transistor output inverts the input
voltage. ie Base voltage (H) Collector voltage (L). So timer off (pin3 0V) would be switch on.
However do connect the 555 3.3V, not to the switch's 3.3V but to where you find the 3.3V power rail in the device.
AS you see in the diagram, when the switch is open, the 3.3V reading on the switch contact is via the pull-up resistor which
is normally a high value, typically 10k or more.

hope that clears things a bit.

BTW, I assumed you had connected device ground to your 555 ground, otherwise some ground may be floating, or by luck connected elsewhere.
circuit would not work or not reliably if they were not.
 
First, what did you use to draw that nice diagram? I've tried a couple of free softwares, but they're either overkill for a beginner, or they don't look and feel good. I think drawing is a great help for a beginner. Thinks look easy in online documentation, but then actually putting components together feels completely different.

Now everything works! It turns on with the astable controlling its switch. And it turns off and charges with the monostable switch controlling its charging cable.

I think I need to use a transistor between the oscillator and the switch, because the switch is on 3.3 V while my NE555P requires minimum 4.5 V. And I think I need another transistor for charging the device, because its from USB with up to 500 mA, but again my NE555P has maximum 200 mA in its specification. But I think I see what you mean in principle.

I don't understand the term "power rail", does it essentially mean Vcc? But the two poles of the switch (and the charges cable I cut up) are the only points I can interract with since everything in the device is surface mounted and undocumented. I barely managed to solder myself onto the switch!

The charging part now works like this:
- Base connected to monostable oscillator output via 3300 ohm.
- Collector connected to 5 volt.
- Emitter connected to device's "Vcc" wire in its USB cable AND to ground with 1 Mohm.
- Ground wire of the device's USB cable is connected to the ground of the oscillator circuit.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top