Close
0%
0%

500mW (27dB) ISM Band Transceiver

This is an ISM band transceiver utilizing the Semtech SX1238. Similar to the popular RFM69 except with an added power amplifier on transmit.

Similar projects worth following
The SX1238 by Semtech is a little known ISM band transceiver IC. It is the big brother to the SX1231, which is used in transceiver's such as the popular RFM69HW. Where the SX1238 really shines is that it has not one, but two power amplifiers on the transmit side, as well as two low noise amps on the receive. This enables the transceiver to have a longer range than the RFM69.

This particular transceiver would be practical in a situation where you wanted long range and high bit rate. Since there didn't seem to be any dev boards or libraries for this chip already in place, I decided to build my own. Each transceiver is capable of connecting to a network of up to 254 other devices. You can also send packets to either individual nodes, or broadcast them to every node in the network. Attach them to robots and let them communicate their battle plans. The sky is the limit.

I’ve been meaning to play around with RF circuits for awhile now, but always felt a bit intimidated. However, I recently watched an amazing talk by Michael Ossmann which inspired me to give a simple RF transceiver circuit a try. For those interested, here's the talk:

Mr. Ossmann gives 5 simple rules to follow for RF design. These are the rules he recommends if you want to delve into RF pcb design without having to buy expensive test gear and read mountains of books:

1.  Use 4 layers.
2.  Use integrated components.
3.  Use 50 ohms everywhere.
4.  Follow manufacturer recommendations.
5.  Route RF first.

The first rule, use 4 layers, is fairly self explanatory. By having 4 layers, it’s possible to have a stack up with a dedicated ground and power plane and a separate layer for RF signals. Here’s the recommended stack up mentioned in the video:  
---------------------RF signals  
---------------------GND  
---------------------VCC  
---------------------Signals

The second rule is to use integrated components. The idea here is to use chips that have the RF magic baked in wherever possible. For my project I opted to use a  Semtech SX1238  transceiver. I discovered this chip through the digikey parametric search. Some feature’s I like about this particular transceiver is obviously it’s got an RF transmitter/receiver built in, 50 ohms output, good documentation, a built in power amplifier on the transmit(up to 27dB) as well as a low noise amplifier on the receive end. This particular transmitter has a frequency range between 868MHz and 915MHz in the ISM band.

The third rule speaks about using 50 ohms everywhere, which refers to impedance matching. So ideally you’d have 50 ohm outputs and 50 ohm transmission lines etc. In the video Mr. Ossmann uses Oshpark’s 4 layer stack up and an online  pcb calculator  to determine the trace width needed for 50 ohms impedance. I was planning on using Oshpark anyway, so I used the same numbers he used for his calculation. Here's the link to Oshpark’s 4 layer board specs. By plugging in the pertinent numbers from the Oshpark website to the pcb calculator we find out that in order to get a 50 ohm microstrip we need a 12 mil trace.  

Rule number four states that we should follow the manufacturer recommendations. Of course, this is usually a good idea. For this rule I looked at the datasheet for the SX1238 and copied over the recommended schematic and components for the transceiver.

The fifth and final rule is to route RF first. The idea is to optimize the top layer of the PCB for RF. Michael Ossmann specifies that in general for this rule, you should keep traces short and direct and keep other signals away from RF. For this rule I tried to keep the RF specific traces on the top layer and route the other traces on the bottom layer. This went pretty well, although the giant ground pad underneath the SX1238 made it difficult at times to route traces close to the component. One other problem I ran into was attaching the ground traces from the transceiver to the giant ground pad. At first I had one large pad specified in the footprint for the transceiver. But the problem with this was pcbnew wouldn’t let me route the traces out to the pad. I ended up just breaking up the pad into smaller pads and squishing them all together as can be seen below. This allowed me to route the ground traces without a hitch.

Here is a short video of the finished transceivers:

ms-excel - 3.87 kB - 04/03/2018 at 22:56

Download

sx1238.pdf

SEMTECH SX1238 DATASHEET

Adobe Portable Document Format - 1.74 MB - 04/03/2018 at 04:08

