555 in astable mode (carrier frequency)

An area for more general discussion by the user community for topics not covered elsewhere
Post Reply
chris.james
Posts: 5
Joined: Sat May 02, 2015 10:08 pm
Contact:

555 in astable mode (carrier frequency)

Post by chris.james »

Hi all,

I am trying to create a astable circuit to generate a 56khz carrier frequency for infrared but first i want to build the astable circuit using a 555 timer i have used the information online using this website here

http://www.ohmslawcalculator.com/555-astable-calculator

the values i have used are C - 0.1nf, R1 18k, R2 120k to generate 55.930 which is the closest i could get to 56khz with a duty cycle of 53.49.

it is to my belief that a lower duty cycle is better? (as i understand this means i can use more current)

i will be using a tsop 4856 to receive and a tsal6100 to send i have check the power supply on the oscillator using
a arduino 5v and a dedicated power supply.

My problem i am having is on my oscilloscope i am getting 43.72khz on the frequency with these awful surges at each rise in peak, i have attached a picture below if anyone can take a look it would be appreciated.

P.S i am also using 1% tolerance resistors and ceramic capacitors with a NE555N timer.

Thanks in advance, Chris.

Image
User avatar
AnalysIR
Site Admin
Posts: 776
Joined: Sat Aug 31, 2013 3:51 pm
Location: Dublin, Ireland
Contact:

Re: 555 in astable mode (carrier frequency)

Post by AnalysIR »

Hi James

We designed a similar 38kHz circuit for our BeamIR project recently and got it working OK. In the final version we changed to a crystal circuit.

I suggest you change one of the resistors for a Potentiomer so you can adjust or tune the frequency. However, unless it is a critical or long range application the frequency can be off 10-20% or more and still function.

Lower duty cycle is often used in battery powered circuits otherwise anywhere between 30-50% is fine.

One of the problems with the 555s can be getting duty cycles greater than 50%, which can be overcome by inserting an inverter (a Schmitt trigger can also restore it to a good square wave)

Regarding the surges do a search for "ringing" on square waves. Can be caused by long jumper wires on breadboards or the test probles etc and may not be present in the test circuit.
A 74HC14 should help this.
Add some extra capacitor on your power supply to this circuit.

Unfortunately, I dont see the image you mentioned.

I think you will have to use a POT to get closer to the 56kHz, but 43kHz should work OK as long as the range is not too far.
After testing you can remove the POT and replace with the equivalent resistor values.

Finally, these 555 circuits will suffer from a lot of drift with temperature which can be an issue in some environments and is why we switched to crystal oscilators in our BeamIR module - for greater stability & accuracy.


PS: Have you thought about using an Arduino Nano clone or pro mini which can be found for circa $2 from China incl PP. This would be a superior option.
chris.james
Posts: 5
Joined: Sat May 02, 2015 10:08 pm
Contact:

Re: 555 in astable mode (carrier frequency)

Post by chris.james »

I have attached a proper picture below that might help, Thank you i am using a breadboard with jumper wires and they are most probably to long.

My application for this is a laser tag set-up so it is a long range application, I have used a 555 timer to generate the carrier frequency as I do not want to leave the task dedicated to my micro controller but I am interested in hearing more about your solution and will look into it if you have any more links.

For the time being is there any way i can make do with the long jumper wires (Space out the circuit more ect) any workarounds that might improve it.

Image

Thanks in advance, Chris.
User avatar
AnalysIR
Site Admin
Posts: 776
Joined: Sat Aug 31, 2013 3:51 pm
Location: Dublin, Ireland
Contact:

Re: 555 in astable mode (carrier frequency)

Post by AnalysIR »

I just had a look for a 56khz crystal and it seems they are not available - so you will have to proceed with the 555.
I assume you dont have any spare pins avaialble on your MCU, but $2 for an arduino clone with crystal is hard to beat!

Unfortunately the image didn't make it - I will upload one below to test if there is an issue with the site.

If you like I can look to see if I have a spare older BeamIR available and if it can be adjusted to 56kHz from the nominal 38kHz. (may take a few days before I get to it)

Details on our MakeIR modules can be found: http://www.analysir.com/blog/tag/makeir/

The BeamIR module info is here: http://www.analysir.com/blog/2015/09/23 ... t-barrier/

The BeamIR module has a matched receiver, jumper selectable power levels plus custom power levels via optional resistor(TH), TSAL6100, freq matched TSOPxxxx and the Tx & Rx boards are both 25x25mm.

PS: looks like the image uploaded fine -so make sure to browse to the file & click add file. I will also check your access permissions to see if that is an issue.
You do not have the required permissions to view the files attached to this post.
chris.james
Posts: 5
Joined: Sat May 02, 2015 10:08 pm
Contact:

Re: 555 in astable mode (carrier frequency)

Post by chris.james »

Hi a lot of people on the forums believe that using another chip would be a better way so now i am trying to use my arduino duemvilanove to generate a 56khz square wave using the method describe here https://www.arduino.cc/en/Tutorial/SecretsOfArduinoPWM however its not making much sense at the moment and if i do it using the standard digitalwrite and delaymicroseconds the closest i can get is down to 55.530khz with spikes up to 66.530khz and it doesnt look a very clean signal can anyone help me manipulate this so i can get a square wave down on this.

thanks in advance, Chris.
User avatar
AnalysIR
Site Admin
Posts: 776
Joined: Sat Aug 31, 2013 3:51 pm
Location: Dublin, Ireland
Contact:

Re: 555 in astable mode (carrier frequency)

Post by AnalysIR »

Yes
using the timer on your MCU is the best approach - assuming it has a crystal.

You will not get exactly 56kHz, but 55.x is close enough.


You shouldnt be getting 66kHz spikes - so there must be something wrong with your setup, code wiring etc.


Did you try the Timerone arduino library, which whould make things much easier, for you.
chris.james
Posts: 5
Joined: Sat May 02, 2015 10:08 pm
Contact:

Re: 555 in astable mode (carrier frequency)

Post by chris.james »

no i haven't my application is for a laser tag setup so im trying to get the frequency to be the best match for the diode and receiver to avoid this being a range limiting factor, ive been looking at code for doing this,
im trying to avoid using external library's and making the code as optimised as possible could you possibly recommend some sample code at the moment i have just tried this.

Code: Select all

void setup() {
  pinMode(11, OUTPUT);

}

void loop() {
  
  digitalWrite(11, HIGH);
  delayMicroseconds(2);
  digitalWrite(11, LOW);
  delayMicroseconds(2);
}
ive just viewed it at a 5.000us on the oscilloscope to realise its averaging at 57khz.
User avatar
AnalysIR
Site Admin
Posts: 776
Joined: Sat Aug 31, 2013 3:51 pm
Location: Dublin, Ireland
Contact:

Re: 555 in astable mode (carrier frequency)

Post by AnalysIR »

Some options

1. Look for the example of 'softPWM' on our blog.

2. Just copy the method used in IRremote or TimeOne for generating PWM. (you dont need to include the full library)

PWM methods will be better. Any PWM inaccuracy of less than 1kHz is not material for your application.
Post Reply