Jan Goolsbey
S04:E33

Jan Goolsbey

Episode description

Jan Goolsbey joins the show. He and Paul discuss the CircuitPython Community Bundle, Jan’s contributions to the bundle, his IoT wind chimes project, and the string car racer.

Transcripts are available in most podcast players.

00:30 Welcome Jan

2:24 Discovering CircuitPython

3:52 CircuitPython’s Community Bundle

6:10 Jan’s favorite libraries in the Community Bundle: Range Slicer

7:45 Graphics libraries including PaletteFader

9:27 Advice for adding to the CircuitPython Community Bundle

10:30 Using synthio for the Internet of Things Wind Chimes project

  • Wind Chimes repository

14:14 The String Car Racer

19:05 Where to learn more?

20:15 Which board?

Download transcript (.srt)
0:00

[MUSIC PLAYING]

0:01

Welcome to the Circuit Python Show.

0:03

I'm your host, Paul Cutler.

0:05

This episode, I'm joined by Jan Goolsbey.

0:07

After a long and varied career in information technology

0:10

for a large research laboratory, Jan

0:12

became refocused on his first love, electronics hardware

0:15

design, and all the things that go with it.

0:17

He is an active member of the Circuit Python community,

0:19

enjoying learning new ideas and concepts.

0:22

His current project direction involves music and sound

0:24

synthesis, but is easily distracted

0:26

by robotics, sensors, and anything noisy that blinks.

0:30

Jan, welcome to the show.

0:32

Hey, Paul.

0:32

How are you?

0:33

I'm great.

0:34

Thanks for coming on.

0:35

How did you first get started with computers and electronics?

0:39

Well, I started with electronics first before computers.

0:43

Oh, god, I can't remember how many years ago.

0:45

Just a seventh grade kind of child,

0:48

and I was very interested in electronics

0:50

because I don't know why.

0:52

Some fascinating elements of that.

0:54

And I started to take things apart.

0:57

That was my introduction into electronics.

0:59

And back when I grew up-- and I'm an older kind of a guy,

1:01

so back then, there really weren't any computers around.

1:05

And so if you were going to do things in electronics,

1:08

it was all about radio and television.

1:10

Those are the big things-- audio, radio, television.

1:13

I got started by going down to one of the local electric shops

1:16

that did TV repair, and I grabbed these old broken TV

1:20

sets that they have, and I gleaned them for their parts.

1:24

And from that, I would build circuits,

1:26

and it started to build into a habit of mine

1:30

to tear things down and figure out how they work

1:33

and use that to build other things.

1:35

And so I got started in electronics then.

1:37

Computers are a little bit different because, like I said,

1:40

the computers really weren't very prevalent

1:42

when I was growing up.

1:44

But when I was in high school--

1:45

I was a junior in high school--

1:47

my physics teacher said, I've got all these parts

1:51

that the telephone company gave us.

1:52

Can you build a computer from those?

1:55

And I thought, well, I certainly can give it a shot.

1:58

So I built my first relay digital computer back

2:02

when I was about 16, 17 years old.

2:05

And a couple of years later, when I was in college,

2:08

I started to build from TTL circuits

2:11

and put together a computer from that.

2:12

And then I went through the cycle

2:15

and computers became a lot more prevalent.

2:17

I learned how to program in BASIC and a few other things.

2:20

But I've always been focused on the hardware side of it.

2:23

How did you discover CircuitPython?

2:26

Well, that was interesting.

2:27

I had a couple of projects, robotics projects.

2:30

One was a string car.

2:32

And the string car experience is something

2:36

that is kind of embedded in our family.

2:38

And I won't go into too much detail.

2:40

You might have some other questions about the string car

2:42

a little bit later, right?

2:44

That's right.

2:45

I wanted to build this robot string car.

2:48

And I was using TTL circuits for that.

2:51

And then somebody said--

2:52

and I don't remember who it was--

2:54

hey, there's this thing called a microcontroller.

2:57

And of course, I knew what they were from my work

2:59

in electronics.

3:00

And they said, you can buy these things from Adafruit.

3:03

And you could use that to control this robot

3:06

that you're trying to build.

3:08

So I got involved with Arduino on a trinket.

3:12

And oh, Anne Burrell wrote a fantastic book

3:15

about how to get started with the trinket.

3:17

And that got me involved in that.

3:20

And then Tony DeCola wrote an article about MicroPython.

3:26

And that was before CircuitPython came out.

3:28

So I started to transition all of my robots

3:32

over to MicroPython and learn a little bit about that.

3:36

