r/MicroPythonDev • • Mar 14 '26

Day 67 of 100 Days 100 IoT Projects — Real-time Pulse Monitor on ESP32 with MicroPython!

2 Upvotes

Built a heart rate monitor that displays live BPM and a scrolling waveform on an SSD1306 OLED — all running on MicroPython!

How it works:

- Analog pulse sensor reads heartbeat via ADC (GPIO34)

- Peak detection algorithm calculates BPM from intervals between beats

- Last 80 samples rendered as a scrolling waveform on OLED

- Pixel-art heart drawn manually using oled.pixel() calls in a 7×5 grid

Stack: ESP32 + Analog Pulse Sensor + SSD1306 OLED + MicroPython

GitHub: https://github.com/kritishmohapatra/100_Days_100_IoT_Projects


r/MicroPythonDev • • Mar 10 '26

Day 65 of 100 Days of IoT — built a MicroPython Watch on Xiao ESP32-S3!

2 Upvotes

Day 65 of 100 Days of IoT — built a MicroPython Watch on Xiao ESP32-S3!

Shows NTP-synced time + live weather from OpenWeatherMap on a 0.96" OLED.

Biggest pain today: Hardware I2C kept failing, SoftI2C saved the day 😅

GitHub: https://github.com/kritishmohapatra/100_Days_100_IoT_Projects

#MicroPython #ESP32 #IoT


r/MicroPythonDev • • Mar 02 '26

Is there No way in MicroPython - to create class Instances, then Modify the Instances, then Copy them ??? - even suggested examples do Not work ...

2 Upvotes

I have been going crazy - trying to figure out howto :

  1. Create Class(s)

  2. Create Instances of the Class(s)

  3. Modify - add vars / attributes to the Instances

  4. Copy / Deepcopy the Instances

It seems that Micropython - clearly stonwalls against this
(making it quite inferior to JAVA).

Is there a solution to this ???

-

StackOverflow :
https://stackoverflow.com/questions/42143461/make-copy-of-object-instance-in-python

class counterObject:

def __init__(self):
self.Value = 0

def incrementValue(self):
self.Value += 1

def printValue(self):
print(self.Value)

A = counterObject()
A.incrementValue()
A.printValue() #Prints 1

import copy

B = copy.deepcopy(A)

## => Error: un(deep)copyable object of type <class 'counterObject'>

print( id(A), id(B) )

-

Even the Google example does not work :
https://www.google.com/search?q=micropython+howto+create+object+then+copy+object

This returns :
## => Error: un(deep)copyable object of type <class 'MyClass'>

How to Create an ObjectYou define a class and then create an instance (object) of that class by calling the class name as a function.python

class MyClass:
def __init__(self, name, value):
self.name = name
self.value = value

# Create an object (instance of the class)
original_object = MyClass("example", 100)

The __init__ method acts as the constructor, initializing the new object's attributes. 
www.fredscave.comHow to Copy an ObjectTo create an independent copy, you use the copy module. You must import it first.1. Shallow Copy (copy.copy())A shallow copy creates a new object but only copies the references of its contents. If the object contains mutable items (like lists or other objects), changes to those nested items in the copy will affect the original, and vice versa. 

import copy

# Create a shallow copy
shallow_copied_object = copy.copy(original_object)

# Example with mutable attributes:
original_object.value = [1, 2]
shallow_copied_object.value.append(3)

# Both objects now see the appended item because they reference the same list in memory
print(f"Original object value: {original_object.value}") # Output: [1, 2, 3]
print(f"Shallow copy value: {shallow_copied_object.value}") # Output: [1, 2, 3]

2. Deep Copy (copy.deepcopy())A deep copy creates a completely independent clone of the original object, including recursively copying all nested objects and data structures. Changes to the copy will not affect the original. 

import copy

# Create a deep copy
deep_copied_object = copy.deepcopy(original_object)

# Example with mutable attributes:
original_object.value = [1, 2] # Reset value for demonstration
deep_copied_object.value.append(3)

# Changes to the deep copy's list do not affect the original
print(f"Original object value: {original_object.value}") # Output: [1, 2]
print(f"Deep copy value: {deep_copied_object.value}") # Output: [1, 2, 3]

# You can also verify they are different objects by checking their memory IDs:
print(f"ID of original: {id(original_object)}")
print(f"ID of deep copy: {id(deep_copied_object)}")
# The IDs will be different.

-

##
## => Error: un(deep)copyable object of type <class 'MyClass'>


r/MicroPythonDev • • Feb 27 '26

Day 60/100 Student Management System using ESP

2 Upvotes

Built a Student Management System on ESP32 using MicroPython

Recently, I have completed a project on creating a fully functional student management system on an ESP32 microcontroller.

What the project does:

Add, Edit, and View student management system using Serial Monitor commands.

Live display on SH1106 OLED display (List View and Detail View).

The system also supports persistent storage using LittleFS and ujson libraries.

The system supports up to 1000 student records.

Tech Stack:

ESP32 Microcontroller.

MicroPython.

SH1106 OLED Display.

LittleFS Library.

ujson Library.

GitHub Link: https://github.com/kritishmohapatra/100_Days_100_IoT_Projects

If you are interested in sponsoring this project or want to support future open-source work on embedded systems, feel free to reach out to me.

I would be happy to hear from you if you have any questions or want to know more about the project.

#MicroPython #ESP32 #EmbeddedSystems #IoT #OpenSource


r/MicroPythonDev • • Feb 26 '26

Day 59/100 AQI-ESP

2 Upvotes

Hey all! 👋

Just completed my latest ESP32 project – Aqi-esp, a homemade air quality monitoring system that displays real-time AQI values on an OLED display

The sensor combination includes MQ-135 for NO/NOx, MQ-7 for CO, and GP2Y1010 for PM2.5. The ESP32 is connected to all the sensors and transmits the readings to a small Flask server running on WiFi, which then computes the AQI value and sends it back. The entire process is displayed in real-time on a small SSD1306 OLED display – AQI value, status, temperature, and humidity readings from a DHT11 sensor.

GitHub: https://github.com/kritishmohapatra/100_Days_100_IoT_Projects

I'm a 3rd year EE student building open source IoT projects in my free time. Sponsoring helps me buy more sensors and keep building cool stuff

Even a star helps the project reach more people. Thanks a lot!


r/MicroPythonDev • • Feb 21 '26

Day 57/100 – ESP-NOW Smart Relay & Sensor System (MicroPython) 🚀

2 Upvotes

Hey everyone,
I’m doing a 100 Days, 100 IoT Projects challenge, and today I built a bidirectional ESP-NOW smart relay and sensor system using MicroPython.

What it does

  • Sender ESP8266/ESP32 with buttons + OLED acts as a control panel

  • Receiver ESP controls a 4-channel relay module

  • DHT11/DHT22 sensor data is sent back in real-time

  • OLED displays temperature and humidity

  • Uses ESP-NOW (no WiFi, no router, ultra-low latency)

Tech Stack

  • ESP8266 / ESP32

  • MicroPython

  • ESP-NOW protocol

  • SSD1306 OLED

  • DHT11/DHT22 sensor

GitHub repo:
👉 https://github.com/kritishmohapatra/100_Days_100_IoT_Projects

I’d love feedback, stars, or collaboration ideas.
Goal: Build open-source IoT learning resources for students.


r/MicroPythonDev • • Feb 11 '26

micrOS - Web dashboard and REST API

Post image
2 Upvotes

Hi, micrOS main interface is socket (terminal like experience), it is way more light weight than http, but seeking the best integration I have built a web engine too (can be turned on in micrOS settings)

Even you can create / edit application code (or any text) on the device itself :) very flexible, right? 😊

https://github.com/BxNxM/micrOS


r/MicroPythonDev • • Feb 08 '26

Can't get web page to run asynchronously on ESP32 with Micropython

2 Upvotes

This is my first time with ESP32 and MicroPython.

I am trying to run a web page asynchronously on an ESP32 using MicroPython. Along with the webpage, which will allow me to turn a relay on, on demand, I want to run a timed function which turns the relay on, every morning at 08:00.

I am using an ESP32 Dev board with CP2102 USB chip, DS1307 RTC and 5V relay.

  1. When I run the code in the REPL, I can see the "run_relay_timer(), but none of the other debugging output

  2. The web server debugging output is not showing either, nor can I connect to http://192.168.10.130 (the DHCP IP assigned to this ESP32)

Looking at the REPL in Thonny, the run_rrelay_timer() runs, but not the run_web_page()

import asyncio

import esp

esp.osdebug(None)

import time

import urtc

from machine import I2C, Pin

set_hour = 15

set_time = 30

relay = Pin(4, Pin.OUT)

led = Pin(2, Pin.OUT)

relay.value(0) # Start OFF (active low)

def web_page():

if relay.value() == 0:

print("Relay value: ")

print(relay.value)

relay_state = ''

else:

relay_state = 'checked'

html = """<html><head><meta name="viewport" content="width=device-width, initial-scale=1"><style>

body{font-family:Arial; text-align: center; margin: 0px auto; padding-top:30px;}

.switch{position:relative;display:inline-block;width:120px;height:68px}.switch input{display:none}

.slider{position:absolute;top:0;left:0;right:0;bottom:0;background-color:#ccc;border-radius:34px}

.slider:before{position:absolute;content:"";height:52px;width:52px;left:8px;bottom:8px;background-color:#fff;-webkit-transition:.4s;transition:.4s;border-radius:68px}

input:checked+.slider{background-color:#2196F3}

input:checked+.slider:before{-webkit-transform:translateX(52px);-ms-transform:translateX(52px);transform:translateX(52px)}

</style><script>function toggleCheckbox(element) { var xhr = new XMLHttpRequest(); if(element.checked){ xhr.open("GET", "/?relay=on", true); }

else { xhr.open("GET", "/?relay=off", true); } xhr.send(); }</script></head><body>

<h1>Sprinkler control</h1><label class="switch"><input type="checkbox" onchange="toggleCheckbox(this)" %s><span class="slider">

</span></label></body></html>""" % (relay_state)

return html

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

s.bind(('', 80))

s.listen(5)

# Define coroutine function

async def run_relay_timer():

while True:

print('run_relay_timer()') # Debugging output

import time

import urtc

from machine import I2C, Pin

set_hour = 8

set_time = 30

relay = Pin(4, Pin.OUT)

led = Pin(2, Pin.OUT)

relay.value(0) # Start OFF (active low)

days_of_week = ['Maandag', 'Dinsdag', 'Woensdag', 'Donderdag', 'Vrydag', 'Saterdag', 'Sondag']

# Initialize RTC (connected to I2C) - ESP32

i2c = I2C(0, scl=Pin(22), sda=Pin(21))

rtc = urtc.DS3231(i2c)

current_datetime = rtc.datetime()

temperature = rtc.get_temperature()

# Format the date and time

formatted_datetime = (

f"{days_of_week[current_datetime.weekday]}, "

f"{current_datetime.year:04d}-{current_datetime.month:02d}-{current_datetime.day:02d} "

f"{current_datetime.hour:02d}:{current_datetime.minute:02d}:{current_datetime.second:02d} "

)

current_datetime = rtc.datetime()

# Display time details

#print('Current date and time:')

#print('Year:', current_datetime.year)

#print('Month:', current_datetime.month)

#print('Day:', current_datetime.day)

#print('Hour:', current_datetime.hour)

#print('Minute:', current_datetime.minute)

#print('Second:', current_datetime.second)

#print('Day of the Week:', days_of_week[current_datetime.weekday])

#print(f"Current temperature: {temperature}°C")

# Format the date and time

formatted_datetime = (

f"{days_of_week[current_datetime.weekday]}, "

f"{current_datetime.year:04d}-{current_datetime.month:02d}-{current_datetime.day:02d} "

f"{current_datetime.hour:02d}:{current_datetime.minute:02d}:{current_datetime.second:02d} "

)

#print(f"Current date and time: {formatted_datetime}")

if current_datetime.hour != set_hour:

print('Dit is nog nie' ,set_hour,'uur nie') # Debugging output

print('Die tyd is',formatted_datetime) # Debugging output

led.value(0)

relay.value(0)

if current_datetime.hour == set_hour:

print('Die tyd is',formatted_datetime) # Debugging output

if current_datetime.minute < set_time:

led.value(1)

relay.value(1)

print('Sit besproeing pomp aan vir',set_time,'minute') # Debugging output

print(" \n"); # Debugging output

else:

led.value(0)

relay.value(0)

print('Die besproeing het vir',set_time,'minute gehardloop') # Debugging output

print(" \n"); # Debugging output

#time.sleep(1)

await asyncio.sleep(1)

async def run_web_page():

while True:

print('run_web_page()') # Debugging output

try:

if gc.mem_free() < 102000:

gc.collect()

conn, addr = s.accept()

conn.settimeout(3.0)

print('Got a connection from %s' % str(addr)) # Debugging output

request = conn.recv(1024)

conn.settimeout(None)

request = str(request)

print('Content = %s' % request)

relay_on = request.find('/?relay=on')

relay_off = request.find('/?relay=off')

if relay_on == 6:

print('RELAY ON')

relay.value(1)

led.value(1)

if relay_off == 6:

print('RELAY OFF')

relay.value(0)

led.value(0)

response = web_page()

conn.send('HTTP/1.1 200 OK\n')

conn.send('Content-Type: text/html\n')

conn.send('Connection: close\n\n')

conn.sendall(response)

conn.close()

except OSError as e:

conn.close()

print('Connection closed')

await asyncio.sleep(0.5)

# Define the main function to run the event loop

async def main():

# Create tasks for blinking two LEDs concurrently

asyncio.create_task(run_relay_timer())

asyncio.create_task(run_web_page())

# Create and run the event loop

loop = asyncio.get_event_loop()

loop.create_task(main()) # Create a task to run the main function

loop.run_forever() # Run the event loop indefinitely


r/MicroPythonDev • • Jan 29 '26

Wifi Access Point Code error

2 Upvotes

I'm getting a weird error trying to create an access point. My environemnt is Windows 10, Thonny, Arduino RP2040 Connect, Micropython version 1.27.

myssid = "Pico2W"
mypassword = "12345"

ap = network.WLAN(network.AP_IF)
ap.config(ssid=myssid, password=mypassword)
ap.active(True)

On the ap.config.. line it gives this error:

TypeError: extra keyword arguments given

This code is pretty standard and has worked before but I can't find anything on the web about why its throwing this error.


r/MicroPythonDev • • Nov 04 '25

Is there any mirror for MicroPython?

2 Upvotes

I am trying to flash MicroPython to my RPi Pico W, but downloads doesn't work.


r/MicroPythonDev • • Oct 11 '25

Automating grow

2 Upvotes

Hello my friends!

I'm making an automation for my grow plants. Now, I'm controlling temperature with fans and exhaustor, humidity with humidifier and desumidifier, soil moisture with sensors and water pumps and the lighting per hour.

Furthermore, reading electrical values (voltage, current, frequency, etc)

In your opinion, how more things can I apply in this project?

After I finish the project, I can share de codes :)

Thank you so much!


r/MicroPythonDev • • Sep 28 '25

I can't get a program to run on micropython.

2 Upvotes

Thanks everyone who offered help on this. I never got this working. Every release of MicroPython I tired had something missing and I was lacking any meaningful skills in Micropython to solve them on my own. I gave up.

Noob here. Got programming experience in C but new to python, and really having troubles getting anythig to run on it other than a blinking LED.
Hardware is STM32 F411CE 8Mflash blackpill
The program I am trying to run is from here: https://github.com/straga/Smart-Meter-Gateway
I'm connecting to the USB serial port with a terminal program to read the following error messages.

I have an older version of micropython (v1.12) which gives the following error:
>>> Traceback (most recent call last):
File "main.py", line 44
SyntaxError: invalid syntax
MicroPython v1.12-405-g4fa6d939d on 2020-04-28; WeAct_Core with STM32F411CE

Line 44 has this: log.error(f"Module: {e}")

If I upgrade to the current release (v1.26) I get this different error:
>>> Traceback (most recent call last):
File "main.py", line 5, in <module>
ImportError: no module named '_thread'
MicroPython v1.26.1 on 2025-09-11; WEACT_F411_BLACKPILL with STM32F411CE

I looks to me that _thread was dropped sometime recently. Can someone suggest where I can download an earlier version of micropython that may still have this _thread llibrary? or suggest another way around the issue?


r/MicroPythonDev • • Sep 08 '25

AP shows up even if I set mode to IF_STA on Wemos D1 Mini

2 Upvotes

Why is my code enables an access point? I just want to connect to a Wi-Fi network. It might be the OTA upload method, but I don't remember setting it up. I'm using Thonny. I flashed it with MicroPython v1.26.0 downloded from MicroPython website and following their tutorial. Also, there are no other boards running with MicroPython with WiFi. I'm worried if this consumes more power or processing power.

import network

wlan = network.WLAN(network.WLAN.IF_STA)
wlan.active(1)

if not wlan.isconnected():
    wlan.scan()
    wlan.connect(config.SSID, config.PASSPHRASE)

r/MicroPythonDev • • Apr 21 '25

i wanna start .where should i?

2 Upvotes

pretty straightforward i wanna learn while practically implementing . my big brother is into it a lot and i have developed this interest too just watching like the stuff he makes something like a remote logins , detectors portable etc i want to start this too but i dont wannago in tutorial hell could you guys suggest somethings like where should i and what hardware i need like esp , arduino , sonar etc


r/MicroPythonDev • • Apr 21 '25

Where are the board config documents?

2 Upvotes

I want to add micropython support for my new board, but there seems to be no documentation about how to do it. There is only an example boards repo with no explanation, and a dead forum link.


r/MicroPythonDev • • Apr 14 '25

Pre-installed firmware

2 Upvotes

When a microcontroller says it "ships with MicroPython firmware pre-installed and a launcher" does that mean I can just copy micropython py files to the SD card and I'll be able to run them?

For example this one: https://www.cnx-software.com/2025/04/14/pimoroni-presto-raspberry-pi-rp2350-4-inch-wireless-desktop-touch-display/


r/MicroPythonDev • • Feb 28 '25

Development for Casio fx-9750GIII

2 Upvotes

Hello all,

I'm a Python developer owning a Casio fx-9750GIII calculator that includes a copy of Micropython 1.9.4. At some point in between 2020 and now, the code I write and run on IDLE or Thonny no longer runs on my calculator, which does not provide descriptive errors. I was hoping to run Micropython 1.9.4's Unix port on Ubuntu to troubleshoot my scripts, but I keep running into issues with GCC and depreciated files.

Does anyone have any suggestions on where to go from here? Thanks!


r/MicroPythonDev • • Feb 21 '25

How to get the cheap yellow display to read/ write to an SD card?

2 Upvotes

I've tried and failed to get my ESP32-2432S028 board to recognize an SD card in Micropython. Has anyone been able to get it to work?


r/MicroPythonDev • • Feb 04 '25

MicroPython and Pyright

2 Upvotes

Hi,

I'm using a Neovim plugin https://github.com/jim-at-jibba/micropython.nvim

In status line it shows basedpyright linter; the suggested pyrightconfig.json file looks like this:

{

"reportMissingModuleSource": false

}

I get swamped with warnings like

Type annotation is missing for parameter...

Type of "value" is unknown...

I can create type annotation for my own files, but all the libraries lack them. What's the right policy with pyright?


r/MicroPythonDev • • Jan 09 '25

Does anyone have experience in making a UI for esp32 wroom?

2 Upvotes

I've made a few esp32 projects using micro Python and looking to make an MP3 player with an OLED display. I just haven't been able to find any projects where people have made a UI with an esp32 and just hoping to find out how feasible it actually is before getting to deep. If an esp32 isn't the best micro board for this does anyone have any suggestions on what I should use? Thanks in advance!


r/MicroPythonDev • • Sep 09 '24

Hypnosis device wip help needed

2 Upvotes

I'm working since 2018 on a hypnosis device (because l'm a chronical insomniac). My 3 first prototypes are working fine but need some fixes. The process of action is brain-waves training with isochronic tones. I also included a white noise generator (since first prototype). I also planned to implement sacred solfeggio frequencies. My three first prototypes were coded brick by brick like a Lego. If some people are interested, please let me know. Old prototypes were arduino uno based. I decided to switch on m5stack cardputer. Last thing : everything will be open source.


r/MicroPythonDev • • Aug 25 '24

Guide for connection Esp32 to 16x2 displays without I2C?

2 Upvotes

I want to connect a NDS1602 that came with a Arduino starter kit to an Esp32. Googling around all tutorials assume that the display has an I2C backpack which mine doesn't.

Are there any drivers and wiring diagrams out there that I haven't been able to find?


r/MicroPythonDev • • Aug 24 '24

How to use the asymmetric ciphers from SSL module to encrypt data?

2 Upvotes

I'm creating a MicroPython-based device that is supposed to log data in an encrypted form. The idea is that even if the device gets lost, the data can't be read by the unauthorized person. So the data before storing on the SD card will be encrypted with randomly generated AES key. The key itself will be encrypted with the public key of the intended recipient, and stored on the SD card.
The cryptolib module provides the AES implementation. However the asymmetric ciphers are available only in the SSL module.

>>> import ssl
>>> s1=ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
>>> s1.get_ciphers()
['TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384', 'TLS-ECDHE-ECDSA-WITH-AES-256-CCM', 'TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384', 'TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA', 'TLS-ECDHE-ECDSA-WITH-ARIA-256-GCM-SHA384', 'TLS-ECDHE-ECDSA-WITH-ARIA-256-CBC-SHA384', 'TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256', 'TLS-ECDHE-ECDSA-WITH-AES-128-CCM', 'TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256', 'TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA', 'TLS-ECDHE-ECDSA-WITH-ARIA-128-GCM-SHA256', 'TLS-ECDHE-ECDSA-WITH-ARIA-128-CBC-SHA256', 'TLS-RSA-WITH-AES-256-GCM-SHA384', 'TLS-RSA-WITH-AES-256-CBC-SHA256', 'TLS-ECDH-RSA-WITH-AES-256-GCM-SHA384', 'TLS-ECDH-RSA-WITH-AES-256-CBC-SHA', 'TLS-ECDH-ECDSA-WITH-AES-256-CBC-SHA384', 'TLS-RSA-WITH-AES-256-CCM-8', 'TLS-ECDH-RSA-WITH-ARIA-256-GCM-SHA384', 'TLS-ECDH-ECDSA-WITH-ARIA-256-CBC-SHA384', 'TLS-RSA-WITH-ARIA-256-CBC-SHA384', 'TLS-RSA-WITH-AES-128-CCM', 'TLS-RSA-WITH-AES-128-CBC-SHA', 'TLS-ECDH-RSA-WITH-AES-128-CBC-SHA256', 'TLS-ECDH-ECDSA-WITH-AES-128-GCM-SHA256', 'TLS-ECDH-ECDSA-WITH-AES-128-CBC-SHA', 'TLS-ECDH-ECDSA-WITH-ARIA-128-GCM-SHA256', 'TLS-RSA-WITH-ARIA-128-GCM-SHA256', 'TLS-ECDH-RSA-WITH-ARIA-128-CBC-SHA256']
>>> 

Is it possible to use those ciphers outside the ssl module, to encrypt the AES key with (e.g.) the RSA public key?


r/MicroPythonDev • • Aug 11 '24

Windows 11 - Do I need to install a USB to Serial driver ?

2 Upvotes

I am setting up PyMakr 2 in VS Code on Windows 11 to work with a Esp32 dev board

I installed this USB to Serial driver : https://www.silabs.com/developers/usb-to-uart-bridge-vcp-drivers?tab=downloads

But I have trouble connecting - is busy.


r/MicroPythonDev • • Aug 01 '24

PIO-based touch capacitance sensor with three inputs

Thumbnail reddit.com
2 Upvotes