Skip to content
Parallax Learn

Parallax Learn

  • Welcome
  • Tutorials
        • Tutorial Series head tag

          Tutorial Series
        • Tutorial Series

          The special, classroom-ready series pages are organized collections of tutorials for our most popular hardware and/or languages. The tutorials for each topic are conveniently accessible from a single page, shown in the order it is recommended that they be completed.
        • Robotics Series Head tag

          Robotics Series
        • Robotics Series

          • Artificial Intelligence
          • Cybersecurity: Radio Data tutorialCybersecurity
          • cyber:bot + Python
          • cyber:bot + MakeCode
          • Boe-Bot Tutorial SeriesBoe-Bot
          • Arduino Shield-Bot
          • ActivityBot with C TutorialsActivityBot + C
          • ActivityBot with BlocklyProp Tutorial SeriesActivityBot + BlocklyProp
          • Scribbler 3 Tutorial SeriesScribbler 3
        • Electronics & Programming Series Head tag

          Electronics & Programming Series
          • BS2 Board of Education Tutorial SeriesBS2 Board of Education
          • Propeller C-Language BasicsPropeller C Basics
          • FLiP Try-It Kit C Tutorial SeriesFLiP Try-It Kit + C
          • FLiP Try-It Kit BlocklyProp TutorialsFLiP Try-It Kit + BlocklyProp
          • Badge WX Tutorial SeriesBadge WX
          • Propeller BlocklyProp Basics and ProjectsPropeller BlocklyProp Basics
          • View All Tutorial Series »
        • Browse Tutorials
        • Browse Tutorials

          Individual tutorials sorted by robot or kit, and language.
        • By Robot or Kit
          • ActivityBot
          • SumoBot WX
          • Boe-Bot
          • Shield-Bot
          • cyber:bot
          • Badge WX
          • ELEV-8
          • ARLO
        • By Language
        • By Language

          • Propeller C
          • Arduino
          • BlocklyProp
          • PBASIC
          • Python
          • MakeCode
          • View All Tutorials »
  • Educators
  • Reference
  • Downloads
  • Home
  • All Courses
  • LED Lights

LED Lights

How it Works

How It Works: led_blink_with_voltmeter

Earlier, we learned that the micro:bit’s microcontroller connects a pin like P13 to its 3.3 V supply in response to pin13.write_digital(1) and to its 0 V (GND) supply in response to pin13.write_digital(0).  It looks like the 0 V (GND) signal checks out, but why does it only supply 2.65 V to turn the LED light on?

The answer is that the transistors inside the micro:bit that make connection between an I/O pin and 3.3 V have some internal resistance.  With current for the LED circuit flowing through that internal resistance, the result is a voltage drop of 0.55 V inside the micro:bit, leaving 2.65 V for the LED circuit.  This I/O pin behavior is called voltage drop under load.  Again, your measurements could vary, and the variations will depend on temperature, version of micro:bit, and even microcontroller manufacturing variations from one batch to the next.

This script started as led_blink from Connect and Blink a Light.  Aside from the fact that the green light was moved from P14 to P13, the led_blink_with_voltmeter script has two main differences.  First, it has from multimeter import *, which has functions for measuring voltage and displaying it with the CYBERscope.  Second, it measures voltage with voltmeter(device=”CYBERscope”) after each pin13.write call.  This function call measures the voltage between the P2 and P0 alligator clips and sends the measurement data to the CYBERscope to be displayed.

# led_blink_with_voltmeter

from microbit import *
from multimeter import *                  # <-- added

while True:
    pin13.write_digital(1)
    voltmeter(device="CYBERscope")        # <-- added
    sleep(2500)
    pin13.write_digital(0)
    voltmeter(device="CYBERscope")        # <-- added
    sleep(2500)
    

Try This: Float the P13 Resistor Lead

Here, you will test I/O pin voltage without any load.  You will do this by disconnecting the circuit “load” from the I/O pin “supply.”

  • Unplug the resistor lead that’s connected to the left terminal strip’s (e, 17) socket.
  • Leave the other end where it is, plugged into the right terminal strip’s (a, 17) socket.
  • Unbend the resistor leads to make it point straight up in the air.  In electronics-speak, this is sometimes called “floating” the lead.
  • Repeat your voltage measurements.
  • Do the measurements now oscillate between about 3.3 V and 0 V?
  • Reconnect the resistor to the left terminal strip’s (e, 17) socket when you are done.

 


Printer-friendly version
Script and Tests
Prev
Change the Resistance
Next

DISCUSSION FORUMS | PARALLAX INC. STORE

About | Terms of Use | Feedback: learn@parallax.com | Copyright©Parallax Inc. 2024

© 2025 Parallax Learn • Built with GeneratePress