Go Down

Topic: I need help  (Read 840 times) previous topic - next topic

ledgirl8089

So hello I really need help with my project for my electric class, and I have a big problem I can't find anything on it, I need to create a led strip with magnetic pen, with 20 led chip that when I move the pen over them to one direction it will turn white and when I move to the other direction it will turn red please help me to find a solution it should be very easy but I can't find away to do it, the pen will not be attached to it but over the led chip will be a metal ball that will be drug with the magnetic pen and I want the metal ball to light the chips each direction I go it will be different color. 

Thank you for your help.
Jess. 

dougp

Inormallydon'trespondtopostslikethisbutIdecidedtomakeanexceptionthistimeYouwillgetbetterresponsesbyputtingupacoherentpostwithproperpunctuationandallthatCheckouttheHowtoUseThisForumlinkpinnedatthetopofthistopicIt'scustomarytootoincludesomesortofquestion.
Everything we call real is made of things that cannot be regarded as real.  If quantum mechanics hasn't profoundly shocked you, you haven't understood it yet. - Niels Bohr

No private consultations undertaken!

ledgirl8089

I am 15 please don't  judge  Me and I am from Germany so my English is not perfect

Grumpy_Mike

Quote
it should be very easy but I can't find away to do it,
No it will not be very easy, that is quite an involved project.

Along side each LED you will need to have a Hall effect sensor, that is 20 sensors wired up to your Arduino. With a Uno that will mean using port extenders to read that many inputs. It will also cost quite a bit.

slipstick

So have you worked out how you can tell where the "metal ball" is and what direction it is moving in? I guess it must be  running in some sort of track/cage so it doesn't just fly off or stick to the end of the "magnetic pen".

A picture of your proposed system might help but it doesn't sound like a very easy project from what you've said so far.

Steve

Grumpy_Mike

I did do this project some time ago where I tracked the position of a magnet using a magnetometer chip. Full details were in The MagPi No. 59 July 2017, free pdf download. Search for it.
It was done on the Raspberry Pi and used the Pi's display but you could use the same thing with a strip of LEDs as the display.
https://vimeo.com/223453491

It is not quite what you want but you might struggle with what you envisage. It certainly needs some experiments to see if you can do what you are after with a Hall switch, otherwise you can probably do it with 20 magnetometer, one on each LED, or maybe one ever other LED. Anyway to minimise magnetometers you can experiment with spacing.

The only down side I can see with using magnetometers is that while it will detect a steel ball rolling over the top of them, the dragging magnet will also affect them.

david_2018

Since you are having the magnet drag a metal ball, you could build a track for the ball that has contact pads along it, and use the ball itself to make the connection between the pads to indicate its position along the track.  Simple way would be to have one side of the track lined with a foil strip connected to ground, and on the opposite side of the track have 20 short sections of foil connected to 20 inputs.  Would act as a very noisy switch contact, but you are only interested in the movement from one pad to another, so you only need to detect the initial contact on each pad, then look for contact on an adjacent pad.  You would need a mega to get enough inputs for that arrangement, but it could be done on an uno if you split the contacts into 4 groups of 5, and treated it as a grid of switches.  

Grumpy_Mike

#7
May 22, 2019, 01:04 pm Last Edit: May 22, 2019, 01:05 pm by Grumpy_Mike
Quote
have 20 short sections of foil connected to 20 inputs
That is a good idea.

I would use copper foil, the sort you get in craft shops for working with stained glass. Here is a photo of a ball baring game I made many years ago.



And a video of it in action.
https://vimeo.com/65274719

ledgirl8089

No it will not be very easy, that is quite an involved project.

Along side each LED you will need to have a Hall effect sensor, that is 20 sensors wired up to your Arduino. With a Uno that will mean using port extenders to read that many inputs. It will also cost quite a bit.
so i have decided first i would like to thank you here is my plane

i am going to use the following:

1. Arduino uno - https://www.aliexpress.com/item/high-quality-One-set-UNO-R3-CH340G-MEGA328P-for-Arduino-UNO-R3-NO-USB-CABLE/32697443734.html?spm=2114.search0104.3.1.24ed5764yXh5hq&ws_ab_test=searchweb0_0,searchweb201602_8_10065_10068_319_10059_10884_317_10887_10696_321_322_10084_453_10083_454_10103_10618_10307_537_536,searchweb201603_52,ppcSwitch_0&algo_expid=128f99bd-b71d-4d02-aade-beda3f8e8552-0&algo_pvid=128f99bd-b71d-4d02-aade-beda3f8e8552
2. led chip - https://www.aliexpress.com/item/10-1000-PCS-SMD-SMT-5050-LED-RGB-Red-Green-Blue-Yellow-White-Warm-white-PLCC/32801702656.html?spm=2114.search0104.3.15.b7fc90ddFiepwd&ws_ab_test=searchweb0_0,searchweb201602_8_10065_10068_319_10059_10884_317_10887_10696_321_322_10084_453_10083_454_10103_10618_10307_537_536,searchweb201603_52,ppcSwitch_0&algo_expid=ae955a1a-65a6-408e-9714-16dfe2a0b996-2&algo_pvid=ae955a1a-65a6-408e-9714-16dfe2a0b996
3. port extenders -  PCF8574 PCF8574T I/O https://www.aliexpress.com/item/1PCS-PCF8574-PCF8574T-I-O-For-I2C-IIC-Port-Interface-Support-Cascading-Extended-Module-For-Arduino/32962725844.html?spm=2114.search0104.8.25.57721ceavTwl9O
4. effect sensor - https://www.aliexpress.com/item/10PCS-Hall-element-49E-OH49E-SS49E-linear-Hall-switch/32295739566.html?spm=2114.search0104.3.1.1a077c93XiYy7B&ws_ab_test=searchweb0_0,searchweb201602_8_10065_10068_319_10059_10884_317_10887_10696_321_322_10084_453_10083_454_10103_10618_10307_537_536,searchweb201603_52,ppcSwitch_0&algo_expid=78665792-7038-41fe-978e-609a643111bb-0&algo_pvid=78665792-7038-41fe-978e-609a643111bb

is there anything eles i need ?
what about pwoer surce ?
also what about porgraming the arbiuno is it hard ?
and do i need anything else ?

thank you all for all your help i am going to do it and then i will post a video and proov evryone in my class that i can do it thanks to all of you and your help

Thank you.

Grumpy_Mike

#9
May 22, 2019, 10:21 pm Last Edit: May 22, 2019, 10:25 pm by Grumpy_Mike
1) Link https://www.aliexpress.com/item/high-quality-One-set-UNO-R3-CH340G-MEGA328P-for-Arduino-UNO-R3-NO-USB-CABLE/32697443734.html Fine but it is not a read Arduino.

2) Link https://ru.aliexpress.com/item/10-1000-PCS-SMD-SMT-5050-LED-RGB-Red-Green-Blue-Yellow-White-Warm-white-PLCC/32801702656.html No, that will take three outputs to control each LED, so for 20 LEDs you need 60 outputs and if you want to control them you will need the outputs to be PWM outputs. Way too complex for you and there are much simpler ways. Use WS2812 LEDs either as a strip or individual PCB mounted LEDs like this:- WS2812. Using these you only need one digital output from your Arduino, no matter how many LEDs you have, no port expanders needed.

3) port extenders -  PCF8574 PCF8574T No these are only 8 bits and do not have a PWM output and you would need 8 chips.

4) Link https://www.aliexpress.com/item/10PCS-Hall-element-49E-OH49E-SS49E-linear-Hall-switch/32295739566.htm - No these are linear devices, you would need an analogue input for each of these sensors. Look for a hall effect switch.

Quote
is there anything eles i need ?
what about pwoer surce ?
Yes you need a power supply, it depends on the number of LEDS and the currents.
You also need ( with those LEDs you were going to get ) you need three resistors for each LED.

Quote
also what about porgraming the arbiuno is it hard ?
Well at your age and experance of programming you have a steep learning curve ahead of you. It will require a lot of work, and we can help you with that. But note we will not do it for you.

I am from Germany
Then why are all your links Russian?

ledgirl8089

So first of all thank you so much, I am a very fast learner, and for once this really interesting to me, so I will try hard to do it and get it don't. 

So for number 1 you are saying this is not good ? So if you provide me a link to that one I need I will appreciate that.

Number 2 if I'll buy the led you suggest to me I will not need port extender correct ?

Number 3 if I will buy the led you said then I will not need it at all ?

Number 4 are those good ? A3144E Hall sensor OH44E magnetic sensor switch Hall-Effect IC contactless

Number 5 I will use the led you suggested to me and I am going to use 20 pcs 4-Pin WS2812B WS2812 LED Chip & Heatsink Board DC5V 5050 RGB WS2811 IC Built-in RGBW RGBWW WWA LED Chip I will have to calculate the voltage output for those and make sure the hall switched is good with them or I need 3 pin led ? Also about the resistors what kind do I need ?

Number 6 about the programming I currently don't have an arduino device but I have been watching allot of coding videos on how to program the device and there are allot of totorials online and I'm sure I'll figure this out. (I need to do it by myself without help) and I am not going to cheat.

Number 7 I'm not sure why it's Russian I was just googling it I don't have an account I'll have to have my mom buy it for me I guess my google give russain links )))

Again thank you so much you have been very helpful I hope With just lil more help from you and I'll be able to go on my own soon )).
Good night.

Grumpy_Mike

#11
May 23, 2019, 10:31 am Last Edit: May 23, 2019, 10:37 am by Grumpy_Mike
Quote
So for number 1 you are saying this is not good ?
No it is good technically. It is just that buying a fake Arduino does deprive the Arduino company of money that is used to do good things, like fund this forum and other educational projects.

