Maker Pro
Maker Pro

Light glow along a path and stairs following distance movement

Hi,

I am looking to illuminate a path to my house and up some stairs using a distance sensor to detect a persons position.

I have attached a sketch of what I am trying to achieve at various stages.

I wish to make 2 strips approx 5m long light up with a glow at the distance someone is detected along the path half a meter behind fading to off and half a meter in front of detection fading to off and follow the persons movements along the path until arrival at the stairs. Then 2m strips attached to the tread nosings light up for each tread in sequence until the sensor cannot detect any more (approx 200mm in front of sensor) and the lights fade out to off.

I am completely new to this kind of electronics and have searched through quite a few forums but nobody seems to have done anything similar or used my sensor. I did think that a loop detecting a fixed distance and converted to specific leds being lit would be easy but it seems to be a lot more ambitious than I thought especially making the glow.

Due to the distance involved I have purchased a me007-uls v1 waterproof long range ultrasonic sensor. This will be attached into the face of the top step looking centrally down the path and stairs.

I have :
4 x 5m of WS2812B 5V led strips 30 leds per m.
2 x 300w 60A 5v power supplies
2 x Arduino nano v2
1 x Wemos D1 mini
10 x 25v 1000uf caps for end of led strips.
100m of 16 awg wire

My Questions.

1 Can I do all this in 5v with a single controller or do I need to separate the stairs?
2 Can anybody help me with the code required completely lost with this.
3 Can I use the controllers I have or is there a better option.
4 Best practice for a wiring circuit and additional parts I require.

Many thanks for any help with this.

Craig.
 

Attachments

  • STEPS sequencing.pdf
    136.7 KB · Views: 63
So basically you have an idea, a bunch of parts and you want 'us' to do the donkey work? Have you got any workings you've done yourself? if only to prove that you are at least making some effort and not going to be wholly reliant on the forum members to do this 'for you'?

What will be our 'cut' in this?

This might sound 'cheeky' but no more so that what you're asking. This is no straightforward task you're asking and will involve considerable effort on someone's (or multiple 'someone's') behalf to get a halfway working version.

If you'd showed up with a basically connected system and the rudimentary parts/circuit to get you going I'd be more inclined to assist but your post seems to be...... errr, 'selfish'?? Demanding???

1. The LED strip seems reasonable - although it's an RGB programmable (addressable) strip and overly complex for the purpose unless your intention is to have a variable 'colour' scheme indicating motion???

2. Break the task down, programming-wise, into blocks of code. A block to read the ultrasonic sensor, a block to drive the LEDs etc and derive a flowchart that can be created to further simplify the whole process. There are 'sketches' (program libraries) out on the web that offer the ready-made coding for reading common ultrasonic distance modules AND for driving those serial-coded LEDs. Obtain the code and program your Arduino to drive the display strips in a basic fashion. By inspecting the code - which is usually very well commented so you can figure out which line does what - you might spot the routines necessary to make the changes required to display the LEDs the way YOU want.

3. The Arduino is perfectly capable of doing all the above.

4. Breadboard the initial design - use only a small strip of LEDs to prove your programming. When you get the ultrasonic distance signal to activate even a strip of three LEDs then scaling up to a greater distance will follow quite easily.

I've seen/heard of people doing this before - have you searched for other examples? Either way it's quite a striking effect and, if you put in some decent work yourself then I suspect you'll get the support from other forum members to assist you through any of the more complicated areas of the design.

Just don't expect us to do it all!
 
One Nano can do it.

What I would do first with this is find out if the ultrasonic sensor is working.
Write a sketch that waits a given amount of time (say 15 seconds, for you to get into position) and then uses the sensor to find out how far away you are from it, and then report that back over the USB/serial connection.

Then I would try testing the sensor the same way but with it placed roughly in the position it will be mounted in--on the stairs. There's no point in bothering with everything else until you know that the sensor part of things will work.
 
So,
Kellyseye, Doug 3004, thank you for your responses.

I am a construction engineer so i've never really wanted people to do the donkey work for me as thats usually what I do day to day. i just want to learn.
After a bit more research the effect i am after is an assignable larson scanner.

I tried testing my nano with the fast led example cylon code but to no avail.
Nano is a clone and after spending days trying to upload code gave up (Doesnt accept 340g drivers or holding reset etc) and went with a wemos d1 mini pro.
I have the code on the wemos now but am awaiting a logic level shifter to get 5v on the data line for a 15 led test driven from the wemos.

I have looked into my ultrasonic sensor me007-uls v1.
Nobody seems to have code for a 5 pin sensor.

This is where I am stuck.
 
Nobody seems to have code for a 5 pin sensor.

I doubt whether anyone on here has the code for it either. The datasheet for the sensor is quite explicit and contains enough information to develop code necessary to use it.

That said, I did a Google using "ME007 software" and came up with this:

http://playground.arduino.cc/Code/NewPing (first result no less.....)

which states its features as:

"Works with many different ultrasonic sensor models: SR04, SRF05, SRF06, DYP-ME007 & Parallax PING)))™."

You need to try harder......
 
The Chinese Arduino clones I've bought all worked 100%, even the ones with ch340g chips.

If the Arduino board has any kind of "blink" sketch on it that should run when you connect it to any USB cord, because any USB cord will supply the 5v the board needs to run. Some boards don't blink constantly like the official Arduinos: for example, the RobotDyne boards just quickly blink the pin-13 LED 3 flashes, 3 times, and then go off. And the Nano board doesn't need the PC to tell it to run, it just needs ~5v power.

1) Does the PC do anything when you connect the Nano board at all? ...I forget which chip it was, but with ONE of the chips that the China boards use, I had to connect it to my Win10 PC and leave it connected for like 5 minutes, before the PC recognized it and enabled the USB connection. After the first long setup, the PC can instantly recognize it like normal.

2) What PC is it? Windows? Mac? Linux?

3) What voltage does your USB cords put out? It might be low. ...I had Arduino issues once and traced it back to the fact that my PC (motherboard) was only putting out about 4.4 volts on the USB plugs. I bought a powered USB hub and use that, and it puts out the expected 5 volts on all its USB lines. And that problem that I had before--disappeared.
 
Kellyseye, the DYP-ME007 uses four pins me0007 uls v1 is completely different using 5. Google images.
I have read somewhere though that one pin can be omitted. Will try find a link.

Ill try my powered hub with the clones, as i have 2 pcs with usb 3.0 ports but both are tablets.

My level logic shifter has arrived in the post today so i'm going to get it soldered up tonight.

And, once again guys thanks for the responses. I didn't even understand what a logic shifter was last week.

Im going to wire up a second wemos mini to the ultrasonic and take your advice, build both test seperately then amalgamate the circuits and code to one controller.

Thanks guys.
 
If you want to do something quick and simple, then this is what I have on my stairs...

One of those security lights at the top of the stairs which detects movement.
Take out the two spotlights, and replace them with a string of Xmas lights.
When the motion sensor detects a person near the stairs, the string of lights come on which go up the whole staircase. Has worked perfectly for years.

After someone tried to break into my house, in place of the second spot light I attached a tape recorder which would play something like a dog barking if someone approached the stairs, and when the string of pixie lights came on. This I only switched on when all had gone to bed, on nights I was feeling paranoid. Have not used this for years.
 
Top