Every inventor began with one small project. Pick one and bring your idea to life today!
Great inventors and great teachers all started with one small step. Take yours today!
The same kits we use in 40+ school labs โ grab yours and build something youโre proud of.
Log in to continue
Press a button on one board and a bell rings on another board across the room โ or across the country! Then pick up an old TV remote and drive your robot with it. No phone, no wires: just a few lines of TinkerPy.
Every TinkerPy board has its own name: TP and 8 numbers, like TP00000002. Find it on the board: Menu โ Device info.
Board-to-board radio for boards that are near each other. Tick Wireless in Circuit Connections (import wireless) and write the OTHER boardโs ID before a dot: TP00000002.send("RING").
The same functions for boards that are far apart: each board is on its own WiFi and tinkerpy.com passes the messages. Add _iot after the ID: TP00000002_iot.send("RING").
The connection between two boards. It opens only when both programs list each other with .connect() in setup:, so a strangerโs board canโt disturb yours.
A small 3-leg IR sensor (TSOP1838) on any pin. It reads the invisible infrared flashes of a TV remote. remote_read() tells you which key was pressed.
Tap each step to follow โRINGโ from the button board to the bell board.
Switch between them and compare who talks to whom.
# Add the libraries you need import wireless # Give your pins easy-to-remember names i1 = set_name("bell_button") o1 = set_name("warn") o2 = set_name("link") # ===== Wireless doorbell: button board (TP00000001) ===== # This code block executes only once setup: bell_button = set_input(push_button, active_low) warn = set_output(led) link = set_output(led) TP00000002.connect() # link to the bell board (its Device ID) # This code block executes forever loop: if TP00000002.connected() == 1: # when TP00000002.connected() == 1 link = ON # turn link ON else: # otherwise link = OFF # turn link OFF if bell_button == ON: # when bell_button is ON ok = TP00000002.send("RING") # 1 = the bell board got it, 0 = it did not if ok == 0: # when ok == 0 warn = ON # turn warn ON else: # otherwise warn = OFF # turn warn OFF wait(300) # pause here for 300 milliseconds before continuing
Upload this to the button board TP00000001 (TinkerPy Mega). The link LED shows when the bell board is linked; the warn LED lights when a RING did not arrive. In TinkerPy Code, put your own boardsโ Device IDs โ Compile checks them online.
# Add the libraries you need import oled_display import buzzer import wireless # Give your pins easy-to-remember names o1 = set_name("bell") # ===== Wireless doorbell: bell board (TP00000002) ===== # This code block executes only once setup: oled_begin() # starts the OLED o7 = set_function(SDA) # cannot be changed o8 = set_function(SCL) # cannot be changed bell = set_output(buzzer, passive) TP00000001.connect() # link to the button board oled_write(1, center, medium, bold, "Doorbell") # write "Doorbell" on OLED line 1 (medium bold, centred) # This code block executes forever loop: msg = TP00000001.read() # the message from the button board as text (None if nothing came) if msg == "RING": # when msg == "RING" oled_write(1, center, medium, bold, "Visitor!") # write "Visitor!" on OLED line 1 (medium bold, centred) oled_write(4, left, small, regular, "Signal " + TP00000001.signal()) # write "Signal " + TP00000001.signal() on OLED line 4 (small, from the left) buzzer_play(bell, "door_bell") # play the "door_bell" tone on the buzzer (bell) โ the next line waits until it ends oled_write(1, center, medium, bold, "Doorbell") # write "Doorbell" on OLED line 1 (medium bold, centred)
Upload this to the bell board TP00000002. It lists the button board TP00000001, waits for RING, shows Visitor! and the signal strength, and plays the door_bell tune on a passive buzzer.
# Add the libraries you need import oled_display import wireless_iot # Give your pins easy-to-remember names o1 = set_name("dry_led") # ===== Plant watcher at Grandmaโs (TP00000002) ===== # This code block executes only once setup: oled_begin() # starts the OLED o7 = set_function(SDA) # cannot be changed o8 = set_function(SCL) # cannot be changed dry_led = set_output(led) TP00000001_iot.connect() # the plant board at home, anywhere on the internet # This code block executes forever loop: if TP00000001_iot.connected() == 0: # when TP00000001_iot.connected() == 0 oled_write(4, left, small, regular, "Plant board offline") # write "Plant board offline" on OLED line 4 (small, from the left) if TP00000001_iot.available() == 1: # when TP00000001_iot.available() == 1 soil = TP00000001_iot.read_number() # the soil reading the plant board sent oled_clear_line(4) # clear line 4 of the OLED oled_write(1, left, small, regular, "Soil dryness") # write "Soil dryness" on OLED line 1 (small, from the left) oled_write(2, center, large, bold, soil) # write the value of soil on OLED line 2 (large bold, centred) if soil > 60: # when soil > 60 dry_led = ON # turn dry_led ON TP00000001_iot.send("WATER") # ask the plant board to switch its pump on else: # otherwise dry_led = OFF # turn dry_led OFF
Wireless IoT: this board can be in another city. The plant board at home (TP00000001) runs TP00000002_iot.send(analog_read(soil)) every 10 seconds. Here the reading shows on the OLED; above 60 the LED lights and WATER is sent back so the plant board can switch its pump on.
# Add the libraries you need import motor import tv_remote # Give your pins easy-to-remember names o1 = set_name("headlight") # ===== TV remote robot ===== # This code block executes only once setup: o3 = set_output(right_motor_P) o4 = set_output(right_motor_N) o5 = set_output(left_motor_P) o6 = set_output(left_motor_N) i1 = set_function(tv_remote) # TV remote receiver (TSOP1838) โ learn the keys on the board: Menu > TV Remote headlight = set_output(led) # This code block executes forever loop: k = remote_read() # the TV remote key pressed (1-9, 0, a-d, up, ok, ch+ โฆ) into k โ None if no key if k == "up": # when k == "up" robot_control("F", 80, "F", 80) # Left 80% Forward, Right 80% Forward : Robot - Moving Forward elif k == "down": # otherwise, when k == "down" robot_control("B", 80, "B", 80) # Left 80% Backward, Right 80% Backward : Robot - Moving Backward elif k == "left": # otherwise, when k == "left" robot_control("B", 60, "F", 60) # spin left: left wheel back, right wheel forward elif k == "right": # otherwise, when k == "right" robot_control("F", 60, "B", 60) # spin right elif k == "ok": # otherwise, when k == "ok" robot_control("S", 0, "S", 0) # stop elif k == "1": # otherwise, when k == "1" headlight = ON # turn headlight ON elif k == "0": # otherwise, when k == "0" headlight = OFF # turn headlight OFF
A robot car driven by any TV remote: arrows drive and spin, ok stops, 1 and 0 switch the headlight. Learn the remote on the board first (Menu, TV Remote, Learn Remote). Works on TinkerPy Mega and Mini.
Put the button board at the lab door and the bell board on the teacherโs desk. Nobody has to shout โMay I come in?โ again!
Six boards can link to each other. Pass a message from board to board around the room and time how fast it gets back.
With remote_read_string() an old TV remote becomes a keypad: type 4 8 2 and a servo opens your treasure box.
Upload the button program to one TinkerPy Mega and the bell program to another, each with the otherโs Device ID. Add a second message: a long press sends โURGENTโ and the bell board plays a different tone.
๐งฐ You need: 2 TinkerPy Mega boards, push button, 2 LEDs, passive buzzer, OLEDLearn your remote on the board, then upload the TV remote robot. Add speed keys: v+ makes the robot faster and v- slower, using a speed variable inside robot_control().
๐งฐ You need: robot car with TinkerPy board, TV remote receiver (TSOP1838), any TV remoteA TV remote talks with invisible infrared light. Point a phone camera at the front of a remote and press a key: many phone cameras show the light flashing that your eyes cannot see.
5 quick questions to check yourself โ free with your TinkerPy account.
Log in