RP2350 Explorer Kit

# Display readings from the multi-sensor stick on the Explorer screen
from explorer import display, i2c, BLACK, WHITE, RED
from breakout_ltr559 import BreakoutLTR559
from lsm6ds3 import LSM6DS3
from breakout_bme280 import BreakoutBME280
import time

# Clear all layers first
display.set_layer(0)
display.set_pen(BLACK)
display.clear()
display.set_layer(1)
display.set_pen(BLACK)
display.clear()

try:
    ltr = BreakoutLTR559(i2c)
    lsm = LSM6DS3(i2c)
    bme = BreakoutBME280(i2c)
except OSError:
    # Clear the screen
    display.set_pen(RED)
    display.clear()
    display.set_pen(WHITE)
    display.text("Multi-Sensor stick not detected! :(", 10, 95, 320, 3)
    display.update()

while True:

    # Set the layer we're going to be drawing to.
    display.set_layer(0)

    prox, a, b, c, d, e, lux = ltr.get_reading()
    
#    ax, ay, az, gx, gy, gz = lsm.get_readings()
#    temperature, pressure, humidity = bme.read()
    display.set_pen(BLACK)
    display.clear()
    display.set_pen(WHITE)
    if lux is not None:
        display.text(f"Lux: {lux:.0f}\nProx: {prox:.0f}", 0, 0, 320, 3)
        display.text("a= " +str(a),0,40 ,320,3)
        display.text("b= " +str(b),0,60 ,320,3)
        display.text("c= " +str(c),0,80 ,320,3)
        display.text("d= " +str(d),0,100 ,320,3)
        display.text("e= " +str(e),0,120 ,320,3)
#    if ax is not None:
#        display.text(f"Accelerometer:\nX: {ax:.0f}, Y: {ay:.0f}, \nZ: {az:.0f}\nGyro:\nX: {gx:.0f}, Y: {gy:.0f}, \nZ: {gz:.0f}", 0, 45, 320, 3)
#    if temperature is not None:
#        display.text(f"Temperature: {temperature:.2f}°C,\nHumidity: {humidity:.0f}%,\nPressure: {pressure / 100:.0f}hPa", 0, 180, 320, 3)
    display.update()
    time.sleep(0.1)

a and e appear to change if you move a hand near the prox sensor. a is the most useful and moves up as the hand moves away. e just jumps about.

Here’s the bit of the LTR559 MicroPython bindings that separates out the readings - looks like B is ALS_1 and E is RATIO.

Might need to consult the sensor datasheet to find out what those bits of data mean :)

clock.py
ā€˜Connect to your computer and use Thonny to automagically set the time.’

It starts at midnight on Friday Feb 01 when connected to my PC.

That clock.py just displays the time, it doesn’t sync it first. Near as I can tell anyway. If you try to run it as main.py it’s not going to get the correct time. If your running it from Thonny, I would have thought Thonny would sync the time automatically? The Pico is supposed to get the time from the host (Thonny). There is code out there to sync the Pico’s onboard RTC with your host PC when run. I’ll see if I have it saved somewhere and get back to you.

EDIT: It looks like all my saved files are for the RV3028 RTC Breakout.

Thanks, it works if not run via the menu but as a separate program. The switch from menu.py to clock.py must drop the time sync.

Yeah, if you just plug the Explorer in, and run everything local, it’s not going to sync the time. I don’t think anyway? It’s the actual serial connection via Thonny that updates / syncs the onboard RTC.
I can’t run those examples on mine, not yet anyway.

Does anybody have any suggestions as to how to mount the 2 servo motors (and wheels) so the Explorer can move about? (I understand I’d probably need to retain the two nice shiny props so it’s more like a hand cart.)

Obviously I know how to plug the servo motors into the board.

Take two squares of corrugated card and glue together at right angles to reduce flexing. Glue the servos to the cardboard with the wheels parallel near a front edge. You could also use dual sticky backed foam or a glue gun. Take the ball from a roll-on deodorant and fix into the rear end of the cardboard to make a rear slide. Mount the Explorer on the top with battery. Have fun.

This is cheap and cheerful and the servos are easily removed with a sharp knife for reuse.

1 Like

I use a lot of the 3M double sided sticky Command strips and tape for stuff like this.
3m command strips - Google Search
The thing I like about those wall strips is they are easy to get off if you don’t like how it turned out. They may not work for this application long term, but they should be good enough to have a bit of fun and at least a test run.

I have a Pico Inventor with two micro metal gear motors attached. It has the mounting holes for the motor brackets. At some point I’ll likely add a caster as a third wheel, of something like this.
Supporting Swivel Caster Wheel - 1.3 Diameter : ID 2942 : Adafruit Industries, Unique & fun DIY electronics and kits

This might interest you.
Mini Robot Rover Chassis Kit - 2WD with DC Motors : ID 2939 : Adafruit Industries, Unique & fun DIY electronics and kits

You can get just the chassis part by itself.
Anodized Aluminum Metal Chasis for a Mini Robot Rover : ID 2943 : Adafruit Industries, Unique & fun DIY electronics and kits
The servo / motors you have now should screw in no problem. Then just also buy the swivel wheel.

1 Like

I do not like this chassis with castors. They always twist and turn when you try to go from forwards to backwards as the caster turns. A ball in a socket or a smooth larger ball seems to work better.

2 Likes

Schematic is now linked on the shop page, here’s a direct link!

Thank you. Very helpful. Any news about the Proximity sensor accuracy?

Tony, is this solved alraedy?

I’ve not made any progress. I think it is for very small differences. I’ve not found a use for it yet. Has anyone found a use in a project?

I will be in Japan for a couple of weeks - so no more posts until I get back.

Have fun.