Today we learnt how to use fritzzing whitch is a piece of software for PC/Mac/linux that has a simple interface that allows you to build/design a circuit in 3 formats: breadboard circuit, schematic and PCB layout.
In addition we started to use BBC Micro:bit which is a is a powerful self-contained microcontroller.
what is it containes:
It has a 16 MHz 32-bit ARM Cortex-M0 microcontroller, 256 KB flash memory, 16 KB static RAM, 2.4 GHz Bluetooth low energy wireless networking. It provides voltage regulation from the USB supply (4.5-5.25 V) down to the nominal 3.3 volts used by the rest of the PCB. When running on batteries this regulator is not used. It also has:
- a 3-axis accelerometer sensor via I²C-bus
- a 3-axis magnetometer sensor via I²C-bus (to act as a compass and metal detector)
- light sensor (it uses the LEDs array!)
- temperature sensor (it uses the microcontroller itself!)
- radio and bluetooth antenna
- a MicroUSB connector
- battery connector
- 25-pin edge connector
- 25 LEDs in a 5×5 array.
- Three tactile pushbuttons (two for applications, one for reset).
We used the online code editor to write and upload programs to the microbits. It can be done using a block coding approach, which will convert our code to javascript, or we can write our programs in micropython (guide and online editor).
We tried a tutorial which is called Smiley button:
First we wrote the program in the online code editor
after we uploded the generated code to our microbit and we got a smiley face 🙂
Simple digital circuit with input and output – using Micro:bit
Last time we created an analog circuit to turn on an LED when a button is pressed, then fade it out using a capacitor when the button is released. Now we did the same using the Micro:bit, which is a digital system. We will make use of one of the LEDs on the 5×5 array that are built into the Micro:bit.
More complex analog circuit to switch on an LED – using an LDR connected to the Micro:bit
Light level meter
Light dependent resistors (LDRs), also known as photo resistors, are light sensitive components most often used to indicate the presence / absence of light or to measure the light intensity. In low light, their resistance is very high but when the LDR sensor is exposed to light, the resistance drops dramatically.
How to connect the LDR to the microbit:
- Disconnect the micro:bit from your computer and disconnect the battery pack.
- Use a crocodile clip to connect either leg of your LDR to either end of your resistor.
- Connect another crocodile clip from the other end of your resistor to GND on your micro:bit.
- Connect a crocodile clip to the remaining leg of your LDR and attach it to Pin 0.
What we need
- BBC micro:bit
- Micro USB cable
- Battery pack with 2 x AAA batteries
- 1 x Miniature Light Dependent Resistor (LDR)
- 1 x 10kΩ resistor
- 3 x Crocodile clip leads
The final result: