Featured

Remote SDR v5

Web based Transceiver

“Remote SDR” is a web application allowing to remotely control an amateur radio transceiver between 1 MHz and 6 GHZ. Its first application was the duplex control of a station allowing links to the geostationary satellite QO-100 / Es’Hail 2.

Remote SDR version 5.0 is available on Github.
New features as :

  • New SDRs processed:
    • SDR Play RSP1, RSP1A,
    • MSI.SDR
  • Sharing the receiver between multiple users
  • https protocol (port 443) grouping all communications

Listen to QO-100 live with Remote SDR

Characteristics

Receiver
  • SDR in reception:
    • RTL-SDR (example: NESDR SMArt from Nooelec) or,
    • HackRF One or,
    • Adalm-Pluto
    • RSP1, RSP1A
    • MSI SDR
  • Frequency: 1 MHz to 6 GHz (depending on the chosen SDR)
  • Spectral band processed: 2 MHz on 2048 points (depending on the chosen SDR)
  • Audio: 1 channel
  • Demodulation: NBFM, WBFM, AM, SSB or CW
  • RTTY decoder
  • Automatic band scan
  • Equalizer on the audio channel
  • Notch filter
  • Noise filter
Transmitter
  • Hardware:
    • HackRF One or,
    • Adalm-Pluto (common with the receiver) or,
    • NBFM VHF / UHF SA818 module from G-NiceRF
  • Frequency: 1 MHz to 6 GHz (depending on the chosen SDR)
  • Power: 1 dBm to 30 dBm (depending on the chosen SDR)
  • Audio: 1 channel
  • Modulation: NBFM, SSB or CW
  • RTTY encoder
  • Transmitter modulation compressor
  • Audio equalizer
  • CTCSS encoder
  • DTMF encoder
  • 1750 Hz encoder
  • Programmable frequency offset for relays
  • Automatic CW Manipulator (Iambic A and Iambic B)
Radio processing
  • Hardware:
    • Orange Pi Zero 2 , or
    • Raspberry Pi 4B (2 GB)
  • Software:
    • Operating System: Armbian / Debian Bullseye
    • Web server: Node JS /Express
    • Signal processing: GNU Radio 3.9
    • Remote SDR (version v3 minimum)
      • Html
      • Javascript
      • Python 3
    • Chrome, Edge or Chromium web browser. Don’t use Firefox.
  • Network interface: wired Ethernet or WIFI
  • Interfacing with Gpredict to compensate the Doppler of low orbit satellites
  • Interfacing with GS-232 type rotator
  • Display and Audio: WEB page on PC, tablet or smartphone

Configurations

COMPACT CONFIGURATION with an ADALM-PLUTO – Rasperry Pi 4 – ETHERNET
Remote SDR – Adalm-Pluto – Raspberry 4
AvantagesDisadvantages
– Well-known RPI4
– Wifi or Ethernet
– 12 bits of Pluto dynamic
– poor stability in frequency of the Adalm-Pluto

May require the addition of an external oscillator and the extension of the Adalm-Pluto band.

COMPACT CONFIGURATION with an ADALM-PLUTO – Opi Zero 2 – Wifi
Remote SDR – Adalm Pluto – Opi Zero 2 – Wifi
Avantages Disadvantages
– optimized for cost
– Wifi or Ethernet
– 12 bits of Pluto dynamic
– poor stability in frequency of the Adalm-Pluto

May require the addition of an external oscillator and the extension of the Adalm-Pluto band.

Mixed Configuration HackRF – RTL-SDR – Orange Pi Zero 2
RTL-SDR – HackRF One – Orange Pi zero 2

In degraded mode, it is possible to extend reception in the 0.5 MHz – 30 MHz band with an RTL-SDR V3.

Avantages Disadvantages
– optimized for cost
– good frequency stability of the TX if a TCXO mounted on the HackRF One
– different frequency coverage of RX and TX
– RX frequency stability depends on the chosen RTL-SDR model
– 8 bits of SDR dynamic
Mixed Configuration HackRF – RTL-SDR – Raspberry Pi 4
Remote SDR – HackRF One and RTL-SDR – Raspberry Pi 4