And when CircuitPython came along, I was ready to go.

3:40

MicroPython was great.

3:42

CircuitPython was even simpler, easier to learn.

3:45

And although it's slower than Arduino,

3:48

it worked fine for the robots and projects that I had.

3:51

CircuitPython has the official CircuitPython bundle

3:54

maintained by Adafruit.

3:56

But there's also the community bundle,

3:57

which includes over 100 drivers and helper libraries created

4:00

by members of the community.

4:02

You've contributed over 20 libraries to the bundle.

4:05

What are some of your favorite libraries you've created?

4:08

You know, I get excited about the bundle.

4:10

And before I list a couple of my favorites,

4:13

I'd like to share just how important I think the bundle is.

4:17

Because when you're working with the CircuitPython community,

4:23

you find ample opportunities to learn and share.

4:26

And really, that's the energy behind CircuitPython

4:30

is about the community.

4:32

So the community bundle is just a natural extension

4:34

of what's already going on in the CircuitPython community.

4:38

And that's sharing.

4:39

So when I discovered that there was a bundle of things

4:42

that people out there had put together

4:44

based on their own projects, I got kind of excited about that.

4:49

And I started looking through those.

4:51

And since I'm kind of a lifelong learner anyway,

4:54

and I'm not that strong of a Python programmer,

4:58

the community bundle gave me an opportunity

5:00

to look at how other people did things with CircuitPython.

5:04

And I picked up so many hints and tricks and ways

5:07

to approach things that the bundle just

5:10

was kind of this natural focus for me for a while.

5:12

It's a hidden gem.

5:14

And a lot of people don't understand

5:16

that it exists out there.

5:18

And it could be used not just to apply directly to a project,

5:21

but also used for learning.

5:23

And that's how I used it initially.

5:25

As I was building projects, I'd come up

5:28

with a novel way of doing something,

5:29

at least I thought was a novel way of doing things.

5:32

I would put together a helper or a driver or something.

5:37

And I thought, I really need to contribute back

5:40

to the community.

5:42

So I learned how to convert that helper into something that

5:47

was community bundle compatible.

5:50

It's like getting an idea ready to be a product.

5:53

I had to learn not just how to get things done for my projects,

5:57

but also how to present them in a way

5:59

that other people could learn from them.

6:01

And so the community bundle taught me a lot about not just

6:06

how to write Python, but also how to share it.

6:09

My most favorite one was my first one.

6:12

And it's this thing called a range slicer.

6:15

I had a particular problem in my EuroRack system

6:20

where I needed to quantize a linear signal, an analog

6:24

signal.

6:25

And like when you're turning a knob on a potentiometer,

6:30

you expect the potentiometer voltage

6:32

to rise slowly and accurately so that you

6:37

can use that for controlling a tone or a filter

6:39

or some other setting, something musical.

6:42

But I found out the potentiometers

6:43

are pretty noisy.

6:44

As you turn them up, and if you stop at a certain point,

6:48

they'll still continue to wiggle their value.

6:50

And they're not as stable as you expect them to be.

6:53

They're mechanical.

6:55

And so the range slicer is something

6:57

that I use to smooth out the way that a potentiometer works.

7:02

And there are a couple of ways to do that.

7:03

One is to run it through a filter,

7:06

but that kind of slows it down.

7:08

So I had to find a way that it used something

7:11

called hysteresis.

7:12

It determines the direction that the potentiometer is moving.

7:16

And it waits until it gets to a certain point to say, hey,

7:19

this is the value that you want, and it's stable.

7:21

If you move the potentiometer up a little bit

7:23

or down a little bit, that value stays rock stable.

7:26

If you move it a little bit further down,

7:29

then it jumps to the next stable value.

7:32

So range slicer was really great for quantizing voltages

7:36

into musical notes and to filter settings and things like that.

7:39

So yeah, range slicer was my first one.

7:42

That was a whole lot of fun to do.

7:43

Recently, I've been working on graphics libraries

7:46

for the community bundle.

7:48

Palette fader, that's one.

7:49

Palette filter is another one.

7:51

And palette fader was interesting

7:53

because it came out of kind of a moment of desperation.

7:57

I had a matrix portal.

7:58

I wanted to put a holiday display on the matrix portal.

8:02

And when I first turned it on, it drew so much power.

8:05

It was so bright.

8:07

And it drew so much power that it just shut itself off.

8:09

And a lot of folks that have worked with the matrix portal

8:12

know exactly what I'm talking about.

8:15

So I needed something that could control

8:17

the brightness of that initial image

8:19

before it shut down the microcontroller.

8:22

And palette fader came out of that experience.

8:25

And really, palette fader is pretty simple.

8:27

Getting to the point of putting it into a library

8:30

and understanding how it worked, that was the hard part.

8:32

But palette fader, like I said, is one of my more favorite ones

8:36

because it just looks at the palette of the image,

8:40

and it just scales down the values

8:42

so they're not as bright.

8:43

It scales down all three of the RGB values at the same time.

8:48

And that's really how that works.

8:50

So that's one of my favorites.

8:53

I might say I have 20 favorites, but they were all

8:57

used in a project, and they all seemed very useful to me.

9:00

And that's why I shared them.

9:02

The great thing about the community bundle

9:04

is that once you share it, you start

9:06

getting feedback from people.

9:09

So palette fader, for example, I've received a lot of feedback

9:13

and have improved in my ability to program in Circuit Python

9:20

and also how to write drivers and libraries and stuff

9:24

to share with people because of that.

9:26

What advice would you offer to someone

9:28

looking to add a driver or library to the community

9:30

bundle?

9:31

My advice is it's very simple.

9:33

It's that you're probably doing something that can be shared.

9:37

If you're working on a project and you

9:39

have a particular approach to solve a fairly unique problem,

9:44

like you're trying to get rid of noise on a potentiometer

9:46

or something like that, you can rest assured

9:49

that somebody else is having that same issue

9:51

or they're looking for some advice

9:53

on how to approach solving that problem.

9:56

You're likely to already have something

9:59

in your code that is shareable.

10:01

So I'd say find something that you think

10:03

is unique that somebody else could use

10:06

and share it through the community bundle.

10:08

There are some particular ways of doing that because there

10:11

are standards that have been put into place to make sure

10:14

that the code always functions and that it's readable

10:17

and those kinds of things.

10:18

There are learning guides and there are people like me

10:21

that can help out.

10:22

But I'd say getting started putting something

10:24

in a community bundle is very easy because you're already

10:27

doing it.

10:28

Synth.io was one of the highlights of Circuit Python

10:31

in 2023.

10:32

Tell me about the IoT Wind Chimes project

10:34

that you did earlier this year using Synth.io.

10:37

I love Synth.io.

10:39

I am so impressed with Synth.io because coming

10:43

from a musical background and working in the EuroRack

10:47

and designing my own analog circuits to get sounds out,

10:51

something as simple as Circuit Python that

10:54

has a layer in there that's for generating oscillators

10:58

and--

10:58

I love Synth.io.

10:59

I just love it.

11:00

I could go on.

11:03

So the Wind Chimes project is an interesting one.

11:08

I used to say, well, I have a problem.

11:10

My problem is-- my wife and I have this problem.

11:13

We collect wind chimes and they're out on the back patio

11:16

on the other side of our house.

11:18

We love them because we're both very musical

11:21

and we love having soundtrack going all the time.

11:24

But the thing is, we also listen to them at night

11:28

to gauge what the weather is doing outside.

11:31

We live in the desert of Washington state.

11:34

That's my preface to say wind chimes are important to us

11:37

because they tell us when the wind is going to start blowing

11:41

or when it has started blowing.

11:42

And we can gauge the speed of the wind

11:44

by the character of the wind chimes.

11:48

But unfortunately, in my office, I

11:50

can't hear the wind chimes.

11:52

So the IoT Wind Chimes project was

11:55

one where I wanted to hear the chimes in my office

11:59

and wanted it to be linked to the wind speed outdoors

12:02

so I could gauge how fast the wind was blowing.

12:06

We get-- by the way, wind storms around here

12:10

can become surprising in a number of ways.

12:14

We can get trampolines coming over the fence.

12:17

We can see trash cans blowing down the street.

12:20

I've even encountered a metal lawn shed coming over the fence

12:26

and sticking to the front of the house.

12:29

Oh my goodness.

12:30

We've had some-- so wind is something

12:32

that we think about a lot here.

12:34

And the wind chimes project is one way of doing that.

12:37

The fun part about that wind chimes project

12:39

was I used an ESP32S2 for it, which is a fantastic board.

12:44

I mean, it's one of my go-to boards

12:47

now when I'm doing musical things because it's fast.

12:51

And if I need an internet connection,

12:53

it's got the internet connection.

12:55

And so it was perfect for the IoT Wind Chimes project

12:58

because it could hold all of the musical notes

13:00

that I needed it to hold.

13:02

It could calculate the overtones that I

13:05

wanted to calculate to get that realistic chime sound.

13:09

The ESP32S2 was perfect for the project because of the fact

13:13

that it had the memory, and it had the speed,

13:15

and it had the internet connection

13:17

that I'd need for that.

13:18

And then throwing synth I/O on top of that,

13:20

I did something kind of organic to get the chime sound.

13:25

Because chimes are-- it goes back to physics and mechanics.

13:30

When you think about how a wind chime works,

13:33

it's a tube that vibrates.

13:35

But wind chimes don't vibrate using

13:37

the standard scientific model.

13:38

There's actually a little bit more to it than that.

13:40

They have overtones that are related to the type of metal

13:43

that it is, the striker that hits it,

13:46

and the pattern of the music is also--

13:50

it's periodic and predictable in physics.

13:53

Usually wind chimes are arranged in a circle,

13:55

and the striker travels in portions of a circle.

13:59

That's what made that project a lot of fun

14:01

was that I could take some time and look

14:04

at the physics of what it would take

14:06

to make an accurate chime sound and then figure out

14:09

how the notes would play.

14:10

Synth I/O was perfect for that.

14:13

You mentioned it earlier, but one of the first projects

14:15

you ever shared on the Adafruit Learn system

14:17

was the String Car Racer.

14:18

What is the String Car Racer?

14:20

The String Car Racer is a--

14:22

well, let me go back in history first.

14:25

Because I didn't invent the String Car.

14:27

My brother invented the String Car.

14:29

He's a mechanical genius, I swear.

14:32

And he put together this idea that if you take an old DC

14:35

motor and hang a battery from it, put a pulley on it--

14:38

because the motor already had the pulley on it--

14:41

if you stick it on a string, it's

14:42

going to shoot down this tight string.

14:45

At our house, when we were kids, we

14:47

would run the string from the apple tree in the backyard

14:50

to the telephone pole out front.

14:52

And that was a couple hundred feet.

14:53

And this string car would just zip down there.

14:56

And we came up with all sorts of ways to make the pulley bigger,

14:59

make it stick on the string better.

15:02

How many batteries can you put on it without losing

15:05

the tension in the string?

15:07

It was a great learning experience for us as kids,

15:10

because we got to experiment with all aspects

15:13

of the physics around that.

15:14

So that's how the String Car started.

15:16

It was a single motor, single battery,

15:18

hung on the string by its pulley.

15:19

And it would shoot down there.

15:21

And if you weren't down at the telephone pole

15:23

when it got down there, it would crash.

15:24

And we'd have to repair it.

15:26

And that gave us an opportunity to improve it.

15:29

That's where the String Car came from.

15:30

And so we were always trying to figure out better ways

15:33

to make the String Car go down and back.

15:35

And getting the String Car to reverse when it gets to the end

15:41

meant we could save the life of the String Car.

15:44

That was kind of important.

15:45

We didn't want to keep building over and over and over.

15:48

Let's fast forward.

15:49

We built these simple String Cars.

15:51

We didn't really have any formal rules or anything.

15:54

But we tried to keep them simple.

15:56

We used repurposed parts.

15:57

We'd get our motors from places.

15:59

We'd build the chassis out of fence wire

16:02

or whatever we had in hand.

16:03

And we just tried to keep it simple.

16:06

It wasn't until I was getting ready to retire from my career.

16:12

And I decided I need to work on some of these old family

16:15

projects again.

16:16

I got my brother interested, which is really great.

16:18

And I built some String Cars around the Trinket,

16:23

as I mentioned.

16:24

But I wanted to have the String Car be smarter about collisions

16:30

so that when it got to the end of the string,

16:32

it would reverse and come back.

16:33

And so I came up with a design for a String Car.

16:36

I don't know how--

16:37

I'm showing one right now.

16:39

But if you go to the learning guide

16:42

that I wrote on the String Cars, there's

16:44

a section in there that talks about the advancements

16:47

of the String Car and some of the things that we did.

16:49

So there are limit switches on this chassis that determine

16:54

when it hits something.

16:55

And hopefully, it hits something softly.

16:58

It'll reverse directions and go the other way

17:00

and do the same kind of a thing.

17:02

The String Car evolved into this.

17:05

Started with the Trinket.

17:06

I came up with a special board that's a custom Circuit Python

17:11

board.

17:11

And you can find it out there on circuitpython.org.

17:14

It's down-- the only person that ever uses

17:17

the download for that is me.

17:19

But it's out there.

17:20

And it's an M0 processor.

17:23

But it has all the little sensors and things

17:25

that the String Car needs to be able to go forward and reverse.

17:29

And it's evolved into--

17:31

now I have a feather wing, so I can plug in any kind of a board

17:35

into it.

17:36

Right now, it's running an M4 board

17:38

because that's floating point.

17:40

It can do the calculations that it needs to do.

17:43

But I've also run it with a Bluetooth board,

17:45

so I can remotely control it and things like that.

17:48

The String Car was just a great experience

17:51

in discovering physics and eventually learning

17:54

how to build some intelligence into it

17:56

so that it could be more autonomous.

17:59

We didn't require us to catch it when it reached the telephone

18:02

pole.

18:03

So the String Car was just really a great platform

18:06

for learning those kinds of things.

18:08

And it continues into--

18:10

even today, when I'm thinking about the physics of how

18:13

the robot works, right now, the String Car

18:17

is sophisticated enough to know, well, here's how it works.

18:20

It goes very slowly down the string

18:22

until it encounters a barrier.

18:25

And it determines, oh, I know how long the string is now

18:29

because it knows how long it took to get there.

18:31

And it knows that based on the motor speed and timing.

18:34

So now, it can travel backwards towards the start

18:38

as fast as it wants to because it

18:40

knows when it needs to slow down to keep

18:42

from colliding and falling off the string or worse.

18:46

So that was a fun experience to go

18:49

through the physics of figuring out

18:52

without any sensors other than the time,

18:55

how long does it take to get down to the end of the string

18:58

and keep from colliding and falling off and getting

19:02

damaged?

19:03

So great experience.

19:05

What a great project.

19:06

I'll make sure I link to that in the show notes as well.

19:08

Speaking of links, if people want

19:10

to learn more about your projects, where should they go?

19:13

Well, probably the best place to learn about projects

19:16

is the Adafruit Learning System and the Adafruit Learning

19:19

System Playground because I've been putting more projects

19:23

in the Playground area.

19:25

I also have a GitHub repository site that is Cedar Grove

19:30

Studios.

19:30

And you can put the link in the notes.

19:32

I put most all of my projects out there--

19:35

printed circuit boards I've designed,

19:37

concepts that I've had, and many of the finished projects

19:41

to weather stations and some of the other things

19:43

that I've worked on.

19:45

Playground is a particularly good place

19:46

to find not just my projects but other projects that--

19:51

they're not quite finished enough or polished enough

19:54

to be a learning guide, but they contain

19:56

a core idea about a project that you can learn from.

20:00

That's where I put a project about a guitar pedal

20:03

that I was trying to repair for a friend of mine.

20:08

And I put the details out in the Playground.

20:12

I'll make sure I link to that as well.

20:14

Last question I ask each guest.

20:15

You're about to start a new project.

20:17

Which board do you reach for?

20:19

Well, most of my projects I try to complete like a product.

20:28

So I really like my projects to have a front panel.

20:31

And the Pi Portal is this almost perfect front panel.

20:36

And it comes in three varieties, so you

20:37

get the three different sizes.

20:39

So Pi Portal with the M4 processor in it,

20:42

and it has an ESP32, that's a great choice

20:46

for most of my projects.

20:47

And if I think about a project, that's the first one

20:50

that I go to probably.

20:52

That being said, I kind of like the Pi Badge and the Pi Gamer

20:58

because they act like front panels too.

21:00

I made a turtle bot where I used a robot that moves around

21:05

using the turtle language.

21:06

And I put a Pi Gamer on the top of that with a display,

21:10

and that became the front panel for the robot.

21:12

So front panels, that's my first choice.

21:15

But I really discovered the ESP32-S2.

21:19

And the RP2040, especially the QDPi version,

21:24

is perfect if you're dealing with sensors.

21:26

And I love sensors.

21:28

If you're trying to do something quick and dirty with a sensor

21:31

and you don't want to have to solder a bunch of stuff,

21:33

QDPi RP2040 is perfect.

21:35

So that's four boards.

21:37

That's about the best I could do.

21:39

I can't pick just one.

21:41

Who can these days?

21:42

There's so many great choices out there.

21:44

Yeah, yeah, it's fun.

21:46

Jan, thanks so much for being on the show.

21:48

Oh, you're welcome.

21:49

I really enjoyed it.

21:50

I have a big passion for working with other people

21:54

and learning from what other people do.

21:57

And the CircuitPython environment

21:59

is just so perfect for that.

22:01

Coming on this show and talking to you, it's just been a thrill.

22:05

Thanks again.

22:07

Thank you for listening.

22:08

You can find transcripts in most podcast players,

22:11

and show notes are available at www.circuitpythonshow.com.

22:16

Until next time, stay positive.

22:19

.