Koe Josephine Final Project


LIGHT SEEKING SOLAR CAR TOY

Video: https://www.youtube.com/watch?v=hH_aRpDayTs 

====================================================================================================

Point of View

The purpose of this project was to create a fun way for someone who is bored and has a lot of time on their hands to charge an electronic device. The user connects their device to the solar charger, and the car moves around and uses the light sensors to find the optimal place to charge. For entertainment purposes, the user can use a flashlight (or another light source) to shine on the light sensors and direct the car wherever the user wants it to go. It is the perfect combination of practicality and entertainment. While the user is playing, they can also charge their devices without being restricted to an indoor power outlet.

====================================================================================================

Verplank Diagram


====================================================================================================

State Diagram


====================================================================================================

Parts

Microcontroller: Arduino Micro (1) - https://www.arduino.cc/en/Main/ArduinoBoardMicro

 

Frys:

Solar Charger (1) - http://www.frys.com/product/8275426?site=sr:SEARCH:MAIN_RSLT_PG

Light Sensors (4) - http://www.frys.com/product/8404728?site=sr:SEARCH:MAIN_RSLT_PG

Male to Female Jumpers (1)- http://www.frys.com/product/7726918?site=sr:SEARCH:MAIN_RSLT_PG

Mini Breadboards (1)- http://www.frys.com/product/7726898?site=sr:SEARCH:MAIN_RSLT_PG

 

VEX:

Omni Wheels (2) - http://www.vexrobotics.com/228-2536.html

Motors (4) - http://www.vexrobotics.com/motors.html

Motor Controllers (4) - http://www.vexrobotics.com/276-2193.html

3 in Shafts (1) and Shaft Collars (1) - http://www.vexrobotics.com/shafts-and-hardware.html

 

Miscellaneous:

Wires

Tape

Rubber Bands

1/4 in Duron

1/4 in Acrylic

====================================================================================================

Directions

1. Structure

Use a laser cutter to cut the Duron and acrylic according to the Solidworks CAD files provided. 

 

Parts:

Robot Bottom.SLDPRT (1)

Robot Side.SLDPRT (4)

Robot Bearing Block.SLDPRT (4)

Spacer.SLDPRT (16)

 

Lid Bottom.SLDPRT (1)

Lid Side.SLDPRT (4)

Lid Top.SLDPRT (1)

 

Assemblies

Robot.SLDASM

Lid.SLDASM

Robot and Lid.SLDASM

 

Use Elmer's Glue to glue the pieces together according to the assemblies. Do not glue the robot and the lid together. Save the spacers for later.

 

2. Mechanical Components

Attach the motors and wheels to the robot. You must connect the motor controllers to the motors, and I would suggest using rubber bands to tie together the wires and motor controller in a small bundle, then taping the bundle to the back of the motor. Screw the motors (screws provided with motors) into the 2 small holes in the sides and that the shaft goes through the bearing block. Slide a shaft collar onto the shaft before inserting the shaft into the motor, and tighten the shaft collar so the shaft will not fall out. On the other side of the wall, slide 4 spacers, the wheel, and another shaft collar in that order onto the shaft, and tighten the shaft collar on the end. Do this step for all 4 sides, and it is a good idea to label or color code the motors. Also label the sides of the cars with the following numbers that correspond to the motors:

9   --> A2

10 --> A3

11 --> A4

12 --> A5

Each side should look like this:

4. Wiring

Wire your mini breadboards according to the picture and place (not stick) it on the inside of the lid. 

3. Light Sensors

Plug each pin from the light sensor into one of the jumper wires. I taped those 3 wires together at the end with the light sensor for ease of use. Do this for all 4 light sensors. Then tape the signal wires together in a row, the power wires together in a row, and the ground wires together in a row and plug them in according to the picture below. Slip a light sensor out of each hole in the lid, and tape it so the light sensor points up. Make sure the order and positioning follow the pictures, then peel the paper off the adhesive tape on the breadboard and stick the breadboard permanently on the under side of the lid. It is best to label the light sensors on the lid as well.

4. Upload this sketch onto the Arduino Micro:

RobotFinal.ino

 

5. Put the solar panel battery into the depression in the lid, and run the micro USB cable into the A2 hole and plug it into the Arduino Micro. Do not turn the solar panel on yet.

6. Plug the motors into the breadboard according to this picture. Then close the lid as best you can (it might not fit, but that's OK), and you have a working robot! Just press the power button on the solar panel and it will try to find light.

====================================================================================================

Original Design/Plan

The design for the car was very different from the end product. It originally looked like this:

Each pair of same-direction wheels was in line with each other, as opposed to now where there is a wheel on each corner. In this design, I made it a cross shape instead of a giant square because I was afraid of the corners tipping. I changed this design slightly when I discovered that I did not have an easy way to access the materials that I originally intended to use. After my first prototype, I realized that it was troublesome to make and that there was no problem with putting the wheels in the corners, eliminating both the threat of tipping and the original unimaginative plan to have the wheels be directly opposite each other. After my second prototype, I discovered that it would be difficult to keep the solar panel in place while the car was in motion, so I made a depression in the lid so the solar panel and any charging devices, such as an iPhone, which can fit in there, would not fall off.

 

In terms of functionality, I had also intended the car to have another mode where it could be controlled by a remote. The car was originally supposed to have strips of different colored tape that corresponded to a slider on the remote so the user could easily map the wheel with a certain slider. This is the paper prototype for the original design:

====================================================================================================

Why My Plans Did Not Work

The biggest difference between my first plan and the final product is that it did not have the remote-controlled feature. My timeline was to get the motors running and the light tracking program working the first week, have the remote control operating at the end of the second week, and to test and fine-tune in the last week. I was on schedule for the first week, but I ran into problems when programming the remote control aspect. I could make 2 Arduinos transfer data wirelessly using an RF receiver and transmitter, but I could not run the motors and the RF receiver at the same time because they both used Timer1 interrupts. I tried to use a library that ran the motors using Timer2, but it had conflicting type declarations and I ended up patching the code so much that nothing worked in the end, so I gave up on the remote control and spent the last couple of days perfecting the light-seeking feature. I used a flashlight to test it, and that is when I realized that the flashlight could be used to control the vehicle instead of a remote, maintaining the entertainment aspect in the car.

 

However, I did run into problems with the light sensors. I initially bought loose ones online, thinking that I could solder longer wires onto them and wire together the voltage dividers for the analog input. I ended up with an extremely high current which burned out my Arduino, and I still do not know if I miscalculated the voltage divider, accidentally shorted the light sensors (which had a lot of exposed wiring), or both. At this point, it was close to the deadline, so instead of ordering more light sensors, I went to Frys, which happened to have the exact same light sensors except they were mounted on boards with the voltage divider already built in them.

====================================================================================================

What I Would Want to Do Differently

If I had the time, I definitely would have liked to have a remote control aspect in the car, but I suppose using the flashlight to control it is also user interaction, just not a common form of it in such a toy. The walls of the robot were also a bit short, and it made it hard for the lid to close. Again, if I had the time, I would have remade the structural part of the vehicle. However, the fact that the robot does not close does not make it any less effective, so it is not drastically important either. Overall, I am satisfied with the outcome of this project.