In degraded mode, it is possible to extend reception in the 0.5 MHz – 30 MHz band with an RTL-SDR V3.

Avantages Disadvantages
– Well-known RPI4
– good frequency stability of the TX if a TCXO mounted on the HackRF One
– different frequency coverage of RX and TX
– RX frequency stability depends on the chosen RTL-SDR model
– 8 bits of SDR dynamic
Configuration 2 Hack RF One
Remote SDR – 2 HackRF One – Raspberry Pi 4B
Avantages Disadvantages
– Well-known RPI4
– good frequency stability of the TX and RX if a TCXO mounted on the HackRF One or shared between them
– large frequency coverage
– 8 bits of SDR dynamic
Configurations RTL-SDR and SA818
VHF or UHF NBFM Transceiver
VHF and UHF NBFM Transceiver
Avantages Disadvantages
– cost around 100 €
– power 1w HF
– VHF 2m and/or UHF 70cm only
– only NBFM transmission, no SSB

Details on the one band transceiver here.

Details on the two bands transceiver here.

These configurations make it possible to locate the HF part near the antennas, which is essential for links above GHz. In the transmission chain, amplifiers must be added to bring the HF signal to the desired level as well as filtering to ensure that unwanted lines are not emitted. The SDR of the reception chain can be either an HackRF One, an RTL-SDR or a Pluto depending on the frequency band you want to cover. Not all RTL-SDR models cover the same band. The transmission reception is carried out in full-duplex which is essential during satellite connection to hear the return of its own signal.

As of today (October 2021), the Raspberry Pi 4B (2 GB) is a good solution, but there are supply difficulties. The “Orange Pi” are processors similar to the Raspberry Pi running under the Armbian or Debian Operating System. In 2020 I used the Orange Pi One Plus, now in 2021 the Orange Pi Zero 2 also offers a 64-bit / 4-core processor, but also an ethernet or wifi connection. They serve as a web server and perform radio signal processing.

Example Transceiver QO-100

F1ATB QO-100 Transceiver in June 2022

Example UHF Transceiver – Wifi – Orange PI Zero 2

New configuration with the Orange Pi Zero 2 which allows communication via WIFI. No more wired Ethernet link, only 220v near the transmitter / receiver.

Experimental 432 MHz (70 cm) transceiver

Note that you need a USB Hub between the Pluto and the Orange PI One Plus (not for the Orange Pi Zero 2). This corresponds to a system bug.

Code Source et Image

The source code and the image for Orange Pi and Raspberry Pi 4B are available on Github https://github.com/F1ATB/Remote-SDR .

Updates

Since version 5.0, it is possible to update, online,Remote SDR to the last version. Go to the “Tools” page and click on :
Look for updates / Recherche des mises à jour

Key points of Remote SDR

In addition to being able to locate the HF treatment near the antennas, other points should be noted such as:

Data rate reduction

An SDR like the Pluto requests 1.4 M samples / s (minimum) * 2 Bytes (16 bits) * 2 channels (I and Q) = 5.6 M Bytes / s for reception. It is the same for the emission. Which gives us more than 10M bytes / second.
With Remote SDR, output on Ethernet or WiFi requires:

  • 10 k samples / s * 2 bytes for the audio in reception
  • 10.24 k sample / s * 2 bytes for the received spectrum
  • 10 k sample / s * 2 bytes for transmit audio
    We are at less than 100 k bytes / s by adding the control data.

There is therefore a reduction of approximately 100 in the communication speed required, which facilitates remote control via internet / ethernet without loss of quality through data compression.

The mini remote computer

Indeed, we have a remote computer which has a GPIO to which it is possible to add functions. For example, controlling an antenna rotor, measuring electrical voltages, temperatures, etc., … It is possible to access the system via the web (Apache server), in SSH to launch an application in terminal mode, or in graphical mode by the desktop and VNC.

Posts Remote-SDR

