---
# System prepended metadata

title: How to create a Smart Door Bell

---

# How to create a Smart Door Bell
## Overview
My name is Amandus Bengtson (ab224xy). My Project is about building a prototype of a smart door bell. The device can sense light/darkness, turn on/off led depending on the environment's amount of light. The button triggers a melody simultaneously as it measures the environment’s temperature and humidity. Approximately this project would take about 5-10 hours. 
### Objective
I chose this project because as a beginner I wanted to learn the basics before building something more advanced. The purpose was to learn basic IoT concepts that might be useful later on and could be used in combination with web development. I hope my project will give me insights in an IoT design process. Data that's been sent to the cloud could later be used to showcase an apartment's temperature or humidity when not home, this would be in a later project state, a couple of changes will need to be done before that would be possible. This project could also be combined with an LCD Screen module.

## Material
In this project I've chosen to use the [Raspberry Pi Pico W](https://projects.raspberrypi.org/en/projects/get-started-pico-w/1). MicroPython is a version of Python that that allows you to interact with electronic microcontrollers. The Rasperry Pi Pico W is a low-cost (≈100SEK) microcontroller with  built-in WiFi connectivity, analogue and digital pins, which allows you to use components that needs ADC (Analogue to Digital converter) pin to work properly. The breadboards are connecting components like the sensors and the actuators to the microcontroller, "the brain" (picture from [Elektrokit](https://www.electrokit.com/produkt/raspberry-pi-pico-wh/). 

