Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makecode extension #2

Open
compie67 opened this issue Sep 17, 2020 · 32 comments
Open

Makecode extension #2

compie67 opened this issue Sep 17, 2020 · 32 comments
Assignees

Comments

@compie67
Copy link

He, is there a way to obtain the CC811 extension to the microbit Makecode
can not find it any where like your picture

thank you in advance

@sabas1080
Copy link
Member

Hi @compie67 , yes only insert or copy&past url this repo in extension
Captura de Pantalla 2020-09-17 a la(s) 20 50 51

and ready
Captura de Pantalla 2020-09-17 a la(s) 20 52 09

@compie67
Copy link
Author

first thank you for taking time to answer, i am helping out some students and if i use your provided link i get this
same for the Windows10 app,
Schermafbeelding 2020-09-18 074448

so weird

@compie67
Copy link
Author

Update!!!! found it, trange change it to english and there it is, okay now another problem ;-)

I am missing the start block CC811. (CCS811 Start Function
The first block in the AirQuality package is the |CCS811 Start| block. At the start of any program which will use the air quality sensor place the |CCS811 Start| block in a "Forever" block above the rest of your code.)

Great that we are one step further.
regards Eric

@sabas1080
Copy link
Member

Excellent, the device starts automatically when reading data

@compie67
Copy link
Author

Hey @sabas1080
it wont work, like i said we are missing the start CC811 block like in the picture. here
https://github.com/ElectronicCats/pxt-airQuality

or do you have an axample code with your code for us to use.

If got the basic working, we then can let the students try to extract the data to excel etc.

@sabas1080
Copy link
Member

@compie67 We removed start in the commit dafaad5

New example is

let eCO2 = 0
let TVOCs = 0
loop.forever(() => {
    TVOCs = airQuality.readTvoc()
    eCO2 = airQuality.readCo2()
    loop.pause(1000)
})

I'm going to update the README

@compie67
Copy link
Author

goodmorning(here in the Netherlands)
our mindset is makecode microbit, this code can not be used in that.

Do we heve to use arduino?

@sabas1080
Copy link
Member

No, is javascript mode

Captura de Pantalla 2020-09-19 a la(s) 1 42 17

but is this a example in blocks
Captura de Pantalla 2020-09-19 a la(s) 1 43 54

Good night in México

@compie67
Copy link
Author

bam, no were talking.
image
okay, will try to test this today and let you know
eric

@compie67
Copy link
Author

hi, wel got it working, but it keep giving the value zero. on both "read options"

IMG_20200922_142812 (1)
IMG_20200922_142748

@sabas1080
Copy link
Member

sabas1080 commented Sep 22, 2020

Try with this example:

Captura de Pantalla 2020-09-22 a la(s) 10 41 24

I have change Address and Device Status log, send me your "Device Status" if you have error

Note: Connect PIN WAK to GND

@compie67
Copy link
Author

Hi, again also on behave of the students.
Thank you

ok, i disconnect the CCS811 module from the board and connect this directly on the wire.
Red goes to 3.3v Microbit
green goes to GND microbit

blue goes from p20 microbit to SDA
and purple goes from p19 to SCL

upload the code and status gives me also value zero

@sabas1080
Copy link
Member

Are you connecting PIN WAK to GND?

@sabas1080 sabas1080 self-assigned this Sep 23, 2020
@compie67
Copy link
Author

compie67 commented Sep 23, 2020 via email

@compie67
Copy link
Author

goodmorning!! well connect the WAK to gnd and its now on. 07:35 amsterdam time. I give it 20 minute burn time and wait to see what happen. Nect step is to try another CCS811(i bought three) maybe the one i got was broken
but for now all options are giving the result zero

@sabas1080
Copy link
Member

Good night 0:39 Mexico tine, I am going to test the sensor these days with a microbit and a sensor

@compie67
Copy link
Author

cool, hope you find something

@sabas1080
Copy link
Member

Hi @compie67 I have tested and working for me , my configuration is:
CCS811 - Microbit
GND -- GND
VCC -- VCC
SDA -- SDA
SCL -- SCL
WAK -- GND

My code is:
Captura de Pantalla 2020-09-24 a la(s) 15 28 28

My video
https://twitter.com/Sabasacustico/status/1309227083814572033

@compie67
Copy link
Author

wow, and yess got the same now.
and same numbers as yours ;-) and that stay's that way

co2 gives me 4605
tvoc gives me 65021

it wont drop, or go up
but, i got number!!!!
https://photos.app.goo.gl/YinUWU9hJPEQzyueA

so so far so good.
did you get any other number, like if you blow at the sensor?

@compie67
Copy link
Author

o, this also work
image

that is the goal of our project(student need to sort this out there self) ;-)
but as you can see, it keeps giving the same data

@sabas1080
Copy link
Member

It seems that I forgot to put a reset sequence, can you try the new version 0.1.4 in a new project?

@sabas1080
Copy link
Member

With new code I have
co2 gives me 3327
tvoc gives me 65021

Also, AMS recommends that you run this sensor for 48 hours when you first receive it to "burn it in", and then 20 minutes in the desired mode every time the sensor is in use. This is because the sensitivity levels of the sensor will change during early use.

@compie67
Copy link
Author

okay, seems legit. you said new code? 0.1.4 is that also block or java?
cant find it

@sabas1080
Copy link
Member

is block, only open a new project and import extension

@compie67
Copy link
Author

compie67 commented Sep 26, 2020 via email

@compie67
Copy link
Author

hi, goodmorning. maybe missing a step, with new project and import extension nothing new happen. Still the same blocks

@compie67
Copy link
Author

So, update.

manage to get version 0.1.4
did you get any other reading?
image

after three days still give the reading co2 4605

@compie67
Copy link
Author

hey, how are you doing.
status update, weird thing. Fresh code uploaded to microbit. It works and its giving nice value
poweroff and al go back to the weird reading 4605 for co2 and 65021 and stay that way.
and i get it work anymore.

To bad, looks good to work for the students

@compie67
Copy link
Author

@sabas1080 got this answer on the static value

quote:
The CCS811 has a resistor Rs that varies with air quality. The tvoc value is roughly Rs/R0, where R0 is the resistance for cleanest air seen by the sensor. R0 is also known as "baseline" and is maintained by the sensor as long as it is powered. Once the sensor is switched off, R0 is lost. After a new power on, it takes some time before a good R0 is determined by the sensor.

So, what you can do is x=get_baseline () before you switch off, and set_baseline(x) after you switch on. But read the datasheet for details on when to do this exactly.
en quote

Is this possible with the MicroBit?

@Marshall-Jed
Copy link

@compie67 I've had similar issues to you. I ended up finding that this library worked well using an adafruit ccs881 board https://github.com/xinabox/pxt-SG33. Example: https://makecode.microbit.org/_A43RqUhbzfyF

@redegelde
Copy link

@Marshall-Jed and after powerdown and powerup it give the proper value again?

@Marshall-Jed
Copy link

Marshall-Jed commented Oct 29, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants