Grab a cup of coffee!
This is a sprint 2 about the process of creating a smart coaster which measures your drink temperature and also reminds you to drink water using the LED indicator.
Usually before starting in any
project the first thing i do first is to make a prototype of this idea because it cost less when something fails or get burned so that is what i did in the coaster
Before starting in the PCB Design Process or even the CAD the first thing was to test the components of the project
So that is what i exactly did, the main component in the coaster is mlx90614 and it is a non-contact IR sensor and it is really accurate, fast in measuring temperatures so i have started searching how to interface this sensor in the Arduino IDE
Searching did not take much time because there is an existing library for the sensor and example code so i have attached the wires of the sensor as follows
VCC to 5V
GND to GND
SCL to SCL
SDA to SDA
Then uploaded the code and opened the serial monitor and started getting the sensor readings and it was pretty fast, accurate too.
Next thing i needed to test is the buzzer i have attached it to the arduino and played different tunes to choose a non noisy one and it was working great too !
Last thing i needed to test is the LED Strip but it was a 12V strip so i needed to make a circuit using transistors in order to control it through Arduino.
After hooking up all the wires of the LED and making sure that everything is alright i have uploaded the code and then they were working perfectly and smoothly so it was the time to merge everything in one board after testing every component separately.
i won't go in a deep details in this stage because i have already explained it in the group project
I needed to create a PCB which integrates the microcontroller and the led strip with buzzer and the temperature sensor so i have already designed a LED strip board that is driven by Atmega328P microcontroller in the group project and it was pretty simple only the bare minimum hardware of the arduino and bunch of resistor and transistors in order to drive the LED strip using the pwm signal of the arduino .
The only things i needed to do is to remove the Bluetooth module because i did not need it and change the outline of the PCB to a circular one.
then add in the schematic the rest of the components i needed such as the mlx90614 and the buzzer
i have connected the buzzer and the IR module by referring to the Atmega328P core pinout.
then i have switched the the board mode and the first thing i did is to set the DRC rules to 0.42 to avoid any missing traces in the fab modules when i export the PNG files .
The routing Process was quite easy to be honest because i have already did it in the group project of the lamp .
i have confirmed with my instructor the PCB design then it was the exporting time i have exported the gerber files from fusion then imported to gerbv to export the files as a PDF
Then i have opened GIMP imported the files and set the resolution to 1000 then set the color mode indexed and inverted the colors and i have repeated the process with the drills and the profile too i did not need to flip the board this time because all the components are SMD and routed on the TOP but this mistake lead to flip the position of the IR sensor.
Then to make sure that everything is alright i have opened fab modules and imported the PNG files to see if there is any missing traces or drills and all was good because i have set the clearance a minimum value of 0.42 which exceeds the drill bit width (0.4mm)
next step was to stick the PCB on the bed of the modela and first thing is to load the traces file and set the parameters then set the z distance of modela then calculate and send the files then repeat the same process in the drills and the profile.
After fabricating the PCB it was soldering time and actually it didn't take much time as expected the first thing i started to solder was the microcontroller and its other related components and tried to upload a code using the ISP header and it got uploaded so that's means the bare minimum hardware i have designed is working then i have soldered the rest of the components.
After successfully fabricating the board it was cad time i have exported the PCB design to fusion 360 after adding all the 3D packages now i have a 3d model of the PCB
So the shape of the coaster is planned to be circular so i have sketched a 8cm circle and extruded it then used the shell tool in order to make the fittings of the pcb then on the top i have added a acrylic ring and sanded it to give a nice blurry look and inside the ring i have used a while acrylic and glued them using super glue
after that i have exported the cad design from fusion and imported it into prusa slicer to set the infill ratio and the layer height and the supports.
after exporting the gcode i have loaded the filament and we are good to go.
after printing the enclosure and removing supports etc....
the fittings were inaccurate because i forgot to measure the height of the acrylic so the sensor was too high for the acrylic so i needed to low the base of the board using the dremel which was not totally right but it did the job.
The Fails i have faced during the project are
1- while soldering the dc jack i have switched the polarity which lead to burn the microcontroller and the voltage regulator.
2- i needed to cut into the enclosures to lower the sensor height.
3- the sensor did not detect the objects temperature so i needed to cut a hole into the acrylic using the laser cutter.
Last thing is the programming part which is divided into 2 parts
the first part is related to reading the temperature values from the arduino then i have used those values in if condition in 3 cases .
case 1 if the temperature is higher than 50 the led strip should lights in red .
case 2 if the temperature is between 35 and 40 the led strip should lights in green which means that the drink is suitable to drink .
case 3 if the temperature is between 1and 18 the led strip
should lights in blue which means that the drink is a cold drink.
the second part of the code is related to the function millies()
whenever the coaster gets powered it makes a beep sound every 4 hours to remind you to drink water without interrupting the code.
The product needed alot of workaround and more development but unfortunately I'm limited to a specific time .