Showing posts with label Wireles. Show all posts
Showing posts with label Wireles. Show all posts

Use A DAC To Bias Your Varactor Diode

Varactor (or “varicap”) diodes are used primarily in radio-frequency (RF) circuits to provide a capacitance that can be varied by changing the applied voltage. These types of diodes often are used for tuning circuits, such as RF oscillators and filters found in wireless applications like wireless microphones and radios. Designers, then, should know about the benefits of using a nonvolatile digital-to-analog converter (DAC) to provide the biasing voltage of a varactor diode used as a voltage-controlled capacitor.

The varactor diode is operated under reverse bias, which creates a depletion zone around the P-N junction. Changing the level of the reverse bias changes the thickness of the depletion region and, thus, the effective capacitance of the diode. Increasing voltage causes a decrease in capacitance.

Varactor diodes are specified with a nominal capacitance value and the range of capacitance that can be achieved with a maximum and minimum voltage level. Increasing the bias voltage range increases the capacitance range available, but designers can also look for varactors with a larger capacitance- to-voltage ratio.

A convenient solution for creating a varying bias voltage is to use a DAC. Most DACs have an output voltage range of 0 V to +5.5 V. If a higher voltage bias is required, though, then a high-voltage DAC can be used. However, it may be more cost-effective to use a low-cost, high-voltage operational amplifier in a non-inverting configuration to provide level shifting of the output voltage from a common 5.5-V DAC.

 
The LC-tank circuit portion of a voltage-controlled oscillator allows for FM modulation in wireless microphones and radios. Its back-to-back varactor configuration minimizes the effects of RF modulation.

Using a DAC does introduce sources of potential error. The varactor is affected by any form of amplitude variation of the bias voltage, resulting in an undesired shift in capacitance. Deterministic errors can be accounted for when using the microcontroller to program the DAC output voltage. The primary sources of error that should be considered include varactor nonlinearity, offset errors, and DAC integral nonlinearity (INL). RF modulation may also be caused by voltage induced from a noise source – perhaps from an antenna in the system. The figure shows an LC-tank circuit portion of a voltage-controlled oscillator. This circuit allows for FM modulation in the aforementioned wireless microphone or radio.

Here, a back-to-back varactor configuration minimizes the effects of RF modulation. If a varying signal is injected, the bias across one diode increases as the other decreases, keeping overall capacitance unchanged. Note that the two diodes are in series with each other, so capacitance is half of a single varactor setup.

To also prevent RF signals from affecting the circuitry outside the tuning circuit, the bias voltage is fed through an isolation resistor or an RF choke. There are other benefits to using a DAC to bias a varactor diode. For example, multiple-output-channel DAC devices can be used in a multistage application. Additionally, in a four-channel DAC, three channels could potentially be used for separate band-pass filters for low-, mid-, and high-frequency filtering. The fourth output could be used for offset voltage calibration elsewhere in the circuit, or it could be turned off when it isn’t in use. Space and design time can be saved by avoiding having to set up separate biasing schemes.

Some DACs, such as the MCP4728, also offer on-board nonvolatile memory, which can store configuration data such as output-voltage levels and channel status (on/off). This enables the device to be reset or powered up into a known set state, which could allow a pre-programmed tune to be stored. The tune could be recalled when a desired event or input occurs or when power is lost and restored.
read more...

2.4GHz WiFi & ISM Band Scanner. Assembly, Using the Scanner - Part 3

2.4GHz WiFi & ISM Band Scanner. Description and Schematic - Part 1

2.4GHz WiFi & ISM Band Scanner. Firmware and Sowtware - Part 2

 
Assembly

Because the circuit was so simple I took the easy way out and assembled it on a piece of veroboard. Nowadays I would design my own printed circuit board (see custom PCBs).

Rather than finding a connector for the Cypress module I simply soldered single core hookup wire directly to the connector pins. This supported the module and allowed me to position it away from the microcontroller to minimise interference.