Quote
Number 2 if I'll buy the led you suggest to me I will not need port extender correct ?
Yes you will not need port expanders for the outputs of your system. However, there are 21 pins on the Arduino and to do exactly what you said, use 20 sensors you will need one port expander or to find a way of reading more than one sensor per pin. There are ways of doing this using resistors and an analogue input.

Quote
Number 5 I will use the led you suggested to me and I am going to use 20 pcs 4-Pin WS2812B WS2812 LED Chip & Heatsink Board DC5V 5050 RGB WS2811 IC Built-in RGBW RGBWW WWA LED Chip
Also did you know that this sort of LED can be got in a ready built strip with three different numbers of LED per meter? Normally these are 30, 60 and 120 LEDs per meter so for 20 LEDs you would have the choice of three different lengths. Just search for 'ws2812b led strip' you can normally buy them by the meter.

Quote
I will have to calculate the voltage output for those and make sure the hall switched is good with them
No your sensor goes into the Arduino, it has nothing to do with the LED's voltage.

Quote
Number 4 are those good ? A3144E Hall sensor OH44E magnetic sensor switch Hall-Effect IC contactless
This is the tricky part of your project, the detection of the steel ball and the magnet. That switch will typically switch with a field of 55 Gauss but can switch as low as 20 Gauss. The big question is what sort of field will you get with a ball baring rolling along dragged by a magnet? This is one of those situations where you are going to have to try one, a lot depends on the mechanical construction. We have discussed other sensing methods here like foil contacts, I would like to throw another one into the mix, an optical detector do it switches when the ball covers it up. You might need a light above the detector to make sure there is enough light to turn it on when uncovered. I have used the SFH3410 in past projects for this. But I would start off by trying to make the foil contacts work unless you think the "magic" effect will be lessened.

Quote
Number 6 about the programming ..........  (I need to do it by myself without help) and I am not going to cheat.
Glad to here that. However, asking for help is not cheating, asking for someone to do it for you is. I used to Lecture at a University in England and would be happy if my students were pointed in the right direction by someone but not if they got someone to do the work for them.

ledgirl8089

number 1
you are %100 correct i useing as part number to refrence my mom what to buy


number 2
i understasnd is this what i need to do ? https://www.google.com/url?sa=i&source=images&cd=&cad=rja&uact=8&ved=2ahUKEwiJhMy77bHiAhWdwsQBHdKiBrQQjhx6BAgBEAM&url=https%3A%2F%2Fhobbycomponents.com%2Farduino%2F904-pcf8574-i2c-to-8-bit-digital-port-expander&psig=AOvVaw0dMiJpPbAjW7UCxfIduskm&ust=1558707874745990

number 3
i have found that thank you

number 4
i think i will stick to the hall effect sensors


number 6
all i am asking is to point me to the right direction and i will pick it up from there )))

so here is what iam going to buy
1 *  ws2812b led strip - 1M 30 led
20* hall sensors
1*   ARDUINO UNO
2*   PCF8574 I2C TO 8-BIT DIGITAL PORT EXPANDER

also you have mantion that i need three resistors for each LED correct ? so i need 60 resistors if so what kind do i need ?

and after that is all in the porgraming of the ARDUINO UNO correct ?

am i missing anything ?

and agin thank you for your patiant with all my qustions



Grumpy_Mike

Quote
also you have mantion that i need three resistors for each LED correct ?
No you do not need resistors for the WS2812 type of LED with the exception of a resistor in series with the line from the output of the Arduino and the input of the LED strip. This has not got a critical value it can be anything between 330 ohms and 510 ohms.

You also need a capacitor of value about 100uF to put between the power and ground terminals of the LED strip.

Quote
2*   PCF8574 I2C TO 8-BIT DIGITAL PORT EXPANDER
If you like I can show you a way not to use those but use 1K resistors and a serval analogue port pins, in place of these port expanders.

ledgirl8089

No you do not need resistors for the WS2812 type of LED with the exception of a resistor in series with the line from the output of the Arduino and the input of the LED strip. This has not got a critical value it can be anything between 330 ohms and 510 ohms.
You also need a capacitor of value about 100uF to put between the power and ground terminals of the LED strip.
If you like I can show you a way not to use those but use 1K resistors and a serval analogue port pins, in place of these port expanders.
the resistors where do i need to place them on the board ? and i think with the PCF8574  it will be much easyer i look that up and it looks very easy and also i have seeing how to use analogue port pins and i think its easyer to use those correct ?

also is the list i give you correct ?

1 *  ws2812b led strip - 1M 30 led
20* hall sensors
1*   ARDUINO UNO
2*   PCF8574 I2C TO 8-BIT DIGITAL PORT EXPANDER
20* 330 ohms resisters
1* capacitor 100uF

correct ?  

Go Up