Bit by Elecfreaks
Overview
Bit by Elecfreaks
Overview
Bit by Elecfreaks is an excellent choice for anyone looking to explore the world of IoT and smart home automation. With its comprehensive range of sensors, wireless communication capabilities, and ease of use, this kit provides a solid foundation for developing innovative and practical smart home projects.
3.3V
Wi-Fi, Bluetooth, Zigbee
| + Temperature | 1C |
| + Humidity | 5% |
| + Light | 10 lux |
| + Sound | 5 dB |
| + Motion | 1m |
| Bit Compatibility | 100% compatible with Micro:Bit V1 and V2 |
Conclusion
Smart Home Kit with Sensors Compatible with Micro:Bit by ElecfreaksOverviewThe Smart Home Kit with sensors is a comprehensive IoT component designed for use with the Micro:Bit microcontroller board. This kit provides a range of sensors and modules that enable users to create intelligent home automation systems, monitoring environmental conditions, and detecting various parameters. The kit is compatible with the Micro:Bit board, making it an ideal choice for educational projects, prototyping, and DIY enthusiasts.Kit ComponentsMicro:Bit compatible board
Temperature and Humidity sensor (DHT11)
Light sensor (LDR)
Sound sensor (Microphone)
PIR Motion sensor
3-Color LED module
Buzzer module
Jumper wires and breadboardTechnical SpecificationsOperating Voltage: 3.3V
Communication Protocol: I2C
Connectivity: Micro:Bit compatible headers
Dimensions: 65mm x 55mm x 20mm (main board)Code Examples### Example 1: Temperature and Humidity MonitoringIn this example, we will use the DHT11 temperature and humidity sensor to monitor environmental conditions and display the readings on the Micro:Bit's LED display.Code:
```python
from microbit import
import ustructwhile True:
# Read temperature and humidity data from DHT11 sensor
temp_humd = i2c.read(0x27, 5)
temp = ustruct.unpack('H', temp_humd[0:2])[0]
humd = ustruct.unpack('H', temp_humd[2:4])[0]# Display temperature and humidity readings on Micro:Bit's LED display
display.scroll("Temp: " + str(temp) + "C, Humd: " + str(humd) + "%")# Wait for 1 second before taking the next reading
sleep(1000)
```
### Example 2: Motion-Activated LED LightingIn this example, we will use the PIR motion sensor to detect motion and trigger the 3-Color LED module to turn on when motion is detected.Code:
```python
from microbit importwhile True:
# Read PIR motion sensor data
pir_data = pin0.read_digital()# If motion is detected, turn on the 3-Color LED module
if pir_data == 1:
pin1.write_digital(1) # Turn on the LED module
sleep(500) # Keep the LED on for 500ms
else:
pin1.write_digital(0) # Turn off the LED module
```
### Example 3: Sound-Activated BuzzerIn this example, we will use the sound sensor to detect loud noises and trigger the buzzer module to emit a warning sound.Code:
```python
from microbit importwhile True:
# Read sound sensor data
sound_data = pin2.read_analog()# If the sound level is above a certain threshold, trigger the buzzer
if sound_data > 500:
pin3.write_digital(1) # Turn on the buzzer module
sleep(200) # Keep the buzzer on for 200ms
else:
pin3.write_digital(0) # Turn off the buzzer module
```
Note: In these examples, we assume that the Micro:Bit board is connected to the Smart Home Kit's sensors and modules according to the manufacturer's instructions. Additionally, the code examples provided are for illustration purposes only and may require modifications to suit specific use cases.