Flex Sensor

Hi I recently bought a flex sensor for a project and I was wondering if the flex sensor can work with a 12v or 5v led light strip since it works with a led bulb?? Hearing back quickly would be greatly appreciated thank you!

Not directly as these are low current devices and won’t be able to dissipate enough power to run a whole strip of LEDs.

You’d need to have a micro controller read the resistance and then PWM control a MOSFET to drive a heavy load like a LED strip.

There is a microcontroller on the board already but is there a diagram that can show me how to connect the mosfet, the led, the flex sensor and a battery connection to a breadboard that way I dont have trouble getting it working?

I’m afraid we don’t have a hookup guide for what you’re attempting to do.

What flex sensor are you using?

I am using the longer flex sensor that is a little more than 4 inches that I saw off adafruit and I am not skilled with electronics like this, meaning I’m not knowledgable with using breadboards, led strips, arduino boards/red boards and flex sensors so I would greatly appreciate it if I could get help with getting the led to work with the flex sensor so that when you flex the sensor the led strip gets brighter. I have a project dew in the next few weeks and I really need help.

Can you link me to the flex sensor and microcontroller board you’re using?

https://www.sparkfun.com/products/8606 is the flex sensor

https://learn.sparkfun.com/tutorials/what-is-an-arduino is the Arduino board with what I think is a microcontroller on it

and if this board doesn’t work I also have a Redbeard from this link which I believe also has a microcontroller on it, https://www.sparkfun.com/products/13975

I really need help with this since I am not knowledgeable with this stuff!!

OK, I can’t design and build your project for you, but I can recommend some parts to use and point you to some tutorials that might help. You’re also going to have to write some software that makes this all work. (Sorry, it’s not going to be plug and play)

Here’s the parts I’d use:

  • - An Arduino Uno or the SparkFun RedBoard you have now.
  • - The flex sensor you have now.
  • - One [[10K resistor](https://www.sparkfun.com/products/14491).
  • - A 12 volt power supply large enough to run your 12 volt LED strip.
  • - One [[MOSFET power control kit](https://www.sparkfun.com/products/12959).
  • - A [[5mm LED](https://www.sparkfun.com/products/9590).
  • - A [[1K ohm resistor](https://www.sparkfun.com/products/14492).
  • [/list]

    You’re going to want to look at the [hookup guide for the flex sensor, that shows how to connect the sensor to your Arduino/RedBoard.

    Once you have that working, take a look at [this tutorial on PWM for changing the brightness of a LED with a potentiometer. (In your case the potentiometer is being replaced with your flex sensor and 10K resistor.) For now, just use your 5mm LED and resistor to stand in for the LED strip. You may need to experiment with the code in the tutorial to get the LED and flex sensor working the way you want the LED strip to work just the way you want it too in the final project.

    Once the LED is working the way you want, then you can add the MOSEFET kit in place of the LED and resistor by connecting the “C” pin on the MOSFET kit to pin 13 on the Arduino, and the “-” pin on the SYSTEM side of the MOSFET kit to ground on the Arduino. Your 12 volt power source connects to the “+” and “-” pins on the SYSTEM side of the MOSFET kit. Your 12 volt LED strip connects to the “+” and “-” pins on the DEVICE side of the MOSFET kit. Now, the LED strip will dim and brighten just like the 5mm LED did earlier.](Arduino PWM Explained: Basics & Applications)](https://learn.sparkfun.com/tutorials/flex-sensor-hookup-guide)](Resistor 1K Ohm 1/4 Watt PTH - 20 pack (Thick Leads) - PRT-14492 - SparkFun Electronics)](https://www.sparkfun.com/products/9590)](SparkFun MOSFET Power Control Kit - COM-12959 - SparkFun Electronics)](https://www.sparkfun.com/products/14491)

    I did the steps and I am still having trouble with it, I just need someone to tell me what else I would need to do in order to get the flex sensor to work with the LED strip. The black wire in A0 is causing the led strip to turn on and off by bringing your hand farther and closer to the wire and only one end of the wire is connected to the A0.

    It doesn’t sound like you have things connected properly.

    Can you send a schematic diagram detailing your connections and photos of your setup?

    Here is a drawing of how I wired the boards, mosfet kit and led strip. It will turn on but the flex sensor isn’t working with the led Strip, what do I need change for it to work?

    It looks like you might be using pin D13 for controlling your MOSFET. Pin 13 can’t do PWM and that is likely what’s causing the “on or off” behavior you’re seeing.

    You’re going to want to connect the control pin on your MOSFET board to a PWM enabled pin like D11, D10, D9, D6, D5 or D3 and change your sketch to use that instead.

    (The digital pins on an Uno that are PWM capable have a ~ next to them.)

    I tried to move the wire connecting the mosfet kit to the elegoo board in the D13 spot and tried D11,D10,D9,D6,D5, and D3 and the led strip didn’t turn on. I am not sure what is wrong, what can I do?

    I can’t help you with your code, but you need to change that too so that the Arduino knows what pin you’ve moved the wire too.

    Hi,

    I did what you recommended and after changing the code it kinda worked, the flex sensor sometimes does it and when it does it is delayed.