#MagTag GPIO through D10 JST header

1 messages Ā· Page 1 of 1 (latest)

past burrow
#

Done.

#

Thank you for helping with the diagram. I am a bit new to all this. It feels weird to be 46 years old and ask for help. šŸ˜„ I've been so sure about most of the things I do that this is a novel experience.

fickle estuary
#

Happy to help. We all started at the beginning.

#

Paying it forward is how I honor my many mentors.

#

Does this make sense?

past burrow
#

Oh, so GND from the Stemma port goes to GND on the breakout, and the D10 to SET, and D10 and GND have a 2.2K resistor. Where's the best place to mount that resistor? On the cable, or directly on the breakout board?

#

Alright, cables and resistors have been ordered. I hope they arrive before Christmas.

fickle estuary
#

I'd put it on the cable with a generous helping of heat shrink tubing. It's easier to modify/change/fix that way.

past burrow
#

OK, so what's the process there? I clip the cable halfway, skin it, then solder the two ends to one leg of the resistor, and same for other cable?

#

(and don't forget to put on the dang heat shrink tubing first, Torgny!)

fickle estuary
#

Yes. That would work just fine. Also put some heat shrink over the end of the red wire to keep it from accidentally connecting with something.

#

I can't count the number of times that a lonesome piece of heat shrink tubing stared back at me from the benchtop.

past burrow
#

Right?

fickle estuary
#

Do you have a solderless breadboard?

past burrow
#

I do.

#

I also have plenty of solder and a bunch of perma-proto boards.

fickle estuary
#

Mocking up the final circuit on the breadboard first is highly recommended.

past burrow
#

Will do so.

#

So, my next question I think is more of an enclosure kind of question. How would I go about in making this look prettier?

fickle estuary
#

Oh, there are lots of options. Do you have a 3d printer?

past burrow
#

Right now I have the cloud front and clear back and magnet legs on the MagTag, but they're not tall enough to fit the PM25 on the back of the MagTag.

#

I do have a 3D printer.

fickle estuary
#

A printer is nice, but not always necessary. This is the version I made with the PyBadge and a Pelican case.

past burrow
#

I am wondering where the best spot for the PM25 sensor would be? Part of the reason for doing this is to actually measure the PM 2.5 from the printer. I am currently logging everything to Adafruit IO.

#

why the little cages?

#

also, the breakout on the right side, is that the CO2 sensor?

fickle estuary
#

Since the PM25 sensor has a fan, placement isn't very critical. Perhaps close enough for early warning but far enough away from the printer to be good for general room monitoring, too.

#

Yes, that's the CO2 sensor. This is a portable unit I made for my asthmatic grandson to take camping. The cages just help protect the sensors.

past burrow
#

Oh wow. That's awesome.

fickle estuary
#

He speaks multiple languages, so this version also converses in French and German.

past burrow
#

niiiice

fickle estuary
#

Was very fun to make!

#

As far as enclosures go, check out the Adafruit Learning guides for inspiration if you haven't already. Always some good stuff in there.

#

I wrote one on enclosures a few years ago -- nothing 3D printed, though. I'm an old school fabricator.

past burrow
#

I am thinking I need to design a case for the MagTag that can also contain the sensor breakout. Have the PM25 on the side of the MagTag so it's not so fat, and have a nice little opening for the fan intakes.

#

Can you link me?

fickle estuary
past burrow
#

That's nice!

#

Whatever I build I'll opensource it and maybe I can even write a guide for it?

fickle estuary
#

I hope so. That's the fuel that keeps the creativity going for the community.

past burrow
#

Sweet. Will do.

#

I'm going to add a temp/humid sensor, then I am off to design an enclosure for all this in OpenSCAD.

fickle estuary
#

Cool. Looking forward to seeing your design. Am also very interested in how the MagTag and sensor work together after sleeping.

past burrow
fickle estuary
#

šŸ‘

past burrow
#

@fickle estuary you magnificent mastermind! I have breadboarded your solution and it definitely works to standby the PM25 sensor.

#

Just got a few things left to check, and then I think I'm ready to cut some wire and start soldering. But, I kind of regret putting male header pins on the PM25 sensor, and I am terrible at desoldering.

#

they're not exactly the most secure connection.

fickle estuary
#

I noticed that the sensor led stays lighted, so that means there will be a few milliamperes drawn by it and possibly the board’s I2C pull-ups.

#

If you remove the black plastic from the header sockets (on the wires), you can simply solder them to the header pins. Remember to use heat shrink there, too, if spacing is tight.

past burrow
#

oh, yeah, I'll solder them on like that, good call

#

and it wakes from sleep and turns the fan back on, then shuts it back down... time to measure some draw on this when it sleeps, and it so happens that the Nordic PPK II arrived today.

fickle estuary
#

Excellent! I don’t have the PPK II but have heard good things.

past burrow
#

Yeah, I had looked at it previously, and I think someone recommended it, and then it was available at the store, and it was all a blur, but I think I may have spent some money.

fickle estuary
#

I’ve made a few purchases like that.

#

Ladyada likes the PPK.

past burrow
#

Yeah, I saw her talk about it on the live feed. And, come to think of it (and after reading chat history) I think I found it on the shop and researched it a little bit, then asked if there were any alternatives (since it was out of stock)...

#

and MadBodger replied and we talked a bit about the uCurrent.

#

Hey, do you know if there's any recommended time frames for how long I need to wait after spinning up the fan before sampling with the plantower PM25?

fickle estuary
#

Don’t recall. Let’s check the specs…

past burrow
#

hmm, I think... this guy actually has two modes... but, not sure if we can change those?

fickle estuary
#

Says at least 30 seconds.

past burrow
#

The active mode is divided into two sub modes: stable mode and fast mode. If the concentration change is small the sensor would run at stable mode with the real interval of 2.3s. And if the change is big the sensor would be changed to fast mode automatically with the interval of 200~800ms, the higher of the concentration, the shorter of the interval.

fickle estuary
#

Circuit Attentions

Stable data should be got at least 30 seconds after the sensor wakeup from the sleep mode because of the fan’s performance.

past burrow
#

yup, was reading that now, so, I spin the little one up, then wait for 30 seconds

fickle estuary
#

You might be able to shorten that time since they are probably specifying a general case. I’d try it at 15 seconds and see if the measured value is reasonable.

past burrow
#

(note to self, don't wait for 30 seconds AFTER you've connected to wifi, that uses a lot of power)

past burrow
#

Waiting 30 seconds after spinning up the sensor. Now I am getting much more consistent readings.