pulse on transition

Status
Not open for further replies.

NeX

Member
hi everyone,

i have a track ball that puts out a square wave form. when the track ball stops moving it can stop with an output that is constantly high or constantly low.

what i need to do is monitor the output, and as soon as it changes state i want to pulse a transistor.

i am sure this should be really easy, just something that ignores if the output it high or low, but as soon as it changes from one to the other it sends a short, high pulse.

but i cannot think of what i could use to do this.

can anyone help me out? thanks
 
If you can live with only detecting pulses from low to high then a capacitor to the base of a transistor will do what you want.

If you tell us what you are trying to accomplish we will be able to help more.

Mike.
 
great, thanks for that, that might actually do it.

basically i am using this:
SparkFun Electronics - Blackberry Trackballer Breakout

basically it has a round magnet that is picked up by a hall effect sensor, as the magnet moves it causes the output to shift from low to high, but when the magnet stops moving it rests on either low or high.

i want to use this track ball to control something that normally has push buttons for direction control, like a game controller. so i need to make each transition into a pulse that will act like one push of the button

does that make sense?

this track ball is very sensitive, so mesuring only transitions low to high would make it less sensitive, which would be better i think
 
Sounds like what you need is an "edge detector" Attached are a couple made with an XOR gate. The top is made with one section of a 4070 quad XOR. The other is an XOR made from a 4011 quad NAND.

Ken
 

Attachments

  • Edge Detector.gif
    17.5 KB · Views: 285
Sounds like what you need is an "edge detector" Attached are a couple made with an XOR gate. The top is made with one section of a 4070 quad XOR. The other is an XOR made from a 4011 quad NAND.

Ken

yea an edge detector sounds about right, i have some XOR chips lying around so i will give that a try,

only other problem is that i don't seem to be able to do the switching with a transistor, i need something like a relay which gives me a switch but is isolated from the circuit its switching
 
NeX

Can you sketch out how you are connecting the transistor and what the voltages at the original switches are.

Ken
 
NeX

Can you sketch out how you are connecting the transistor and what the voltages at the original switches are.

Ken

i will do a sketch in a sec, but the controls i am working with are in the bottom left of this diagram: https://www.devrs.com/gb/files/gameboy1.gif

the only voltage i can seem to find according to the multimeter is 0.70v from the 4 input pins, using the diodes as a referance i had the collector taking from pin 13 and then the emitter going to pin 14, and then the base going to 5v+ from the regulator.

to be perfectly honest my knowledge of electronics is small, this is actually the first time i have actually tried to use transistors, i have normally shyed away and gone for a relay instead. i harvisted some transistors from old circuits, and the best i can get is the switch being always on unless the 5v feed is applied, but after looking it up, i think this is not a transistor at all but actually a FET? either way, i seem to be getting interferance, by having the transistor not totally isolated from the hall effect sensor, it triggers some of the other controls,

so yea i have been looking up reed switch relays at the moment, it feels like overkill which is why i was hoping transistors would work, but maybe i need something like an opto coupler?

thanks again for the help by the way i am learning so much right now
 
I would opt for opto-isolators. See the attached.

Ken
 

Attachments

  • Edge Detectorand Optocoupler.gif
    9.9 KB · Views: 230
I would opt for opto-isolators. See the attached.

Ken

wow thanks very much for going to the effort!

i just want to check some things, the switch in the top left, that is my input from the hall effect sensor right?

and i can get all the XOR gates i need from one chip (4 one for each direction) but i need 4 seperate opto isolators?

is there any specific isolator to look for? i am having trouble finding that isolator with that code.

oh and what is the value of the capacitor? is it uf?

thanks again for the help!
 
Last edited:
Be for you order, try the attached test circuit to make sure it works. The transistor can be any small NPN transistor. Pushing the this button should do the same as pushing the controller's button.

Ken
 

Attachments

  • Edge Detector and OptocouplerTest.gif
    4.1 KB · Views: 359
Be for you order, try the attached test circuit to make sure it works. The transistor can be any small NPN transistor. Pushing the this button should do the same as pushing the controller's button.

Ken

ok i just took one of the old LCD boards i had lying around: diagram here https://www.devrs.com/gb/files/gameboy2.gif

and took the transistor from that, wired it up how you showed me with an AA battery and it works fine, it makes the cursor go down as if i was pushing the down button directly.

which is promising,

but i wired it straight to the powersupply from the regualator board, (5v which might be why it didn't work) but nothing happened. also it is when ground is connected to the input pins, (pin 10 ~ 13) that sometimes the problems happen. for example, pin 13 is "down" but also "start" and when you run pin 13 to Ground it is as if you pushed "start", note that this doesn't happen every time but enough to be a problem.
 
Last edited:
The outputs 14 and 15 bank-select which four buttons the four inputs inputs look at. The diodes isolate the buttons in a bank from each other. You can't use the +5V and ground in the controller for the switching transistors. That's why I used the battery and transistor to simulate the opto-isolator. The edge-detector circuits can run off the +5V/ground from the controller.

Ken
 

ok, so you are saying that i can use the circuit you drew for me, with the opto isolators and that will be able to run off the same power source as the board? because the isolators stop it being directly linked, like it is when i try and power the transistor directly?

this is looking promising, if this works i will make a video and post it here
 
Yes. The CMOS edge-detector circuits draw very little current, so should not add much of an additional load the the controller's regulated supply.

Ken
 
Last edited:
Yes. The CMOS edge-detector circuits draw very little current, so should not add much of an additional load the the controller's regulated supply.

Ken

great, i will give it a try and get back to you, thanks again for your help i really apriciate it!
 
right ok, i have an update.

i built this circuit, but there is a problem, as i move the track ball around it almost does nothing, every now and again i get a responce on the screen, it does the right thing, eg when i move up eventually it goes up, but it first of all only seems to do something if i move the track ball very slowly,

if i move it fast i get nothing, and if i move slowly i might get the odd pulse in the right direction. it seems like the pulses comeing from the track ball are either too fast or too close together or not strong enough,

can anyone help? i am so close to getting this working
 
Not sure which circuit you're referring to. The response time depends on the time constant of the input resistor and capacitor. The values in my circuits were just starting points. If it responds to slow movements, but not to fast moves, then the resistor and/or capacitor values need to be reduced bu a factor of 10 or 100 or 1000. An oscilloscope would help here, but you can just try different values. Start by changing the 100K to 10K and the 1uF to 0.1uf and then to 0.01uF.

Ken
 
ok thanks for the help!

i have just checked part of the circuit, the opto isolator is working fine and the diodes, but when it is all wired up as it should be the opto isolator channels all seem to be on. there is a voltage of about 1.6 volts constantly across the opto LED, that rises to 2 or 3 volts for a second when i move the track ball. so i assumed there was a small voltage leak or something that is keeping the LEDs on all the time and what it could do with is a higher value resistor to just trim it a bit. is this a possiblity?

i am going to keep checking

i have plenty of smaller resistors but i don't have any electrolytic capacitors less than 1uf, would changing the resistor only do anything?

thanks again for the help with this
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…