AR Project
Start your own AR project
Index
IOT Intro
TokyMaker, designed with a WIFI card, is capable of creating IOT projects and sending / receiving data over the internet. Using internet connectivity, sensors, and actuators, TokyMaker can communicate and interact with others over the Internet. It can be remotely monitored and controlled. Today, we will set up IoT technology with a TokyMaker.
You have to include these two blocks in every IOT program you create. They establish connection to the Internet and the Adafruit server
What we use:
Adafruit IO is a platform designed to display, respond, and interact with your project’s data. It is the Internet of Things, for everyone. Click Get Started for Free then create a new account .
io.adafruit.com
IOT Setup
After you signed in, click the Adafruit IO Key to get your personal IO Key ,the key will be used in your IOT block.Then we set a simple program to examine if the IOT is connected or not. The on head LED Is green when IOT is connected, and red if not connected.
Check Connection
It might take a while for the TokyMaker to connect, so give your TokyMaker about 30 seconds to respond. Debug if IOT is not connected.
Visualize Data
Click the create new block button then we use line chart to show the temperature vary.In block setting, enter a block title. Set the Y-Axis minimum as 0, and Y-Axis maximum as 100, because that’s our data range.
Setup-Feed
Feeds are the core feature of the Adafruit IO system. The feed contains the sensor data values that get pushed to Adafruit IO from your device. It also holds metadata about the data you push to Adafruit IO. You will need to create one feed for each unique source of data you send to the system.Click create new feed and name your feed.
Tokymaker Programming
Receiving your data from Internet. Check the IOT connection .Get your data from feed cup.temp and write a code to make sure the data from moisture sensor shows up on the screen. Then we can know the temprature accurately.
Augmented Reality Programming
Get connected with IOT and set sphere and axes. We could set the sphere position by change the value of X axis and Y, Z. Then we get the info from feed cup.temp to set the color of our sphere. When the temp above 50 then it is still red ,if the temp below 50 ,the sphere becomes blue.
Show your own AR project
After coding your project, then save your project to google drive and use your camera scan the QR code to go to the AR website. Put your camera on the right side picture. You could also print it on platform. Check it out!
Tips
Set Text in AR
Set String to the AR element. In here the ID could be a string or number. You could free type anything you like to show a text field in AR. In here ,we input TOKYLIFE for example. Just try to show you own idea!
Change the color of your text
Set Sphere in AR
Create or update a sphere in AR .The ID here could be a string or number. We could set the sphere with different radius in AR.In here, it is given by a sphere which radius is 0.5.
Set Box in AR
Use Scale function
And then we could add a scale block to change its scale by changing the value of our IoT feed.In here, we use rotate sensor to control the value of scale.
How to control the scale
Set Graph in AR
Use set graph block to show a graph from IoT feed in AR. Discover the magic of the graph. In here we set a graph named Gianana at x label 0.5 and y label 0.5.The code is shown below.
Set 3D object
Except the box and sphere we could also import the 3D model into our Toky AR pattern. In here we could import a 3D model into our AR project.
Use rotate function horizontal
You could use rotate block to rotate of your 3D model with different degree on the x, y ,z axes. In here we import a 3D model and use rotate block to rotate the 3D model in AR. If the IoT value is below 50 then we rotate it with 270 degree in y axe. If the IoT value is above 50 then we rotate it with 90 degree.
Use rotate function vertical�
You could also use rotate block to rotate of your 3D model with different degree on the x, y ,z axes vertically.
Use rotate function lateral
You could also use rotate block to rotate of your 3D model with different degree on the x, y ,z axes laterally.
3D object website
Tinkercad is a free, online 3D modeling program that runs in a web browser, known for its simplicity and ease of use.. We could DIY our own 3D project in here and import it into our AR design!
https://www.tinkercad.com/things
Move your 3D project
Show your Axe
Change opacity of your 3D model
Block explanation
Name |
Explanation |
| The simplest "repeat" block runs the code in its body in an endless loop. Will execute the inner instructions continuously, once and again. |
| At every block, together with the conditioner if/do, runs the code in each period of time specified in milliseconds or minutes. |
| Break the repeat block |
| Run and do for the items in list |
Block explanation
Name | Explanation |
|
Create a list with any number of items. |
|
Provide a name of your list. |
|
Returns the length of a list. |
Block explanation
Name | Explanation |
| Add a letter, word, or a line of text in this block |
| Create a piece of text by joining together any number of items |
| Append some text to variable ‘item’ |
| Returns the number of letters in provided text |
Thank you and enjoy!
See you in the community