HS402 Oscilloscope series are quite good DIY oscilloscopes designed for higher performance respect the HS10X series while keeping the best ratio performance/cost/ease to build.
Power consumption is also one of the lowest in the market (~40mA). They can be used only with HScope app for Android (since version 2.2.7).
Consider to support this project with a donation!
A 2 Channel oscilloscope based on STM32F4x1 Black Pill development board. It provide long memory buffer and high real-time transfer speed.
|Channels||1 or 2|
|Input Range||Can be built with one of the following variants:|
±5V (fixed) | ±15V (fixed) | ±30V (fixed) | PRO (multiple ranges)
PRO input ranges
±15V, ±7.5V, ±3.25V, ±1.6V, ±480mV
2 KSa/s – 1.4MSa/s
2.8MSa/s, 3.8 MSa/s not linear rates
2 KSa/s – 1.6MSa/s
3.2MSa/s, 4.2 MSa/s not linear rates
|ADC Resolution||8-12 Bits (8 bit @ max rate, 10bit @ 100KSa/s, 11bit @ 25KSa/s)|
|Input Noise||Schematic Option 1|
0.4% MAX @ 1.4MSa/s
0.12% MAX @ 140KSa/s (in real-time, 2 Channels, 10 bit)
<0.01% @ 50KSa/s (in real-time, 2 Channels)
Schematic Option 2 (REF2033)
0.17% MAX @ 1.4MSa/s
0.13% MAX @ 800KSa/s
0.09% MAX @ 400KSa/s (10 bit)
0.05% MAX @ 200KSa/s
<0.06% @ 160KSa/s (real-time, 2 Channel, 11 bit)
<0.05% @ 50KSa/s (in real-time, 2 Channels)
|Input Impedance||1 Mohm|
16K samples (half when use 2 channels together)
32K @ 3.8 MSa/s
32K samples (half when use 2 channels together)
64K @ 4.2 MSa/s
Hardware – checked after each complete scan, not centered, may loose samples
Hardware, real-time, position within first 500 samples
|HW Options Supported||– AC/DC Coupling Module|
– PWM Output Generator
– Input Buttons Module to control basic oscilloscope functions (eg. Start/Stop, sampling rate,..)
|Modules Supported in HScope||Automotive Module up to*:|
280 KSa/s single channel, 140KSa/s with 2 channels
320 KSa/s single channel, 160KSa/s with 2 channels
PWM Generator: supported up to 1 MHz, duty cycle 1-99%
|OS Version||Android 7+ (Android 4.4 supported but Automotive Module cannot reach more than 100KSa/s for 1 channel and 50KSa/s for 2 channels)|
*performances dependent from Android hardware and OS version. Check required OS Version. Suggested CPU 2.1GHz+
Schematics & Built
- Other STM32 development boards can be used, the important is that the main crystal is 25MHz
- On the schematic are indicated 2 hardware options. One exclude the other.
Flash the Firmware
The firmware flashing is made with the app STM32 Utils with an OTG adapter connected to the phone and an USB-TLL adapter connected to the OTG adapter. After connecting the phone to the STM32 Black Pill board like in picture, the red led light up.
By pressing the buttons on the Black Pill as in picture, the board enter into the STM boot loader and it is ready to be flashed. On the App:
1) Go to
Init Chipset and check that the app read the chipset
2) Go to the
Blue Box icon and in the list under vendor Martinloren select HS402 Oscilloscope, select the chipset from the variants (STM32F411 or STM32F401), then
3) After flashing disconnect the USB-TTL cable from the STM32 board and connect the STM32 to the phone through the OTG cable. Open HScope, the app should show you the signal from Channel 1.
First Setup / Calibration
When the oscilloscope is connected go in HScope Settings,
General - Hardware. Here:
- Set the Model to
HS402and Input Type to
PRO. When you do this change also the option Hardware AC/DC Coupling will be enabled automatically.
- Disconnect and reconnect the oscilloscope to get the new configurations.
You can also Enable the input buttons if you have installed the corresponding I2C module.
- (required just for Hardware Option 1) Connect Channel 1 probe to its GND.
- (required just for Hardware Option 1) Rotate the precision variable resistor (R9) until the software show a DC voltage quite near to 0. This trimmer requires a lot of turns. Make sure with a multimeter that its value is around 1Kohm before proceed with the fine tuning.
- For each channel do the Calib Zero Lvl procedure in the
Settings -> Calibration.
- Enable the PWM signal using the PWM module (red square icon in the right menu, then open the module). HS402 will generate a square wave on pin
- Connect the probe to pin
B15. Use an high rate, i.e. 450KSa/s and turn the variable capacitor until the rising part of the square wave reproduce a good square. Do this for each channel.
Now the device is calibrated in frequency response.
For this calibration you need an accurate voltage source, for example 3.3V or 5V from a voltage stabilizer. 5V from USB port is not accurate and should never be used for this calibration. Batteries also should not be used. At least you can use LM7805 or this kind of linear voltage regulators.
- For each channel do the Calib Multiplier procedure in the
Settings -> Calibration.
Here the tests you can perform in case of issues:
- Check that
PGNDis approximately around 1.65V respect GND. In Option 1 the R9 trimmer requires a lot of turns to get the offset near the 0. With a multimeter you can test it reach around 1Kohm and then fine tune the zero level with HScope.
A5pins (analog inputs) also should be at the same voltage with no input signal is applied.
- With a multimeter check that there are no shortcuts among the pins
B3, B4, B5, B6(these are connected to the PGA (U1, U3) which are very small and are easy to get shortcuts between the pins).
- Check that voltage change on C4 and C5 when on HScope you enable/disable AC/DC option on the channels. To check that the AC/DC coupling works just apply a battery to the input. When DC is selected you should read the voltage of the battery, when AC is selected you should read 0V.
Hardware options & Modules
Schematic Option 2
This option require a modification on the STM32 board and it aim to bring the Vref pin from the STM32 to one of the pins of the development board (PA2). One component should be removed (the inductor) and a jumper should be created to PA2 according the picture under. PA2 is inactive and used just to provide the Vref signal.
Note: after this modification the STM32 board will work only if 3.3V is applied to PA2 (now Vref)!
Hardware Buttons Module
By connecting the PCF8574 I2C module it is possible to have 8 hardware buttons to control the oscilloscope. These are the pin that should be connected to the STM32: GND, VCC (5V), SDA, SCL, INT. Buttons are triggered by connecting the P0-P7 pins to GND.
- P0: Start / Stop
- P1: Rate up
- P2: Rate down
- P3: Fit waveform to screen
- P4-P7: (not assigned yet)
HS402 can generate PWM output. A MOS driver like the MOSFET IRF520 Module Board can be used to control loads. Here the schematic of connections. A video about how to use the HScope PWM module is here. The IRF520 has been tested at 1KHz PWM frequency and showed low pass characteristics so it is not suggested to use an higher frequency.
Built by Users
Built by Matt (2020, 3D case files available here)
Built by Sebastian (2020)
Built by Denis (2020)
Built by Mikael (2020)