Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Need help with a unique circuit

Status
Not open for further replies.

donovanbuck

New Member
I have been trying to build a circuit that will replicate the action of an optical encoder. I need to be able to alternately fire two small relays to simulate the clockwise or counterclockwise rotation of a notched HVAC fan speed control. It would be nice to operate this circuit with only two momentary buttons, one each to simulate cw or ccw rotation. I suspect a 555 or 556 timer type circuit should work but I am stuck on how to initially start the astable process to make it start with one relay or the other. According to the spacing of the notches on the knob passing through the optical encoder is would be a 50 percent duty cycle. I hope I have provided enough info for someone here to point me in the right direction or to a link for the type of circuit I am trying to build. I appreciate any help I can get. Thank you.
 
If I have understood you right, you're asking how to build a square wave generator.

You will find an astable 555 timer eg. here along with other useful circuits.
 
Yes, I have checked out and built a successful one of these that almost replicates what I need to do. I need to be able to start the square wave with either a high or a low signal. My biggest problem is with figuring out how to start the toggle sequence to start with one relay or the other. The optical encoder I am trying to replicate has 2 optic sensors, it interpets which sensor is dark, which one sees light, and in what sequence and with what frequency they are toggling. I am not worried about the frequency as a set pulse duration of .5 seconds should be close to the rate of rotating the notched knob that passes through the optic sensor. Thank you for your help.
 
wish they were all this easy...

Take a 555 and make it freerun (astable) at twice the required encoder output speed (or as variable).
Take a 7404 and invert the 555 output.
Take a 7474 and clock one side from the 555 directly, clock the other side from the 7404.
Connect each sides' Q* output to its' own D input.

Direction will be set by which 7474 output leads the other == quadrature outputs... Enjoy & G.H.... <<<)))
 

Attachments

  • NONAME_14.pdf
    4.2 KB · Views: 304
Last edited:
this seems simple. A 555 timer can be a square wave oscillator or a one shot. The only difference is a connection between the timing capacitor and the threshold connection. So, for each of the two timers, the pushbutton switch makes the connection from the capacitor to the threshold. That starts the oscillation. Only push one button at a time because only one timer should oscillate. Now, the output of the oscillating timer is connected to the other timer, which is still configured as a one-shot, since it's button isn't being pressed. It will fire after the oscillating timer's output falls to a low.

EDIT: I think instead of "The only difference is a connection between the timing capacitor and the threshold connection" I think I should have said "The only difference is a connection between the timing capacitor and the trigger connection"
 
Last edited:
Ummmmm.... You just went over my head by quite a bit. Im a very novice electronic builder. I can build a circuit by design, but engineering isnt my thing. Is there a type of generic design that I could follow? Thanks again.
 
A generic design for a "unique circuit"? You can find both the square wave oscillator (astable) and the one-shot (monostable) on the page linked by Grossel.
 
Last edited:
If I can find the time, I'll draw a schematic. Don't count on my finding the time though.
 
I suggest you read this link. Note the part about Incremental rotary encoder and look at the truth tables and waveforms. They are what OlPhart was getting at in his post. It sounds to me like you want to simulate or duplicate the A and B pulses of a rotary encoder (Quadrature Output). CW rotation B leads A by 90 degrees and CCW rotation A leads B by 90 degrees. The frequency of the pulses is a function of the rotational speed. I would work from OlPharts suggestion.

Ron
 
Attached is a counter that outputs the waveform seen in your posts.
At the right is a "switch" that selects B or NB. This reverses the 'direction'.
I did not draw a 555 to make the clock. In my circuit I used a signal generator.
hope this helps.
 

Attachments

  • COUNTER.JPG
    COUNTER.JPG
    18.1 KB · Views: 308
First of all, I apologize for this poor schematic. I just don't have the time to fix it. I illustrated my basic idea. It will require a 2P2T switch. The NC and NO connections are shown on the schematic ( I don't have a good switch symbol, a NO contact is shown as break in the wire, and a NC contact is shown as a continuous wire.) The left timer is an astable oscillator and the right timer is a one-shot. By throwing the switch, the two timers reverse roles, and the right one becomes and oscillator, while the left one is the one-shot. One configuration simulates CW and the other CCW rotation. Change the values of the timing caps for more 'realistic' frequency. It requres 2 555's 8 resistors and 4 capacitors ( not including PS decoupling caps )
 

Attachments

  • opc_enc.PNG
    opc_enc.PNG
    63.9 KB · Views: 293
Here is the simulation data. Green is oscillator ( left timer ) and blue is one-shot. You can play wiht the circuit values and try to get the waveform more symmetrical. I would work more on it, but I'm out of time. Good luck
 

Attachments

  • opt_enc_sd.PNG
    opt_enc_sd.PNG
    76.9 KB · Views: 361
I have been trying to build a circuit that will replicate the action of an optical encoder. I need to be able to alternately fire two small relays
In an incremental rotary encoder the A and B outputs are in quadrature. When you say fire the relays 'alternately', do you mean in quadrature? If so, then OlPhart's suggestion in post #4 will do the trick.
 
If quadrature is what you need, you can do it with a dual opamp. Google quadrature oscillator and you will get dozens of hits. You can use a dual comparator, one comparator for each output, to square up the edges.
 
Last edited:
Thank you very much for the help and the diagrams. I think I'm headed in the right direction now. I apperciate your time, this is a great site!
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top