0

Bare Conductive touch board & 26 RGB Neopixels
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Bare Conductive touch board & 26 RGB Neopixels

by rachelmax on Wed Sep 04, 2019 8:38 pm

Hello -

I am using the Bare Conductive touch board with conductive paint and 26 RGB neopixels. I have pixel check at the start of my loop and the pixels are all a lovely bright white. In the code I use a button counter to count the number of times a sensor is touched - after 5, the Neopixels light up - but sadly are only a dull orangish - sort of like there's not enough power... but that first pixel check looks great....

Any ideas?

I am running the Neopixels from the 5v (also tried 3V - same issue). no other sensors - just three 30mm circles of conductive paint.

Thank you, Rachel

rachelmax
 
Posts: 35
Joined: Sat Mar 11, 2017 11:40 pm

Re: Bare Conductive touch board & 26 RGB Neopixels

by nickine9 on Thu Sep 05, 2019 2:51 am

although it was some time ago I have used a bare conductive board with 40+ neopixels. are you pixels individual pixels or part of a strip/ring? You could try powering the pixels from an external battery pack (remembering to tie the grounds together). It would help if you could post your code and a picture of your wiring.

nickine9
 
Posts: 119
Joined: Fri Jan 06, 2017 4:14 am

Re: Bare Conductive touch board & 26 RGB Neopixels

by rachelmax on Thu Sep 05, 2019 3:11 am

Code: Select all | TOGGLE FULL SIZE
/*******************************************************************************
 
 NTS: seems to work with proximity too - so far I seem to only be able to get maybe duration?
 
 
 This sketch is based on Random_Touch_MP3.ino from Bare Conductive which uses code by Jim Lindblom
 and plenty of inspiration from the Freescale Semiconductor datasheets and application notes.
 Bare Conductive code written by Stefan Dzisiewski-Smith and Peter Krige.
 This work is licensed under a MIT license https://opensource.org/licenses/MIT
 Copyright (c) 2016, Bare Conductive
 
*******************************************************************************/

// compiler error handling
#include "Compiler_Errors.h"

#include <Adafruit_NeoPixel.h>
#include <math.h>

#define NUMPIXELS  26  // Number of pixels in strand
#define NEOP_PIN 12  // NeoPixel LED strand is connected to this pin
Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUMPIXELS, NEOP_PIN, NEO_GRB + NEO_KHZ800);


// touch includes
#include <MPR121.h>
#include <Wire.h>
#define MPR121_ADDR 0x5C
#define MPR121_INT 4


// define LED_BUILTIN for older versions of Arduino
#ifndef LED_BUILTIN
#define LED_BUILTIN 13
#endif

//time
unsigned long timeAtLEDon = 0;
long LEDonInterval = 1000.0*60.0*10.0; //1000 milliseconds (1 sec) * seconds in a minute * number of minutes
boolean isOn = false;

//button
int buttonPushCounter = 0;   // counter for the number of button presses
int buttonState = 0;         // current state of the button
int lastButtonState = 0;     // previous state of the button

void setup(){ 

 
  strip.begin();
  strip.show(); // Initialize all pixels to 'off'
 
   Serial.begin(9600);
 
  pinMode(LED_BUILTIN, OUTPUT);

  // initialise the Arduino pseudo-random number generator with
  // a bit of noise for extra randomness - this is good general practice
  randomSeed(analogRead(0));

  if(!MPR121.begin(MPR121_ADDR)) Serial.println("error setting up MPR121");
  MPR121.setInterruptPin(MPR121_INT);
 
   
}

void loop(){

    readTouchInputs();
   
  //do a quick LED test to show that LEDs work and sketch has been reset
  //made it 3000 so I can get a nice group start up animation
 if (millis() < 3000) {
  colorWipe(strip.Color(255, 255, 255), 30); //white
  colorWipe(strip.Color(0, 0, 0), 30);
  }

}


void readTouchInputs(){
  if(MPR121.touchStatusChanged()){
   
    MPR121.updateTouchData();

    if(MPR121.getNumTouches()<=4){
      for (int i=0; i < 12; i++){  // Check which electrodes were pressed
        if(MPR121.isNewTouch(i)){       
            //pin i was just touched
            Serial.print("pin ");
            Serial.print(i);
            Serial.println(" was just touched");
            digitalWrite(LED_BUILTIN, HIGH);
            } else {
          if(MPR121.isNewRelease(i)){
            Serial.print("pin ");
            Serial.print(i);
            Serial.println(" is no longer being touched");
            digitalWrite(LED_BUILTIN, LOW);
          }

           
   if (MPR121.isNewTouch(9)) {
   buttonState = HIGH;
    }

    if (MPR121.isNewRelease(9)) {
   buttonState = LOW;
    }

    if (buttonState != lastButtonState) {
    if (buttonState == HIGH) {
      buttonPushCounter++;
      // Serial.println("on");
      Serial.print("number of button pushes: ");
      Serial.println(buttonPushCounter);
    } 
  }

//interaction
if (buttonPushCounter >= 5 && MPR121.isNewTouch(1)) {
    for (int i = 0; i <= strip.numPixels() - 1; i++) {
      strip.setPixelColor(i, 100, 100, 100);
    }
  }


  if (buttonPushCounter >= 10) {
    buttonPushCounter = 0;
    for (int i = 0; i <= strip.numPixels() - 1; i++) {
      strip.setPixelColor(i, 0, 0, 0);
       
    }
  }

//  if (!isOn) {
//    if (buttonPushCounter >= 5 && MPR121.isNewTouch(1)) {
//      timeAtLEDon = millis();
//      isOn = true;
//      }
//    }
// 
//
//  if (millis() > LEDonInterval + timeAtLEDon) {
//    for (int i = 0; i <= strip.numPixels() - 1; i++) {
//      strip.setPixelColor(i, 0, 0, 0);
//     isOn = false;
//    }
//  }
        }
      }
    }
  }
}
 


  // Fill the dots one after the other with a color
void colorWipe(uint32_t c, uint8_t wait) {
  for (uint16_t i = 0; i < strip.numPixels(); i++) {
    strip.setPixelColor(i, c);
    strip.show();
    delay(wait);
  }
}
 

rachelmax
 
Posts: 35
Joined: Sat Mar 11, 2017 11:40 pm

Re: Bare Conductive touch board & 26 RGB Neopixels

by rachelmax on Thu Sep 05, 2019 3:12 am

Code is above - not tidy code - but code.

Everything is going directly into the board.

rachelmax
 
Posts: 35
Joined: Sat Mar 11, 2017 11:40 pm

Re: Bare Conductive touch board & 26 RGB Neopixels

by adafruit_support_mike on Thu Sep 05, 2019 3:29 am

Please post a photo showing your hardware and connections.. that sounds like a power issue.

800x600 images usually work best.

adafruit_support_mike
 
Posts: 58856
Joined: Thu Feb 11, 2010 2:51 pm

Re: Bare Conductive touch board & 26 RGB Neopixels

by rachelmax on Wed Sep 11, 2019 3:26 pm

Thank you but I finished the project and am now moving so it's all quite stressful.

I could not get the Neopixels to light correctly.

I will try again at a later date.

Cheers,
Rachel

rachelmax
 
Posts: 35
Joined: Sat Mar 11, 2017 11:40 pm

Please be positive and constructive with your questions and comments.