The USB cable was made from a standard USB cable with type A and B connectors, I just cut off the B connector and soldered the wires directly to the veroboard with half an inch of heatshrink tubing to keep it neat. That left the type A connector at the other end, ready to plug into the computer.

Note that the red and black wires in the USB cable are +5V and ground respectively. You should check these with a multimeter before soldering them in. The green wire is normally D+ and goes to pin 16 of the 18F2550 while the white is D- and goes to pin 15. The shield does not have to be connected.

The final touch was to drop the assembly into a standard UB5 "jiffy" box with a notch cut out for the USB cable to pass through.

2.4GHz WiFi & ISM Band Scanner

Using the Scanner

With nothing running in the immediate vicinity you will just see background noise, as shown in the screen shot below.

2.4GHz WiFi & ISM Band Scanner

Note that the vertical scale is not calibrated to any particular scale. In fact the scale is just the signal level "factor" reported by the Cypress radio module.

The base level signal represents the noise in the air and in the radio receiver part of the module.

The screenshot below shows a WiFi 802.11n wireless router running on channel 1 and located about 12 metres from the scanner. As you can see the 802.11n (and for that matter 802.11g) routers spread themselves over six channels.

2.4GHz WiFi & ISM Band Scanner

That is the good thing about using channel 1 and 13 for your WiFi setup, you get some unused channels on one side where your spectrum can spread into.

But, using channel 13 has its own problems.

The spectrum on the next screenshot is identical to the one above but this time my microwave oven was heating up dinner. Incidentally, the microwave oven was nothing special, just a domestic model and about 10 metres from the scanner.

2.4GHz WiFi & ISM Band Scanner

As you can see, it totally blotted out the higher frequency end of the band. All microwave ovens seem to use this part of the band and you cannot blame the microwave for their activity, as this was part of the reason for setting up the 2.4GHz ISM band in the first place. Avoiding the microwave oven interference and having some free spectrum on one side is the reason why channel 1 is the best choice for your router (assuming your neighbour has not got there first).

Finally, the screenshot shows a Bluetooth mouse communicating with a computer.

2.4GHz WiFi & ISM Band Scanner

Bluetooth hops all over the 2.4GHz band as it finds the best spots with the minimum of interference. Spikes all over the spectrum is a good indicator of Bluetooth activity. 

read more...

2.4GHz WiFi & ISM Band Scanner. Firmware and Sowtware - Part 2

2.4GHz WiFi & ISM Band Scanner. Description and Schematic Part 1
 
PIC Firmware

The firmware running on the PIC18F2550 was written for the CCS C compiler and uses the CCS USB protocol stack, which in turn appears to be derived from Microchip code. At the top level it is quite simple, it just repeatedly steps through the frequency range taking readings.

For each frequency it takes repeated readings until it gets what seems to be a consistent value. It then saves that value and moves on to the next frequency. When it has finished running through the band it sends off all readings to the computer over the USB. The CYWUSB6935 chip steps 1MHz at a time and the band is 85MHz wide, so the number of readings sent to the computer is 85. Despite the repeated measurements needed to get a consistent reading the chip achieves quite a good performance, about 4 complete spectrum scans every second.

The firmware and source code for the 18F2550 is available from the download section below.

Windows Software

The software running on the computer was written in Visual Basic 5. It is not particularly sophisticated, for example it keeps polling the USB interface to see if new data has arrived and that uses up a lot of CPU time. But, you don't generally use the scanner for a lot of time and you would not normally be running computer games at the same time, so this inefficiency is not of great importance.

The software on the computer saves the set of readings into an array. When it comes to drawing the spectrum display on the screen it steps through all the saved readings for each frequency looking for the highest reading, and it is that highest reading that it draws on the screen for that frequency. As a new reading is received the oldest reading in the array is discarded. The slider on the screen controls how many readings are saved for each frequency, the default is 350 readings which represents about 90 seconds of data.

