Pages: [1] 2 3 4   Go Down
Author Topic: Flex Sensor and Mini 8X8 LED Matrix????  (Read 4438 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 31
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Completely new to Arduino-I just received my components listed in the title and below:
8X8 Mini LED Matrix, Flex Sensor, Arduino Uno, MAX7219 and perma-proto 1/4 Sized BreadBoard (3)

I am hoping to rig this project such that the flex sensor can act both as the switch for the matrix and the dimmer...
Bent=Off Straight=Full power
I have watched various videos and read tutorials on both functions-wiring the matrix with the MAX, and the flex sensor
working with only one LED but bringing them both together as one project is what i want to do.

I am an Industrial Design Student trying to incorporate all of this within a task light I have made.
Any and all help would be appreciated.

Is this possible?
What other parts do I need other than resistors? Are my breadboards too small?
Can the flex sensor and matrix be on separate breadboards with distance between them?

I don't know code or really anything when it comes to this-just what I have read/watched.
I am also new to wiring so the right amount of voltage/resistance is something I cannot do myself.
Thank you again for any and all help...


* parts.jpg (2609.2 KB, 2448x3264 - viewed 71 times.)
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 524
Posts: 26443
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes, that will be easy to do.
Obtain a 0.1uF and a 1uF cap also for the MAX7219.
Wire up the matrix and the display per the MAX7219 datasheet to start.
http://datasheets.maximintegrated.com/en/ds/MAX7219-MAX7221.pdf
Seg0-7 go to the Anode pins, and Dig0-7 go to the Common Cathode pins.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Edison Member
*
Karma: 64
Posts: 2464
Now, More Than Ever
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The current [ISET] for the LEDs, vis-a-vis the MAX7219, is established by RSET.  There is a value below which that should not go (too much current).  I don't know what the range of a flexsensor is, but I think that you may not want to substitute it directly for RSET.
<speculation> Maybe the better way would be to use the flexsensor with analogRead and result a variable  RSET that way. </speculation>
As this is for a "task light" then perhaps the "7219" may not be necessary.  Do you require just an arrangement of LEDs to vary (dim as a whole) or is the arrangement required to do patterns and so on?  If you need just to vary the lot, it'd be easy to read the flexsensor (analogRead) and  result a PWM result (analogWrite) for the LEDs based on that.
Logged

"Hello, I must be going..."
"You gotta fight -- for your right -- to party!"
Don't react - Read.
"Who is like unto the beast? who is able to make war with him?"

Offline Offline
Faraday Member
**
Karma: 61
Posts: 2833
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Do one thing at a time.

Learn how the flex sensor works,  and implement it.

Learn how the led works,  and implement.

And then try and combine the two.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 31
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The current [ISET] for the LEDs, vis-a-vis the MAX7219, is established by RSET.  There is a value below which that should not go (too much current).  I don't know what the range of a flexsensor is, but I think that you may not want to substitute it directly for RSET.
<speculation> Maybe the better way would be to use the flexsensor with analogRead and result a variable  RSET that way. </speculation>
As this is for a "task light" then perhaps the "7219" may not be necessary.  Do you require just an arrangement of LEDs to vary (dim as a whole) or is the arrangement required to do patterns and so on?  If you need just to vary the lot, it'd be easy to read the flexsensor (analogRead) and  result a PWM result (analogWrite) for the LEDs based on that.

Thank you SO much. Yes all I need is for the matrix to dim as a whole. I can/am open to buying a different LED product if that would make it an easier project-I must be finished by Monday the 4th. I understand that probably sounds like plenty of time but I also need to figure out how to build the body of the task light and optimally have the wiring/arduino/flex sensor contained within the model so figuring this out ASAP is vital.  Thanks so much to your help Runaway. Today I will be finalizing the form of the light, coating a foam body in epoxy resin for a mock up.  Eventually I hope to make it out of wood but may not be doing that because of time.  Continued advice from anyone is appreciated.
Logged

Offline Offline
Edison Member
*
Karma: 64
Posts: 2464
Now, More Than Ever
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What colour/s ?

> > > Avoid at this time arranging the LEDs in an electrical matrix, that may make things more complicated than necessary.  There's a physical bunch of LEDs, but how to connect them [i.e. what to do] depends on some other factors.
What's the power source (a 12V battery pack)?

> > >
http://arduinobasics.blogspot.com/2011/05/arduino-uno-flex-sensor-and-leds.html
http://garagelab.com/profiles/blogs/tutorial-flex-sensor-with-arduino
« Last Edit: February 23, 2013, 09:59:00 am by Runaway Pancake » Logged

"Hello, I must be going..."
"You gotta fight -- for your right -- to party!"
Don't react - Read.
"Who is like unto the beast? who is able to make war with him?"

Offline Offline
Newbie
*
Karma: 0
Posts: 31
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What colour/s ?

> > > Avoid at this time arranging the LEDs in an electrical matrix, that may make things more complicated than necessary.  There's a physical bunch of LEDs, but how to connect them [i.e. what to do] depends on some other factors.
What's the power source (a 12V battery pack)?

> > >
http://arduinobasics.blogspot.com/2011/05/arduino-uno-flex-sensor-and-leds.html
http://garagelab.com/profiles/blogs/tutorial-flex-sensor-with-arduino

Awesome! Thank you! Color is just bright white.  Power source can be whatever is necessary I mean ideally this light would plug into the wall and convert the power itself but for school/project purposes using the USB on the arduino or it's power source converter plug in or batteries would work-whatever isn't going to fry everything if that's what the danger is.  I will dissect all this info ASAP Runaway thanks once again. My Dad is more solder/tech experienced than I am and I have to still run out to get the resistors so some delay may come before assembly but this is great.  I will also pick up other LEDs, singles and possibly a strand if those are better? Do they sell at strands at radioshack? Which is best and available for pick up/what store without breaking my bank... I guess is what I'm asking.

I guess other questions that could be addressed now would be:

Can I have the arduino/flex resistor in one location that would be about 20" away from the LEDs?
    -if changing from the Matrix is also even better because of this I am again open to whatever is best...

Runaway many thanks!
Logged

Offline Offline
Edison Member
*
Karma: 64
Posts: 2464
Now, More Than Ever
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I think I would stay with discrete LEDs (eschew "strands").

It's good you have your Dad to assist, his experience will likely prove a valuable resource.

It'll require some wiring (thin gauge wire is OK for this) for sure.
Others may see it different.

The drawing (attached) shows how I figure easiest - 2 in series with their own resistor, in parallel with all the rest, all going through the one FET, PWM-controlled, I estimate 380 mA.
(The dwg doesn't include the flexsensor, it's just the LEDs circuit.)

I see the sketch (programme) as a loop that's constantly (well, repeatedly anyway) reading the flexsensor and adjusting the PWM output based on that...
And that could be fluid or coarse, depending on your vision of that action.

Good "logic level MOSFETs" are STP40NF10L or IRLZ44, both available from DigiKey.
http://www.digikey.com/product-detail/en/STP40NF10L/497-6741-5-ND/1039549
http://www.digikey.com/product-detail/en/IRLZ44NPBF/IRLZ44NPBF-ND/811808
Maybe you have other resources available.  You should buy at least a couple, in case of "mishaps".

I'll stress that you can, and should, come up with the sketch and then implement a modest test of that - while you wait for your MOSFETs to arrive.


* tasklt.JPG (21.17 KB, 513x440 - viewed 42 times.)
Logged

"Hello, I must be going..."
"You gotta fight -- for your right -- to party!"
Don't react - Read.
"Who is like unto the beast? who is able to make war with him?"

Offline Offline
Edison Member
*
Karma: 64
Posts: 2464
Now, More Than Ever
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You don't have to run a wire from each pair back to the MOSFET.
The pairs and resistors would be assembled in the "head" with two wires running out of it back to the "control box" (one for +12 and the other to the MOSFET's Drain.)



Logged

"Hello, I must be going..."
"You gotta fight -- for your right -- to party!"
Don't react - Read.
"Who is like unto the beast? who is able to make war with him?"

Offline Offline
Newbie
*
Karma: 0
Posts: 31
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You don't have to run a wire from each pair back to the MOSFET.
The pairs and resistors would be assembled in the "head" with two wires running out of it back to the "control box" (one for +12 and the other to the MOSFET's Drain.)


Great. A little of that was over my head but you seem to be following my vision perfectly.  I would like a more fluid motion. SO speaking of-we got the flex sensor working with one LED that was just simply on pin 13 but I think because of how the code was that we copied the dimming is too little and it's basically just on/off.  Maybe with more LEDs it will be more apparent.  Don't understand the MOSFET looking up now and will continue research as I construct the model (excited-right now foam is hardening epoxy finish should be done tomorrow)

Will a proto board for the arduino help? I can just use that to solder on the flex sensor and it's resistor then also use it as an easy out to the LEDs downstream...??  I think I can still pull off the matrix have been doing more and more research on that the only thing that confuses me is that the pins are not just opposite - and + on either side of the matrix.

Is there any reason I can't just do what this sketch shows? http://arduino.cc/en/Tutorial/RowColumnScanning
Picture below:


* rowColScan.png (76.85 KB, 725x560 - viewed 50 times.)
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 31
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

And then one of the potentiometers is the flex sensor...??



* RIG.JPG (2619.06 KB, 3264x2448 - viewed 42 times.)
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 31
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Here is a side view drawing of what my task light will look like and work.
The red lines are describing the motion and the flex sensor.

When the light is compressed it automatically turns off given the flex sensor and when the
user pulls it out-off the wall-the LEDs automatically slowly brighten to full power and full extent
and vice versa for dimming just move the light back closer to the wall.

That's why need about 20" of slack from flex sensor/arduino/wall to the LEDs.


* techDRAW.jpg (2303.62 KB, 3264x2448 - viewed 26 times.)
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 31
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes, that will be easy to do.
Obtain a 0.1uF and a 1uF cap also for the MAX7219.
Wire up the matrix and the display per the MAX7219 datasheet to start.
http://datasheets.maximintegrated.com/en/ds/MAX7219-MAX7221.pdf
Seg0-7 go to the Anode pins, and Dig0-7 go to the Common Cathode pins.

Crossroads thanks! I also posted in other forum at this link: http://arduino.cc/forum/index.php/topic,150219.0.html
and have been getting help from Runaway Pancake but he has been steering me away from the matrix idea.

I have the flex sensor rigged up working with a single LED still mounted on the arduino uno.  Code needs some revision to make it a broader dimming process but I also believe the effect will be more visible with multiple LEDs idk I may be wrong please let me know.

I got the caps and resistors-also picked up an arduino proto board and a separate larger breadboard for testing.
My vocabulary for this stuff is very minimal especially abbreviations so I guess I'm wondering if you could just draw me what you meant.

Clarification-I do not need to be able to control each LED in the matrix I just want all 64 to turn on and dim/brighten as a whole given the flex sensor.  This should make it much easier right? especially with the code. I am inferring that I still need the MAX to be able to power all 64 enough correct?  What's really throwing me in all the wiring drawings/diagrams the Matrix has pins at the top and left caddycorner to each other and not opposite each other as it is on my matrix.  Thanks again for your help and any and all advice is appreciated! Or if even just hopped on the other forum link if easier.


* RIG.JPG (2619.06 KB, 3264x2448 - viewed 19 times.)
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 31
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This site is the data sheet for my LED matrix: http://www.adafruit.com/datasheets/BL-M07C881.PDF

This is what I was working off of the just get the flex sensor working with one LED in pin 13" http://arduinobasics.blogspot.com/2011/05/arduino-uno-flex-sensor-and-leds.html


Can I just do something like this: http://arduino.cc/en/Tutorial/RowColumnScanning
-use one of the potentiometers as the flex sensor??

What I don't get from this drawing is necessary MAX or resistors?
/What pins are what on the matrix? How can I tell which side is positive/-?
Actual pins are across from each other but in every diagram they are on left and top...

Thanks AGAIN!  Finishing form of light arm tonight and will get deeper here after.


* rowColScan.png (76.85 KB, 725x560 - viewed 23 times.)
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 31
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This is where I get confused-cathode/anodes of the matrix.
http://playground.arduino.cc/Main/MAX72XXHardware#Wiring

Wiring a Led matrix

The MAX72XX can drive up to an 8x8 matrix as shown in the schematic below. The labels on the left and the top of the schematic refer to the matching pins of the MAX72XX.

You can build your own matrix out of individual Leds, but there are also pre-wired ones available. They can be directly connected to the MAX72XX. Some are arranged as column cathode and some are column anode (as in the diagram above). Either type will work but you must connect the anodes to the Seg lines and cathodes to the Dig lines and arrange your source data to suit (e.g. be prepared to swap rows for columns).

MY MATRIX http://www.adafruit.com/datasheets/BL-M07C881.PDF
Is the BL-M07C881W-XX which according to the datasheet is: Row-Cathode Column-Anode

HELP thanks to anyone!
Logged

Pages: [1] 2 3 4   Go Up
Jump to: