Tutorial: Arduino Night Light

Tutorial: Arduino Night Light

Hello everyone!

This tutorial will cover how to create lights that turn on when it gets dark. We will be using the Arduino microcontroller along with the SwissCHEESE shield to make it easier to code.

This tutorial assumes that you have a working environment setup with the Arduino IDE and Cardublock library. See here for more information.

Materials

Wiring

  1. When wiring, make sure that the Arduino USB wire is not plugged into the computer.
  2. Insert the SwissCHEESE shield onto the Arduino board.
  3. Attach a jumper wire to a LED of your choosing.  The other end of the wire should be attached to pins O0 on the SwissCHEESE board.
  4. Attach a jumper wire to a SwissCHEESE Light Sensor. The other end of the wire should be attached to pins I1 on the SwissCHEESE board.

Programming

Open up Arduino IDE, and go to Tools –> CarduBlock Edu to open up the Cardublock user interface.

  1. The light sensor takes in values from 0 to 1023. The dimmer the light, the higher the value. We will first create a variable called “darkness”, by going to Variables/Constants –> Set Integer Variable. Next we will set the variable’s value to LDR, which is found in CAROBOT SwissCHEESE –> LDR.
  2. Now we want to make a decision, so first add an if/else statement from Control –> If/Else. Add the greater than test found in Tests –> ‘>’ to the test section of the If/Else Statement. From Variables/Constants, add Standard Integer, and Standard Integer Variable, and rename like below. What we are doing is checking if the darkness is greater than 800.
  3. Now we are going to decide what we do with the If/Else statement. So if the darkness exceeds 800, then we will turn the LED on, otherwise, we will turn it off. Drag the LED blocks from CAROBOT SwissCHEESE –> LED and adjust the status sections like below. 
  4. Upload the code to the Arduino. 

You should have something that looks like this:

Tutorial: Light Controlled Robot Cars

Hello everyone! In this tutorial we will create light controlled robot cars and play soccer with them. It will be similar to Rocket League, except we will use arms attached to servo motors to hit the ball.

This tutorial assumes that you have a working environment setup with the Arduino IDE and Cardublock library. See here for more information.

 

Materials

Note: we will be using our own robot car configuration including two motors and a caster. Feel free to use your own robot car as long as it is controlled with the Arduino, and has 2 DC motors included. 

Assembly:

  1. Mount the Arduino on the car chassis, and then mount the SwissCHEESE shield on the Arduino.
  2. Using 2 nuts and bolts, attach the servo face at the front end of your robot car. 
  3. Using 2 nuts and bolts, attach 2 brackets to the servo to form the kicker.
  4. Using 2 nuts and bolts per light sensor, attach one at the front, back, left and right sides of the chassis.

 

Wiring

  1. When wiring, make sure that the Arduino USB wire is not plugged into the computer.
  2. Attach the wires of the two motors to the SwissCheese at M1, and M2.
  3. Connect a jumper wire from:
    1. I0 to the light sensor on the right.
    2. I1 to the light sensor on the front.
    3. I2 to the light sensor on the left.
    4. I3 to the light sensor on the back.
    5. O0 to servo at the front.

Programming

    1. Open up Arduino IDE, and go to Tools –> CarduBlock Edu to open up the Cardublock user interface.
    2. Subroutines make your program easier to read. To use subroutine blocks, or delays look in Control. To use motor blocks, or servo blocks, look in CAROBOT SwissCHEESE. Using this, assemble 6 subroutines like below.
    3. Next, create the following below. To use the loop, or if else statements, look in Control. To use the orange comparison blocks, look under Tests. To use the light sensor, look in CAROBOT SwissCHEESE.

  1. Now connect the Arduino USB wire to the computer and hit “Upload To Arduino” *

*Make sure you have the following selected: Tools –> Boards –> Arduino Uno/Genuino,  and Tools –> Ports –> COMX (where x is a number).

SwissCHEESE Robot Car Development

SwissCHEESE Robot Car Development

Hello world! (Cheesy, huh?) As a summer student at CAROBOT Learning and Research Organization, I was tasked with following a modified engineering design process to develop a new car design for the CAROBOT SwissCHEESE Education kits.

Step 1. Identify Needs

The first step in the modified engineering design process is to find the customer’s needs. Through discussion with my superior, I had come up with the following list of needs:

Step 2. Establishing Car Specifications

The next step involved creating a list of metrics that helped us quantify our needs.

Then I came up with a list of marginally accepted and ideal values for our metrics.

By acknowledging the constraints, I could move on to the next step.

Step 3. Generate Product Concepts

Now came the fun part: producing design sketches.

Concept 1 was the idea of a modular car where certain parts could be exchanged for others. An idea with this concept was the use of slide-in feature where the base carrying the Arduino and breadboard could be slid into a frame. However, this idea was later dismissed because sliding parts are prone to wearing out.

Concept 2 was a minimal design with only the core components attached on the base. These core components included 2 motors, the Arduino and SwissCHEESE boards, a breadboard and a caster.

Concept 3 was the opposite of the first concept; instead of keeping the flexibility that comes with using multiple parts, the compartment design only would work with components of similar size. The pro of having such a design would be a more rigid model, where parts must stay in the confines of discrete sections.

Concept 4 was based on a DIY car called the Donkey Car. This design would make the car much sturdier in exchange for more material.

Concept 5 was popular with some of the board members. The concept gives the person assembling it creative freedom to place components where they want to. Furthermore, this is a multi-layer concept. The first layer holds the battery, the second layer holds the microcontroller and other electronics parts, and the last layer for customization.

A final idea was the use of having a sleek-looking car that would have hinges to open the cover. However, the costs would increase because this is a 3D printed design.

Step 4. Select Product Concepts

I chose concept 2 because of its simplicity, only the base, and two caster attachments needs a laser cutter. Concept 5 was a popular contender, but the hexagonal shape caused the breadboard and battery to jut out at odd angles.

Step 5. Test Product Concepts

For the chosen concept, I designed the parts using Solidworks and Draftsight.

Note: The caster is not shown in the diagram below as it was difficult to find a solid model of the specific caster used.

Step 6. Set Final Specifications

From this model, I noted a few weaknesses. The edges were sharp, and although the board looked aesthetically pleasing, the contours on the sides restricted where the user could place the motor attachments. For the last model, I added a servo slot to the base, rounded the edges, and removed the contour on the sides.

Step 7. Economic Analysis

The cost of the new car is much less than that of the earlier one due to less material being used. That is because the earlier model had two layers, compared to one layer for the new model.

Step 8. Assembling the Car

Some of the parts  in the earlier design were no longer needed, and this resulted in assembly time decreasing. The size of the new base board is around the same as the earlier one.