Solar Energy Router to manage overproduction (DIY)

Version V2

With solar panels, in a self-consumption installation, it is common to have overproduction of energy which we do not know what to do with and which is sent to the grid. A solution to store this excess is to send it to the electric water heater.

A quick calculation, for a 200l water heater, equipped with a 2400W heating resistor, shows that it takes nearly an hour of heating, or 2.3 kWh to raise the water by only 10°.

200l*1000gr*4.18Joule*10°/3600s=2322 Wh = 2.3kWh

Every day, several kWh must be supplied to the water heater. For a conventional system, this is done at night at a reduced rate. In the event of overproduction during the day of the photovoltaic panels, this energy must be sent to the water heater. It is a superb energy storage battery. But it is common to have only a few hundred watts available and not the power of 2400 w required by the resistance of the water heater in conventional connection.

Here, we are going to make a system that sends only excess power to the water heater by monitoring the power that enters or leaves the house so that it is zero using a current sensor connected behind the meter. This system only works for classic electric water heaters in which there is an electrical resistance and an electro-mechanical thermostat to control the temperature.

Diagram of Excess Energy Routing to a Water Heater

The solar router acts as a valve that opens to let the overproduction pass by monitoring the current entering the house so that it is zero.

Hardware

To complete the set, you will need the following hardware :

Current Sensor

Probe sensor SCT013 100A/50mA

To measure the current entering the house, a current sensor is used through which the mains phase wire is passed. At the output, acting like a transformer, it provides an identical current, but 2000 times lower. This current is sent across a resistor and we will measure the voltage generated.

There are different models depending on the Max current that you want to measure. The 100A version is suitable for a home with a maximum power delivered of 12kVA. It is found in China at Aliexpress.

Voltage sensor

To know if energy is entering or leaving the house, the electrical voltage must also be measured. It is by comparing the phase of the current I and the voltage U that we will know the direction of the energy transfer.

Transformer 230V/6V (Aliexpress)

To measure the voltage, we use a classic wire-wound step-down transformer that isolates us from the mains. For example a 230v/6v. We need a model as small as possible, we do not take any power. It’s not very easy to find anymore. A transformer, called bell, can do the trick.

Microcontroler

ESP32 – Development Board

To perform voltage measurements and calculations, the ESP32 is a microcontroller adapted to our needs. It contains :

  • analog inputs for measuring voltages,
  • digital inputs/outputs to activate a relay or a triac if necessary,
  • good calculation skills
  • a WIFI connection for remote reporting on a web page or a home automation system.

Dimmer – Triac

Dimmer with Zero Crossing detection

To adjust the current to be injected into the water heater, a dimmer from RobotDyn is used, consisting of a Triac and a voltage zero crossing detection system. It exists in 16A or 24A and is available from Aliexpress.
Be careful, the original Triac heat sink is undersized knowing that it will have to operate for several hours. Add aluminum elements or replace it with a larger one.

In addition to a dimmer, you can optionally add 1 or 2 solid relays to activate other devices if necessary.

Solar Energy Router description

Current and Voltage Measurement

The measurement of the 2 voltages representing the current and the mains voltage is done by the analog inputs of the ESP32. These inputs accept a positive voltage between 0 and 3.3V and digitize the value on 12 bits, values between 0 and 4095. To adapt to the input dynamics, a voltage reference is created in the middle of the range at 1.65V =3.3V/2 to which the output voltage of the transformer and the current probe will be added.

We take the 3.3V from the ESP32 which, passing through a bridge of 2 resistors (R6 and R7) of 4700 ohm connected to ground, provides us with a reference of 1.65V in the middle. To avoid measurement noise, a 470uF capacitor (C2) filters the 3.3V and another 10uF (C1) filters the midpoint at 1.65V.

In order not to exceed 3.3V peak to peak of the signals to be measured, or 1.65V peak, we set a limit of +-1V maximum effective.

For the current probe with 80A and a 24 ohm resistor, we arrive at approximately 1V peak to peak.

