LuxBlaster: Give that rude driver behind you a taste of his high beam (Arduino)
LuxBlaster is an Arduino robot that detects and tracks the most intense light source then sends back an intense and annoying light in the same direction.
WARNING: THIS PROJECT IS JUST FOR FUN AND SHOULD NEVER LEAVE THE LAB. This project falls under the category of "what-if" gizmos and is not intended for real world usage.
While you are driving at night, every once in a while a car will approach you from behind with its annoying high beam turned on. Some auto headlights can be as powerful as 3000 Lumens. Most of the time, the driver of the car will remember to lower the lights. But on rare occasions you will run into some crazed driver who will blast his/her high beams from behind to prod you into shifting to another lane quickly even if you are following the speed limit. The smart thing to do is to let this rude driver pass. But what if the streets is crowded or you are on a country road with two narrow lanes.
Even if you can't change lanes for a number of reasons, you would turn the rear view mirror up or down to avoid the nasty high beam reflection from behind your car.
Some deranged drivers, to intimidate you further, will swerve to the left or right to ensure their annoying high beam is reflected into your face via the side mirrors. It's on those occasions that I wished I had the LuxBlaster...but glad I did not.
So just for fun, here's the dream gadget that would have given those crazy drivers a taste of their own medicine. Except that two wrongs could push cars off the road. Keep in mind the LuxBlaster can be annoying at best since the 230 Lumens of the 3W LED is no match for the disorienting power of a single 3000 Lumens xenon headlamp blasted back at you.
THE LUXBLASTER HAS GENERATED INTENSE DISCUSSIONS ON ROAD SAFETY ON YOUTUBE, BUT THE QUESTIONS KEEP REPEATING SO I DECIDED IT'S BEST TO HAVE A LUXBLASTER FAQ PAGE ON MY BLOG WITH ANSWERS TO THOSE FREQUENT QUESTIONS.
LuxBlaster In The News
Assembling the Pan/Tilt Servo Bracket
Follow the steps in the diagram to assemble the servos and brackets. The most challenging part of the LuxBlaster is getting the Pan/Tile platform assembled and wired according to this guide to ensure the Arduino code works with no modifications. Once you have the LuxBlaster up and running feel free to make adjustments.
THE PAN/TILT BASE
I used a metal base to hold the pan/tilt platform which I found in a cheap construction set. But you can use any other material such as wood if you prefer. What matters is the orientation of the servos, the correct wiring, the centering of servo horns, and the physical stability of the pan/tilt platform. When the servos rotate quickly, they can shake the whole breadboard to the point of dislodging components or forcing them out of alignment.
CENTERING THE SERVOS
Center then fix the servo horns to the mid point between the rotation start/end before you screw on the brackets. When you run the accompanying Arduino code, in the initialization section the Arduino will issue a command to center servos at 90 degree which is the half way point for both servos. If your servo horns are not physically centered properly, the servos and brackets may assume starting positions at the wrong rotation position and the pan/tilt tracking mechanism will not function properly.
TESTING AND DEBUGGING THE SERVOS
When it's time to test your wiring against the Arduino code, test the pan servo first then test the tilt servo second, but if you attempt to debug while both servos are active at the same time you will make testing more difficult.
Constructing The Light Tracking Radar
There are many ways to design the light tracking radar. But the basic concept is to have 4 quadrants each containing a photoresistor and one middle cavity for the center photoresistor.
We want the photoresistors to be optically isolated from one another but not isolated from the ambient light around them. This isolation makes it possible for the different photoresistors to register different light intensity readings from 5 different directions with the fifth being the center photoresistor.
The Arduino code compares the reading of the resistors from the 4 quadrants against the reading of the center photoresistor to determine to what direction it should move the pan/tilt platform to keep the center photoresistor pointing in the direction of the most intense light source.
MAKING THE PAPER RADAR
I should have used matt black cardboard paper instead of the beige colored paper you see in the diagrams. So I ended up painting most of the exposed areas black and using black electric tape to minimize light reflection.
I cut a 20 cm X 5 cm piece of cardboard then folded each 1 cm section over the next 1 cm section until I got an accordion shape. This is just to make the edges more flexible. Then I folded it into a 4-tip star with an open square inside for the center photoresistor. All the sections are 1 cm long. I stapled the folded sections but you can use glue if you prefer.
WIRING THE PHOTORESISTORS
The photoresistors have long pins so I cut them all down to 1 cm in length. Then I used 2 female-male jumper wires to wire each photoresistors. You can use glue to ensure the connection is solid.
Finally I wrapped each photoresistor in black electric tape. There's really no art to this just make sure you have solid connection to avoid unnecessary debugging time.
For the center photoresistor, I used a piece of anti-static foam but styrofoam or even a regular sponge would do fine. The point is to fix the photoresistor in the center cavity of the light tracking radar.
Putting The LuxBlaster Together
Since the 3W LED had to point in the same direction as the light tracking radar it made sense for both components to be on one frame but far enough from one another. Any closer, and the light from the 3W LED could contaminate the readings from the light tracking radar photoresistors. For this project, I think I have achieved an acceptable level of isolation between the LED and the photoresistors.
The Keyes 3W LED is a complete circuit with a power FET ready to be controlled from an Arduino. This simplified my LuxBlaster circuit. I used a wire tie to fix the LED module on one end of a construction set frame.
For the light tracking radar, I used electric tape to stick one fin to the right-angled section so the photoresistors are pointing in the same direction as the LED.
From this point on, remember that the light tracking radar photoresistors should be labeled based on their physical location, from your point of view. This is important because it dictates which Arduino analog pin a given photoresistor should be wired to:
Now fix LED/Radar frame on top of the tilt bracket and proceed to wire the components according to the attached schematic.
In the Eagle schematic note how the two 9g servos are powered directly via the Arduino's 5V power net. But both the Arduino (VIN) and the 3W LED get their power directly from the 7.4V Lipo battery. Yet all GND points must be connected together, which may not be clear for those who did not work with schematics before.
A photoresistor is a variable resistor whose value changes with the amount of light being exposed to. More light translates into less resistance. But Arduino Uno can't measure resistance. It can measure voltage changes from 0 up to 5V. So each photoresistor is wired as the R1 resistor in a voltage divider circuit while a 10K Ohm resistor is the R2 resistor.
The joint between R1 and R2 is wired to an Arduino analog pin where changes in voltage due to changes in light intensity are measured and output as an integer numbers between 0 and 1023 (10-bit ADC). The more light hits the photoresistor, the less resistance, the more voltage is read and the higher the number reported by the Arduino analog pin.
As to how you interpret the numbers generated by the analog pins, that's totally subjective and depends on your requirements. You may find a 600 value to mean an annoying light is being pointed at you while others may think 800 is really an annoying light intensity and decide to turn on the 3W LED.
Calibrate the LuxBlaster by operating it in various lighting conditions then take note of the values generated by the sensors. This will help you decide your thresholds and max/min values. Or, add buttons or pots to control these values during operation.
The 3W LED module has three pins: GND, VIN, Signal. The VIN is wired to the external battery since this LED draws up to 0.75 Amp. This is more than the Arduino can provide. The signal pin is wired to the famous digital Pin 13 on the Arduino. (Run Arduino Uno with the Blink sample sketch while the 3W LED is connected to get the Mother of all Blinks.)
- Your Android Phone Is A Sensors & Comm Nervana
- How to Network Many Arduinos with Sensors using I2C
- Universal IR Remote Control Station for Android
- Bluetooth-controlled Pan-Tilt Servo
- ArduDroid: Simple Bluetooth control for Arduino and Android
- Modify The HC-05 Bluetooth Module Defaults Using AT Commands
- TV Volume Loudness Guard
- Geo Data Logger
- Bluetooth Comm for Arduino and PC
- Face Tracking with Arduino and OpenCV
- Fast Line-following Robot
- Kinect Controls Servos Using Human Motion
- GOduino: The Breadboard-friendly Robot Controller