Prerequisites for Luminosity Logger

Simuli Virtual Lab

First, log in to your Simuli account and navigate to the Simuli Virtual Lab. Here we will create a new emulated instance of the Raspberry Pi. Click on the Launch button under Raspberry Pi to get started.

This will open the configuration menu. First, provide a name for the project. Then we will select the OS which will be Buster. Next, we will select ADPS9301 Light Sensor. Finally, we will review that all the details are correct and click on the Launch button.

Once we have clicked on the Launch button, a new instance of Raspberry Pi will be created. It can take a few minutes for this process to be completed.

While our new instance is being created, let's move forward to create the app script and configure the google sheet to work with it.

Google Sheets & App Script

Before we start, a Google account is required. If you do not have that you can simply sign up for one. Once logged in go to your Drive.

Here click on +New -> Google Sheets -> Blank Spreadsheet. A new SpreadSheet open's up here let the first row be named TimeStamp and the second row be named lux value.

Now in the link of the sheet note down the sheet id, it will be used later on in the App script.

The Sheet Id can be extracted from the URL of the google sheet.

For example in the URL https://docs.google.com/spreadsheets/d/123abcd/edit#gid=0

the sheet id is between /d/ and /edit which is 123abcd in this case.

Now we will create a new app script, click on +New -> More -> Google Apps Script. A new App script opens up in a new tab. In the editor(code.gs) paste the script/code given present in the Github link.

Replace <sheet id> in the first line of the script with the spreadsheet id we saved earlier.

var SS = SpreadsheetApp.openById('<sheet id>');    //Enter Your Sheet ID Got From Sheet URL Link

Once all edits are done save the script and click on Deploy -> New Deployment present in the right upper corner.

Provide a description to the deployment and execute as Me. For access keep it Anyone and then click on Deploy.

Once Deployed you will get a URL for the App script save it for later use in the code.

Now going back to google sheets we will create a graph for the values against the timestamp.

Select the Timestamp and Lux Value columns then click on Insert -> chart. For the chart, you can design it according to your interests or refer to the settings as applied in the screenshot below.

Our setup is complete. We will now move on to our instance in Simuli Virtual Lab.

Last updated