Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Circuit Analysis of IR transmitter/receiver

  1. Oct 21, 2016 #1
    Hi everyone,

    I am a complete beginner when it comes to circuit analysis that involves anything more than a few resistors and capacitors. Currently, I am working on a project that requires the transmission and reception of IR signals to control a motor. I know the requirements for the motor I must use and the amount of voltage I am able to work with. My question is, will the voltage have any effect on the frequency output of the 555 timers? In addition, I'm having trouble selecting the correct transistor to provide the right amount of power to the DC motor. Any help is much appreciated!

    Here is the picture for the schematic that I am working off of:
    Wireless%20DC%20Motor%20Speed%20Control.jpg

    I am fairly comfortable with how the 555 time operates in astable and monostable configurations. I'm just having difficulty calculating numbers.
     
  2. jcsd
  3. Oct 21, 2016 #2

    davenn

    User Avatar
    Science Advisor
    Gold Member

    it shouldn't do so unless the PSU cannot supply the voltage and more specifically the required current so that the Vcc rail voltage doesn't sag when the motor is running under load .... I would also be adding some bypass capacitors on that Vcc rail so that the 555 doesn't get spike noise from the motor

    it needs to be able to handle the current that the motor you choose requires .... you have given no info on that


    Dave
     
  4. Oct 23, 2016 #3

    Baluncore

    User Avatar
    Science Advisor

    Try to avoid controlling the Vcc power terminal of an LM555. One improvement to the transmitter circuit would be to gate the second LM555 with it's RST input rather than the Vcc power supply terminal. When an LM555 switches it takes a short but high current spike from the supply and so needs a bypass capacitor on Vcc. That upsets the internal voltage divider and comparators. If the Vcc is hanging off another LM555 then you cannot use a bypass capacitor on Vcc of the second LM555.

    You might also use the open collector Discharge output from the first LM555 with a pull-up resistor to Reset on the second LM555. Those changes will give better regulation of output frequency.
     
  5. Oct 30, 2016 #4
    Thanks for the suggestions davenn. Is there a way to calculate/estimate the amount of noise produced by the motor? I'm trying to figure out what value of capacitor to use.
    Here are the requirements of my motor:
    Torque: 0.1 Nm
    Total Power: 11 Watts
    Maximum Current: 2.44 A

    Also, I'm working with a 4.5 V power source and will use a potentiometer to control the frequency/pwm.

    @Baluncore
    I'll look into those other methods as well. I'm still getting use to 555 timers and the different modes of operation that they have. Thanks for the suggestions!
     
  6. Dec 1, 2016 #5
    Hi All,

    I've done some research into bypass capacitors and I'm finally starting to grasp its purpose and implementation within a circuit. However, I am having trouble testing my circuit and seeing where it can be improved. I don't currently own an oscilloscope so I am wondering if there are others ways of signal analysis. Does any one know of online simulators or alternative methods that could help with the design?

    Thanks
     
  7. Dec 1, 2016 #6

    Baluncore

    User Avatar
    Science Advisor

    You could download a free copy of LTspice from; http://www.linear.com/designtools/software/

    Here is an LTspice model of an example IR transmitter with the example output shown.
    I left out the bypass capacitors but changed the gate method.

    IR_TX.png

    All the attached files are text files inside, but need a txt extension to attach to this post.
    You will need to remove the .txt extensions from the attached files to use them.
    The .asc and .plt files go in your working directory.
    The .sub and .sym files for an idealised NE555 need to go in the installed library directories.
     

    Attached Files:

  8. Dec 3, 2016 #7
    Wow, I can't explain how much this helps out! Being able to see the pwm signals being modulated is extremely informative. If I want to experiment with different bypass capacitors would I get rid of the gate and place in varying capacitors. I ask because currently I do not see any noise.

    Also, to clarify a few things in this circuit:
    1) Do the two resistors in parallel act as a potentiometer?
    2) Am I correct in saying that this type of modulation would be amplitude modulation?
     
  9. Dec 3, 2016 #8

    1) Typically no they do not..two r's in // act as current dividers. Unless you picked the V from the middle node of the 2 resistors giving you a single voltage somewhere between VCC and grd.

    2) To obtain a true AM wave output, generally you would excite 2 xtls. your schematic as shown would output two positive going AM'ed alterations, I believe.
    Kinda' like a full wave bridge with intelligence 'inside' the DC waveform.

    Below, would be one example.


    upload_2016-12-3_15-40-15.png


    Again as my colleagues suggested, a oscilloscope would be invaluable to see this outputted waveform.
     
  10. Dec 3, 2016 #9

    Baluncore

    User Avatar
    Science Advisor

    If you avoid turning the power on and off to the chips it will not take much bypass capacitance to keep the circuit happy. I would put an 0.1uF ceramic capacitor as close as possible to the end of each NE555 chip, between pins 1 and 8.
    To simulate supply noise I would add some resistance and inductance to the Vcc1 voltage source. There are no big circuit currents with the gating circuit I used in the example. The NE555 model I used is idealised, so it is simple and computes fast. I would test the real circuit rather than load a more realistic model of the NE555.

    R4A and R4B make the 10k pot. The “.param pot 50” is the 50% position. Edit that “50” to test other duty cycles. The two {equations} are the resistance values that make the two sides of the potentiometer.
    They are drawn next to each other since they are used as variable resistors in this circuit. The diodes make sure that current only flows through one side of the pot at the time. If it was a voltage divider I would have drawn them end-on in series,, more like a typical potentiometer.

    It is probably best not to think of it as AM since when it is there it is a fixed amplitude carrier. It is a version of pulse-width or duty-cycle modulated continuous wave. MCW.

    Have you got LTspice installed and running yet? If you have problems, ask in this thread.
    For the best help, post your filename.asc by appending .txt, to filename.asc.txt then others can run and test your circuit.
     
  11. Dec 3, 2016 #10
    Excellent point indeed. I was thinking what you verbalised Balun, as in CW in HF communications. I'm a old bag of bones and still pound away with a bug or straight key! Thanks for pulling me back on track! :oldsmile:

    ES
     
  12. Dec 4, 2016 #11
    Thanks guys. I really appreciate the help!

    I did manage to get LT spice running and simulating the circuit you sent. Being able to probe each section of the circuit has allowed me to see the different square waves that are generated. It has helped me greatly to visualize what is going on. Now I just need to look into the MCW that you mentioned.

    Also, I'll look into seeing if I can pick up an oscilloscope for cheap. Maybe my University has an old one they don't need.

    If I decide to make a more realistic simulation with noise, I'll update this thread to see what you guys think.

    There is only one more question before I start ordering parts and putting everything together. What is the best way to estimate noise and thus calculate a bypass capacitor for my DC motor?
     
  13. Dec 4, 2016 #12

    Baluncore

    User Avatar
    Science Advisor

    That will depend on the type and rating of the DC motor. Maybe you do not need a capacitor.

    But you MUST use a reverse biassed power diode across the motor, to catch the expected positive inductive voltage spike when the transistor turns the motor current off. Without that flyback diode the TIP122 will be destroyed by the excessive positive collector voltage. It would be best to use a fast recovery diode rated at the motor current, similar to that used as a rectifier in a switching power supply.

    Any bypass capacitor should go across the transistor and motor, that is between the motor positive = Vcc, and ground.
     
  14. Dec 7, 2016 #13
    A quick update of progress

    First, I just wanted to say that I appreciate all the advice I've received. You've given me plenty to research and learn.

    1)
    So I decided to visually wire up the schematic on a breadboard so that wiring up a prototype is easier.
    Here's what I have so far:
    https://circuits.io/circuits/3383536-ir-transmitter

    One question that I have is in the wiring of the potentiometer. I'm pretty sure the wiper should be in series with the 1k resistor but I don't know if the other two pins are connected correctly. The led does light up when I run the simulation, but I just want to double check my work.

    2)
    For the lt spice simulation I'm getting interesting values for the frequencies. After probing and measuring, I am getting a value of 3.8 kHz for the output square wave. Is there a correct way to go about measuring the frequency of pwm in lt spice? Thanks
    pwmfrequency.png
     
  15. Dec 7, 2016 #14

    Baluncore

    User Avatar
    Science Advisor

    The pot, 1k0 and diodes on the breadboard look OK to me.

    The first cycle of a burst produced by an NE555 often has a stretched first cycle because the capacitor must be charged from zero to 2/3Vcc, rather than 1/3Vcc to 2/3Vcc. So avoid the first cycle, measure the period of a later cycle.
    First zoom in on a couple of later cycles of the signal. You could do that with the mouse on the plot window, or by specifying the transient analysis simulation time and the time to start recording data.
    Select two cursors for the trace. Place cursor 1 on a rising edge, then cursor two on the next rising edge. Read the Freq. If rising edges are irregular, try falling edges.
    Or measure over ten cycles to average the period, remember to multiply the frequency, or divide the period, by ten.

    I would use an opto-isolator to simulate the IR LED to phototransistor link. But I am a bit confused by your original circuit for the IR receiver, because the pin numbers are not clearly readable. I suspect it would be best to use a re-triggerable monostable configuration.
    Can you please attach a clearer circuit of the proposed IR receiver to your next post.
     
  16. Dec 8, 2016 #15
    Perhaps I am not using the correct method or not placing the cursors at the right location. However, my values always end up being around 3.8 kHz. The readings are even less if I try measuring more cycles.

    wireless_dc_motor_speed_controlsmall.png
    As you mentioned, the 555 timer is configured in the monostable mode. The purpose is to demodulate the input signal to it's original pwm duty cycle wave form. From what I understand the low pulses generated by the IR sensor are the trigger for the 555 timer. The output is configured to be slower than the input pulses thus changing the 38 kHz frequency back to original pwm.

    How would an opto-isolator work in place of this? Thanks!
     
  17. Dec 8, 2016 #16

    Baluncore

    User Avatar
    Science Advisor

    I am not sure why you have trouble, but 3.75kHz is about right. Try displaying a shorter period of time by editing the .TRAN script to show only a very short time with two positive edges.

    Yes, changes it back to the PWM envelope of the signal. But your monostable is not retriggerable.
    Attached is a “retriggerable monostable” version using the NE555. It fills in the gaps between the gated carrier pulses and so prevents gaps of drive to the motor. I think you will see those gaps if you modify my model back to your circuit by removing the PNP transistor.

    The optocoupler is a simple model of the IR path, but has very low losses compared to real paths. The real path loss suffered by the IR signal may result in a need for amplification. The usual reason that an IR signal uses a PWM string of regular pulses is so it can be extracted from the background IR environment by using a tuned amplifier with automatic gain control.

    I'm not sure if you have the darlington transistor models. I would use an Nchannel MOSFET to drive the motor rather than a darlington. You can change the darlington to a "logic level" Nchan MOSFET from the LTspice devices list, or let me know if you need me to give you a set of standard darlington models.

    Remove D3 from my model to demonstrate the inductive voltage spike that, on the first turn-off edge without a flyback diode, would destroy the U4 motor switch.
     

    Attached Files:

  18. Dec 10, 2016 #17
    Okay, that's my fault. My intention is to have an output frequency of about 38 kHz so it can be read by my IR sensor. I'll have to change the capacitor and resistor values to obtain that. I assume that the second 555 timer is being run in an astable mode, correct?

    Is there a certain method for choosing a resistor/capacitor combination that's most efficient? Right now I am using an online calculator to determine the values that output 38 kHz (I also have the written equations for this). Should I aim to make the capacitance as high as possible while keeping the resistances low?
    So this means that the circuit will still work in a non-retriggerable mode, but the pwm pulse will not be continuous and thus the duty cycle will be less than anticipated?

    So this is just a way to simulate the transfer of IR signals digitally and not a physical component?

    Sorry for the many questions, but I want to make sure I know how everything works and how to optimize it. You've been a great help!

    Also, here's an update of progress. I managed to breadboard the circuit and gain access to an oscilloscope.
    Here's some results:
    20161209_200107small.jpg
    After some calculating the cycles vs time period the frequency was found to be about 3.3 kHz. It does make sense that the frrequency is not 3.75 kHz as shown in the simulation because I had to use different resistances (R1= 330 ohms & R2=2.2 kilo ohms). However, it also deviates from the theoretical frequency of an astable timer. The calculated output frequency should be 3.05 kHz. Is there any explanations for this difference?
     
  19. Dec 10, 2016 #18

    Baluncore

    User Avatar
    Science Advisor

    Yes, it produces a rectangular wave when not reset by the PWM signal.

    No. Make the resistor big, but not bigger than 100k when surface leakage currents become a problem in dirty environments. Smaller capacitors need less charge so use less power per cycle. The currents being switched are also smaller so make less RFI.

    Indeed, the position of the decimal point is important. That is why in electronics we write 2k7 rather than 2.7k. The frequency you want is 38k0 Hz not 3k80 Hz. To change from 3.78kHz to 37.8kHz, try simply changing Ct from 100nF to 10nF. Test it, then each time you increase resistors by a factor of 10, reduce Ct by a factor of ten. Avoid Ct less than about 220pF as capacitance of the prototype breadboard then becomes a problem.

    The NE555 is usually non-retriggerable so there will be small gaps after recovery while waiting for the next trigger. The added PNP prevents all that unnecessary switching of motor currents. It also permits shorter monostable times and so follows the PWM tail closer.

    Yes, I needed to get the simulation signal from the TX model to the RX model. The common 38kHz IR receiver modules handle the IR receiver design problems for you.

    I have not tried to explain the simulation versus reality difference.

    I have changed the motor drive to a logic level MOSFET because it is more efficient than the darlington which wastes 30%, 1.5 volts of the 5V available. I used the IRFH6200 because it is in the standard LTspice library, I would use something cheaper in reality.
     
  20. Dec 10, 2016 #19
    This is actually one of the things I tried while I was in the lab. I forgot to take a picture but I measured cycles that ended up giving me around 45k0 Hz. That was using a 10nF capacitor and 330 ohms for R1 and 2.2 kilo ohms for R2. Based on my calculations I should be getting around 30 kHz instead. I know there is some error in reading exact values from the oscilloscope, but is there another reason that could cause this discrepancy?
    Would you mine sending me the model for this exact part? I would like to make sure that I'm following along with your data.

    PS I have finals next week so my response times may be a lot slower.
     
  21. Dec 10, 2016 #20

    Baluncore

    User Avatar
    Science Advisor

    It should be in the LTspice library. Specify nmos device, then right click and Pick New Mosfet.
    The Nchan MOSFET in my circuit has a 10R series gate resistor to prevent parasitic oscillation.

    I trimmed the carrier frequency closer to 38 kHz. Use .TRAN 0 12m3 12m to see ten cycles for frequency measurement.
    I removed pullup resistor from DIS of U1 and now take gate signal from OUT of U1, to RST of U2.

    Maybe you do not need a monostable with the IR receiver module. What model module ?
     

    Attached Files:

Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted



Similar Discussions: Circuit Analysis of IR transmitter/receiver
  1. Receiver and Transmitter (Replies: 12)

Loading...