Skip to content

Week 13: IoT. Administration of IoT in schools.

Assignments

  • Connect your microcontroller board with other device
  • Reflection questions

Smart Farm with Micro:bit and IoT

For this week’s assignment I am working on a previous project I built a year ago. I purchased a Smart Agriculture Kit to be used with the micro:bit and I integrated it with a LEGO farm.

photo

Previously, I managed to make all the sensors work and display data on a small OLED display. I also included a small water pump that is activated when the soil moisture goes below a certain value.

The kit includes an IoT expansion board which uses an ESP8266 for Wi-Fi and serial communication with the micro:bit. It also extends the available I/O ports of the micro:bit using GVS (ground, voltage, signal) pins. The IoT:bit also includes a buzzer and an onboard RTC clock with its own power supply.

  • photo
  • photo

My aim is to refine the code (using the MakeCode platform), as I think I have too many operations running in parallel and that is affecting the correct functioning of some sensors, such as the PIR and distance sensors, which are not very reliable.

I also want to make the most of the IoT expansion board and connect to a platform that receives the sensor data so it can be visualised in graphs.

Improving the code

Here I show how I used the pins to connect the sensors:

  • P14: DHT11 (temperature + humidity)
  • P2: Soil moisture (0–100)
  • P3: Water level (0–100)
  • P16: DS18B20 (water temperature)
  • P13: Ultrasonic (Sonar:bit distance)
  • P10: PIR digital read
  • P15: NeoPixel
  • P9: Relay / pump control

sample photo

Before, I had three “forever” loops and now I have only one, with the rest of the loops working as “Every x ms”. For example, the reading and displaying of sensors runs every 3000 ms. I also included variables such as pumpStart and pumpRunning, and used running time (ms) to make the pump work in bursts of 2 seconds rather than working continuously.

sample photo

IoT

To send the data via Wi-Fi to a platform I am using ELECFREAKS Smart IoT, which focuses on STEAM education, collecting and visualising real-time sensor data.

In MakeCode it is necessary to add the Environment and Science IoT extension, which adds the menus to control the ESP8266_IoT menu, the OLED display, the sensor readings, and the RTC1307 clock.

To be able to upload the sensor readings to the Smart IoT platform it is necessary to connect the board to the internet using the SSID and key of the local Wi-Fi. After creating an account in Smart IoT you get a user token (a code). Then you create a device or project (in my case “Smart_Farm”) which is assigned a topic (number). With this information you can connect the micro:bit + the IoT board to the Smart IoT server.

sample photo

The data visualisation consists of a line chart that gets updated every time that new data is uploaded by the micro:bit. There are other graphs you can add such as gauges, pie charts, and numeric displays. For my project I created gauges for each uploaded sensor value: ambient temperature, ambient humidity, soil moisture, water tank level, and water temperature.

sample photo sample photo

The photo shows the electronics and sensor integration to make the smart farm. sample photo

This includes a greenhouse alarm that uses the PIR and distance sensors to detect intruders. If activated, the green LED turns red. There is also a weather station that monitors ambient temperature and relative humidity. The smart farm includes automatic irrigation. The soil moisture sensor sends readings to the microcontroller and the pump starts automatically if the value is less than the threshold. You can also monitor the water level and temperature in the water tank and display its status on the OLED screen and in the Smart IoT interface.

The video shows how the Smart IoT platform receives data from the sensors.

Reflection

  • What are some opportunities in your context to work within your local community? Who you could collaborate with? How? What should happen to succeed in the collaboration?

I work in a makerspace with centres in rural areas that are open to the general public, schools, and organisations. There are many opportunities to work with local communities, such as local administrations, non-governmental organisations, women’s associations, artisans, entrepreneurs, and local schools. In this way, the makerspace becomes a connector between different local stakeholders.

This creates opportunities to develop projects that respond to real local needs while also promoting participation, creativity, and skills development. For example, collaborations could focus on digital fabrication, local entrepreneurship, traditional crafts, or educational activities for children and young people.

Working with these groups also allows the makerspace to act as a meeting point where knowledge, resources, and ideas can be shared. By collaborating with local stakeholders, it is possible to strengthen community ties, support innovation in rural areas, and create learning opportunities that are relevant to the local context.

  • What are the next steps in development further a makerspace in your school? How do you envision the maker space?

As a makerspace of recent creation, we need to focus on building strong local ties with our stakeholders and developing a large, diverse community of makers who understand and make the most of the potential of this type of space.

At the same time, we need to ensure that we have clear and measurable objectives, continue the professional development of staff, and establish strong policies and effective internal management of resources.

I envision the makerspace as a dynamic, inclusive, and collaborative environment that becomes a reference point for innovation, creativity, and learning in the local area. It should be a place where students, educators, families, entrepreneurs, artisans, and community members can come together to learn, experiment, and develop projects that respond to local needs and opportunities.

  • What is the potential of physical computing and IoT for your teaching? Do you have any ideas on how you are planning to integrate those techniques in your context?

Physical computing and IoT have great potential in teaching because they allow students to connect programming, electronics, data, and real-world problem solving in a meaningful way.

Many microcontrollers include connectivity features such as Bluetooth and Wi-Fi, and there are educational expansion boards and kits, like the one I used in this assignment, that make it easier to explore IoT applications. The use of IoT protocols for sending and receiving data, together with platforms for visualising that data, makes these technologies especially suitable for educational projects in different fields such as agriculture, fire prevention, security, environmental monitoring, and home automation.

I way to integrate these techniques is through project-based learning activities in which students identify a local problem or need and develop a simple connected solution. For example, they could create systems to monitor temperature, humidity, air quality, or soil moisture. In this way, physical computing and IoT can support not only technical skills such as coding and electronics, but also creativity, collaboration, and critical thinking.

Tools