Example Code for MakeCode-Alcohol concentration detector(Based on BeeBotte)
In this tutorial, we will simulate a smart alcohol monitoring system. An alcohol concentration sensor installed in a vehicle uploads real-time data to the Beebotte platform. By monitoring the uploaded values, users can identify vehicles with alcohol levels exceeding a predefined threshold (for example, 800 as an assumed drunk-driving limit). This demonstrates how IoT technology can be used to remotely monitor data and improve efficiency in real-world applications.
Hardware Preparation
- MBT0039 micro:bit board x 1
- MBT0008 IO Extender for micro:bit x1
- SEN0128 Analog Alcohol sensor x1
- WiFi IoT module x1
- Wires
Software Preparation
This section mainly introduces how to use the WiFi IoT module and how to program it using MakeCode.
MakeCode Programming Platform:
https://makecode.microbit.org/
I2C Library:
MakeCode I2C Library – DFRobot WiFi IoT
Wiring Diagram

How to use BeeBotte
Open BeeBotte website: https://beebotte.com/login. Register an account and log in.

Enter the following interface when logged in. Click "Create New" to create a new channel.

Write in the corresponding Channel name and resource according to the tip.

Click "Create channel" to build up your own BeeBotte Channel.

Check the channel token in the created channel of BeeBotte.

Sample Code
Program Link
https://makecode.microbit.org/_8PbTJAFPL2CH
Program Blocks

Result
Check the alcohol concentration on the corredsponding channel in BeeBotte.

Turn the received data into line chart, table, etc

Was this article helpful?