All this means that the delay has a "memory" and one high reading will hang around for 90 seconds until it is flushed out. This is done because devices normally hop around in frequency and it would be hard to see what frequencies were popular unless there was some way of holding on to the reading for a while. You can see this in action when there is a noise spike. That spike would remain on the screen for (say) 90 seconds then disappear. But a device that communicated on that frequency (amongst others) would in most probability revisit that frequency within the 90 second period and that would place a new high value into the array of values for that frequency.

By adjusting the slider you control the size of this array and consequently the amount of time that it would take to flush a reading out. Smaller numbers flush more quickly, larger ones take more time. You can pause the display by clicking on the Pause button. Clicking on it again will clear the array and start a new collection. This is also a handy way of clearing everything to restart with a fresh display.

The Export button will export the current set of readings to a .csv file which can be loaded into a spreadsheet like Excel.

As usual, the software and source code is available for download below.

C# Version of the Software

A reader, Jim McCullers in the USA, took up the challenge of porting the desktop software to a more modern environment. The code he wrote compiles under Microsoft Visual C# 2010 Express (the free version) and is also available for download below.

He did not make any major changes to the structure or look but created a new version of the MPUSBAPI to suit C# and made it into a class. The mpusbapi.dll module must be in the same directory folder as the executable so you will notice that he has copies in both the debug and release folders.

Plugging It In

Because the scanner uses standard USB it can be connected to any computer, although the software is written only for Windows XP, Vista and Windows 7.

Before you plug the scanner in you must install the software first. This is available in the download section below. Failure to install the software first will result in Windows identifying the scanner as an "Unidentified Device".

During installation of the software a device driver is installed and it is this that helps Windows identify the scanner. After you have correctly installed the software and plugged in the scanner you should see the device show up under "Other Devices" in Device Manager as shown on the left.

When you fire up the desktop software (ISMScanner.exe) you should see the message in the software window stating "Connected to Geoff's 2.4GHz Scanner". If you get "Scanner not found" then the scanner is not plugged in or not working.

2.4GHz WiFi & ISM Band

Downloads

