Inspiration

I wanted to build a device that worked with the sensors I had available but had a problem coming up with an idea so I took to the mentorship board. The first person I was connected with, Jacob, brainstormed with me to get to this idea. I knew I wanted to work with something space-related that could implement the sensors I had on me. This is when Jacob suggested I create a light-seeking / temperature avoidance system for a rover I built in the past. I had only done the most basic of setup on this rovers chassis and it had little to no code associated with it. For more of a challenge, I tried to write this in node but it turns out the equipment I am using is not compatible with johnny-five, which is the node to Arduino platform I used to write the node alternative to the code I wrote. I did however still include this code in my project repo to anyone that is curious.

What it does

This Bitbot implements a unique spin on obstacle avoidance. Instead of directly trying to avoid objects it seeks light and avoids high temperatures. This robot has many various uses such as rover exploration, solar panel movement, and energy conservation/creation.

How we built it

I implemented this by using two photoresistors mounted on either side of the front of the chassis. When the light value read from either sensor is greater than 100 the robot compares the values with their average to determine which direction to turn. If the average is larger than the others it will move forward, otherwise, it turns towards the maximum amount of light. Since most electronics have a maximum temperature before they stop working there had to be a check for this if this rover was to survive in harsh environments. So with a DHT11 temp/humidity sensor mounted to the top of the rover, when the sensor reads high temperatures the rover retreats away.

Challenges we ran into

The main challenges I ran into were converting the C++ code to node, getting the light following system right, and taking into account various motor speeds. In this section, I will address what I did to get past these errors. So for the node conversion, I was pointed towards a few resources by my mentor. After a few hours working through a quick johnny-five workshop on Friday night, I thought I had this down. I then spent much time troubleshooting my program and found that half of my sensors are not compatible with johnny-five. So I included the code I came up with for johnny-five but the device is still run by C++. As for the light-seeking system. My first iteration was not great; the bot either spun in circles or never stopped going forward. After some troubleshooting, I found that this was due to my complex if statements. So with this in mind, I dumbed down the if blocks and separated the checks for temperature. I went through this process a few times and came to the solution in my repo. Lastly, I discovered that the right motor was slightly off and could not achieve the same speed as the left. This cause the rover to veer off to the left every time it went straight. To combat this I lowered the speed value of the left motor to try and match that of the right until it went straight, but later on, decided to just move the rover in spurts which stopped this from occurring.

Accomplishments that we're proud of

I am really proud of the system I set up in a few days. I know there are still improvements to make but I am happy about what I have so far. I am also proud that I learned a new way of programming Arduino in practically one night. In the future, I am going to order some parts to work with this and will solely use johnny-five at my next Hackathon.

What we learned

I learned a lot about light and temperature sensors. I had worked with these devices in the past but had not done a project as extensive as this. I also did some research regarding the light needs and temperature extremes a robot can be exposed to; which is reflected in my code. Another thing I learned as I said in the past sections was the johnny-five API to program Arduino with node. The resources I used are listed below: http://johnny-five.io/api https://www.npmjs.com/package/nodebot-workshop https://create.arduino.cc/projecthub/pubnub/getting-started-with-johnny-five-for-iot-part-1-3f3607

What's next for Light Seeking BitBucket

For the future of this project, I would like to add more photoresistors to this rover and implement a better obstacle avoidance system implementing the UV spectrum. This rover already has an ultrasonic sensor but as of now, its only purpose is to backpedal away from obstacles. Along with this, I would also like to add a solar panel array which would actually be the power source of the device. The possibilities are really endless but as of now, these are my next steps.

Thanks for looking at my project. I will put some of my testing and work videos in the attachments below.

Built With

Share this project:

Updates