24*80A/2000=0.96V rms or 1.36V peak to peak.

Thus the voltage to be measured will be in the range 1.65V +/- 1.36V.

At home, with a 12KVA subscription, I should not exceed 60A.

Pour la mesure de tension, il faut mettre un pont de résistances (R4 et R5) pour abaisser le 6V autour de 1V efficace et avoir ainsi un signal à mesurer entre 1.65V +/- 1.41V.

Wiring to ESP32

Circuit Diagram – ESP32 Development Board 2*19 pins

The treasure hunt with these cards that integrate an ESP32, is to find the GPIOs available and not used for Flash programming etc.
In our case, we measure the following voltages:

  • GPIO 35: the reference voltage at 1.65V in theory.
  • GPIO 32: the output voltage of the transformer reduced by the bridge of resistors R4 and R5
  • GPIO 33: the voltage representing the current to be measured

2 LEDs on GPIOs 18 and 19 flash every 2s. The yellow if we consume current, the green if we supply current, because we are in overproduction.

The control of the dimmer is done via the GPIO22 and the reading of the zero crossing pulse “Zero Crossing” of the mains voltage on the GPIO23. This pulse is essential to synchronize with the mains.

As an option, you can for example connect a solid controllable 3.3V relay to the GPIO5.

Timing

Opening of the Triac 50% of the time

The “Zero Crossing” signal is used to synchronize the micro-controller to open the Triac between 0 and 100% of the time of a half-period of 10 ms depending on the level of energy to be transferred to the water heater.

Measurement

Measuring the 2 values representing voltage and current takes about 150uS. In practice, it is planned over a period of 20ms (1/50Hz) to sample 100 pairs of values, which will give a good description of the a priori sinusoidal voltage and of the current often disrupted by switching power supplies.

Formules de calcul des puissances

To properly time each measurement, the “Zero Crossing” signal from the dimmer is used. It changes to 1 for 500 µs every 10 ms when the 230v voltage is zero.

Every 40ms, we do:

  • measurement of voltages and currents for 20ms
  • an average of the last measurements to smooth and reduce measurement noise
  • the calculation of the effective current Ieff (RMS)
  • the calculation of the effective voltage Ueff (RMS)
  • the calculation of the apparent power Pva in kVA
  • the calculation of the active power Pw in kW
  • the cosine φ

A prior calibration must be made to define the multiplicative constant kV in the program which allows the conversion of the voltage measured in binary to the real voltage. Likewise for the current, the constant kI . Use a voltmeter, ammeter clamp or your grid counter for calibration.

The convention adopted is to have Pw positive if current fromGRID is consumed and Pw negative in the event of overproduction. If the sign is reversed, turn the current probe half a turn on the mains phase or reverse the wires.

Total Harmonic Distortion

At the request of developers of version 1 of the system, I added the “Total Harmonic Distortion rate”. THD.


An ideal voltage and current are defined by a perfect sinusoidal shape at 50 Hz. In practice, devices (switching type power supplies or others) introduce non-sinusoidal currents generating numerous harmonics at 100 Hz, 150 Hz, 200 Hz, 250 Hz and disturb the operation of generators, transformers, etc. The THD will measure the energy contained in the harmonics (Total Energy – Energy of the signal at 50 Hz) in relation to the main energy and give a percentage.
0% = a perfect sine wave at 50 Hz,
100% = all the energy is in the harmonics

THD + N pour la tension et le courant

Here, for simplicity of calculation, the result includes the noise energy N in addition to the harmonics.

Operation

Every 40 ms, the voltage and the current are measured on 100 points for 20 ms. If the active power Pw is directed towards the public network (Pw<0), the triac opens a little more to favor the transfer towards the water heater. This is repeated until the equilibrium point is reached where Pw is close to zero.

If the temperature is reached, the water heater thermostat cuts the power supply to the resistance. In this case, the router will open the triac to the maximum, but no overproduction will be consumed. The Pw value will become strongly negative, from the level of overproduction. From a certain value, you can activate (optional) a relay to consume on another device. We stop it if the overproduction stops. Be careful to have a difference between the on and off threshold greater than the consumption of the device so as not to have an oscillation input of the relay.

