Ozeki 10
Analog Sensor
DC Motor
DHT Sensor
ID Manager
IR Transceiver
LCD Display
NFC Reader
Optical Gate
PBX VoIP Phone
RF 433 MHz
RF 2.4 GHz
RGB Sensor
Rotary Encoder
Servo Motors
Speech Engines
Split view camera
Stepper Motors
Switch Controller
Temperature Sensor
Arduino Mega 2560
Arduino Nano
Arduino Uno
Ozeki Matrix
Ozeki Ultrasonic Module
Raspberry PI
Chat Control
Autoconnect to Serial
Installation guide
Terms and Definitions
Bulk Messenger
Developer tools

Ozeki Matrix Ozeki Matrix | Raspberry PI Raspberry PI

Ozeki Ultrasonic Module

The Ozeki Ultrasonic Module is a modified Arduino Nano, that was built to controll ultrasonic sensors. This is an open source board, with all the files needed for manufacturing. You may also freely modify the design.

Video 1 - How Ozeki Ultrasonic Module measures distance from an ultrasonic sensor
Start the video

The Ozeki Ultrasonic Module contains an ATmega328P microcontroller so you can program it just like an Arduino Nano using the Arduino IDE environment. It has a micro USB port, which is compatible with mobile phone USB cables. It was designed to make it easy to control ultrasonic sensors, and it has standard mounting holes for M2 screws. You can connect a maximum of 4 HC-SR04 ultrasonic sensors to it. The ultrasonic sensor pins from left to right are: Vcc, Trig, Echo and GND (for help you can find a HC-SR04 datasheet below).

Figure 1 - Ozeki Ultrasonic Module photos

Download files for manufacturing





  • IC: ATmega328P
    • Clock Speed: 16 MHz
    • Flash Memory: 32 KB
    • SRAM: 2 KB
    • EEPROM: 1 KB
  • USB support provided by a CH340G USB to serial chip:
  • Power supply from USB (5V)
  • 500mA resettable fuse
  • Status LEDs: power, TX, RX, D13
  • 4 ultrasonic sensor connections
    (Vcc, Trig, Echo and GND from left to right, which are used on HC-SR04 sensors)
  • Can be screwed on an Ozeki Matrix Board
  • Product dimensions:

Pinout of the Ozeki Ultrasonic Module:

Figure 2 - Pinout for 4 ultrasonic sensors

The pinout for the HC-SR04 sensor connections:

HC-SR04 VCC Trig Echo GND
01 5V A0 A1 GND
02 5V D4 D2 GND
03 5V D5 D3 GND
04 5V D8 D9 GND

The pinout of the HC-SR04 ultrasonic sensor:

The Trig pin will be used to send the signal and the Echo pin will be used to listen for returning signal.

Figure 3 - Pinout of a HC-SR04 ultrasonic sensor


Connect the ultrasonic sensors to the Ozeki Ultrasonic Module as shown below. Before wiring the ultrasonic sensors to your Ozeki Ultrasonic Module we suggest to solder a JST header strip to the following 4 pin count connector, as you can see in the image above.

Figure 4 - How to wire 4 HC-SR04 ultrasonic sensors to Ozeki Ultrasonic Module

Program codes

A code that measures distance from 4 sensors

This code allows you to connect a maximum of 4 ultrasonic sensors to the Ozeki Ultrasonic Module. If they are connected you will be able to measure the distance of objects from all 4 sensors. Distance is measured in cm. You can choose to connect less sensors as you can see in the video below.

Do not forget to ad NewPing.h to your Arduino libraries which you can usually find at

You can find the newest versions of NewPin.h on the Arduino website.

Downloadable code:

Video 1 - How to measure distance from an ultrasonic sensor? Code is included below.
Start the video
#include <NewPing.h>

#define SONAR_NUM    4
#define MAX_DISTANCE 200
#define PING_INTERVAL 33

unsigned long pingTimer[SONAR_NUM]; 
unsigned int cm[SONAR_NUM];         
uint8_t currentSensor = 0;          

NewPing sonar[SONAR_NUM] = {    
  NewPing(A0, A1, MAX_DISTANCE),
  NewPing(4, 2, MAX_DISTANCE),
  NewPing(8, 9, MAX_DISTANCE),
  NewPing(5, 3, MAX_DISTANCE)

void setup() {
  pingTimer[0] = millis() + 75;  
  for (uint8_t i = 1; i < SONAR_NUM; i++)
    pingTimer[i] = pingTimer[i - 1] + PING_INTERVAL;

void loop() {
  for (uint8_t i = 0; i < SONAR_NUM; i++) {
    if (millis() >= pingTimer[i]) {        
      pingTimer[i] += PING_INTERVAL * SONAR_NUM;  
      if (i == 0 && currentSensor == SONAR_NUM - 1) oneSensorCycle();
      currentSensor = i;                          
      cm[currentSensor] = 0;                      

void echoCheck() {
  if (sonar[currentSensor].check_timer())
    cm[currentSensor] = sonar[currentSensor].ping_result / US_ROUNDTRIP_CM;

void oneSensorCycle() {
  for (uint8_t i = 0; i < SONAR_NUM; i++) {
    Serial.print(". sensor");
    Serial.print(" = ");
    Serial.print("cm \t");
Source Code 1 - Arduino example for sensing 4 sensor values simultaneously

Other modules

All of the Ozeki Processing Modules have ATmega328P or ATmega2560 microcontrollers integrated. Ozeki Modules can be connected to eachother like pieces of blocks. The connection is provided through USB to each module. They have M2 screw holes to give you an option to screw them on an Ozeki Matrix Board.

See all Ozeki Processing Modules

Copyright © 2000- - Ozeki Informatics Ltd. | | Tel: +36 1 371 0150
Home > Products > Ozeki 10 > Connections > Ultrasonic > Ozeki Matrix > Ozeki Ultrasonic Module
Page: 1643 | Login