Raspberry Pi Pico - Adafruit Sensors

Moderators: adafruit_support_bill, adafruit

Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/
Locked
User avatar
silverage
 
Posts: 28
Joined: Sun Jan 27, 2019 5:14 pm

Raspberry Pi Pico - Adafruit Sensors

Post by silverage »

Hi,

I am currently using a Raspberry Pi Zero WH with three environmental sensors attached through a Sparkfun Qwiik Pi Hat. The Pi is running the AWS IoT Python SDK v2 with CircuitPython.

https://github.com/aws/aws-iot-device-sdk-python-v2
https://www.adafruit.com/product/5190
https://www.adafruit.com/product/4829
https://www.adafruit.com/product/4636

This combination works well together, but I am interested in potentially replacing the Pi Zero WH with the new Pico WH. From what I read about the Pico, it is designed for single use applications and does not have the Raspbian (Linux) OS. Will my solution as described above run on the new Pico board?

Also, does Pico have a Hat available that is similar to the Sparkfun Qwiik Pi Hat, and is there a power adapter available for the Pico? I need to power it with a wall outlet, not a laptop USB connection or battery.

Thanks!

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: Raspberry Pi Pico - Adafruit Sensors

Post by mikeysklar »

Adafruit does have examples of AWS IoT usage with Circuitpython with with the PyPortal board so that is a good sign for using the Pico W.

https://learn.adafruit.com/pyportal-iot ... cuitpython

The three sensors you are using are well supported under CircuitPython SCD-41, SGP40 and SHTC3.

You could use the PiCowbell to get a Qwiic connection and add a min 5 port hub to get more.

https://www.adafruit.com/product/5200
https://www.adafruit.com/product/5625

For wall power it is often easiest to convert to USB.

https://www.adafruit.com/product/1994

User avatar
silverage
 
Posts: 28
Joined: Sun Jan 27, 2019 5:14 pm

Re: Raspberry Pi Pico - Adafruit Sensors

Post by silverage »

@mikeyskylar

So the Pico can run a Python script with no issues? The client that runs on my Raspberry Pi Zero is written entirely in Python.

Is there a way to connect the three or four sensors to the Pico without using the PiCowbell? I have an environmental case that the Pi and sensors are attached to, and I dont think any kind of breadboard solution would fit in it cleanly.

Thanks!

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: Raspberry Pi Pico - Adafruit Sensors

Post by mikeysklar »

No, the Pico can run CircuitPython code so you will need to adapt to use the CircuitPython libraries. The worst case scenario would be if you had made use of a python library that does not exist in the CircuitPython realm.

The Cowbell is more proto board than bread board so still soldering not loose wires. but I get your meaning about it not being a clean.

I think you have two options.

1) The easy way to solder up a pair of STEMMA QT ports to your Pico WH. Then chain your remaining sensors off the in and outs STEMMA QT connectors:

https://www.adafruit.com/product/4527

2) Make a custom PCB hat for the Pico WH that has all the JST SH 4-pin (STEMMA QT) ports you need using these connectors:

https://www.adafruit.com/product/4328
https://www.adafruit.com/product/4208

User avatar
silverage
 
Posts: 28
Joined: Sun Jan 27, 2019 5:14 pm

Re: Raspberry Pi Pico - Adafruit Sensors

Post by silverage »

I asked AWS about their Python v2 SDK for IoT and here is what they said about compatibility with Pico.
I don't think this sdk will work with MicroPython or CircuitPython. They are both based on Python3.4 and the minimum requirements for this sdk is Python3.7.
Is CircuitPython based on Python 3.4? Are there plans to release a new version that is based on Python 3.7 or later?

Thanks!

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: Raspberry Pi Pico - Adafruit Sensors

Post by mikeysklar »

Is there something about this AWS IoT example that is not working when you try to set the same libraries on your Pico W? Be specific about what part you are struggling with and we can help.

https://learn.adafruit.com/pyportal-iot ... cuitpython

CircuitPython is based on Python 3.x

User avatar
silverage
 
Posts: 28
Joined: Sun Jan 27, 2019 5:14 pm

Re: Raspberry Pi Pico - Adafruit Sensors

Post by silverage »

I have not tried to implement the tutorial yet. However, it looks like the AWS tutorial is using the AWS IoT Python SDK v1 not v2. Version 1 of the SDK might work with earlier versions of Python. AWS has not updated v1 of the SDK since April.

https://docs.aws.amazon.com/iot/latest/ ... setup.html
Run the following command to install the AWS IoT Device SDK for Python:
pip3 install AWSIoTPythonSDK
https://github.com/aws/aws-iot-device-sdk-python

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: Raspberry Pi Pico - Adafruit Sensors

Post by mikeysklar »

I see the issue now.

v2 of the AWS IoT for CircuitPython will likely be an issue.

You can inquire about future support for v2 on the v1 release.

https://github.com/adafruit/Adafruit_Ci ... IOT/issues

Locked
Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/

Return to “Adafruit Raspberry Pi® accessories”