Proximity controlled RGB LED Stripe

Hey guys,
I'm completely new to this whole DYI universe and at least had a cool idea for my hobby.

Maybe some of you have seen RC Drift, if not at least the idea of drifting should be applicable.

To my idea, I'm surely not the first one with the idea, I want to set up an arduino that can handle something like 10 ultrasonic HC-SR04 Sensors combined with a programmable RGB LED Strip.
Each Sensor is supposed to compare its result of distance within a chart that ranks the proximity from something like red to green (too far away to perfectly close) which then illuminates a part of the RGB LED Strip with the resulting colour.

My issue is that after reading a lot of the possible codes I dont quite find anything in a decent pricerange that can handle that many sensors or I might just be mistaken and its easier than I thought.
I know for one Sensor + RGB LED Strip a simple Arduino Uno is plenty, but what combination of hardware would be suitable for what I described?


I hope the rough picture describes the idea and I hope this is the correct sub forum.

What's the maximum distance you need to measure?

Track width is about 40-50cm and the zone in which the result will be give is about 10-15cm away from the furthest point in the outside curve.

So should we say 65cm max?

The reason why I'm asking about distance is because you can only activate one HC-SR04 at a time.

You need to wait for the sound signal to go out and come back before you can activate the next ultrasonic sensor. The further you need to measure, the longer you need to wait.

Okay, that shouldnt be a problem then. Since RC Drift might be at a decent speed around the track, but its not comparable with anything race related.

And the importance is always a singular car when running qualiying labs or the lead car when running tandems so its a steady speed, the sensors are positioned at a distance between each other and measurements will be taken every few cm.

The total length of the curve is between 1-3m since there will be a total of 2 or 3 of those systems in the end, but obviously every curve runs on its own Arduino.

Let's say 1m then.

So it will take about 6 milliseconds to receive the sound signal. Add 1msec to provide a gap between sending the sound signals and maybe 0.5msec for processing. For 10 ultrasonic sensors it will take at least 0.075 seconds to do all 10 measurements. Meaning, each distance measurement will take 0.075 seconds.

Is that fast enough?

I think a whole turn takes roughly about 1-2 Seconds so 0.075 should be sufficient.
If needed we can always reduce the amount of sensors a bit so theres even more headroom for processing.

Does the controlling of the LED after each measurement also add a bit of time to the processing that should be considered?

I added the 0.5ms for processing, that includes calculation of the distance ad picking which color to use.. How long it takes will require some experimenting but I can't see it taking more than 1mses

Sounds good.
Then back to my initial question. What Components would you suggest besides the Sensors?

You may need to build some custom hardware using ICs, capacitors, resistors, etc, soldered on a protoboard. Is this something you can do?
Also what is your coding experience?

Soldering is no problem.
I work as an IT Network Administrator so I can do basic scripting.

The arduino programming language is basically C++ but much of the low level interaction with the hardware is hidden from the user with simple one line instructions. You will need to do some learning.
You need two pins for each of the HC-sr04s and at least 2 pins for the LEDs, that 22 pins and more than what an UNO has.
Possibilities are to use a one Mega2560 or two UNOs. I'm not sure which will be simpler overall

I hope links are allowed.

https://www.makershop.de/plattformen/arduino/mega-2560/
Something like that as the brain?
As long as theres documentation on the libs and the basic command sets I should be fine.
I forgot to mention the languages for basic scripting I have used in the past, which would be python, VB and C# for programming.

I think I will try a smaller version for feasibility on the uno since thats less than 10 Euro currently and if everything works I will go for the bigger brother.

Yes, starting with the Uno is a good idea. Buy two of the HC-SR04s and see if you can make it work in a mock-up.
You will need a solderless breadboard, jumper wires, a couple of LEDs and two 330 ohm resistors.
You will also need to download the Arduino IDE (Integrated Development Environment) to write the code. Everyone starts withe the Blinky example (make an LED blink).
There is plenty of getting started stuff on the web.

You may need to give echos more time to die out, depending on the room the sensors are in.

Maybe you want to measure things up to 1m away, but if there's a wall some 3m away from the sensor it will also produce an echo, taking three times as long to reach your sensor. If you don't wait long enough, that echo could be picked up by the next sensor.

What you could also do in such an array, is run them out of order. So not 1, 2, 3, 4, ... but something like 1, 6, 2, 7, ... As they're pointing more or less away from each other and there's more physical distance there is far less chance of an echo of one reaching another.

Just looking at the image again I notice I misread it, you draw sensors on the outside facing in. I was thinking they're on the inside facing out. Sensors on the inside of the curve does sound safe to me when talking about drifting, for having less chance of being hit by an out of control car.

Will do thanks for your insight. Will come back here in a bit with my progress

Yeah out of order might be something to look at, but I dont think that really works in my head the way I imagined the way the code is supposed to run.

And it has to be on the outside for those corners, since every body shell on the rc car has different width and length so all that matters is the distance of the bumper to the wall and the sensors are going to be placed roughly 1cm above and behind the wall at an really slight downward angle if needed.

I think I got everything for a first Setup.
I just now ordered the Arduino Uno, 3x HC-SR04 Sensors, the small 400 contact Breadboard, 40 Pin male to male and female to female Jumper cables, wasnt entirley sure on the resistors so I got 10x 330 Ohm and 10x 330 kOhm, 3 basic white LEDs and a small NeoPixel RGB LED Stripe thats supposed to work with the GitHub - adafruit/Adafruit_NeoPixel: Arduino library for controlling single-wire LED pixels (NeoPixel, WS2812, etc.) Library.

I think that should be everything for a starting point for this project.

That should keep you out of trouble for a while.
The 330 ohm resistors are for putting in series with the LEDs