![Fig.1](https://hackmd.io/_uploads/H12JQ42oJg.jpg)
> Figure 1.The Rasperry Pi Pico W [Pico W](https://www.electrokit.com/raspberry-pi-pico-wh)


&nbsp;

>![Figure 2] (https://m.media-amazon.com/images/I/61p+QTbMf5L.jpg =360x) 
> Fig. 2. Breadboard Mini x2 [Like this one](https://www.electrokit.com/en/product/solderless-breadboard-400-tie-points/?gclid=Cj0KCQjw1rqkBhCTARIsAAHz7K0yFEuPeyK3DJbx-Z9VI07mRCNT7Zmk93HBuFtZAhFpe3ab_X0xsPsaAqtTEALw_wcB)

The rest of the materials and the specifications of use is described in tables down below. 

### List of material:
| Tech & Kits              | Used material                                                                                                                                                  | Price + Store                                                                                                                                                                                                                          |
| -------- | -------------------- | ------- |
| LNU Starter Kit          | Raspberry Pi Pico W, Breadboard, USB A -> Micro B, Jumping wires Male-Male, LED 5mm green fuzzy, resistor 4-Band, Digital Temperatur- and Humidity Sensor DH11 | 399 SEK, [Elektrokit](https://www.electrokit.com/produkt/start-kit-applied-iot-at-linnaeus-university-2023/)                                                                                                                           |
| Sensor Kit, 25 modules   | Push button momentary, lightsensor, Passive Buzzer                                                                                                             | 299 SEK, [Electrokit](https://www.electrokit.com/produkt/sensor-kit-25-moduler/)                                                                                                                                                       |
| Addon Tech |USB C -> USB 3.0 adapter. You need one of these adapters if your computer doesn't have built in USB A connector to connect Pico to computer.                                                                                             | 259 SEK, [Webbhallen](https://www.webhallen.com/se/product/218809-Apple-USB-C-till-USB-adapter?channable=00c0c76964003231383830395f&gclid=CjwKCAjwp6CkBhB_EiwAlQVyxXI2ty1TxXnTAhff1FPrbDqdWlaU1UxNCIuRftkFJ2H2BVi5ebDLBxoCbXAQAvD_BwE) |

### List of Specifications
Below you see pictures of material, source [Electrokit](https://www.electrokit.com/en/).
| Product             | Specifikation                    |
| --------------- | -------------------|
|  Momentary Push Button Module![Push Button]![push_button](https://hackmd.io/_uploads/rkoL4Nnokl.jpg =200x)| A button that triggers an action, in this case trigger buzzer turning on melody.  [Elecrokit](https://www.electrokit.com/en/product/momentary-push-button-module/)
| Jumping Wires, male to male pins.![jumping_wires](https://hackmd.io/_uploads/HJyDS42jJl.jpg =200x) | Connecting everything. [Electrokit](https://www.electrokit.com/en/product/jumper-wires-40-pin-30cm-male-male/) |
Light Sensor module (a.k.a. Photoresistor module) ![light_sensor](https://hackmd.io/_uploads/Hk_Vv42iye.jpg =200x)| A light sensor that measures the detected light. In this case, it determines the amount of light or the amount of darkness. A specific amount of darkness triggers action that LED turns on, and a specific amount of light turns LED off. [Electrokit](https://www.electrokit.com/en/product/light-sensor-module/) |
| Green LED ![Green LED]![green_light](https://hackmd.io/_uploads/HkJCvNhs1e.jpg =200x)| A diffused LED diod. [Electrokit](https://www.electrokit.com/produkt/led-5mm-gron-diffus-80mcd/)                                                                                                                                                                                                           |
| Temperature and humidity Sensor (DH11) ![DH11]![temperature_humidity](https://hackmd.io/_uploads/H11-_43iyl.jpg =200x)| Measures temperature and humidity in digital output data. [Electrokit](https://www.electrokit.com/produkt/digital-temperatur-och-fuktsensor-dht11/)                                                                                                                                                                                                                                                   |
| Piezo Alarm passive ![Piezo Alarm passive]![piezo_alarm](https://hackmd.io/_uploads/BkSQ_Vni1l.jpg =200x)|   A buzzer that generates tones from different frequencies by switching it on and off. In my projects it genrates a melody from programmed notes. [Electrokit](https://www.electrokit.com/en/product/piezo-alarm-passive/)                                                                                                                                                                                                                                                                                                         |
| Resistor ![resistor](https://hackmd.io/_uploads/Sk3rdNnj1l.png =200x)|           Approximate value of 330 Ω ±10% (K) according to [this resistor calculator](https://www.calculator.net/resistor-calculator.html?bandnum=4&band1=orange&band2=orange&band3=blue&multiplier=brown&tolerance=silver&temperatureCoefficient=brown&type=c&x=67&y=22)     A resistors task is to limit the voltage in a circuit, to not overcharge a microcontroller with an electronic component. [Electrokit](https://www.electrokit.com/en/product-category/resistors/)     [,approximately this one](https://www.electrokit.com/produkt/motstand-kolfilm-0-25w-10kohm-10k/)                                                                                                                                                                                                                                                                                      |
## Computer setup
I used Mac OS, Vistual Studio Code IDE. [The Official Raspberry site](https://www.raspberrypi.com/documentation/microcontrollers/micropython.html#drag-and-drop-micropython) (video below) offers a good demo for the basic  setup: 
{%youtube D588q_uVHBw %}
At the same site there is also other good documentation and tutorials. After connecting your pico to the computer, follow these steps in this [part 1 tutorial](https://hackmd.io/SvANKoxnSf-uR_nW76ejxw?view#Mac-OS). 

- [ ] 1. Start with download and install the plugin Node.js [here](https://nodejs.org/en/download). I chose LTS package and Mac OS. Follow installation instructions.
- [ ] 1.2 verify in terminal by insert this which <font color="blue"> node</font>. 
- [ ] 1.3 Install verified when you get output similar to <mark>/usr/local/bin/node</mark>
- [ ] 2. Install Visual Studio Code [here](https://code.visualstudio.com/Download)
- [ ] 3. Open Extension Marketplace in VS Code and search for the extension <mark> Pymakr</mark> (Official Pymakr plugin, titled <font color="blue"> Pymakr 2 </font> like in image below) ![image](https://github.com/amandusbengtson/IoT-project-2023/blob/main/hackmd%20report%20stuff/VSCode%20screenshot.png?raw=true) 
- [ ] 3.2 Now you should see Plugin view as shown in video below. When connecting your Pico it will show up under <font color="orange">devices</font>. <iframe width="801" height="501" src="https://www.youtube.com/embed/qC2iazihGlA" title="Verified plugin Pymakr UI" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>

Now you are <font color="green"> almost ready to connect your Pico</font>. 
> :memo: Remove the black ESD sponge  before connect your Pico to prevent further issues. It's attached under your Pico.

&nbsp;
After this you need to flash (install micropython firmware) your pico. 
- [ ] Choose the latest micropython firmware [here](https://micropython.org/download/rp2-pico-w). You will get a <font color="orange"> uf2 file</font>.
 
- [ ] :bulb: Hold in the BOOTSEL button to connect pico as a massmedia device. Release the button after connecting Pico to your computer. 
- [ ] :memo: That drive you will see is called RPI-RP2. Copy/paste the uf2 file in Pico storage using finder. Do not disconnect until firmware installation is done.

After flashing is done, open VS Code. Now Pico will show under devices. Create new project, choose <font color="indigo"> 
- [ ]     1. project name. 
- [ ]     2. location.  
- [ ]     3. empty template.
</font> 
:man-tipping-hand: If problem, follow instructions from [this Raspberry Pi Documentation](https://www.raspberrypi.com/documentation/microcontrollers/micropython.html). 
:+1: Remember to put VS Code in <font color="blue">development mode</font>. That way any changes uploads and overwrites automatically on the pico.
An other way to run code on the pico is to right-click your main.py file, choose <font color="red">Pymakr</font> and "run file on device". "Run file on device" is how the code is uploaded through the micro B USB connected to the computer.

## Putting everything together
The electronic components is connected between two breadboards. Raspberry pi pico w, resistor, led and a lightsensor on one. The dh11 sensor, push button and buzzer module on the other breadboard. In terms of resistor and voltage, whatever resistor type works. I used resistor with  value of 330 Ω ±10% (K), worked fine. In this stage my device is only used for development and learning. 
In the circuit diagram below you see what my project looks like finished. The red and black wire connects the second breadboard to the Pico Breadboard (left one). The red one represents Power Supply(VCC) and is connected to Pin36(3V3 Out). The black one represents GND and connects everything to GP38. 

&nbsp;
>![image](https://github.com/amandusbengtson/IoT-project-2023/blob/main/hackmd%20report%20stuff/everything%20put%20together%203.png?raw=true)
> ![image alt](https://github.com/amandusbengtson/IoT-project-2023/blob/main/hackmd%20report%20stuff/pico_pins_map.png?raw=true) 
>:bulb: In the best of worlds I would have used the same color for every kind of connection type. That would be much easier. It's highly recommended to use black wires for GND, blue for Signal and orange for Minus.

The GIF's below will show how to connect the electronic components step-by-step. Let's start to connect one component at a time.
#### Step 1
![dh11 gif 1](https://github.com/amandusbengtson/IoT-project-2023/blob/main/hackmd%20report%20stuff/step%201%20dh11%20github/dh11%20animation_1,2.gif?raw=true)
:bulb: GND means ground, VCC, power suply, and Signal Pin is for the data transfer part.
 DH11 Signal (blue wire) connects to Pico GP27. Orange and green wire connect to the second breadboard [Bus Strip](https://www.sciencedirect.com/topics/engineering/breadboard).
- [ ]  Place the material like Gif down below. Now you connect the jumping wires.
![dh11 gif 2](https://github.com/amandusbengtson/IoT-project-2023/blob/main/hackmd%20report%20stuff/step%201%20dh11%20github/dh11%20animation%202,1.gif?raw=true)
- [ ] Done with step 1.
![dh11 completed](https://github.com/amandusbengtson/IoT-project-2023/blob/main/hackmd%20report%20stuff/step%201%20dh11%20github/DH11_2_breadboards.png?raw=true)

#### Step 2
![lightsensor+led 1](https://github.com/amandusbengtson/IoT-project-2023/blob/main/hackmd%20report%20stuff/step_2_lightsensor+led%20github/lightsensor_+_led_animation%201,2.gif?raw=true)
- [ ] Now it's time for connection. 
Collect some jumping wires, preferably choose one color representing for example Power Supply. 
Connect the resistor to GP15, the same Pin provides the led with Power. The green wires connects to the sencond breadboard. The lightsensor connects Signal (white/gray wire) to GP28(ADC = Analog-to-Digital Converter). The middle white/gray wire provides lightsensor with Power Supply and the pink wire connects to GND from Bus Strip.
![lightsensor+led 2](https://github.com/amandusbengtson/IoT-project-2023/blob/main/hackmd%20report%20stuff/step_2_lightsensor+led%20github/lightsensor_+_led_animation_2,1.gif?raw=true)
- [ ] The connections should look like image below.
![lightsensor+led 3](https://github.com/amandusbengtson/IoT-project-2023/blob/main/hackmd%20report%20stuff/step_2_lightsensor+led%20github/lightsensor+led_finished.png?raw=true)

#### Step 3
![push_button_1](https://github.com/amandusbengtson/IoT-project-2023/blob/main/hackmd%20report%20stuff/step_3_Push%20Button_github/push_button_1,2.gif?raw=true)
- [ ]  Place the material like Gif down below. Now you connect the jumping wires.
![push_button_2](https://github.com/amandusbengtson/IoT-project-2023/blob/main/hackmd%20report%20stuff/step_3_Push%20Button_github/push_button_2,2.gif?raw=true)
- [ ] The blue Signal wire connects to the GP16 Pin. The red and black wires connects to the GND Pin and Power Supply Pins.
![push_button_3 finished](https://github.com/amandusbengtson/IoT-project-2023/blob/main/hackmd%20report%20stuff/step_3_Push%20Button_github/Push_Button_finished.png?raw=true)

#### Step 4
- [ ] Last part of connecting components.
![passivebuzzer1](https://github.com/amandusbengtson/IoT-project-2023/blob/main/hackmd%20report%20stuff/step_4%20-%20github/buzzer_step1.gif?raw=true)
- [ ] Put the components onto the breadboards.
![passivebuzzer2](https://github.com/amandusbengtson/IoT-project-2023/blob/main/hackmd%20report%20stuff/step_4%20-%20github/buzzer_step2,1.gif?raw=true)
- [ ] Connect the yellow Signal wire to Pico GP26 and the gray GND wire to the Bus Strip. 
>:notebook_with_decorative_cover: Note that the buzzer connection pins are mirrored.  Irl minus (-) left, GND middle and Signal right side.
![passivebuzzer3-finished](https://github.com/amandusbengtson/IoT-project-2023/blob/main/hackmd%20report%20stuff/step_4%20-%20github/buzzer_step_3_3,1_finished.png?raw=true)

## Platform
In this project i'm using Ubidots STEM (free version of Ubidots). The platform is user friendly and offer several widgets and other functionalities. All widgets are placed in the device's "dashboards" there you can place widgets in dynamic ways. Dashboards visualize the data sent from the physical device. In the event of scaling my idea, it may be relevant to try out Google's IoT platform or any other Big Data Platform. In comparison, Ubidots STEM is both a Low Data Platform and the free version of the actual Ubidots service.

## The code
Find the full code and other materials in Project Github Repository [here](https://github.com/amandusbengtson/IoT-project-2023/blob/main/README.md). And [here](https://github.com/amandusbengtson/IoT-project-2023/tree/main/hackmd%20report%20stuff/LNU_IoT_libraries) you will find the used LNU material I have used in this project. Here is the direct link to the [source repository](https://github.com/iot-lnu/applied-iot/tree/master/Raspberry%20Pi%20Pico%20(W)%20Micropython). 

---
Libraries, explanation in the code snippet.
``` python
import machine #enables communication between machine and Pico.

from machine import Pin, PWM, ADC #library and Pin import and define Pin PWM and ADC.

from utime import sleep # utime provides functions for relevant time, date, measuring time intervals and delays

import time #library time module import provides various time-related functions

import dht # this library calls upon the Digital Humidity & Temperature sensor functionality

import network # provides drivers and routing configuration

import urequests as requests # urequests provide the HTTP protocol requests

import random # imports random numbers

from secrets import secrets # imports information from the secrets.py file

from time import sleep # imports sleep functions from time
```
---
Code below demonstrates that the code has value 2 second delay. I changed it from 5 seconds, because 5 seconds was too long interval delay.
``` python
DELAY = 2  # Delay in seconds
```
----
This code send data to Ubidots REST API through communication protocol HTTP. The [urequests module is used for convenient](https://docs.micropython.org/en/v1.14/esp32/quickref.html?highlight=urequests%20requests) HTTP requests. 
``` python
def sendData(device, variable, value):
    try:
        url = "https://industrial.api.ubidots.com/"
        url = url + "api/v1.6/devices/" + device
        headers = {"X-Auth-Token": secrets["TOKEN"], "Content-Type": "application/json"}
        data = build_json(variable, value)
        if data is not None:
            print(data)
            req = requests.post(url=url, headers=headers, json=data)
            return req.json()
        else:
            pass
    except:
        pass
```
----
This infinite loop calculates darkness and light. Darkness prints in %, value 70, it's dark enoough to turn led on. The sendData function sends data with information from secrets.py file, REFL value 1. If not dark, then led turn off, value 0. Delay time.sleep interval 1 second.
``` python
while True: # While loop
    light = ldr.read_u16()
 darkness = round(light / 65535 * 100, 2)*100 #senses how dark it is to turn led on
 if darkness >= 70:
        print("Darkness is {}%, LED turned on".format(darkness))
        led.on()
        VARIABLE_LABEL = "led_status"
        returnValue = sendData(secrets["DEVICE_LABEL"], VARIABLE_LABEL, 1)
        sleep(DELAY)
    else:
        print("It is enough light, no need to turn the LED on")
        led.off() 
        VARIABLE_LABEL = "led_status"
        returnValue = sendData(secrets["DEVICE_LABEL"], VARIABLE_LABEL, 0)
        sleep(DELAY)
    time.sleep(1)
```
---
This defines the string that collects information, in secrets.py file from device, variable and value (labels linked to Ubidots). The code sends data to Ubidots if button pressed, value 0. For example, sendData(secrets)["DEVICE_LABEL"], VARIABLE_LABEL, temperature) find and collect information from secrets.py file, device label and variabel label is created at Ubidots. The code strings connects Pico code to Ubidots. 
This code print("Temperature is {} degrees Celsius and Humidity is {}%".format(temperature, humidity)) determines that temperature and humidity is printed in percent and the temperature is presented in Celsius.
``` python
if (button_value == 0):  # if the putton pushed
try: #python keyword
                tempSensor.measure()
                temperature = tempSensor.temperature()
                VARIABLE_LABEL = "temperature"
                returnValue = sendData(secrets["DEVICE_LABEL"], VARIABLE_LABEL, temperature) #send data
                sleep(DELAY)
                humidity = tempSensor.humidity()
                VARIABLE_LABEL = "humidity"
                returnValue = sendData(secrets["DEVICE_LABEL"], VARIABLE_LABEL, humidity)
                sleep(DELAY)
                print("Temperature is {} degrees Celsius and Humidity is {}%".format(temperature, humidity))
        except Exception as error:
                print("Exception occurred", error)
```
---
If the button pressed, DH11 collects and sends data. At the same time a melody plays from the passive buzzer. The code present the song that is collected from the notes in main.py file and make it possible for the buzzer to generate the sound.The song's source code did not identify the song but I believe it is "smoke on the water". 
``` python
song = ["E5","G5","A5","P","E5","G5","B5","A5","P","E5","G5","A5","P","G5","E5"]
```
---
This is for the Wi-Fi connection, the Wi-Fi functions. Checks if Pico connected or not. Wlan.active(True) activate network interface and configure and connects to Wi-Fi, which the secrets.py file provides with SSID and Password. REFL prints "connected" + IP if it worked.
``` python
def connect():
    wlan = network.WLAN(network.STA_IF)         
    if not wlan.isconnected():                  
        print('connecting to network...')
        wlan.active(True)                       
        wlan.config(pm = 0xa11140)
        wlan.connect(secrets["WIFI_SSID"], secrets["WIFI_PASS"])  # Your WiFi Credential
        print('Waiting for connection...', end='')
        # Check if it is connected otherwise wait
        while not wlan.isconnected() and wlan.status() >= 0:
            print('.', end='')
            sleep(1)
    # Print the IP assigned by router
    ip = wlan.ifconfig()[0]
    print('\nConnected on {}'.format(ip))
    return ip
```
---

## Transmitting the data / connectivity
The data is sent every 2 seconds or when the button is pressed, then after 0,1 seconds. I used the wireless protocol Wi-Fi and transport protocol HTTP (REST API). I chose this because a door bell is usually outside a door, and that would mean that it could connect to a low-range wireless protocol like Wi-Fi. HTTP transmitting a bit slower than MQTT. I tried but MQTT did not work correctly. 5 seconds delay felt close enough to real-time, as the choice of HTTP, the data wouldn't transmit in real-time anyway. But that was wrong. I changed to 2 seconds and now it transmits the data for sure in real-time.

## Presenting the data
The Dashboard is built with Ubidots TOKEN and DEVICE_LABEL, linked to the project file from secrets.py file. This connected Pico to Ubidots. Then I configured temperature value, humidity value and led status value which connected to Ubidots Widgets. The data is saved in the Ubisoft database with a 2 sec interval.
<iframe width="717" height="403" src="https://www.youtube.com/embed/FgrgU4ae9ck" title="Presenting the data" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>


![Dashboard 1](https://github.com/amandusbengtson/IoT-project-2023/blob/main/hackmd%20report%20stuff/Dashboard/Screenshot%202023-06-28%20at%2016.10.51.png?raw=true)

![Dashboard2](https://github.com/amandusbengtson/IoT-project-2023/blob/main/hackmd%20report%20stuff/Dashboard/Screenshot%202023-06-28%20at%2016.16.07.png?raw=true)

I chose Ubidots STEM because it was the one platform that I got to work. I did try Adafruit IO with MQTT protocol but it did not work properly, not even with the help from TA's. 


## Finalizing the design
I am really happy about how the project turned out.

<iframe src="https://poly.cam/capture/1D88B657-00C2-4D94-9DB9-8F04F54F0CD0" title="polycam capture viewer" style="height:60vmin;width:100%;max-height:720px;max-width:1280px;min-height:280px;min-width:280px" frameborder="0"></iframe>

This 3d-scan does not do this device justice, but it's pretty cool that it worked that well. It did not capture the cables very well though. 

![bild 1](https://github.com/amandusbengtson/IoT-project-2023/blob/main/hackmd%20report%20stuff/finalizing_the_design_images/final_1.JPG?raw=true)

![bild 2](https://github.com/amandusbengtson/IoT-project-2023/blob/main/hackmd%20report%20stuff/finalizing_the_design_images/final_2.JPG?raw=true)

![bild 3](https://github.com/amandusbengtson/IoT-project-2023/blob/main/hackmd%20report%20stuff/finalizing_the_design_images/final_3.JPG?raw=true)

![bild 4](https://github.com/amandusbengtson/IoT-project-2023/blob/main/hackmd%20report%20stuff/finalizing_the_design_images/final_4.JPG?raw=true)

<iframe width="560" height="315" src="https://www.youtube.com/embed/Fx7L1aubeSI" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>


My project probably will stay as a prototype, but if one would develop it further it might be used as a  smart door bell, or a device that can tell the temperature inside/outside and play a melody. And then it would be the most relevant to put it in a door bell shell and add a video stream function with a camera inside a dummy security camera shell.

#### <font color="orange">How to develop this device with actual usefulness?</font>
If this device was in a door bell shell plus add a LCD Screen, then this project would be (more) actually usefull. When it’s dark the led would turn on and the user would be able to see the door bell button. Without trying to find the corridor light button in the dark. It would be relevant to add a more lighty/big led for that functionality.  When pushed the door bell song activates and notifies the house. The temperature and humidity could be placed inside or outside (remotely) the apartment and connected to a LCD for the data presentation. 



#### Final Reflections
In this project and for this report i've used this program/services: 
[fritzing](https://fritzing.org) for the circuit diagrams. [Youtube](https://www.youtube.com) for the video stream service. Github to store and link the repostories and other digital materials. PowerPoint 365 for the GIF Animations and visual demonstrations. In some cases I used iMovie for Mac in combination with Powerpoint. Benosound there I found royal free music, there I used the song [Cute by Benjamin Tissot](https://www.bensound.com/royalty-free-music?tag[]=cute&category=Mood&type=free&sort=relevance). 

I used the app [Poly-Cam](https://poly.cam) for the 3d-scan. Besides exporting components from Fritzing in PNG, in addition I removed in some cases images background with [Adobe Express](https://www.adobe.com/se/express/#). For the melody I used the repository code provided from the course, I do not know exactly the source link but it should be [this one](https://github.com/iot-lnu/applied-iot/tree/master/Raspberry%20Pi%20Pico%20(W)%20Micropython/sensor-examples/P19_Passive_Piezo_Buzzer), more specificaly [this one](https://github.com/iot-lnu/applied-iot/blob/master/Raspberry%20Pi%20Pico%20(W)%20Micropython/sensor-examples/P19_Passive_Piezo_Buzzer/main1.py). More possibly that [this is the source code](https://www.tomshardware.com/how-to/buzzer-music-raspberry-pi-pico) though. Next melody should be [like this one](https://github.com/robsoncouto/arduino-songs/blob/master/gameofthrones/gameofthrones.ino) from Game of Thrones. 

I asked [ChatGPT](https://openai.com/blog/chatgpt) for advice in the creative presentation-and writing process. The AI helped out fine.

Some of my old ideas involved an AI bug detector, another one was to create a Door Bell with video streaming function. These two ideas was a bit too advanced to develop at this moment. In addition it did not seem to exist a camera that could be used for either detecting insects or be used as a video streaming component with Raspberry Pi Pico W. 

Next time I want to do two things differently. First, try another melody and put the source code in a good safe-keeping location. It sounds to me like "smoke on the water", but I am not sure, and the source code did not clarify that. Second, I want to get the visualisation syncronisation part right. I did, as mentioned before, change delay time to 2 seconds but the led indicator does not sync at Ubidots. So in addition in choice of IoT platform I would want to get the MQTT and MQTT Broker with Adafruit to work in unison with HTTP and Ubidots. One other thing is that I would like to simulate the device with a webservice like [Wokwi](https://wokwi.com), because that would be cool to learn and Fritzing did not offer that functionality, atleast not in the free version of Fritzing.

That was everything. I really enjoyed this course and I learned a lot about IoT design processes. And it was really fun to create this kind of academic report.