Smart Home
The Smart Home is a house you build. It measures the room, raises alarms, opens its door for a card and lights itself, and it is on Wi-Fi. It has no drive motors. In Python you reach every part of it through one object, called home.
At a glance
Section titled “At a glance”| Chip | ESP32-S3 |
| Motor driver | None. The house has no drive motors |
| Link to your phone | Wi-Fi. You set it up over Bluetooth, see Wi-Fi setup |
| In code | home |
| Current firmware | 3.0.2 |
| Pins | Smart Home pins |
The website lists these parts in the box: the MoBoard IoT board, the house structure, an RFID reader with two RFID tags, a temperature and humidity sensor, a motion sensor, a gas sensor, a servo motor, a fan, an OLED display and a holder for 6 AA batteries. The light sensor, the knob, the buzzer, the three-digit display and the RGB lamp are on the board itself.
Parts and how to reach them
Section titled “Parts and how to reach them”Every part is an attribute of home. Click the class name to open its reference page.
| Part | In code | Reference | What it does |
|---|---|---|---|
| Temperature and humidity sensor | home.temperature_sensor |
TemperatureSensor | Measures the temperature in degrees Celsius and how much water vapour is in the air (humidity, in percent). |
| Motion sensor | home.motion_sensor |
MotionSensor | Notices a person or an animal moving nearby. Warm bodies give off infrared light we can’t see, and the sensor reacts when that light moves. |
| Gas sensor | home.gas_sensor |
GasSensor | Notices gases and smoke in the air. A tiny heated plate changes how well it conducts electricity when those gases touch it. |
| Light sensor | home.light_sensor |
LightSensor | Measures how bright it is: a special resistor lets more electricity through when more light falls on it. |
| Knob | home.knob |
Knob | Reads how far the knob is turned. |
| Button | home.button |
Button | The house’s push button. |
| Battery sensor | home.battery |
Battery | Measures the battery’s voltage, which drops as the battery empties. |
| RFID reader | home.rfid |
RFIDReader | Reads the number of a card or tag held close to it. The reader powers the card with radio waves and the card answers with its number. |
| RGB lamp | home.rgb_led |
RGBLed | The house’s colour lamp; colours are red, green and blue from 0 to 255. |
| Screen | home.display |
Display | The house’s screen: 128 x 64 dots, x from 0 (left) to 127, y from 0 (top) to 63. |
| Three-digit number display | home.number_display |
NumberDisplay | The house’s three-digit number display. |
| Buzzer | home.buzzer |
Buzzer | The house’s buzzer; frequencies are in hertz and durations in milliseconds. |
| Servo (the door) | home.servo |
Servo | The house’s servo motor (the door); angles are in degrees, 0 to 180. |
| Fan | home.fan |
Fan | The house’s fan; its speed is in percent, 0 to 100. |
| Wi-Fi | home.wifi |
Wifi | The house’s Wi-Fi: its address, its name and the networks it remembers. |
| Web page | home.dashboard |
Dashboard | The house’s web page: the readings, and the switches, sliders and boxes a program adds. |
Other things on home:
| In code | What it does |
|---|---|
home.enable_number_display() |
Switches on the three-digit number display, home.number_display (start-up already does it). |
The mobot module has two helpers: from mobot import map_range, sleep_ms. They are on the Smart Home reference page.
Things to know about these parts
Section titled “Things to know about these parts”- A part that did not start is
None. The house prints a line such asError initializing RFID:and carries on.home.rfidandhome.displaycan beNone, so check before you use them. - The pin of
home.led1, GPIO 39, is also the data pin of the three-digit number display, which the house switches on when it starts. See Shared pins. - The Smart Home has no LED 1 and no LED 2. The current board has no LED on the pins of
home.led1andhome.led2. This was checked on a real board in September 2026. The lights on the board are the RX, TX and power lights and the RGB lamp. The firmware keepsled1andled2for programs that already use them, sohome.led1.on()runs without an error and nothing lights. That is why they are not in the table above or in the reference. Usehome.rgb_ledfor a light you can see, for examplehome.rgb_led.set_color(0, 255, 0)for green. - The gas sensor and the light sensor are read on pins that the Wi-Fi radio also uses. If a reading is lost, the firmware tries again, and if it still fails it gives you the last real reading. It does not make one up.
home.wifiandhome.dashboardare not parts you can touch. They are the house’s Wi-Fi helpers and its web page. They are explained on their own pages, below.
Names on firmware 2.x
Section titled “Names on firmware 2.x”Firmware 3.0 renamed some of these. A house that still runs 2.x needs the old names.
| Firmware 3.0 | Firmware 2.x |
|---|---|
home.temperature_sensor |
mobotIOT.dht11 |
home.motion_sensor |
mobotIOT.pir |
home.gas_sensor |
mobotIOT.mq135 |
home.light_sensor |
mobotIOT.ldr |
home.knob |
mobotIOT.pot |
home.display |
mobotIOT.oled |
home.number_display |
mobotIOT.seg |
home.dashboard |
mobotIOT.server |
home.enable_number_display() |
mobotIOT.init_seg() |
Every other part has the same name on both: button, battery, rfid, rgb_led, buzzer, servo, fan and wifi. The calls on each part were renamed too. See Names from 2.x to 3.0.
The app modes
Section titled “The app modes”The Smart Home has no mode numbers, and there is no home.mode. Its modes live in the app. The website lists five:
| Mode | Part it goes with |
|---|---|
| Weather station | Temperature and humidity sensor |
| Security mode | Motion sensor (the website says “Security alarm”) |
| Gas detection | Gas sensor (the website says “Alert and ventilation”) |
| RFID access | RFID reader (the website says “Smart lock”) |
| Smart lighting | Light sensor (the website says “Automatic lighting”) |
These five run inside the house’s own web page, so they need the house on Wi-Fi. The house starts that web page by itself as soon as it joins your Wi-Fi. If your program starts its own Wi-Fi network instead, the house’s page and these five modes stop. See Your own web page.
What a program can do
Section titled “What a program can do”- Sense the room.
home.temperature_sensor.temperature()gives degrees Celsius andhumidity()gives percent. Both areNoneuntil the sensor has made its first good reading.home.motion_sensor.motion_detected()is true while something moves.home.gas_sensor.level()andhome.light_sensor.level()give a raw reading from 0 to 4095.home.knob.position()also gives 0 to 4095. - Read the button and the battery.
home.button.is_pressed()andhome.battery.voltage(). - Show things.
home.display.show_text(text, x, y)writes on the 128 by 64 dot screen, and the display can draw lines, rectangles, circles, triangles and faces.home.number_display.show_number(n)shows a number on the three digits. - Light and sound.
home.rgb_led.set_color(r, g, b)lights the lamp, each colour from 0 to 255.home.buzzer.play_note("C4", 200)plays a note for a number of milliseconds. - Move things.
home.servo.set_angle(degrees)turns the door servo from 0 to 180 degrees.home.fan.set_speed(percent)sets the fan from 0 to 100. - Read cards.
home.rfid.read_card()gives the number of the card on the reader. See RFID cards. - Use Wi-Fi.
home.wifi.ip()gives the house’s address. See Wi-Fi setup. - Serve a web page.
home.dashboard.start()starts the house’s web page, andadd_switch,add_slider,add_colorandadd_textadd controls to it. See Your own web page.
Each of these has a full reference page. Start from the table above.
More about the Smart Home
Section titled “More about the Smart Home”- Wi-Fi setup: join your Wi-Fi, set it up again, and ask the house for its address.
- Your own web page: the house’s web page, the controls you can add, and the MoBot dashboard.
- RFID cards: read card numbers and build a door that knows your card.
- Smart Home pins: every pin.
Where next
Section titled “Where next”- Connect your board and run your first program.
- Smart Home reference has every call.
- Smart Home examples are programs you can open and run.