0% found this document useful (0 votes)
59 views15 pages

Mini Solar Car With Micro:bit: 13 Steps (With Pictures) - Instructables

Uploaded by

h9nhp4kfqg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
59 views15 pages

Mini Solar Car With Micro:bit: 13 Steps (With Pictures) - Instructables

Uploaded by

h9nhp4kfqg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

Mini Solar Car With Micro:bit

By Gurbey Demirturk in TeachersGrades 6-8

Introduction: Mini Solar Car With Micro:bit

Before we start I must say that you may use right-click to open the links on a new tab. Other
wise, it is very annoying to wait for the page to load.

Hi everyone!

So excited to share my first Instructables project. I am an educator and I build this mini solar car as
part of my job.
Some of my colleagues have been working on full-size solar cars with their students to participate i
n Solar Car Challenge. A full-size solar car takes a lot of effort and time as you may see in the vide
o. We wanted to democratize this project so more students can benefit from it.

We had all the materials in our Innovation Lab which is a maker-space and we have many rapid pro
totyping tools like 3D printers, laser cutters, micro:bit, Arduino, and Raspberry Pi. So all I need to d
o is to put them together.

Supplies
The car chassis, wheels, and the DC motor are based on Junior Solar Sprint Competition Kit from
Pitsco because we have been hosting the competition for a while and I already had the kit.

I used 2 micro:bit boards for remote control. You can buy 1 board and 1 Go bundle from Sparkfun.
Since you only need the batteries and the battery holder for the remote controller.

We had the micro:bot kit from Sparkfun but I only used the moto:bit as the motor controller from the
kit.

The solar panel (You may use the solar panel that comes with the JSS Kit or any other), the charge
r, and the rechargeable battery are from Adafruit. I used the Adafruit solar panel because it already
comes with a DC jack connector. Otherwise, you need to solder one to JSS solar panel and this is
discussed in the next steps.

You may see the material list here. There are options to choose from for each item.
Step 1: Build the Chassis With Some 3D Parts

You may use this pdf guide to build the car chassis but skip the panel support member section and
do not install anything other than the wheels, gears, and motor.

The pdf guide tells you to glue the DC motor to the chassis but I used a 3D-Printed mount so I woul
d remove it when needed. I attached the STL file so you can 3D print it.

There is something called spacers in the kit to mount the metal axle to the body and it also decreas
es the friction. The ones that come with the kit are hollow cylinders but I designed a version with on
e flat side so it would be easier to glue to the chassis. The STL is also attached.

I tried designing some wheels for 3D printing as well. They are not very efficient since they do not p
rovide enough traction on smooth surfaces.

Step 2: Attaching a DC Jack Connector to Solar Panel


Ah
25 00Mm 85060
0 7
3.7 LLLP E
PKC
The solar charger has a DC jack. If you are going to use Pitsco solar panel you might need to solde
r or screw a DC jack connector to it depending on what you have already. Both panels have similar
specifications so you would save money if you just purchase the Ray Catcher kit.

If you are going to use Adafruit's solar panel you may skip this part since it already comes with the
connector.

Step 3: Attaching 2-Pin JST to a DC Jack


The moto:bit has a DC power jack and the solar charger has a 2-pin JST Load output. Therefore, w
e need to solder or screw a DC jack connector to a 2-pin JST wire depending on what type of DC ja
ck you want to use. You may need to check polarity: red to positive, black to ground.

Step 4: Soldering M/M Jumper Wires to Alligator Clips


*Update

Thanks to KathyCeceri that you may use these jumper wires to skip this step.

*Original Post

In this step, we are going to connect moto:bit to the DC motor. We need to solder the alligator clip(c
omes with the JSS kit) to one end of the M/M jumper wires. You may see the pictures for details.

You can solder jumper wires to the motor directly but if you want to remove the motor and change t
he gear on it, it might be harder.

Step 5: The Codes


<Share iBlocks EB JavaScript

logodown
logoup
radiosendnumber
owicon radiosendnumber

showleds
showleds
diosetgroup

pause(ns)
pause(ms) 100

clearscreen
Clearscreen

Before we assemble everything we should check if the setup is actually working. We will download
2 sample codes to micro:bits before the assembly since it might be harder to connect micro:bits to t
he computer when everything is in place. Especially the micro:bit on the chassis will be harder to re
ach. RemoteCode

The first 2 pictures are the codes for the remote controller and, let's say, "the driver". This will help
us determine if the motor is running as expected before we assemble everything.

The first code starts with the "on start" block on the left side of the picture. The "on start" is a specia
l event that runs when the program starts, before any other event. We use this event to initialize our
program.

It starts with showing the heart icon. It is a good practice to include some visual feedback for yours
elf so that you would know if your code is downloaded and working. Then we set up the radio chan
nel to 1. We will do this with the other code as well so that the 2 micro:bits can recognize each othe
r and transfer data.

I decided to move the car forward when I tilt the micro:bit remote forward(logo down / it is like showi
ng the screen to someone else). When the logo is down the micro:bit remote will send the number "
0" to driver micro:bit.

When the driver micro:bit receives "0" then we tell driver micro:bit to run the right motor forward sin
ce I connected my motor to the right motor on the moto:bit.

Then I add the "turn motors OFF" block to stop the motor after showing, up and down arrow icons.
This is enough for testing but it is better to stop the motor with another input after the full as
sembly. Otherwise, you need to keep tilting the remote again and again.

The wheels should turn the opposite direction when you tilt the remote toward yourself(logo up). It i
s the same algorithm; when the logo is up, the remote sends the number "1" and the driver tells the
right motor to turn in the reverse direction when it receives the number 1.
I updated the code and add the 2nd set of codes. With those codes, the car will move forward when
you press button A and it will move backward when you press button B. The car should stop if you
press both buttons.

With this setup, the car can only go forward and backward but I am planning to add a servo to the fr
ont to steer the car. Moto:bit has ports to connect servo motors as well.

Check the next steps if it is hard to see the code on the pictures.

Step 6: Remote Code

This is the code for the microbit as a remote. Click here to open the code on makecode.
Step 7: Driver Code

This is the code for the microbit on the chassis. Click here to open the code on makecode

Step 8: Connect Everything and Test

Connect everything based on the pictures above and the labels on the solar charger, BATT, and LO
AD.
Step 9: Assembly

It is time to put things together.

Let's start with fixing the moto:bit to the chassis with 2 wood screws. I put it somewhere between th
e middle and front of the body but you may move it closer to the front as much as the jumper wires
stretch.

Then I used brass spacers so that the solar panel sits on top of the chassis. I used 2 screws to fast
en the solar panel to the chassis. Also, I used one of those screws to fasten the solar charger to the
chassis as well. I solder my capacitor standing so it does not fit under the solar panel. Therefore, it
has to stick out from the chassis. You may overcome this by laying down the capacitor like in the pi
cture.

You may tape the rechargeable battery under the chassis for now. Masking tape or painter's tape w
orks better than packing tape. I did not want to fix it permanently while still working on it but feel fre
e to come up with your own solution.

Please refer to the pictures for details.


Step 10: Final Thoughts

I think this is a great project to teach how solar panels and solar cars work. It also covers some phy
sics, engineering, and coding concepts.

You might be asking how fast it goes but that is not the scope of this project. Although, it can be im
proved with weight reduction, different gear ratios (Pitsco kit comes with different gears), and a bett
er motor.

As I mentioned earlier in one of the steps you need to change the code so that the motor would not
stop immediately. You just need to add another else statement to the "driver" code so that it would s
top the motor when it receives a certain number and you should also update the remote controller c
ode so that it would send that number after, let's say, you press the button A or B.

Lastly, I should start working on the steering.

I hope you would try this project and I will try to improve my instructions based on the feedback.
Step 11: UPDATES

In this version, the code allows us to control the motor speed with the pitch of the micro:bit.

There are 2 versions of the code. The first 2 and the last 2 pictures are a set, "remote and driver". T
he last 2 are the most updated version. You may see them below

Click here for the Driver code and here for the Remote

The "rotation degrees pitch" block returns a number between -180 and 180. We assign that number
to the "power" variable and send it to the "driver" micro:bit. This determines the speed and direction
of the motors with the help of "if statements". In the updated version, the remote sends the number
"0" to stop the car when you press button A on the micro:bit.

The speed of the motors changes between 0 and 100 and the pitch changes between -180 and 18
0. I did not want to deal with limiting the pitch numbers which is not a good practice but it works fine
:)

I added the following note on the Remote Code 2. You need to hover your mouse on the empty squ
are which looks like a bug and not very intuitive. So, I added the same not below;

There are 3 "radio send number power" blocks in if statements and that is not necessary. In
coding terms, they are called redundant because they do the same job. You may just add on
e of them outside of the "if statement". This is demonstrated in the following pictures.
Step 12: Steering

Finally made it steer. Placed a micro-servo in front of the car and attached it to the Servo section on
the motobit. Motobit has 2 ports, P15 and P16. Mine is attached to P15. Then we designed a part o
n Tinkercad with the help of this servo arm model to connect the servo head to the front axle.
Step 13: Codes for the Steering

Block coding is fun and can get serious. We need to use name-value-pair for the driver(Microbit on
the car) since the driver microbit will get the same range of numbers(-180 to 180) whether you tilt th
e remote microbit in the x(pitch) or y(roll) coordinate. In other words, the driver microbit needs to kn
ow whether it should use the received number for power(speed) or steering.

Then you use if statements to check if the "name" sent matches with the "power" or "steer" and use
the received value accordingly.

The Arrows with the "show LEDs" are for visual feedback. I am not sure if these slow down the micr
obit to process but the steering does not work as efficiently as I hoped. Any feedback would be app
reciated.

1) The code to download to the microbit on the chassis

2) The code for the microbit as a remote

You might also like