Week 18: Applications and implications

Assignment:Propose a final project that integrates the range of units covered.
Learning outcomes: Define the scope of a project, develop a project plan.

The questions that need to be answered

a) what will it do?
b) who has done what beforehand?
c) what materials and components will be required?
d) where will they come from?
e) how much will it cost?
The answers to the questions above will allow you to create your BOM, or Bill Of Materials.

f) what parts and systems will be made?
g) what processes will be used?
h) what tasks need to be completed?
i) what questions need to be answered?
j) what is the schedule?
k) how will it be evaluated?

Final project

I am planning to build a simple robot, in the shape of a turtle. The turtle will be equipped with a sonar and two DC motors that are controlled with an ATtiny44 microcontroller. The microcontrolled is soldered into the main project board that connects to the sonar, and to another PCB that hosts 2 H-bridges for the DC motors.

a) what will the robot do?
It is a simple wall avoiding robot programmed in C code:
- When the robot is on the Attiny44 will receive values sent by the sonar (input).
- Then these values are turned into centimeters
--> If the centimeter values indicate that we are close to a wall (for example under 10cm)
--> Then the Attiny44 will send the H-Bridges a message to make a random turn either to left or right (Output).
--> Else the robot will move forward
- The sonar values should be read constantly.

Inspired by techninsider and reddit :D

Bill of materials

c) what materials and components will be required?
d) where will they come from?

Making the base of the turtle robot
Material Purpose Quantity Price Origin
2x50mm thick insulation sheathing (FinnFoam FL-300) For creating the mold for the turtle robot. A sheet of 7.27m2 costs about 60.6\$ (52e) I eastimate I used max 1m2 for the mold ~8\$ FabLab Inventory (Scoured locally)
SuperSap 100/1000 Entropy resins epoxy and hardener for creating the base of the turtle robot. The big jugs cost 254.95\$ I estimate I used max 1/30 of the jugs for the base ~8.5\$ FabLab Inventory
LA Linen 15-Inch Natural Jute Burlap Roll Material to laminate fo the base of the turtle robot. A 100-yard roll costs 50.90\$ I estimate I used max 1 meter (1.1 yards) of the roll for the base ~0,509\$ FabLab Inventory
Polyester Batting Breather fabric used when doing the composite. A roll costs 15.01\$ I estimate I used max 1/10 of the roll 1,5\$ FabLab Inventory
Stretch Wrap Used when doing the composite, to protect molds and to secure everything in place. A roll of 305m costs 29.09\$ I estimate I used less 2meters 0,19\$ FabLab Inventory
TOTAL COST OF BASE 18.7\$ (~16 euros)

Electronic parts and components
Material Purpose Quantity Price Origin
Single side machineable PCB stock For milling our the main project board and the H-Bridge board 1 1.40\$ FabLab Inventory
Soldering tin To solder the components into the milled PCB. One roll costs approx 10\$ I estimate I have used max 1/10 of one roll 1\$ FabLab Inventory
ATttiny44A-SSU-ND Microcontroller to read values from Sonar and to send messages to H-Bridges 1 1.18\$ FabLab Inventory
S1011EC-40-ND ftdi 1X06SMD header to connect the main board to the computer. 40 pin piece á 0,60\$ 1*6 0,09\$ FabLab Inventory
Ultrasonic HC-SR04 Sonar to read the distance from the obstacle 1 4.495\$ FabLab Inventory
620-1428-1-ND A4953-H-BRIDGE Motor driver for DC motors. á 1.41\$ 2 2.82\$ FabLab Inventory
DC motor 12V DC motor from Jameco á 3.49\$. To rotate the wheels 2 6.98\$ Apparently these are not in Fablab inventory, but I was given 2 from the treasure cabinet at FabLab Oulu
609-5161-1-ND one 2*3 pin header for programming the ATTiny, two 2*3 pin headers to connect H-Bridge board to main project board. á 0.60\$ 3 1.80\$ FabLab Inventory
609-5160-1-ND 2*2 pin header: connect the sonar to the main board, connect two DC motors to the H-Bridge board, connect battery to Hbridge board. á 0.66\$ 4 2,64\$ FabLab Inventory
445-1423-1-ND 1uf capacitors á 0.07\$ 2 0.14\$ FabLab Inventory
587-1352-1-ND 10uf capacitor 1 0.18\$ FabLab Inventory
311-10.0KFRCT-ND 10k resistor 1 0.01\$ FabLab Inventory
311-0.0ERCT-ND 0 resistor(jumper) 1 0.01\$ FabLab Inventory
BH9V-W-ND Box to host hold a 9V battery 1 1.27\$ FabLab Inventory
9V battery To power up the DC motors 1 2.2\$ Buy own
1528-1379-ND F/F Jumper Wires 6", To connect the pin headers, battery, etc. Bag of 40 pieces 1 Bag 3.95\$ FabLab Inventory
TOTAL COST OF ELECTRICAL COMPONENTS 29,165\$ (~ 25euros)

Other stuff that is still needed
Material Purpose Quantity Price Origin
Green acrylic 3mm To form a transparent shell for the turtle that will be attached to the base. Laser cut. According to the Fab inventory this stuff is crazy expensive. 103.68\$ per sheet? Or is it more sheets than one... 1m2 10\$? Fab Lab Inventory
Mount for sonar Mount for the sonar, 3D printable (Shindoh 3DWox Refillable Cartridge PLA black, 49.99\$) 1 I would assume that one part does not take too much out of the cartridge - 4\$? Model from thingiverse, material from FabLab Inventory
Mount for the DC motor Mount for the DC motors, 3D printable (Shindoh 3DWox Refillable Cartridge PLA black, 49.99\$) 2 I would assume that the part do not take too much out of the cartridge - 6\$? Model from thingiverse, material from FabLab Inventory
Wheels for the robot To allow for the robot to move 4 Free (used) These are not in the FabLab inventory, but there are old robot cars there I was told I can scour for parts. I think some might also have mounts for motors ready
TOTAL COST OF "OTHER STUFF" 20\$ (~17euros)
So it seems that the final cost of my robot would rise to about 70\$. That ain't cheap. I think that the biggest place where I could save up, would be skipping the composites for the base, instead optint to lasercut the whole structure.

who has done what beforehand?
- I drew the final project board that I need on input week. I also connected the sonar to the board, and was able to read data from it successfully by uploading Neil's Hello.HC-SR04.c code on the ATTiny, and by using his Python UI to visualize the values
- I drew the H-Bridge board needed for the motors on output week. I also connected the board to the final project board, and was able to run both of my DC motors successfully by uploading a somewhat modified version of Neil's Hello.H-Bridge C code.
--> When I combined the Sonar and H-Bridge C codes to run on the same ATTiny however, the sonar values are updating really slowly, every 10 seconds. So this is not a good thing.
--> I am planning to use as much of Neil's codes for W11 and W12 as I can for my robot, but as of yer I have not yet been able to combine the C code in a way where the motors would respond to the values coming from the sonar. To help with this, I have been browsing through Instructables and the FabAcademy archive to see how others have done it.

I found out that there are a plethora of wall avoiding robots out there:

Instructables examples
- Arduino mini Sonar robot
- Arduino ultrasonic mobile sonar
- Wall avoiding robot
- Low cost arduino compatible drawing robot
- Arduino Wall avoiding robot
- Obstacle avoiding robot
- Turtle 2WD robot

- Hiro Tanaka's final project 2010
- Tim Rolls' final project 2017

The thing about ALL of these examples are however, that they were made by using Arduino, and it seems that with my ATTiny44 it seems to be a hopeless endeavour - Apparently using Arduino needs more space than I have on that microcontroller as even the libraries are so large. That is why I am trying to stick with C, even though everyone says Arduino is easier. The other option would be to redraw my final project board using the ATmega microcontroller (that has more space to work with Arduino).

