+21622886281
App Inventor DC Motor Micro:bit

Control a small fan with a smartphone and the Micro:bit

Purpose of this tutorial:

In this tutorial, we will control a small fan by bluetooth using the Micro: bit card and a smartphone.

we create two programs: a mobile application with App Inventor for the smartphone and a makecode program for the Micro: bit card.

Necessary components

  • Micro:bit
  • Smartphone
  • Fan
  • Relay
  • Test plate

  • Connecting wires

Mounting

To build the assembly we can connect:

Relay:

  • pin S  to pin P1 of micro:bit
  • pin (-)  to GND pin of micro:bit
  • pin (+)  to 3.3V pin of micro:bit
  • pin ON to 5v energy

Fan:

  • the first terminal to the COM pin of the relay

  • the second terminal to the GND terminal of the Micro:bit card

There are many mounting methods and here are some examples:

Mounting 1

Mounting 2

Makecode program

Here is the makecode program which allows you to connect the Micro: bit card to the smartphone and to receive a message containing the order to start or stop the fan.

Creation of the application with App Inventor:

We create a mobile application named ‘start_ventilator’ with App Inventor which allows remote control of the fan.

We propose to create the design of the application, with the following visual:

Programming with App Inventor

To program the application, App Inventor offers us to use the Blocks space, which allows you to create a program in the form of a block diagram. Very easy to use but requiring a little programming logic.

Here is the program of the application created in the Blocks area of ​​the Inventor App:




0 commentaire


Leave a comment

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Scroll to Top