In this activity, you will learn the simple rules of creating electrical connections with a breadboard and test them with the micro:bit. The micro:bit will run a script that beeps and displays a checkmark when it detects an electrical connection. If it does not detect an electrical connection, it will stay silent and display a circle with a slash through it to indicate ‘not connected.’
Here are two simple rules of terminal strips, for the breadboard in your kit:
So, to electrically connect a pair of wires or leads—or up to five at a time— just pick one of the rows of 5 sockets and plug them in.
What if you want to connect a different pair of wires or leads? For those two leads to be electrically connected to each other, but not to the first group, just pick a different row of 5 sockets. Keep in mind that these are rows of 5 sockets, not 10. So, if you plug a wire into (a, 16) and another into (j, 16), they will not be connected. That’s because even though they would be on the same row, they are not on the same row of 5 sockets. Want them connected? Add a wire that connects the two rows.
(View full-size: terminal-strips-for-electrical-connections.mp4 [1])
The row of sockets on the left side of the slot in the center of the terminal strip are electrically insulated from the row of sockets on the right.
So, if your terminal strip has some other number of sockets per row, you can use the slot in the center as your guide for which sockets are connected. Let’s say a terminal strip has 12 sockets per row with 6 sockets to the left of the slot in its center, and 6 more sockets to the right. In that case, for a given row, sockets in columns a through f would be electrically connected. Sockets in columns g through l would also be electrically connected, but they would be insulated from the sockets in columns a through f.
The breadboard in this kit also has three bus strips. Instead of rows of 5, each bus strip has two columns of 25 sockets. All 25 sockets in the column by the blue line are electrically connected, but insulated from all other sockets. The same rule applies for a column of 25 sockets by a red line.
Bus strip columns can also be connected with wires. For example, a jumper wire that is plugged into the (-) column of the center and right bus strips will make it so that a lead plugged into the (-) column of the center bus can be connected to a lead in the (-) column of the right bus.
(View full-size: bus-strips-for-electrical-connections.mp4 [2])
Keep the alligators apart! Adjust the plastic covers on the alligator clips when you connect them to the 3-pin headers, to make sure the two probes are not touching and making electrical contact.
The script you will be working with has a custom module called multimeter added to the micro:bit filesystem. That multimeter module is already part of the .hex file you will download and then open in the python.microbit.org [4] online editor.
(View full-size: download-measure-continuity-hex.mp4 [7])
Your micro:bit continuity tester will beep (micro:bit V2 only) and display a checkmark when the continuity probes are electrically connected. You can use this to test the various breadboard rows and columns, and even probe rows/columns that have been connected together with jumper wires.
(View full-size: continuity-tester-concept.mp4 [8])
Let’s test all the examples from How to Connect Two Wires.
Modules are files that typically contain Python functions, methods, and properties. After your script imports a module, it can use the functions, methods and properties it contains. For example, the continuity_tester script has this statement: from microbit import * which gives the script access to anything from the microbit module. Without it, the script would not be able to call sleep(50). The script also needs the microbit module for its display.show method and Image.YES property.
# continuity_tester from microbit import * from multimeter import * import music while True: connected = continuity() if connected == True: display.show(Image.YES) #music.pitch(3000, 100) else: display.show(NC) sleep(50)
The continuity_tester script also uses a function named continuity. That function is from a custom module called multimeter. A custom module is different because the micro:bit module’s file system needs the multimeter.py file module before these statements can work properly: from multimeter import * and connected = continuity(). In this activity, the multimeter.py file was already added to continuity_tester.hex.
See Add Modules to your micro:bit [10] for an example of how custom modules are added to a .hex file. In that example, the cyberbot module is used, but the steps of adding the multimeter.py module are similar.You can also download and view the multimeter.py by clicking these items in the python.microbit.org editor:
To view its code, drag it into the python.microbit.org editor. Keep in mind that this code is not a script and so cannot run on its own. It has to be imported into your script, and then your script calls its functions.
Take a closer look at the while True: loop. The multimeter module has a function named continuity(), which returns True if it detects an electrical connection, or False if it does not. In connected = continuity(), the variable connected stores the True/False result continuity returns. When connected stores True , the statements in if connected == True makes the display show a checkmark with display.show(Image.YES). Otherwise, statements in the else block display the not-connected circle with a slash with display.show(NC). Note: NC is property of the multimeter module.
while True: connected = continuity() if connected == True: display.show(Image.YES) #music.pitch(3000, 100) else: display.show(NC) sleep(50)
Links
[1] https://learn.parallax.com/sites/default/files/content/Python/breadboard/mp4/terminal-strips-for-electrical-connections.mp4
[2] https://learn.parallax.com/sites/default/files/content/Python/breadboard/mp4/bus-strips-for-electrical-connections.mp4
[3] https://learn.parallax.com/sites/default/files/content/Python/breadboard/mp4/connect-continuity-probes-to-breadboard.mp4
[4] https://python.microbit.org
[5] https://learn.parallax.com/sites/default/files/content/Python/breadboard/hex/continuity_tester.hex
[6] https://python.microbit.org/v/2
[7] https://learn.parallax.com/sites/default/files/content/Python/breadboard/mp4/download-measure-continuity-hex.mp4
[8] https://learn.parallax.com/sites/default/files/content/Python/breadboard/mp4/continuity-tester-concept.mp4
[9] https://learn.parallax.com/sites/default/files/content/Python/breadboard/mp4/continuity-measurements.mp4
[10] https://learn.parallax.com/tutorials/robot/cyberbot/add-modules-your-microbit