Edit: I discussed with our local instructor Ivan, who told me that I had some misunderstandings about how much space Arduino needs. Apparently my project is completely doable with Arduino also, and I was encouraged to give it a go. Might just do that!

I also found one FabProject that uses ATTiny44 and arduino to do what I want to do
:
- Muhammed Safwan's final project 2016
--> The difference with his project is, that he is using one Hbridge instead of 2, the L293D which can simultaneously control 2 DC motors. I might take this as a starting point, and see what I can do with it!

f) what parts and systems will be made?
- The PCB's were made during input week and output week.
- The composite base is ready, I made it on wildcard week
- The shell for the turtle still needs to be designed and fabricated I am thinking slicer for fusion and laser cutting
- The mounts for the DC motors and the sonar need to be 3D printed out - I will use ready examples from thingiverse

g) what processes will be used?
Computer aided design with fusion 360:
- The 2-sided mold for the base of the turtle
- The model of the shell of the turtle
CNC machining:
- Milling out the 2 sided mold for the base of the turtle
Composites
- creating the base of the turtle:
- SuperSap 100/1000 for laminating
Computer controlled cutting:
- Laser cutting to create the shell of the turtle
3D printing:
- the mounts for the DC motors and the sonar
Electronics design and production:
- Final project board and H-Bridge board designed with Eagle
- Milled out with a ronald mill
- Components soldered with a soldering iron
Embedded programming:
- Creating the C code in Atmel studio (using Neil's code as the basis) / Or using arduino and some existing example, tweaking it a bit
- Transferring the code into the ATtiny44 using the FabIsp programmer created on Week 5
h) what tasks need to be completed?
Still to do:
- Model the shell of the turtle, laser cut it.
- Print out the mounts for the DC motors and sonar
- Find suitable wheels and power train (There are a lot of scrapped robot cars at FabLab oulu, that I was told I can use for parts)
- Assemble the robot
- Program the robot

i) what questions need to be answered?
- How to attach the shell of the turtle to the base of the turtle? A hinge of some sort?
- The final project board now gets power from the computer, can it be powered by the same 9V battery that powers the motors? Can not have the robot connected to my computer
- How to turn the robot on, is it now OK, that the wheels start moving when you insert the battery?
- I am not sure how to attach the wheels to the motors. They need some sort of a power train (right?) so that there is a possibility to turn and not just go forward.

Schedule

j) what is the schedule?
- 28.5-3.6: Programming - Trying to get the C code to work - If this then that....
- 4.-6.6: Model the shell for the turtle, laser cut it
- 7.-8.6: 3D print the mounts for the motors and the sonar
- 9.6.-13.6: Assemble and test the robot
- 14.6-16.6: Troubleshoot kinks
- 17.6.-19.6: Prepare final presentation and finalize documentation

Evaluation

k) how will it be evaluated?
As for me, I will be happy, if the robot moves forward and avoids the obstacles as it is supposed to. No need to look pretty, I am more concerned about the coding and assembling parts
From the FabAcademy assessment, the final project requirements are as follows:
- create your own integrated design
- demonstrate 2D & 3D modelling capabilities applied to your own designs
- select and apply appropriate additive and subtractive techniques
- demonstrate competence in design, fabrication and programming of your own fabbed microcontroller PCB, including an input & output device

Assesment of the final project
Have you -
- made your slide: 1280 x 1024 pixels with your name, project name, Fab Lab name, a photo/render/sketch of your project, a brief description of what your project is/does
- made a ~1 minute (10MB/1080p/720p) video of you explaining your project
- made a separate Final Project page that briefly summarises your project
- included the BOM (Bill of Materials) for your project
- linked from Final project page to any weeks that you worked on your final project