At night, if the tank’s heating level is not reached, the grid Day/Night relay is left to take over (if it is retained) or the router can be programmed to open the Triac. The router takes the time on the internet network. Be careful, in the event of an internet cut, it may become out of sync. Put an activation time slot that covers winter and summer time to avoid time adjustments.

In the source code, you will find reporting to the Domoticz system. This is an example, as an option, to send data outwards if needed.

For the sake of simplicity, I have limited the functionalities to the essentials. People comfortable in programming can add other Triacs or relays. Similarly, it is possible to add a 20A current probe to measure and display the current sent to the water heater.

Web Page

The code installed on the ESP32 includes a Web server that displays on one page the various measurements as well as the voltage and current curves during a period of 20 ms. Simply enter the ESP32’s IP address into the address field of your web browser.

Table of measurement
Voltage and Current Curves to the Water Heater

In “Auto” mode, the system adjusts the injection to the water heater in order to no longer send overproduction to the outside world. Other injection levels can be forced manually.

Assembly

Montage

In an electrician’s box we install:

  • The ESP32 card (Development Board 2*19 pins))
  • A 5V 1A power supply for the ESP32
  • A low voltage transformer to measure the voltage
  • A 16A or 24A dimmer from RobotDyn
  • Some resistors and capacitors for analog measurement circuits
  • On the front 2 LEDs

Connected to this box, we have the current probe to be placed around the phase wire of the sector to be measured. Ground the shield to avoid picking up electrical noise.

In the diagram below, we keep the Day/Night contactor and we install the router in parallel.
Note: the router does not switch the neutral but the phase/load only.

Circuit diagram contactor and router in parallel

Source Code

All code is written using the Arduino IDE. It is initially injected by the serial link, then once in place, it can be modified if necessary by WIFI as described here https://f1atb.fr/index.php/2022/05/27/programming-the-esp32-over-wifi/

The source code is composed of 3 files:

  • the main file : SolarRouter_v2.ino
  • the PageWebb.cpp file which contains the HTML and Javascript code of the web page
  • the declaration file PageWeb.h

The source code is available here :

Check that you have the libraries installed like RemoteDebug on your Arduino IDE.

Soft Bugs

Please note, if you are unable to communicate between your PC and the ESP32, you are missing the driver for the USB interface. In general, it is the CP2102 which is on the ESP32 board. Many tutorials on the internet explain how to install it. Example: https://techexplorations.com/guides/esp32/begin/cp21xxx/

The Arduino IDE will ask you for a password when compiling. Answer anything, 1 letter minimum.

Sometimes with the Arduino IDE at the end of the transfer, the icon remains yellow and you no longer have control. Close the IDE and relaunch it.

On some configurations, during compilation, there is a non-existent library error: …..include <hwcrypto/sha.h>
With a text editor, open the file in your Arduino libraries C:\Users\User\Documents\Arduino\libraries\RemoteDebug\src\utility\Websockets.cpp

On line 42, replace:

include <hwcrypto/sha.h>
by
include <esp32/sha.h>

Don’t ask me why, on my desktop PC, I don’t need to make this change, on my laptop PC I need to.

Functional diagram

The dimmer with the Zero Crossing signal every 10ms, allows synchronizing the whole by activating an interruption on the ESP32. A timer provides an internal interruption every 100μs allowing the generation of a delay of 0 to 10ms in steps of 100μs to trigger the opening of the triac at the instant defined by the software.

Every 40ms and for 20ms, 100 voltage values and 100 current values are sampled and stored. Then the power calculations are made and can be sent to the web client that requests them.

Shower time

Now that you have hopefully understood how it works, you will notice that you have to take your shower in the morning on sunny days in order to take advantage of the overproduction at noon.

Security

By working on this 230V project, you agree to assume responsibility for your own safety and take all the necessary precautions to avoid electric accidents.

Articles sur le photovoltaïque