Low cost radar speed tester
Have you ever thought of building your own low-cost radar speed logo? I live in a car driving too fast in the street, I am worried about my child's safety. I think it would be safer for me to let the driver slow down if I could install my own radar speed flag to show the speed. I check out the radar speed sign on the internet but I found that most of the signs are for more than $ 1,000 and it is very expensive. Nor do I want to go through the long process of installing a logo in this city because I've heard it could cost 5,000-1,000 dollars. Instead, I decided to set up a low-cost solution to save some money while having some fun.
I found OmniPreSense, which offers a low-cost short-range radar sensor module for my application. The PCB module measures only 2.1 x 2.3 x 0.5 inches and weighs only 11g. The electronics are self-contained, fully integrated, so there is no power tube, bulky electronics, or a lot of power. Large objects such as cars range from 50 feet to 100 feet (15 meters to 30 meters). The module takes all speed measurements, processes all signal processing, and outputs the raw speed data through its USB port. I use a low-cost raspberry pie (or Arduino, or any other USB port) to receive data. With some python coding and some large low-cost LEDs installed on the board, I can show the speed. My monitor board can be attached to a pole on the curb. By adding a sign labeled "Radar Speed Check" to the display, I now have my own radar speed flag that draws the driver's attention and slows their speed! All of this is less than $ 500.
I found OmniPreSense, which offers a low-cost short-range radar sensor module for my application. The PCB module measures only 2.1 x 2.3 x 0.5 inches and weighs only 11g. The electronics are self-contained, fully integrated, so there is no power tube, bulky electronics, or a lot of power. Large objects such as cars range from 50 feet to 100 feet (15 meters to 30 meters). The module takes all speed measurements, processes all signal processing, and outputs the raw speed data through its USB port. I use a low-cost raspberry pie (or Arduino, or any other USB port) to receive data. With some python coding and some large low-cost LEDs installed on the board, I can show the speed. My monitor board can be attached to a pole on the curb. By adding a sign labeled "Radar Speed Check" to the display, I now have my own radar speed flag that draws the driver's attention and slows their speed! All of this is less than $ 500.
Step 1: Materials and Tools
1 OPS241-A short range radar sensor
1 OPS241-A mount (3D printed)
1 Raspberry Pi Model B v1.2
1 5V microUSB power supply
1 Rhino Model AS-20 110V to 12V/5V 4-pin molex power supply and power cable
1 Terminal block 3poles Vertical, 5.0mm centers
1 Micro-USB to Standard USB cable
4 Spacers, screws, nuts
1 Enclosure box and plated PCB
4 Plated PCB mounting screws
3 1/8W 330ohm resistors
3 NTE 490 FET transistor
1 NTE 74HCT04 Integrated TTL High Speed CMOS hex inverter
1 OSEPP mini bread board with adhesive backing
2 0.156” header square straight wire pin, 8-circuit
20 6” F/F premium jumper wires 22AWG
1 1” x 12” by 24” wood mounting board
1 Black spray paint
2 Sparkfun 7-Segment Display - 6.5” (Red)
2 Sparkfun large digit driver board (SLDD)
1 “Speed Checked by Radar” Sign
Step 2: Floor Planning of the Electronics PCB Board
I started with the main control hardware which is the Raspberry Pi. The assumption here is that you already have a Raspberry Pi with the OS on it and have some Python coding experience. The Raspberry Pi controls the OPS241-A radar sensor and takes in the reported speed information. This is then converted to be displayed on the large LED 7-segment display.
a. I want to place all electrical components other than the radar sensor and LED displays onto a single enclosed electronics PCB board mounted to the backside of the display board. This keeps the board out of sight and safe from the elements. In this manner, only two cables need to run from the back of the board to the front. One cable is the USB cable that powers the OPS241-A module and receives the measured speed data. The second cable is drives the 7-Segment display.
b. The PCB board needs to allow plenty of room for the Raspberry Pi, which takes up most of the area. I also need to make sure that I will be able to easily access several of its ports once mounted. The ports I need to access are the USB port (OPS241-A module speed data), Ethernet port (PC interface for developing/debugging Python code), HDMI port (display Raspberry Pi window and debug/development), and the micro USB port (5V power for Raspberry Pi).
c. To provide access for these ports, holes are cut in the enclosure which match the port locations on the Raspberry Pi.
d. Next I need to find room for the bread board that contains the discrete electronics components to drive the display LEDs. This is the second largest item. There needs to be enough space around it that I can jumper wires to it from the Raspberry Pi and output signals to a header for driving the LEDs. Ideally, if I had more time, I would solder the components and wires directly to the PCB board instead of using a breadboard, but for my purposes it’s good enough.
e. I plan to have the display driver header next to the breadboard at the edge of the PCB, so that I can keep my wire lengths short, and also so that I can cut a hole in the cover and plug in a cable to the connector.
f. Lastly, I allow room on the PCB for a power block. The system requires 5V for the level shifters and display driver, and 12V for the LEDs. I connect a standard 5V/12V power connector to the power block, then route the power signals from the block to the breadboard and the LED header. I cut a hole in the cover so that I can connect a 12V/5V power cord to the power connector.
g. This is what the final electronics PCB floor plan looks like (with cover off):
Step 3: Mounting the Raspberry Pi
I mounted my Raspberry Pi to a perforated and plated PCB board using 4 spacers, screws, and nuts. I like to use a plated PCB board so that I can solder components and wires if need needed.
Step 4: LED Signal Level Shifters
The Raspberry Pi GPIOs can source a maximum of 3.3V each. However, the LED display requires 5V control signals. Therefore, I needed to design a simple, low-cost circuit to level-shift the Pi control signals from 3.3V to 5V. The circuit I used consists of 3 discrete FET transistors, 3 discrete resistors, and 3 integrated inverters. The input signals come from the Raspberry Pi GPIOs, and the output signals are routed to a header that connects to a cable from the LEDs. The three signals which are converted are GPIO23 to SparkFun LDD CLK, GPIO4 to SparkFun LDD LAT, and SPIO5 to SparkFun LDD SER.
Step 5: Large LED Seven-Segment Display
For displaying the speed I used two large LEDs that I found on SparkFun. They are 6.5" tall which should be readable from a good distance. To make them more readable, I used blue tape to cover the white background although black may provide more contrast.
Step 6: LED Driver Board
Each LED requires a serial shift register and latch for holding the control signals from the Raspberry Pi and driving the LED segments. SparkFun has a very good write-up for doing this here. The Raspberry Pi sends the serial data to the LED seven-segment displays and controls the latch timing. The driver boards are mounted on the back of the LED and are not visible from the front.
Step 7: Mounting the OPS241-A Radar Module
The OPS241-A radar sensor is scrwed into a 3D printed mount a friend made for me. Alternatively I could have screwed it into the board directly. The radar sensor is mounted on the front side of the board next to the LEDs. The sensor module is mounted with the antennas (gold patches at top of board) mounted horizontally although the specification sheet says the antenna pattern is pretty symmetrical in both the horizontal and vertical directions so turning it 90° would probably be fine. When mounted to a telephone pole, the radar sensor is facing outward down the street. A couple different heights were tried and found placing it around 6’ (2 m) high to be the best. Any higher and I’d suggest possibly angling the board downward a little.
Step 8: Power and Signal Connections
There are two power sources for the sign. One is a converted HDD power supply which provides both 12V and 5V. The 7-segment display requires 12V for the LEDs and 5V signal levels. The converter board takes the 3.3V signals from the Raspberry Pi and level shifts them to 5V for the display as discussed above. The other power supply is a standard cell phone or tablet 5V USB adapter with USB micro connector for the Raspberry Pi.
Step 9: Final Mounting
To hold the radar sensor, LEDs, and controller board, everything was mounted on a 12” x 24” x 1" piece of wood. The LEDs were mounted on the front side along with the radar sensor and the controller board in it's enclosure on the backside. The wood was painted black to help make the LEDs more readable. Power and control signals for the LED were routed through a hole in the wood behind the LEDs. The radar sensor was mounted on the front side next to the LEDs. The USB power and control cable for the radar sensor was wrapped over the top to the wood board. A couple holes in the top of the board with tie-wraps provided a means to mount the board on a telephone pole next to the “Speed Checked by Radar” sign.
The controller board was bolted to the back side of the board along with the power adapter.
Step 10: Python Code
Python running on the Raspberry Pi was used to pull the system together. The code is located on GitHub. The main parts of the code are configuration settings, data read over a USB-serial port from the radar sensor, converting speed data to display, and display timing control.
The default configuration on the OPS241-A radar sensor are fine but I found a few adjustments were needed for the startup configuration. These included changing from m/s reporting to mph, changing the sample rate to 20ksps, and adjusting the squelch setting. The sample rate directly dictates the top speed that can be reported (139mph) and speeds up the report rate.
A key learning is the squelch value setting. Initially I found the radar sensor didn’t pick up the cars at a very far range, maybe only 15-30 feet (5-10m). I thought I may have had the radar sensor set too high as it was positioned around 7 feet above the street. Bringing it down lower to 4 feet didn’t seem to help. Then I saw the squelch setting in the API document and changed it to the most sensitive (QI or 10). With this the detection range increased significantly to 30-100 feet (10-30m).
Taking in the data over a serial port and translating for sending to the LEDs was fairly straight forward. At the 20ksps, speed data is reported around 4-6 times per second. That’s a little fast and not good to have the display changing so fast. Display control code was added to look for the fastest reported speed every second and then display that number. This puts a one second delay in reporting the number but that’s ok or can easily be adjusted.
Step 11: Results and Improvements
I did my own testing driving a car past it at set speeds and the readings matched my speed relatively well. OmniPreSense said they had the module tested and it can pass the same testing a standard police radar gun goes through with accuracy of 0.5 mph.
Summing it up, this was a great project and nice way to build in some safety for my street. There are a few improvements which can make this even more useful which I’ll look at doing in a follow-on update. The first is finding larger and brighter LEDs. The datasheet says these are 200-300 mcd (millicandela). Definitely something higher than this is needed as the sun easily washed out viewing them in daylight. Alternatively, adding shielding around the LEDs edges can keep the sunlight out.
Making the entire solution weather proof is going to be needed if it's going to be posted permanently. Fortunately this is radar and the signals will easily go through a plastic enclosure, just need to find one the right size which is also water proof.
Finally adding a camera module to the Raspberry Pi to take a picture of anyone who exceeds the speed limit on our street would be really great. I could take this further by making use of the on-board WiFi and sending an alert and picture of the speeding car. Adding a time stamp, date, and detected speed to the image would really finish things off. Maybe there’s even a simple app to build which can present the information nicely.
Step 2: Electronic PCB floor plan
I started using Raspberry Pi's main control hardware. The assumption here is that you already have a raspberry pie with an operating system and have some experience with Python coding. The Raspberry Pi controls the OPS241-A radar sensor and receives the reported speed information. Then convert it to be displayed on a large LED seven segment display.
One. I wanted to put all the electronics except the radar sensor and the LED display on a single closed electronic PCB mounted on the back of the display. This leaves the circuit board out of sight and unaffected by the components. In this way, only two cables are required from the back of the board to the front. One cable is a USB cable that powers the OPS241-A module and receives measured speed data. The second cable drives a 7-segment display.
Bay PCB board takes up most of the area raspberry pie space. I also need to make sure that once installed I will be able to easily access some of these ports. The ports I need to access are the USB port (OPS241-A module speed data), the Ethernet port (the PC interface for developing / debugging Python code), the HDMI port (showing the Raspberry Pi window and debugging / development), and the micro USB port Raspberry pie 5V power).
C. To provide access to these ports, holes are cut into the enclosure that matches the port location on the Raspberry Pi.
d. Next, I needed to find room for breadboards containing discrete electronics to drive the display LED. This is the second largest project. There needs to be enough space, I can jumper from Raspberry Pi and output a signal to drive the LED. Ideally, if I had more time, I would solder the components and wires directly to the PCB instead of the breadboard, but for my purposes that was enough.
That is, I plan to install the display driver next to the breadboard at the edge of the PCB so that I can shorten the length of the wire, cut a hole in the cover, and insert the cable into the connector.
F. Finally, I allow space on the PCB for the power module. System requires 5V level shifter and display driver, 12V requires LED. I connect a standard 5V / 12V power connector to the power module and then pass the power signal from the module to the breadboard and the LED plug. I made a hole in the lid so I could connect the 12V / 5V power cord to the power connector.
G. This is the final electronic product PCB layout that looks like (with cover):
Step 3: Install raspberry pie
I used four washers, screws and nuts to mount my Raspberry Pi onto a perforated PCB. I like to use plated PCBs to solder components and wires as needed.
Step 4: LED Signal Level Translator
Raspberry Pi GPIO can provide the highest voltage of 3.3V. However, the LED display requires a 5V control signal. So, I needed to design a simple, low-cost circuit to convert the Pi control signal from 3.3V to 5V. The circuit I use consists of three discrete FET transistors, three discrete resistors, and three integrated inverters. The input signal comes from the Raspberry Pi GPIO and the output signal is routed to the head of a cable connected to the LED. The three signals that are converted are GPIO23 to SparkFun LDD CLK, GPIO4 to SparkFun LDD LAT, and SPIO5 to SparkFun LDD SER.
Step five: Large LED seven segments display
To show the speed, I used two large LEDs on SparkFun. They are 6.5 inches tall and should be readable from a good distance. To make them more readable, I covered the white background with blue tape, although black can provide more contrast.
Step 6: LED driver board
Each LED requires a serial shift register and latch to hold the control signals from the Raspberry Pi and drive the LED segments. SparkFun did a good job writing here. The raspberry pie sends serial data to the LED seven-segment display and controls the lockout time. The driver board is mounted on the back of the LED and can not be seen from the front.
Step 7: Install the OPS241-A radar module
The OPS241-A radar sensor was recognized as a 3D printed stand made by a friend. Or I can screw it directly to the circuit board. The radar sensor is mounted on the front of the circuit board next to the LED. The sensor module is equipped with a horizontally mounted antenna (top of the gold plate). Although the spec sheet says that the antenna pattern is very symmetrical both horizontally and vertically, it may be nice to rotate it by 90 °. When installed on the utility pole, the radar sensor faces out of the street. Try a few different heights and find it best to place it 6ft (2m) high. Any higher, I suggest may go a little bit down the board.
Step 8: Power and











评论
发表评论