Applying the HC-SR04 to the RC Car

Over the past week of robotics I created some additional hardware to the RC car. This would include a circuit to have the Motion sensor operating to turn the motor off when it comes within 30cm of any structure. This required a code having a regular void loop having an “if” statement. The next steps for the vehicle will be to apply the steering which will require creating more coding this week.

Fine Tuning the Arm

This week I worked on making the arm and marker lifting mechanism work together.  I was able to create a working version, but it was not yet finished, as there were still some changes to be made on the arm.  A new one was created with shorter arms, a larger base, and the servo motor above the marker instead of below it.  After putting this together, there was a small issue with the stepper motors jumping around rather than moving smoothly.  I plan to fine-tune this starting next week.

Motion Sensor Madness

This week was specifically focused on using a motion sensor to control a small motor. The code up above has a simple void loop filled with a couple “if” statements. If  there is an object close to the sensor the motor stops, in order to simulate breaking, otherwise the motor just keeps spinning forward. The function at the bottom actually uses the echo pin  to find how long it takes to get that echo and from there it calculates how far the object is in cm.   I didn’t create the function so here’s the link to the webpage where I got a good chunk of the code http://www.instructables.com/id/Simple-Arduino-and-HC-SR04-Example/

Arduino Programmed Range Finder( HC-SR04 )

In this fantastic week of robotics I was introduced to the HC-SR04, which is a Range Finder that is going to be mounted on my RC car eventually.  The HC-SR04 will be making decisions for my RC car whether to turn or stop to avoid collisions. I was impressed with the large distance the Range Finder was capable of reading up to. I finished the RC car figure 8 code, but i need to make some hardware adjustments with the H-Bridge. After review the RC cars H-Bridges relays were not the correct part for turning the switch on and off rapidly. I am looking forward to adding the HC-SR04 and adjusting the Relays in the H-Bridge next week to get the RC up and running to my commands.

ARDUINO PROGRAMMED RC CAR

                                                          This previous week I transferred my knowledge of programming electric motors to a larger project involving a RC car. This RC car is already programmed to move a foot forwards and a foot backwards consistently, and the distance can be easily modified with change of delays. The next step for this RC car is to add an additional H-Bridge to control the steering. By the end of this week the car will be able to drive around in figure eights and possibly a few other paths. I am working on making a better physical model of the car to create more accurate turns and such as  well.

Speed Control

This week was all focused on controlling the speed of the motor, turns out to be easier said than done. Trying to find out a ratio for stopping and starting the motor in milliseconds is as frustrating as it gets. We hooked up the speed function to a small dial and it was nice learning the boundaries and the purpose of analogWrite, but it was incredibly frustrating beginning to end.