Today we worked on moving all the code to only one NodeMCU. Last night we realize that if we use the TX and RX pins and use the same tricker pin for all the ultrasonic sensor, we could fit everything on one NodeMCU. This meant changing the code all over again, but it solved a lot of the problems we where in encounter, with the two NodeMCU. This took a good chunk of the day to finish off.
When we wanted to test with NodeRed, we found at few mistakes, ui-controller not changing dashboard as they should, we found the mistake in the coding, change it, and everything was working again.
We startede filming the video, the clips whit out the machine were very easy to shoot, and the edit of the first clips went super fast, but we had a bit of trouble with the machine, and just when we were about to be done, we fried the NodeMCU that we were using. So we change over to another NodeMCU, but starting having trouble with the OLED, to the prototype apart again and then we found out that it was a broken cable. Now the everything was running, and we check the math from the code, and made a few adjustments to make it work better.
The rest of the group who was not working on the coding, worked on the report, the PRD, and the BOM. We also spent this reading though the prototyping planers. Around midtnight all this was done, we started filming clips og the NodeRed dashboard.
This is how the final prototype turned out, a last we got every thing to work, but I took a long time, and we finished of in the morning, and tired, but happy that know we are done with the prototype and now we only need to present it.
We made a rendering of how we wanted the finish product to look. The frame should out of white plastic, and the cambers should be transparent.
Today was primarily spent writing the assignment, coding, debugging and testing the mixing mechanism with the motor. The construction was pretty much done. The water container, however, did not seal properly, so this needed to be redone.
It turned out, that the mixing blade we thought was the best version yet, shoved the flour up on the sides of the mixing container. The best mixer turned out to be one of the 3D-printed ones with a big spacing between the bars.
This one scoops and blends the dough very well and minimises trails up the walls and unnecessary resistance in areas with dough-lumps. We also learned that the rounded wall inside of the flour container was working just fine after our other revisions. Therefore we did not need to make the wall square anyway.
With more testing on dose amounts and water-flour ratio we gained more experience on the abilities of our mechanisms. This teaches us how to operate the actuators in order to gain the best results.
Coding and rearranging components has given us loads of insight and with this, also possibilities. Firstly we learned, that one NodeMCU could control both actuators and sensors by connecting input pins from all ultrasound emitters. This reduced the necessary input amount with 2 pins. The serial pins TX and RX can be reprogrammed and this way we were able to incorporate the OLED display to the one NodeMCU thus getting rid of the second nodeMCU entirely.
With coding we worked a lot to gain control, apply functions for calculating sensory inputs and rearranging overall code for the new circumstances.
We’ve achieved a lot but encountered some technical issues once again. Overall construction has been completely finished for assembly over the weekend but now we need to work to gain completely control over the electronics.
Today we faced many challenges with finishing the sourdough machine. We spend a lot of time trying to get the 3D-printer to work in the library, laser cutting the construction pieces (which we need to redo), and had coding difficulties. These obstacles have set us back a lot time wise, so we will work further on the project throughout the weekend.
We needed to 3D-print the frame for the OLED, a new mixing blade with a new shape and a clutch.
The frame for the OLED
One of the new mixing blades
The clutch
Again today we worked on our connectivity issues.
In order to make an improved mixing blade, we needed to test some different shapes out with flour and water with the motor connected. According to our tests, the vertical bars should be rounded, have more space between them, and there should be a rod at the bottom to make sure the dough at the bottom will be mixed properly. The curvy design of the bars also aided in the mixing of the dough. The bigger spaces between the bars made sure more dough passed through, cutting the motor some slack.
The prototype setup with the motor connected
We are now printing a new kind of blade, which has bars with a bigger diameter, has a rod at the bottom and bigger space between its bars.
We also did a lot of research on making the perfect sourdough starter and maintain it, so we knew how the machine should run. Check the saturday post out to see the procedure.
It’s time to wrap things up and get the subfeatures working together. This has proven to require a lot of thinking, coding and designing. The goal since day 1 has been to have a functioning prototype by tomorrow leaving the report, nice to haves and exam preparation for the remaining days.
The initial test of the day was to get stepper and waterpump working to dose flour and water into the mixing container. With a few adjustments we found a stepper speed optimized for dosing flour. In this test we ran into a new problem of preventing uncontrolled spill of flour when demounting the flour container. This was solved in plenum as we went through this test.
Todays jobs were distributed among the members of the group:
Coding screen text and pictures
Connecting motors and sensors (to a functioning circuit and main code)
Mechanical features … (TB explained)
Fine tuning Node Red interface with ‘nice to haves’ and nodeMCU/Arduino connectivity.
OLED display (Overly Lousy and Evil Display
Coding text to OLED has proven to be harder than anticipated. Some faulty code keeps disrupting the screen display when printing messages in several lines to the screen. So only 1/3 of the screen could show text, which was highly frustrating. We had no problems printing an image as an xbm file, so we planned on uploading an image with text when we needed multiple lines and then we made a drawing for every mode.
Later in the day we finally had a break through and found the error in the code, so now it works as it should. Then we tried connecting a SR-HC 4 ultrasonic sensor to the circuit and made a code which displays on the OLED when a refill of flour or water is needed.
Node RED
Today we changed some details in NodeRED. The link to the dashboard will now take you to a page with a button, and clicking this button will either take you to the sign up page or the main dashboard if you already have signed up. We also managed to clear the different inputs on the dashboard after you save the information as a flow or global variable. We also added a count down function which counts down the amount of days left on travel or baking mode. To make sure that the user will not stop the mode by mistake, we added a pop up window, which asks if you are sure you want to stop the current mode. If you try to overwrite the travel mode with baking mode or vice versa, you will get a pop up window telling you that this is not possible, because of the current mode. To change mode you would have to stop the current mode and then activate the new mode.
The lids
We laser cut the different part of the lid for the containers today. The lid is made from 5 acrylic parts. The first two parts are made to fit the ultrasonic sensor, and the tube. One of the these part have a space to mount a hinge. There also are two plates to lay around the tube and the wires, with at hole to get the wires out. At last we have the top part of the lid.
Today we took a few more steeps in the right direction, but everything is taking a longer time than we anticipated, and we still have a lot to do. Our goals was to finish the sourdough machine by day 10, but it is starting to feel a bit unrealistic. Currently it looks like we will have the product ready by day 11, and perhaps we can use the weekend to film, and write the report, so that we will finish everything on time.
One of the goals for today was to collect the Arduino code to one file which is functional with all the components. Another goals was to test the motor set-up and start measuring the amount that get dispensed, for this we needed to build a prototype chassis.
The arduino, nodeMCU and all the components, WIP
Today Aksel has focused on wiring all components and code together, except for NodeRED just currently; that will probably be tomorrow.
The first challenge has been getting it organized in a way that allows us to easily spread it out again on the test bench. Therefore I chose to link up 4 breadboards and keep the arduino on the side. We can then just split the breadboard up if that is needed.
Thereafter I looked at every arduino code file and made each task into a function so it is all callable. Currently are we going to have the following code functions:
Amount(“containerName”), returns and float with the distance from the container lid.
Flour(degrees, speed), to be changed to accept mL, but might vary from flour to flour. The speed is to change the intensity of the movement.
Water(mL), to be changed to reflect a measured flowrate.
Mixing(degrees, speed), to be further incorporated into a mixing function taking into account the amount of sourdough.
The current breadboard setup with: arduino uno, nodeMCU, 2 stepper motors, 2 easy drivers, peristaltic pump, 3 ultrasound sensors, 12-5v voltage regulater, N-channel MOSFET, , barrelplug and a lot of wires.
The next steps are writing the functions controlling the various modes. So that includes baking mode travel mode and keep it kicking. Also the display code needs to be finished and incorporated in the main code. Sebastian is currently writing the display code which will make it possible to display any string easily. The biggest challenge however is going to be establishing a logical way of establishing serial communication between the nodeMCU and the arduino as the nodeMCU acts as the wifi hookup.
OLED
Sebastian and Emilie worked on the OLED-screen, which is a quite unreliable little thing. Even though we bought a new OLED with high resolution and color, it caused us trouble, as it turns out that the display Adafruit sells has one extra pin broken out. A pin that our cheap Chinese knock-off seemed to miss: the CS pin (Chip Select pin). We will ask if instrument group can help us to solder it so it works, but at the moment we plan on just using the OLED we used with the locker.
We figured out how to load images to it, flip between displays and change the font and position. It is important that the display provides easy interaction with the user and is in line with our vision.
Today we tested the flour dispense mechanism. Since the gears were already mounted on the motor, and we had the code for the motor, we just needed to mount the screw on the shaft. As seen below the motor started, and everything was moving as intended.
Then we tested the setup with with the auger screw inside the flour container to see how the flour would behave. As seen below this went very well, and the flour was successfully dispensed. Next step is weighing the amount of flour dispensed at each turn.
This was also our first test of the wall we put inside the flour container on friday. We learned that the flour is dispensed better with the wall, than with no wall, but it did not move the last bit of flour inside the flour container properly. We want to try and optimise the shape of it, by making a square or a trapez shape instead of a rounded shape.
The red lines illustrate how the shape of the new wall in the flour container should be
Node Red progress
Today, we change to layout of Node Red, we keep what we already made and reconfigured some of the elements. The first link you will get to is the page where the user need to input their email. The go back button will take the user back if they came from another dashboard, otherwise the button will not do any thing.
After inputting the email, the use will get to a page where they can name the sourdough and the button will start a new sourdough, and send the user to the main dashboard. The cancel button will send the user back to the dashboard they came from.
In the main dashboard we remove the start a new sourdough, we did this because, the user, will have a smaller chance to start up a new sourdough by mistake. We also add the funktion to create a new user. This will take the user back to the sign up page, it the user regrets the user can use the Go back button to get back to main dashboard.
In the informationen part, we add the name of the sourdough, the baking mode and the travel is not change. The emails for the empty contianers and for the overfilled sour dough contianers is also set up. The Node Red layout is getting finish next thing is to test it together with the Arduino.
The electronics
Aksel has worked on putting all the various electronic together on a few breadboards as this will make prototyping and testing easier when the first chassis/test bench, is done. Besides that is important to test it all set together to verify that there are no conflicts.
The power supply has been ordered, it’s a 12V power supply, therefore we use a voltage regulator to power the Arduino and other 5V components.
The NodeMCU, stepper motors (and their drivers) and the peristaltic pump all run on 12 volts. There is even the option of dosing the flour with a 12v DC motor if the stepper motor isn’t powerful enough. This could also be explored as a mixing option.
Friday we worked on the overall shape and dimensions of the sourdough machine. We made calculations on the volume of both the flour and water containers, based on travel mode, as this mode sets the highest demands on the flour and water amount. Both of them can be shortened quite a bit which makes the machine much more fitting on the kitchen counter.
From our prototyping of the flour container and dispensing mechanism, we figured out, that the container needed a wall, to make sure the flour doesn’t turn around with the auger screw when the amount of flour is low.
The wall inside the flour container
The sour dough container was initially prototyped from a tube and a cut acrylic plate material. This proved to be waterproof and the material could therefore be used for the final prototype.
The final prototype came in production in the work shop on thursday the 13th and was finished today. Finalising the prototype showed, that I (Sebastian) had made a mistake in designing the handle. It quickly showed that the shape and dimension would conflict the overall structure. Apart from this, the design also has an unpractical feature on the bottom piece on which the container stands. It has been fabricated too large. This feature cannot be changed due to risk of breakage. The mixing chamber has a snap fit at the top which holds the shaft.
At the end of the day it was decided to remove the handle, which we will do on monday. We decided that the container would work just fine without an actual handle, so instead it will be removed and carried with both hands on the curved bottom. This way it is easily handled, lifted and taking in and out of the machine. Carrying the container is now analogous to carrying a child / a pet, which we see fit as the sour dough also is a living organism which you take care of.
The old and new prototype of the mixing chamber.
We also decided on the overall shape of the mixing blade. We need to make a new version which is a mix between the two prototypes we have at the moment. It should have both the vertical bars and a scraper at the bottom to make sure stirring is optimal.
We also worked on NodeRED, making the dashboard more user friendly and enabling e-mail notifications when the user starts a new sourdough or changes the setting.
An other part that started today was the connection between the mixer and the motor. The connection should be able to take the the input shaft in any angle configuration and output the angular. It was a lot of CAD work. Next step is to 3D print it and see if it works.
Aksel, my focus has been upon: creating an Arduino function for the mixers’ stepper motor, designing another dough mixing hook, helping with NodeRED and other miscellaneous things.
The function accepts 2 values, a mixing degree (how much to turn away from neutral) and a speed between 0-100% E.g the stepper motor turns 45 degrees forward, then -90 degrees and then 45 degrees again. This returns it to the initial steps and it’s now ready for the next mixing cycle. Our stepper motor is a 17hs4401 bi-channel which is rated for 1.7A and we drive it with an easydriver which can deliver 0.75A per channel. This results in a 1.5A current. We had to turn the Easydriver up to its max to reduce the risk of it ‘stepping wrong’ in high viscosity doughs. This is however a problem that can be mitigated with the proper gearing and potentialy a more powerfull motor in the final product.
Node Red
We also worked further on the Node Red coding. We choose that we wanted the node to communicate the mode/setting, and a few other thing needed to control the modes, but other than this most of the coding and the functions will be done in Arduino.
The dashboard has 4 main functions. The first one is to display information from the sourdough machine, this will show information that the user needs. The next one is to start up a new sourdough. This will send a message to the NodeMCU via the MQTT to start the mode called Start-up. This mode will check if the sourdough contianer is empty, check if the flour and water container is filled, and then mix the water and flour to start up a sourdough from scratch. The Start-up mode will end after 3 days, where NodeRED will send the message to set the mode to Keep it kicking (standart mode). In Baking mode the user types in the amount of dough needed in their recipe and which day they want to bake. Baking mode will feed the dough the appropriate amount, to make sure that the amount of dough needed is ready on the right day, and that there is also some sourdough left, to keep it going. After baking NodeRED will set the mode to Keep it Kicking again. The last function is travel mode. Here the user will type in how many days they will be gone for and press OK. NodeRED, will send the message to NodeMCU to start up the travel mode. When travel mode is started the user will be asked to remove some of the sourdough, and the machine will check if the flour and water containers are completely filled. Then the machine will keep feeding the dough a smaller amount of flour and water everyday, increasing the amount as the weeks go by, and after the set amount of travel days, the mode will be changed back to Keep it Kicking.
We finally got our hands on the ~9hour 3D print of our own CAD-design of the auger screw. We got some valuable insights from the moments we had to remove the supports for the structure. Getting the auger screw free from the support was messy – and the rotor pin broke off in the progress. Thus we spend some time drilling a hole through the center, and replacing the PLA pin with a metal pin. This is going to be redesigned in the upcoming version of the auger screw.
The 3D printed auger screw, on a laser cut gear, after the initial prototyping session.
Don’t say it with flour
Flour is filled with counterintuitive properties – not entirely easy to dispense precisely. Our first prototype with the small auger screw seemed to let the flour out fine from the bottom. But due to the amazing properties of flour, we would be restricted to a canister with the same diameter as the auger screw, if we were to rely on gravity itself. That would cause the flour-canister to become tremendously tall and slim, which is not quite suitable for the user, when flour is poured up. Therefore we needed a larger auger screw – or another way of dispensing the flour.
One of the issues with our current model of the flour-dispensing mechanism, is that the flour is falling straight down on the stepper motor. We have looked into different kind of bevel gears that would solve this issue by providing an alternative placement of the motor. In the morning we woke up to a team member having provided an alternative to expensive bevel gears, which was fast and easy to prototype on. We laser cut the parts needed, and tried to do a test of the gears and the new auger screw in the flour canister.
The Auger Screw v1.1 failed us
The flour went through the first to slopes seemingly without too much difficulty, however it came to a stop, no matter how many turns we gave it. At one point the flour began spinning on top of the screw, so no flour could be added. We learned that we should implement a wall on the flour canister to ensure it would not follow the spin of the auger screw.
Prototyping on the auger screw with the gear mounted on it. (Look at the empty space in the canister)
The test gave us following insights: We need a higher slope and/or fewer threads, which should be included in the next version of the auger screw. OR we should look back at earlier ideas of dispensing flour.
By removing some of the threads on the auger screw 1.0 we got new insights and transformed the model to a auger screw v1.2
Alternative flour dispensing mechanisms
The “classic” or corporate way of dispensing flour, is with flour falling down on an auger screw, which moves sideways. We did a quick test with a flour canister, and it was too narrow to provide a proper slope for the flour to fall. Therefore we try to improve the current auger screw model, while we think of super smart alternatives.
Higher slope & fewer threads for Auger Screw v2.0
We set the new model up for 3D print, and will wait excitedly till tomorrow. The new model will have room for a metal rod to be inserted as a core – to give it the strength needed to dispense the flour.
Container lids
We worked on the lid for the flour container and the water container. The lids need to have holes for the ultrasonic sensor, the sensor is needed to measure how much flour and water is left in the containers. The lids need to hide away the cables and the ultrasonic sensor. We laser cut a part of the lid to see if it fitted the container and that the ultrasonic sensor fitted in the holes. We disused if the lid should be a cylinder, or a cylinder with a sloped top surface. We also played around with a design where the lid had a cylinder shape handle that will hide sensor. For now, we choose the cylinder shape lid. The lid will be made of 2 laser cut acrylic plate with holes for the ultrasonic sensor, a cylinder with holes for the cables and waterpipe and a top plate also made out of acrylic. We made drawing of the lid parts, so that we are ready to laser cut the parts. Because the acrylic is clear we need to paint, so that the sensor will not be visible. We consider, making the lid out of wood, but if we use wood, there is a chance it will reshape or rotten, with contact with water. It is also important that the ultrasonic sensor we stay clear of the water to avoid short circuit.
The mixer motor
So, we have had quite a few struggles with how the motor is going to work together with the dough hooks. The problem is, that the dough hooks should be in a neutral position when they haven’t been turned, and we don’t know if this can be done with a stepper motor without extra logic. A servo would be more suited as it has a rotary encoder to keep track of the position.
After some discussions we decided to mechanically force the dough hooks into a neutral position every time. This is done with a guiding channel where the dough hook axle can only pass through one way, any other way will turn the axle into the correct position.
On tuesday we mainly worked with getting the water pump to work, prototyping a new type of mixing blade and a new bigger auger screw and deciding the size and shape of the flour and water containers. We also begun making the overall structure of the NodeRED flow.
Water pump
We made the water pump work by finding a suitable Arduino code and connecting a diode and a transistor to the system. The Arduino was run by the computer and the water pump was run by the power outlet (12v adapter). The pump is fairly small, but can still transfer 1 dl of water in a time span of 2 minutes, which fits our needs just fine.
Testing the water pump
The prototypes of the new mixing blade and new auger screw were initiated, which we will work further on tomorrow (see separate blog post).
We also cut some acrylic cylinders to use as flour and water containers.
Flour and water containers
We also made questionnaires to cover the users needs and habits when it comes to their sourdough, which we posted in various facebook groups. From this we hope to know more about the way the user interacts with their sourdough and what they need.