3.3v pin on pixelblaze v3

I’ve begun a project for my kids beds, and am looking to combine a force sensor strip to a pizelblaze v3.
I have a separate force sensor strip working with a esp32 project, which caught their attention. The goal is to have a nightlight feature, where my smarthouse puts their pixelblaze into a nightlight pattern when it is bed time, and the lights are on if they are out of their bed, and off if they are in bed. It looks like I can use GPIO 25 or 26 as analog inputs for this, and I plan to use an over/under threshold to determine if they are in bed or not.

In the docs I saw suggestion to use a voltage divider to supply voltage to an analog sensor as 3.3v. I’ve put this together (6.2kohm and 12 kohm), then saw a 3.3 v pin.

** Given that the documentation suggested using a voltage divider from the 5v input, is there a problem with using this 3.3v pin to supply analog sensors with 3.3v?


For those interested, the force sensitive strip is this: https://www.amazon.ca/LANTRO-JS-Pressure-Intelligent-Breathing/dp/B09C8TVYTR/
and it has been working great in my esp32 project for a month now.

On v3, unfortunately many adc pins are unavailable with wifi 9n. Pin 33 works though.

Very recent Pixelblaze have a new revision that exposes more pins, a lot more analog. These just started shipping. If you need more than one input I can swap yours out for the new rev.

The voltage divider for the v2s esp8266 is a bit different as it can only go up to 1v. The v3s esp32 can do 3.3v, so no divider needed unless you have a 5v analog signal.

There’s no problem using the 3.3v, it has some headroom for light current loads.

Perfect, thanks for the clarification!

Another question, as I can’t find a lot of documentation on this.
I am trying to read from either pin GPIO 25 or 26, and they don’t seem to be working in the way I had my ESP32 in arduino.
Do I need to set the pin to analog first in the declaration portion
ie: pinMode(26,ANALOG)

My stripped down test code has a static value read from the pressure sensitive strip, and while it doesn’t look like there were any shorts/problems with my soldering/compontents, I get a static value in the exported fStrip (0.999756). Re-updating the code while pressing the strip doesn’t result in a refreshed value. The strip does appear to give variable resistance when testing with a multimeter, similar to my other ones.

Before I really start pulling my hair out with the wiring, I was wanting to confirm that my code is correct:

/*
Test pattern for using analog input
*/
 
pinMode(26,ANALOG)

export var fStrip = 0;

export function beforeRender(delta) {
  fStrip = analogRead(26);
}


export function render(index) {
  hsv(.5, 1, fStrip)
}

Do I refer to the pin as 26, GPIO26? Is the pinMode required (as I’m not outputting anything through it)? Is something important missing?

From a hardware wiring perspective I may need to desolder my possibly suspect variable pull-down resistor on the analog pin, but was wanting to confirm my code first.

Thanks !

I mentioned that in my earlier post:

On hardware before revision 3.6, unfortunately most ADC pins are unavailable with wifi on. Pin 33 works though.

In the ESP32 docs, anything on ADC2 is not usable. These used to work at some point much earlier on in V3’s development, but might have been working in an unsafe way, and the framework changed at some point to disallow it entirely while WiFi is on.

Thanks for highlighting that. My mind had been on the 3v3 pin at the time, and the esp32 chip I was using for my other application had a lot of ADCs, so it hadn’t occurred to me. Also, it took me quite a while to find pin 33.
I only now notice different ‘pins’ are exposed on the bottom side, where 33 is a metal tab.
It looks like this tab/pin works well. If I run into obstacles, I may take you up on the exchange offer - although it looks like the new version also uses tabs to solder into, so there would be no quick swap-out option.
For those looking into this in the future, below is my working test code:

/*
Test pattern for using analog input. If the force on the strip is less than the threshold, the strip lights up. Use case: night light for bed. Pattern activated at bedtime. If the person gets out of the bed, the strip lgihts up, if they lie down in bed, the strip turns off.
*/

export var fStrip = 0;
export var threshold = 0.05

export function beforeRender(delta) {
fStrip = analogRead(33);
}

export function render(index) {
if (fStrip < threshold) {
hsv(.5, 1, 1)
}
}

2 Likes