Preview
Download

  • Video Demonstration

    Jon Thomasson05/17/2018 at 17:19 0 comments

    Here is a short video demonstration of the transceiver. 

  • Houston, we have transmission!

    Jon Thomasson05/07/2018 at 05:19 0 comments

    I’ve been working more on writing firmware to test the transceiver modules. Although I couldn’t locate any ready made libraries to drive this particular IC, there were a few none the less that helped to guide me in the right direction. Those libraries were the RF69 library by Lowpower Lab, as well as the Radiohead library. These libraries interfaced with a similar model transceiver, the SX1231, which was also designed by Semtech.

    One of the features of the SX1238 that intrigued me was that it included not one, but two low noise amplifiers on its receive, as well as two power amplifiers on its transmit. These added amplifiers should not only make it easier to detect weak signals, but should also give the transceiver a theoretical longer range as compared to the SX1231. Here is a view of the block diagram for the SX1238 showing how the internals are laid out.

    These added amplifiers, PA2 and LNA1, are turned on/off through three front end control pins, TXEN, RXEN, and MODE. The operation of these pins through the different transmit/receive modes can be seen here:

    Interfacing with these pins was of course just a matter of connecting the appropriate pins on the transceiver module to the arduino and then toggling them during the transmit and receive sequence.

    To test the transmitter I used a cheap RTL-SDR dongle and the free SDR Sharp software. I just wrote a simple sketch which transmits a packet once a second and looked for the signal to show up somewhere on the FFT plot. It was a thrill to see the signal pop up on the screen for the first time! It was alive!

    After this euphoria, I thought setting up the receiver would be the easy part. Boy was I wrong! The firmware for the receiver was setup to simply listen for incoming packets from the transmitter, and then print those packets out to the serial monitor. The excitement was nearly unbearable the first time I uploaded the firmware to the receiver. Expecting to see a rush of packets fill the serial monitor screen, instead there was nothing. Just a blank screen. The roller coaster thrill ride came crashing down and hit with reality.

    There was an onslaught of doubt in my mind after this initial test. Maybe there was something wrong with the pcb, or perhaps there was a faulty solder connection somewhere. It was obvious that something was being transmitted since the signals were being picked up by the SDR Sharp software. However, maybe the actual transmission was just garbage.

    After taking a break for a bit and getting some air, I decided to dig through the datasheet again and analyze my code a bit more. This digging led me to discover a peculiar register named RegFifoThresh that had as one of its variable names TxStartCondition. TxStartCondition, as its name implies, determines the state at which the transmitter would begin transmitting packets from the FIFO. By default this register was set to only transmit after a specified FIFO threshold had been passed. Since I wanted the transmitter to transmit whenever there was a new packet in the FIFO, I changed this default value to allow the transmitter to transmit whenever the FIFO was not empty. After making this modification and uploading the firmware once again, I started to see a few packets being received and printed out on the monitor. However, the packets weren’t consistent, and the data wasn’t recognizable. But it was progress!

    I ended up experimenting for some time with all the various filters and frequency shaping registers. It was fascinating just to make some changes to a few registers and see how it affected the look of the signal in SDR Sharp. I finally cleared the registers pertaining to the frequency deviation of the signal, and reset it to its default parameter. And low and behold, I started receiving packets! I had modified these register values when porting some of the code from the other libraries into my own. It’ll require a bit more experimentation to see...

    Read more »

  • SPI testing and register read/write

    Jon Thomasson04/26/2018 at 13:12 0 comments

    The boards passed the initial magic smoke test. I brought the boards up with a current controlled power supply and to my surprise no magic smoke escaped! After that I wired up the SPI bus to an 3.3v Arduino pro mini to see if I could communicate with the transceiver. 

    I wrote a simple sketch that reads/writes to various registers. The idea here is that if the SPI bus isn't working, it's pointless to do any further testing until that can get sorted out. The sketch simply reads the register data to a serial console so I can check it with the default parameters of the datasheet. Here's the results from the SPI testing:

    It looks like the register values match! Cool, so onto transmitter testing next…

  • Built 2 boards

    Jon Thomasson04/20/2018 at 22:38 0 comments

    I got packages from oshpark, digikey, and oshstencil back recently so I decided to make some time to put a couple boards together. I have to admit that I was nervous just thinking about hand soldering these boards, given the close proximity of several small 0402 components and the large ground pad under the transceiver chip. For this reason I thought it would be a good time to try out a solder paste stencil. 

    Since I hadn't done a stencil before, there was a bit of a learning curve. I found some resources that helped me get started. The first was this page from rheingold heavy which introduced some of the parameters needed, such as the solder paste clearance, to get the gerber files ready to send to oshstencil. The second resource was from this forum post on the kicad.info forums. Specifically this picture helped me visualize how the pad mask parameters in Kicad worked : 

    The first step for me was to determine which pads on the PCB required a stencil. At first I was thinking about just including all the SMD components. But after giving it some more thought I opted to leave out the SMA connector and shield, since I wanted to be able to test the circuit out first before sealing it in its metal house. And the SMA connector would require some hand soldering to get a good connection.

    Now that I knew which SMD pads I wanted to exclude from the stencil, I took those pads out of the stencil by unchecking the F. Paste layer (the front solder paste layer) from the Technical Layers area of the Footprint Editor. This disassociates the pad from the front solder paste layer. It looks like F. Paste is checked by default whenever you create a new SMD pad. 

    The next thing I learned was that there should be a little bit of clearance between the solder paste and the edge of the pad. This clearance is aptly named "Solder Paste Clearance" and is illustrated on the picture above. This property can be adjusted on a per pad level on the pad properties page, or on a global level. To set the clearance for the entire PCB you navigate to Dimensions -> Pads Mask Clearance from the Pcbnew screen. 

    On the Pads Mask Clearance screen, there are 2 options for adjusting the solder paste clearance. You can either choose to set the clearance a fixed amount from the edge of the pad, or you can set the clearance to be a ratio based on the size of the pad. I chose to give the clearance a ratio of -5%. After adjusting these properties, the only thing left to do was to generate the gerber files which will be sent to oshstencils. When you go to generate the gerbers, you only need to select the solder paste layer as well as the edge cuts layer, since those are the layers that oshstencils care about.

    I was surprised at how quickly I received the stencil back. It seemed like it only took 2-3 days from the time of order to having the stencil in my hand! Besides the stencil, I also ordered a little jig to hold the stencil in position while applying the paste. I found out you can also just use unpopulated PCB’s to fashion your own jig. Here’s a pic of what I came up with:


    Once the jig and PCB are in place, you lay the stencil over the PCB until all the pads match up and are visible through the appropriate cutouts of the stencil. Then you tape the stencil down on one side.

    From here, my pictures were a little too blurry to share, but I basically followed the same procedure for applying the paste presented in this Sparkfun video. The important thing I learned from all of this was to make sure to clean up the solder paste from the stencil and anything else you want to keep right away. Otherwise it really gets tough to clean up, and it manages to get everywhere!

    To reflow the solder paste after I had placed the components I simply used a hot air rework gun. I did have some solder bridges around one of the transceiver chips, but nothing a little drag soldering couldn’t fix. Here’s the finished boards...

    Read more »

View all 4 project logs

Enjoy this project?

Share

Discussions

Paul D Wilkie wrote 01/24/2021 at 21:22 point

Jon, I am currently working with a pair of Microchip RN2903 915mHz 0.1W LoRa radios sharing GPS data to track a pair of off road recreational vehicles.


I am interested in your project of 0.5W SK1238 LoRa Radio’s to implement into my project for greater Tx/Rx range in the “non linear” conditions found when traveling the “off road” conditions in the woods.  What sense of range have you been experiencing with your SX1238 0.5W Radio’s?

  Are you sure? yes | no

AVR wrote 04/03/2018 at 22:16 point

very nice project! A lot like my S1G-RF project!

  Are you sure? yes | no

Jon Thomasson wrote 04/03/2018 at 22:47 point

Thanks Adam! I really like that project! Actually I think I got the idea for the sweet shield from your project. I like that it has the detachable top as well as specs for the frequencies and power levels it's tested for. I may have used the same SMA connector footprint too. :)

  Are you sure? yes | no

AVR wrote 04/03/2018 at 23:29 point

thanks man! Yeah I went for the shield since a lot of RF product have it and most people leave it out. 

  Are you sure? yes | no

Ted Yapo wrote 04/03/2018 at 17:53 point

Great project! I like those five rules, too.

Do you have an impedance bump at your SMA connector?  The pad for the center pin looks really big.

  Are you sure? yes | no

Jon Thomasson wrote 04/03/2018 at 22:44 point

Thanks Ted! It does seem pretty wide. Just to make sure I double checked the end launch specs for the SMA connector and it looks like it's set to the appropriate width. 

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates