Skip to content
Jesús Capistrán
  • About me
  • Blog
  • Courses
  • Publications
  • Log In
  • Toggle website search
Menu Close
Search this website

Simulación de celdas solares SCAPS-1D

  • Home
  • Courses
  • Course
  • Simulación de celdas solares SCAPS-1D

Simulación de celdas solares SCAPS-1D

Curriculum

  • 1 Section
  • 7 Lessons
  • 1 Week
Expand all sectionsCollapse all sections
  • SCAPS-1D: FASnI3 perovskite
    Simulación basada en artículo científico publicado en marzo de 2020
    7
    • 3.1
      Lección 1: Revisión de literatura
    • 3.2
      Lección 2: Diseño de celda solar
    • 3.3
      Lección 3: Construcción de celda solar
    • 3.4
      Lección 4: Simulación de celda solar en iluminación
    • 3.5
      Leccion 5: Simulación de celda solar en obscuridad
    • 3.6
      Lección 6: Obtención de curva JV light + dark
    • 3.7
      Leccion 7: Variación de Rs mediante proceso batch

Read internal temperature sensor

Print Friendly, PDF & Email
  • Read the internal temperature sensor of the Raspberry Pi Pico
  • Print Temperature values on REPL

Now we are going to modify our Blinking led program a little bit. Here we will import a new module called microcontroller. See the changes in the code and load to your Raspberry Pi Pico.

import board
import digitalio
import microcontroller
import time

led = digitalio.DigitalInOut(board.LED)
led.direction = digitalio.Direction.OUTPUT

while True:
    temp = microcontroller.cpu.temperature
    print(temp)
    led.value = True
    time.sleep(2)
    led.value = False
    time.sleep(1)

You will see on the REPL the temperature is Celsius degrees, and the led will be blinking slower. If you want to see a change in the temperature, you can put your finger over the microprocessor (black squared chip) of your Pico board.

Print the internal temperature of Raspberry Pi Pico

Code Update (You can try this one too)

Of you want to costume the REPL to show the de units you can introduce the command print(f’text’) and pass the value of the temp variable:

import digitalio
import microcontroller
import time

led = digitalio.DigitalInOut(board.LED)
led.direction = digitalio.Direction.OUTPUT

while True:
    temp = microcontroller.cpu.temperature
    temp = round(temp,2)
    print(f'Temperature {temp} ºC')
    led.value = True
    time.sleep(0.5)
    led.value = False
    time.sleep(0.5)
REPL is working and showing the Temperature: 25 ºC

Activity (Write on the comments below)

Leave a Reply Cancel reply

You must be logged in to post a comment.

Continue with Facebook
Continue with Google
  • About me
  • Blog
  • Courses
  • Publications
  • Log In
©Copyright 2025 - All thoughts and opinions are my own and do not reflect those of my institution.
  • About me
  • Blog
  • Courses
  • Publications
  • Log In
 

Loading Comments...
 

You must be logged in to post a comment.

    Modal title

    Main Content