Kits
›
The Ultrasonic Robot
RU
EN
ES
Contents
Introduction
A little history
Lesson 1. The chassis: two wheels
1.1. Idea: no steering wheel — just two wheels
1.2. Idea: four moves
1.3. Idea: the arena
1.4. Build
1.5. Check
Lesson 1 paste (Cmd+I)
Lesson 2. The «bug»: a bumper and the CD4017
2.1. Idea: a manoeuvre is a sequence of steps
2.2. Idea: wait for a bump — HOLD
2.3. Idea: which wheel goes which way — LDIR and RDIR
2.4. Build
2.5. Check
Lesson 2 paste (Cmd+I)
Lesson 3. Ultrasound: centimetres on the display
3.1. Idea: time is distance
3.2. Idea: a measurement is a sequence of steps
3.3. Idea: the centimetre counter — two CD4029s
3.4. Idea: when to count — CIU
3.5. Idea: «full» — FULL
3.6. Idea: the echo in step with the clock — ECHOS
3.7. Idea: a display that does not flicker
3.8. Build
3.9. Check
Lesson 3 paste (Cmd+I)
Lesson 4. Without touching: closer than 20 cm
4.1. Idea: «closer than 20 cm» — compare the tens — CLOSE
4.2. Idea: remember at the show step — NEAR
4.3. Idea: a bump or close — TRIP
4.4. Build
4.5. Check
Lesson 4 paste (Cmd+I)
Lesson 5. Along the line
5.1. Idea: the line sensor
5.2. Idea: drifted off — steer back
5.3. Idea: L_ON — and the GO switch too
5.4. Idea: why the tracks look like this
5.5. Build
5.6. Check
Lesson 5 paste (Cmd+I)
Summary
All the parts
Instructions in pictures
Instructions in pictures
Download PDF — the whole book
kh
ROBOTICS
build kits · khanin.info
Building
instructions
RB-01
The Ultrasonic Robot
lessons 1–5 · a bumper, ultrasound and logic without a program
simulator: cs.khanin.info
© 2026 Daniil Khanin · khanin.info · RB-01
1
How to read these instructions
3
step number — follow strictly in order
AND
2×
6×
parts for this step: how many to place
AND
A
x
B
y
Y
z
a part with labels on its pins
CLK
CLK
labels with the same name are connected
A
Y
chip ports: input [ and output ]
DFF
blue frame — building a chip
CANVAS
grey tab — the main canvas
low
yellow ring — what has changed
remove a part together with its labels
2×
double-click a label — new name
3
chip built in the lesson with this number
check: this is how it should work
Keys
V
VCC (1)
G
GND (0)
N
transistor
I
switch
O
lamp
L
label
K
clock
U
button
[
port in
]
port out
Ctrl+G — into a chip
on a Mac Ctrl = Cmd
© 2026 Daniil Khanin · khanin.info · RB-01
2
A little history
1948
tortoise
1950s
cart
1978
range finder
1984
Braitenberg
2002
vacuum
now
HC-SR04
In 1948 Grey Walter built «tortoises»: a photocell, a bump contact, two radio valves and two motors.
It bumped — backed off and turned. No program — just like our «bug».
In the 1950s factory carts followed a wire in the floor: two sensors on the sides,
the wire slips under one — it steers. In 1984 Braitenberg described vehicles
where a sensor drives a wheel directly. That is lesson 5.
In 1978 Polaroid put an ultrasonic range finder into a camera: beep — count the echo.
In 2002 a robot vacuum drove «straight until a bump — turn». Today the HC-SR04 — like on our robot.
U
Polaroid is a trademark of its owner. This kit is not affiliated with or endorsed by it; the name is mentioned to tell the story.
© 2026 Daniil Khanin · khanin.info · RB-01
3
1
The chassis
two wheels, no steering — turning by the wheel difference
kh
RB-01
VCC
1×
GND
1×
1×
1×
1×
1×
1×
0
3×
∞
© 2026 Daniil Khanin · khanin.info · RB-01
4
CANVAS
1
VCC
1×
GND
1×
2×
VCC
VCC
GND
GND
2
paper first, the contour over it — corner to corner; size — with the handle (written by it)
3
1×
1×
1×
800 × 500
800 × 500
80 × 80
© 2026 Daniil Khanin · khanin.info · RB-01
5
CANVAS …
4
the chassis — on the left, nose to the right; labels — double-click a pin
5
1×
4×
GO
L_ON
LDIR
L_DIR
GO
R_ON
RDIR
R_DIR
speed 60
6
drag by the orange nut to the green point of the chassis — it snaps on
7
1×
1×
VCC
DOWN
© 2026 Daniil Khanin · khanin.info · RB-01
6
CANVAS …
8
0
3×
3×
0
GO
0
LDIR
0
RDIR
LDIR 1 · RDIR 1
forward
LDIR 0 · RDIR 0
back
LDIR 1 · RDIR 0
clockwise
LDIR 0 · RDIR 1
anticlockwise
© 2026 Daniil Khanin · khanin.info · RB-01
7
2
The «bug»: a bumper and the CD4017
bumped — backed off — turned
kh
RB-01
FWD
BACK
TURN
Hz
1×
Q
Q
1×
1×
CD4017B
1×
CD4072B
1×
CD4069UB
1×
CD4001B
1×
1×
1×
1×
∞
© 2026 Daniil Khanin · khanin.info · RB-01
8
CANVAS
1
library → import → robot-chips.json: a Robot folder, ten chips
2
delete the lesson 1 trial — the LDIR and RDIR switches; keep the labels on the chassis
3
Delete
0
LDIR
0
RDIR
4
Hz
1×
Q
Q
1×
2×
10Hz
CK
RESET
5
1×
1×
110
HIT
HIT
© 2026 Daniil Khanin · khanin.info · RB-01
9
CANVAS …
6
the chips are ready: pin names as in the TI datasheet; labels — double-click a pin
7
CD4017B
1×
12×
CD4017B
RESET
RESET
CLOCK
CK
INH
HOLD
CO
O9
O8
T4
O7
T3
O6
T2
O5
T1
O4
B4
O3
B3
O2
B2
O1
B1
O0
FWD
8
CD4072B
1×
10×
CD4072B
A
B1
B
B2
C
B3
D
B4
E
T1
F
T2
G
T3
H
T4
J
BACK
K
TURN
© 2026 Daniil Khanin · khanin.info · RB-01
10
CANVAS …
9
CD4069UB
1×
8×
CD4069UB
A
FWD
B
BACK
C
GND
D
GND
E
GND
F
GND
G
NFWD
H
LDIR
I
J
K
L
10
CD4001B
1×
10×
CD4001B
A
BACK
B
TURN
C
HIT
D
NFWD
E
GND
F
GND
G
GND
H
GND
J
RDIR
K
HOLD
L
M
11
1×
1×
1×
3×
FWD
BACK
TURN
FWD
drives
bump
BACK
back 0.4 s
TURN
turn 0.4 s
© 2026 Daniil Khanin · khanin.info · RB-01
11
3
Ultrasound
echo time is centimetres on the display
kh
RB-01
1×
Hz
2×
CD4017B
1×
CD4069UB
1×
CD4013B
1×
CD4081B
1×
CD4011B
1×
CD4029B
4×
4b
0
A
1×
∞
© 2026 Daniil Khanin · khanin.info · RB-01
12
CANVAS
1
Sensors → Ultrasonic: delete the reflector — any wall gives an echo
2
1×
2×
PING
TRIG
ECHO
ECHO
3
Hz
2×
2×
60Hz
CK60
8kHz
CK8K
4
60Hz
CK60
1Hz
2Hz
10Hz
60Hz
4kHz
8kHz
16kHz
…
MAX
8kHz
CK8K
1Hz
2Hz
10Hz
60Hz
4kHz
8kHz
16kHz
…
MAX
5
the chips are ready: pin names as in the TI datasheet; labels — double-click a pin
© 2026 Daniil Khanin · khanin.info · RB-01
13
CANVAS …
6
CD4017B
1×
5×
CD4017B
RESET
RESET
CLOCK
CK60
INH
GND
CO
O9
O8
O7
O6
O5
O4
O3
O2
SHOW
O1
O0
PING
© 2026 Daniil Khanin · khanin.info · RB-01
14
CANVAS …
7
CD4069UB
1×
8×
CD4069UB
A
CK8K
B
FULL
C
GND
D
GND
E
GND
F
GND
G
NCK8K
H
NFULL
I
J
K
L
8
CD4013B
1×
9×
CD4013B
R1
RESET
D1
ECHO
S1
GND
CL1
NCK8K
R2
GND
D2
GND
S2
GND
CL2
GND
Q1
ECHOS
QN1
Q2
QN2
© 2026 Daniil Khanin · khanin.info · RB-01
15
CANVAS …
9
CD4081B
1×
11×
CD4081B
A
CT3
B
CT0
C
CU3
D
CU0
E
X9
F
Y9
G
GND
H
GND
J
X9
K
Y9
L
FULL
M
10
CD4011B
1×
9×
CD4011B
A
ECHOS
B
NFULL
C
GND
D
GND
E
GND
F
GND
G
GND
H
GND
J
CIU
K
L
M
11
CD4029B
1×
14×
CD4029B
BD
GND
PE
PING
CI
CIU
UD
VCC
CLOCK
CK8K
J1
GND
J2
GND
J3
GND
J4
GND
CO
COU
Q1
CU0
Q2
CU1
Q3
CU2
Q4
CU3
© 2026 Daniil Khanin · khanin.info · RB-01
16
CANVAS …
12
CD4029B
1×
13×
CD4029B
BD
GND
PE
PING
CI
COU
UD
VCC
CLOCK
CK8K
J1
GND
J2
GND
J3
GND
J4
GND
CO
Q1
CT0
Q2
CT1
Q3
CT2
Q4
CT3
13
CD4029B
1×
13×
CD4029B
BD
GND
PE
SHOW
CI
VCC
UD
GND
CLOCK
GND
J1
CU0
J2
CU1
J3
CU2
J4
CU3
CO
Q1
DU0
Q2
DU1
Q3
DU2
Q4
DU3
14
CD4029B
1×
13×
CD4029B
BD
GND
PE
SHOW
CI
VCC
UD
GND
CLOCK
GND
J1
CT0
J2
CT1
J3
CT2
J4
CT3
CO
Q1
DT0
Q2
DT1
Q3
DT2
Q4
DT3
© 2026 Daniil Khanin · khanin.info · RB-01
17
CANVAS …
15
4b
0
A
1×
DT3
DT2
DT1
DT0
DU3
DU2
DU1
DU0
HEX
16
Fast
Fast mode: the counter needs every 8 kHz tick
a wall 41 cm away
farther than 99 cm
© 2026 Daniil Khanin · khanin.info · RB-01
18
4
Without touching
closer than 20 cm — turn before the bump
kh
RB-01
NEAR
CD4585B
1×
CD4071B
1×
1×
∞
© 2026 Daniil Khanin · khanin.info · RB-01
19
CANVAS
1
the chips are ready: pin names as in the TI datasheet; labels — double-click a pin
2
CD4585B
1×
12×
CD4585B
A0
CT0
A1
CT1
A2
CT2
A3
CT3
B0
GND
B1
VCC
B2
GND
B3
GND
LTIN
GND
EQIN
GND
GTIN
VCC
LT
CLOSE
EQ
GT
3
CD4071B
1×
9×
CD4071B
A
HIT
B
NEAR
C
GND
D
GND
E
GND
F
GND
G
GND
H
GND
J
TRIP
K
L
M
© 2026 Daniil Khanin · khanin.info · RB-01
20
CANVAS …
4
Alt/⌘+click — blue
5
1×
1×
NEAR
6
A
2×
B
CD4013B
Q1
ECHOS
R2
RESET
GND
CD4013B
Q1
ECHOS
D2
CLOSE
GND
CD4013B
Q1
ECHOS
CL2
SHOW
GND
CD4013B
Q1
ECHOS
Q2
NEAR
CD4001B
J
RDIR
C
TRIP
HIT
© 2026 Daniil Khanin · khanin.info · RB-01
21
CANVAS …
7
Fast
Fast mode: the counter needs every 8 kHz tick
< 20 cm
NEAR
closer than 20 cm — NEAR, a turn before the bump
© 2026 Daniil Khanin · khanin.info · RB-01
22
5
Along the line
a sensor sees the line — its wheel stops
kh
RB-01
VCC
1×
GND
1×
1×
1×
2×
0
1×
CD4069UB
1×
CD4001B
1×
∞
© 2026 Daniil Khanin · khanin.info · RB-01
23
CANVAS
1
a separate project — a new canvas
2
VCC
1×
GND
1×
2×
VCC
VCC
GND
GND
3
1×
800 × 500
track-1-stadium.json
paper ⬆ → a track file
4
the robot on the line: the line between the sensors
© 2026 Daniil Khanin · khanin.info · RB-01
24
CANVAS …
5
1×
4×
LON
L_ON
RON
R_ON
VCC
L_DIR
VCC
R_DIR
6
drag by the orange nut to the green point of the chassis — it snaps on
7
2×
2×
SL
OUT
fl
SR
OUT
fr
8
0
1×
1×
0
GO
9
the chips are ready: pin names as in the TI datasheet; labels — double-click a pin
© 2026 Daniil Khanin · khanin.info · RB-01
25
CANVAS …
10
CD4069UB
1×
7×
CD4069UB
A
GO
B
GND
C
GND
D
GND
E
GND
F
GND
G
NGO
H
I
J
K
L
11
CD4001B
1×
10×
CD4001B
A
SL
B
NGO
C
SR
D
NGO
E
GND
F
GND
G
GND
H
GND
J
LON
K
RON
L
M
straight
left
right
© 2026 Daniil Khanin · khanin.info · RB-01
26
Kit parts
how many times you place each part over all the lessons
VCC
2×
GND
2×
0
4×
1×
1×
1×
4b
0
A
1×
Hz
3×
Q
Q
1×
203×
2×
1×
1×
2×
1×
1×
1×
2×
1×
© 2026 Daniil Khanin · khanin.info · RB-01
27
Kit chips
ready TI chips from the kit file robot-chips.json — how many you place
CD4017B
2×
CD4072B
1×
CD4069UB
3×
CD4001B
2×
CD4013B
1×
CD4081B
1×
CD4011B
1×
CD4029B
4×
CD4585B
1×
CD4071B
1×
© 2026 Daniil Khanin · khanin.info · RB-01
28
Done!
15 chips · 2,800 transistors
GO — and the robot drives on its own: it turns 20 cm before the walls
© 2026 Daniil Khanin · khanin.info · RB-01
29
Copyright
© 2026 Daniil Khanin, khanin.info. All rights reserved.
These instructions, the drawings and circuits are original work.
Reprinting, publishing online, selling or passing it on to others,
in whole or in part, is prohibited without the written permission of the author.
The latest version is at khanin.info.
kh
khanin.info
RB-01
© 2026 Daniil Khanin · khanin.info · RB-01
30