Firmware - HEX programming file v1.0, Firmware - source code v1.0 - download
Windows software v1.0 Installation (Visual Basic Version), Windows software v1.0 Source code (C# Version), Windows software v1.0 Source code (Visual Basic Version), Windows driver for Vista and Win 7 32/64 bit systems - download

read more...

2.4GHz WiFi & ISM Band Scanner. Description and Schematic Part 1

Have you ever wondered exactly what is going on in the 2.4GHz WiFi and ISM band around your house. What channel is it best to set your wireless router to? Why are you getting such poor performance across your WiFi network? Is your neighbour on the same frequency?

Just what is out there? This neat little gadget will sniff the airwaves and give you a graph of the signal strength vs frequency across the entire band. It connects to your computer by USB 2.0 and with the companion Windows software you can display the spectrum or save the raw data to an Excel compatible file for some more number crunching.

2.4GHz WiFi & ISM Band Scanner

It uses just two significant components, a radio module from Cypress Semiconductor and a PIC microcontroller from Microchip. Total cost to build it should be less than US$30.

The 2.4GHz Band

The 2.4GHz ISM (Industrial Scientific Medical) band is often called the WiFi band because it is used for WiFi networking (ie, 802.11 b/g/n). This band is unlicensed, meaning that you and anyone can transmit on it. As a result it has been used by a multitude of products including video transmitters, portable telephones, Bluetooth devices, wireless keyboards, toys and so on. Because you cannot see what is going in the band on you can experience strange behaviour from your wireless gadget. All of a sudden your wireless keyboard skips characters, is it because someone is using a portable phone on the same frequency?

The biggest victim is WiFi networking. This needs a lot of bandwidth, is always transmitting and is sensitive to interference. This is why people often cannot get a decent range from their wireless network and give up in disgust.

This scanner will draw a graph on your computer screen showing you the activity across the band and indicate the best frequencies to use. If you use a laptop you can also wander around and identify the culprits that are clogging the airwaves.

How It Works

Internally the scanner is very simple. It just contains a radio receiver and a microcontroller…

2.4GHz WiFi & ISM Band Scanner

The radio receiver is the Cypress CYWUSB6935 Radio SoC (System on a Chip). This is a complete low power radio transmitter/receiver chip for the 2.4GHz band and is controlled by a microcontroller over a synchronous serial (SPI) interface. The microcontroller can write to various registers in the chip to set things like operating frequency and can read other registers to retrieve data from the chip.

This chip is designed to operate over the 2.4GHz band and has the ability to listen on a frequency for any other devices that may be already using the frequency. This is to help the microcontroller select a suitably free frequency before transmitting. The chip reports the signal level as a number typically up to 30, with zero representing no signal. We use this facility in this project - simply put, the microcontroller instructs the module to step to a frequency and measure the signal level at that frequency, when done it steps the chip to the next frequency and instructs it to measure the signal level there. And so on, right across the band.

We actually do not use the transmit/receive function, which is normally the chip's main purpose in life.

The microcontroller used in this project is the Microchip PIC18F2550 which integrates the complete USB 2.0 functionality. The microcontroller sets the radio chip to a frequency, reads the signal level from the chip, stores the value in its internal memory and steps on to the next frequency. This continues until the complete 2.4GHz band is covered. The 18F2550 then sends the data off to your computer using USB and your computer, using custom software, displays the resultant spectrum.

Physically the scanner is just a small box hanging on the end of a USB cable.

The Circuit

The circuit is the simplest part of this project. Click on the image or go to the download section at the bottom of this page for a full scale drawing.
2.4GHz WiFi & ISM Band Scanner Circuit Diagram

2.4GHz WiFi & ISM Band Scanner

The PIC 18F2550 microcontroller is a 28 pin part with a built in USB 2.0 interface. As mentioned before, the chip integrates everything connected with the USB including a 3.3V regulator, memory buffers and the USB transceiver. All that you need to do is to connect the USB cable to pins 15 and 16 of the chip and place a capacitor on pin 14 to help smooth the inbuilt 3.3V supply.

The clock for the microcontroller is derived from the 20MHz crystal with the two 15pF capacitors providing the correct loading for the crystal. Internally within the 18F2550 the 20MHz is divided by 5 to give 4MHz and then used to synchronise a phase locked loop (PLL) oscillator running at 48MHz. This is the main clock used within the microcontroller and is used to drive both the USB interface and the CPU. Running at 48MHz this is a speedy little chip so we do not have any issues with performance.

The ISCP connector is there so that I could reprogram the 18F2550 without pulling it out of its socket. It is mostly used for prototyping so you can leave it out if you want. Note that the 10K resistor on pin 1 of the 18F2550 is still needed to pull the reset line high.

Power for the circuit is drawn from the +5V supplied by the host computer on the USB cable. The whole circuit only draws a few tens of milliamps so it is not a significant load. This 5V is dropped to about 3V by three 1N4001 diodes to provide power for the Cypress CYWUSB6935 chip which is mounted on a small PCB (the CYWM6935 module). Each diode will drop about 0.7V resulting in a total voltage drop of about 2V. This is a crude way to derive a 3V supply but it is low cost and does the job without any hassles.

The CYWUSB6935 chip has protective diodes on its inputs, which clamp the signal line to its power supply (3V). This means that we can drive it with 5V signals from the microcontroller with series resistors to limit the current. This is the purpose of the 3.3K resistors, they limit the current in the clamping diodes to less than a milliamp when the PIC's output goes to 5V.

CYWM6935 Module

The CYWUSB6935 chip comes in a tiny package designed for machine assembly and is virtually impossible for a mortal wielding a soldering iron to solder. Fortunately Cypress have assembled it into the CYWM6935 module along with two aerials, a crystal and a few capacitors. The connector used in the module is still rather tiny and non standard (or rather it does not use the 0.1" grid that we know and love), but it can be soldered to. For details of the CYMUSB6935 chip and CYWM6935 module go to here.

2.4GHz WiFi & ISM Band Scanner Circuit Diagram
Parts Listing
  •     1 x Microchip PIC18F2550-I/SP microcontroller programmed with the firmware available in the download section at the bottom of this page.
  •     1 x Cypress CYWM6935 radio module,
  •     1 x 20MHz crystal
  •     3 x 1N4001 silicon diodes
  •     4 x 3.3K resistors (quarter or half watt)
  •     1 x 10K resistor (quarter or half watt)
  •     2 x 15pF ceramic capacitors
  •     1 x 100nF multilayer ceramic capacitor 1 x 220nF polyester capacitor
  •     1 x 100uF electrolytic capacitor (6V or higher)
  •     1 x 28 pin IC socket
  •     1 x USB cable with a type A connector on one end
  •     1 x UB5 jiffy box

read more...

Wireles Temperature Monitor Has Data-Logging Capabilities

You can use a local temperature sensor and an ASK (amplitude-shift-keying) transmitter/receiver pair to design a simple wireless temperature-monitoring system with data-logging capabilities. A microcontroller processes and displays the temperature reading to the user. The microcontroller’s onboard UART (universal asynchronous receiver/transmitter) also allows for data-logging applications.
Wireless Temperature Monitor
 Figure 1. The MaX6577 temperature sensor and 315-MHz MaX1472 aSk transmitter form a wireless temperature-monitoring system.

Local-temperature sensor IC1 detects the ambient temperature at the device (Figure 1). The output of IC1 is a square wave with a frequency proportional to temperature in kelvins. ASK transmitter IC2 modulates the signal onto the carrier frequency of 315 MHz. You measure the output signal’s frequency with a frequency counter. The configured scalar multiplier is 1K/Hz when the TS1 pin connects to ground and the TS0 pin connects to VDD. This scalar multiplier is configurable with pins TS1 and TS0. ASK receiver IC3 demodulates the signal at the corresponding carrier frequency (Figure 2).
 
Circuit Diagram
Figure 2. An ASK receiver with a microcontroller processes and displays temperature data.

Comparator IC4 connects to IC3’s RSSI (received-signal-strength indicator) with an internal peak detector. The external RC follows the peak power of the received signal and compares it with a predetermined, resistor-voltage-divider-generated voltage level. Lab experiments show that a threshold of approximately 1.57V generates a valid output on the data-out pin without receiving false readings. Adjust this threshold to the proper level for optimal performance. The comparator’s output is low when the received signal is weak or invalid and high when the received signal is adequate.

Microcontroller IC5 then measures and displays the value of the signal frequency using its integrated timer/counters and LCD-driver peripherals. A counter tracks the number of rising-edge transitions on the input temperature signal, and a timer tracks the elapsed time. After the timer’s 1-sec period elapses, an interrupt occurs. At that moment, the circuit reads the counter value, converts it to Celsius, and displays it on the LCD. The counter then resets to zero to restart the process. The timer automatically reloads once the timer interrupt occurs. UART0 also outputs the resulting temperature. A handheld frequency counter verifies the temperature reading.

The microcontroller monitors the signal power through P6.0, a general-purpose input pin. When the input is logic low, the LCD and UART output “no RF” to alert users of possible transmitter issues when the transmitter and receiver are too far apart from each other. The LCD connection follows the design in the IC’s evaluation kit (Figure 3). Using a look-up table in the data segment of the assembly code enables you to preserve the internal mapping of the display’s A through G segments. This preservation ensures that the display enables the correct segments. Using an RS-232 level converter, the UART output sends data to a data-logging device, such as a computer.

Kit

Figure 3. Maxim MAXQ2000-KIT Evaluation Kit.

Use the MAX-IDE assembler software to program the device during assembly. The MAXQJTAG board operates with the MAX-IDE to load the code onto the device. You can download the project files here. This design provides for a 1-sec temperature-refresh rate in 1°C increments, which is within the accuracy of IC1.

Downloads


Source Code (MAX-IDE assembler software) - download

MAXQ2000-KIT Evaluation Kit user manual and schematic - download
read more...
 
Copyright © 2019 W3circuits.blogspot.com • All Rights Reserved.
back to top