Skip to content

Commit

Permalink
update smarthome case 9-11
Browse files Browse the repository at this point in the history
  • Loading branch information
samlcy1997 committed Jan 5, 2022
1 parent 77ef370 commit e8998f8
Show file tree
Hide file tree
Showing 25 changed files with 68 additions and 36 deletions.
2 changes: 1 addition & 1 deletion docs/smartHomeIoT/case08.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Case 08: Automatic Sunlight Detecting Curtain
Level: ![level](images/level3.png)

![auto_fit](images/Case8/blank.png)<P>
![auto_fit](images/Case8/intro.png)<P>

## Goal
<HR>
Expand Down
31 changes: 24 additions & 7 deletions docs/smartHomeIoT/case09.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# IoT Case 09: Smart Digital Morning Clock

Level: ![level](images/level3.png)
![auto_fit](images/Case9/blank.png)<P>
![auto_fit](images/Case9/intro.png)<P>

## Goal
<HR>
Expand All @@ -15,19 +15,36 @@ Make a digital clock that performs a normal clock function with auto-synchronizi
Smart digital clock is a clock that shows time as accurate as atomic clock by connecting to the Internet.<BR><P>
<span id="subtitle">Smart digital clock principle</span><BR><P>
NTP protocol ensures devices synchronize their time with an accurate time provider. With connecting to the Internet the digital clock can even show the time of a performing atomic clock.<BR><P>
![auto_fit](images/Case9/blank.png)<P>


## Part List
<HR>

![auto_fit](images/Case9/blank.png)<P>
![auto_fit](images/Case9/Case9_parts.png)<P>

## Assembly step
<HR>
Wait for model choose

![auto_fit](images/Case9/blank.png)<P>

<span id="subtitle">Step 1</span><BR><P>
Use M2 screws and nuts to install the OLED display to E4 cardboard<BR><P>

![pic_70](images/Case9/Case9_ass1.png)<P>
<span id="subtitle">Step 2</span><BR><P>
Insert the E4 cardboard on A cardboard, align with holes at A and B3 cardboard<BR><P>

![pic_70](images/Case9/Case9_ass2.png)<P>
<span id="subtitle">Step 3</span><BR><P>
Insert the E3 cardboard on A cardboard, align with holes at A and B4 cardboard<BR><P>

![pic_70](images/Case9/Case9_ass3.png)<P>
<span id="subtitle">Step 4</span><BR><P>
Build the bed with J1,J2,J3,J4 cardboard<BR><P>

![auto_fit](images/Case9/Case9_ass4.png)<P>

<span id="subtitle">Step 5</span><BR><P>
Place the bed at the correct position<BR><P>

![pic_70](images/Case9/Case9_ass5.png)<P>

## Hardware connect
<HR>
Expand Down
4 changes: 2 additions & 2 deletions docs/smartHomeIoT/case10.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Health monitoring is the concept of tracking the conditions of different paramet

<span id="subtitle">Home health monitoring system operation</span><BR><P>
In this scenario, integrated temperature and humidity sensor DHT11 is used. It can track and send back the data collected to the main control board for further analysis, constant display and cloud server storage. Also the IAQ Score analyst can help to estimate the environment status.<BR><P>
![auto_fit](images/Case10/blank.png)<P>


## Part List
<HR>
Expand Down Expand Up @@ -101,7 +101,7 @@ In this scenario, integrated temperature and humidity sensor DHT11 is used. It c
1. `show string join Temperature: temperature` for temperature
2. `show string join Humidity: humidity %` for humidity
3. `show string Join IAQ Score: iaq_score` for iaq_score
* ![auto_fit](images/Case10/Case10_p7.png)<P>
![auto_fit](images/Case10/Case10_p7.png)<P>

<span id="subtitle">Step 5. Analyst the environment status</span><BR><P>
* Run the `check_condition` function to summarize the IAQ Score result
Expand Down
67 changes: 41 additions & 26 deletions docs/smartHomeIoT/case11.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,37 @@ By installing a fire sensor in the area, the system will trigger an alarm and se
## Part List
<HR>

![auto_fit](images/Case11/blank.png)<P>
![auto_fit](images/Case11/Case11_parts.png)<P>

## Assembly step
<HR>

<span id="subtitle">Step 1</span><BR><P>
Install the flame sensor to the wall<BR><P>
![auto_fit](images/Case11/Case11_ass1.png)<P>
Insert the two L2 cardboard to L1 cardboard, then fold the L1 cardboard into box shape, aligned with the holes. <BR><P>
![pic_80](images/Case11/Case11_ass1.png)<P>
<span id="subtitle">Step 2</span><BR><P>
Install the Multi-Color LED to the wall
<BR><P>
![auto_fit](images/Case11/Case11_ass2.png)<P>
Stick the paper that drawing your favorite cooking stove look<BR><P>
![pic_80](images/Case11/Case11_ass2.png)<P>

<span id="subtitle">Step 3</span><BR><P>
Use M4 screws and nuts to install the flame sensor to B3 cardboard<BR><P>
![pic_80](images/Case11/Case11_ass3.png)<P>
<span id="subtitle">Step 4</span><BR><P>
Use M4 screws and nuts to install the multi-color LED to B3 cardboard<BR><P>
![pic_80](images/Case11/Case11_ass4.png)<P>
<span id="subtitle">Step 5</span><BR><P>
Insert the E3 cardboard on A cardboard, align with holes at A and B2 cardboard<BR><P>
![pic_80](images/Case11/Case11_ass5.png)<P>
<span id="subtitle">Step 6</span><BR><P>
Insert the E2 cardboard on A cardboard, align with holes at A and B2 cardboard<BR><P>
![pic_80](images/Case11/Case11_ass6.png)<P>
<span id="subtitle">Step 7</span><BR><P>
Place the cooking stove model to correct place<BR><P>
![pic_80](images/Case11/Case11_ass7.png)<P>
<span id="subtitle">Step 8 (Optional)</span><BR><P>
Place the fridge model to correct place <BR><P>
![pic_80](images/Case11/Case11_ass8.png)<P>



## Hardware connect
Expand Down Expand Up @@ -91,45 +110,41 @@ In the THEN field, search for the “email” and use it to replace the “notif
* Snap `show icon` from `basic` to `On WiFi connected` and select icon `tick`
![pic_50](images/Case11/Case11_p2.png)<P>

<span id="subtitle">Step 3. Check the flame sensor result and action on OLED display</span><BR><P>
* In the `Forever`, put a `if` statement with condition `Get flame detection at Pin P2`
* In the `if` segment, that's means fire was been detected.
* Clear the OLED diplay before each update by `clear OLED display`
* show the warning message by `show string Flame detected!`
![pic_70](images/Case11/Case11_p3.png)<P>
<span id="subtitle">Step 3. Check the internet connection status</span><BR><P>
* In the `Forever`, put a `if` statement with condition `WiFi connected?` to check the connection status
![pic_50](images/Case11/Case11_p3.png)<P>

<span id="subtitle">Step 4. Action on Warning LED</span><BR><P>
<span id="subtitle">Step 4. Check the flame sensor result and action on OLED display</span><BR><P>
* Put another `if` statement with condition `Get flame detection at Pin P2 = true` to recognize the flame
* Play a warning sound when the flame was detected
![pic_70](images/Case11/Case11_p4.png)<P>

<span id="subtitle">Step 5. Action on Warning LED</span><BR><P>
* The LED should be blinking to telling dangerous
* Put `strip show color red` to turn on the LED in red color
* Add a `pause (ms) 100` to wait for 0.1 second
* Put `strip show color black` to turn off the LED
* Pause for 0.1 second again
![auto_fit](images/Case11/Case11_p4.png)<P>

<span id="subtitle">Step 5. Action on IFTTT</span><BR><P>
* Before sending the IFTTT message, need to check the network state of IoT:bit
* Put a `if` statement with `WiFi connected?` condition
* Put a `Send IFTTT key* XXXXXXXXX event_name* XXXXX ....`inside the `if` segment
* Fill in the IFTTT key from your Webhooks and the Applet's event_name
![pic_50](images/Case11/Case11_p5.png)<P>
![auto_fit](images/Case11/Case11_p5.png)<P>

<span id="subtitle">Step 6. Make the alert warning sound</span><BR><P>
* Play the alert warning sound from the buzzer by `play tone High B for 2 beat`
<span id="subtitle">Step 6. Action on IFTTT</span><BR><P>
* Put a `Send IFTTT key* XXXXXXXXX event_name* XXXXX ....` to send the event to IFTTT
* Fill in the `IFTTT key` from your Webhooks and the Applet's `event_name`
![pic_50](images/Case11/Case11_p6.png)<P>

<span id="subtitle">Step 7. Know the Upload result</span><BR><P>
* To check the upload state, use the `On IFTTT Uploaded` to get the sending result
* Inside the `On IFTTT Uploaded`, use OLED display to show the information
* Clear the OLED display before each update by `clear OLED display`
* Show upload state by `show string join IFTTT: Status`, the `Status` value is from the function's placeholder
* * Show error_code by `show string join Error: Error_code`, the `Error_code` value is from the function's placeholder
* Show error_code by `show string join Error: Error_code`, the `Error_code` value is from the function's placeholder
![pic_50](images/Case11/Case11_p7.png)<P>


<span id="subtitle">Full Solution<BR><P>
MakeCode: [https://makecode.microbit.org/_JY6euUMkqWFi](https://makecode.microbit.org/_JY6euUMkqWFi)<BR><P>
MakeCode: [https://makecode.microbit.org/_PaX5qwPeRa0e](https://makecode.microbit.org/_PaX5qwPeRa0e)<BR><P>
You could also download the program from the following website:<BR>
<iframe src="https://makecode.microbit.org/#pub:_JY6euUMkqWFi" width="100%" height="500" frameborder="0"></iframe>
<iframe src="https://makecode.microbit.org/#pub:_PaX5qwPeRa0e" width="100%" height="500" frameborder="0"></iframe>



Expand Down
Binary file modified docs/smartHomeIoT/images/Case11/Case11_ass1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/smartHomeIoT/images/Case11/Case11_ass2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/smartHomeIoT/images/Case11/Case11_p3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/smartHomeIoT/images/Case11/Case11_p4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/smartHomeIoT/images/Case11/Case11_p5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/smartHomeIoT/images/Case11/Case11_p6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/smartHomeIoT/images/Case11/Case11_parts.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/smartHomeIoT/images/Case11/case11_ass3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/smartHomeIoT/images/Case11/case11_ass5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/smartHomeIoT/images/Case11/case11_ass6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/smartHomeIoT/images/Case11/case11_ass7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/smartHomeIoT/images/Case11/case11_ass8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/smartHomeIoT/images/Case8/intro.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/smartHomeIoT/images/Case9/Case9_ass1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/smartHomeIoT/images/Case9/Case9_ass2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/smartHomeIoT/images/Case9/Case9_ass3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/smartHomeIoT/images/Case9/Case9_ass4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/smartHomeIoT/images/Case9/Case9_ass5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/smartHomeIoT/images/Case9/Case9_parts.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/smartHomeIoT/images/Case9/intro.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e8998f8

Please sign in to comment.