-
2024-04-11
04/25/2024 at 08:02 • 0 commentsToday, we did the final bill of materials and this it was we ordered under our budget:
- USB cable male/male: for the instructions' book charger
- RB-TFT1.8 1,8'' screen: to display the messages and images on the M8B (what will answer to the questions asked)
- hall effect magnetic sensor: detects when the book is opened or closed to light it up automatically
- mini speaker: to make a little sound when the answer is charging in the M8B and potentially read it (we haven't decided yet whether or not to make it, or just if we make it mandatory because it could annoy some people)
- micro USB male to USB female: to wire the battery to the book
- micro SD card: one for the audio, one for the images (we alreay have one)
- audio amplificator module MP3 DF player: for the sound to be good enough to go through the speaker
- micro-SD module card ADA254: to connect the micro SD to the circuit
We mostly ordered our components on Mouser and Gotronic.
-
2024-04-04
04/25/2024 at 07:46 • 0 commentsToday, we checked different ways of putting sound into the M8B.
We started to simulate it.
We also started the list of components, but we changed a lot and took a long time to find the easiest to connect components so we haven't finished it.
-
2024-03-21
03/21/2024 at 10:17 • 0 commentsThis is what we did today:
- successfully made our code work to have an answer appear on the screen when we shake the accelerometer
- made our list of components
- detailed our prototype
-
2024-03-21 - Success! Programming the gyroscope 2.0
03/21/2024 at 09:27 • 0 commentsToday we finally managed to correct the code and ensure that when we shake the gyroscope, text appears on the screen:
#include <Wire.h> #include <Adafruit_MPU6050.h> #include <Adafruit_Sensor.h> #include <LiquidCrystal.h> Adafruit_MPU6050 mpu; const int rs = 15; const int en = 13; const int d4 = 32; const int d5 = 33; const int d6 = 25; const int d7 = 26; LiquidCrystal lcd(rs, en, d4, d5, d6, d7); void setup() { Serial.begin(115200); while (!Serial) delay(10); Serial.println("Adafruit MPU6050 test!"); if (!mpu.begin()) { Serial.println("Failed to find MPU6050 chip"); while (1) { delay(10); } } Serial.println("MPU6050 Found!"); mpu.setAccelerometerRange(MPU6050_RANGE_8_G); Serial.print("Accelerometer range set to: "); switch (mpu.getAccelerometerRange()) { case MPU6050_RANGE_2_G: Serial.println("+-2G"); break; case MPU6050_RANGE_4_G: Serial.println("+-4G"); break; case MPU6050_RANGE_8_G: Serial.println("+-8G"); break; case MPU6050_RANGE_16_G: Serial.println("+-16G"); break; } lcd.begin(8, 2); Serial.begin(115200); lcd.clear(); } void loop() { sensors_event_t a, g, temp; mpu.getEvent(&a, &g, &temp); Serial.print("Acceleration X: "); Serial.print(a.acceleration.x); Serial.print(", Y: "); Serial.print(a.acceleration.y); Serial.print(", Z: "); Serial.print(a.acceleration.z); Serial.println(" m/s^2"); Serial.print("Rotation X: "); Serial.print(g.gyro.x); Serial.print(", Y: "); Serial.print(g.gyro.y); Serial.print(", Z: "); Serial.print(g.gyro.z); Serial.println(" rad/s"); Serial.print("Temperature: "); Serial.print(temp.temperature); Serial.println(" degC"); if (abs(g.gyro.x) > 1 || abs(g.gyro.y) > 1 || abs(g.gyro.z) > 1) { lcd.clear(); lcd.setCursor(0, 0); lcd.print(getRandomMessage()); lcd.setCursor(0, 1); lcd.print("UwU"); delay(3000); lcd.clear(); }
The next step is reducing the sensitivity of the gyroscope. We don't want to text to appear as soon as the person picks up the ball.
Here is the new code:
#include <Wire.h> #include <LiquidCrystal.h> #include <Adafruit_MPU6050.h> #include <Adafruit_Sensor.h> const int rs = 15; const int en = 13; const int d4 = 32; const int d5 = 33; const int d6 = 25; const int d7 = 26; LiquidCrystal lcd(rs, en, d4, d5, d6, d7); Adafruit_MPU6050 mpu; void setup() { lcd.begin(8, 2); Serial.begin(115200); while (!Serial) { delay(10); // Wait for Serial Monitor to open } if (!mpu.begin()) { Serial.println("Failed to find MPU6050 chip"); while (1) { delay(10); } } Serial.println("MPU6050 Found!"); mpu.setAccelerometerRange(MPU6050_RANGE_8_G); mpu.setGyroRange(MPU6050_RANGE_500_DEG); mpu.setFilterBandwidth(MPU6050_BAND_21_HZ); } void loop() { sensors_event_t a, g, temp; mpu.getEvent(&a, &g, &temp); float accelerationMagnitude = sqrt(pow(a.acceleration.x, 2) + pow(a.acceleration.y, 2) + pow(a.acceleration.z, 2)); // Adjust this threshold value to change the sensitivity float threshold = 60.0; if (accelerationMagnitude > threshold) { lcd.clear(); lcd.setCursor(0, 0); lcd.print(getRandomMessage()); lcd.setCursor(0, 1); lcd.print("UwU"); delay(3000); lcd.clear(); } } String getRandomMessage() { String messages[] = { "Go ahead", "Fuck it.", "WTF?!", "OOPS", "Possibly", "Fate.", "Nauwr", "Shut up", "RIP", "Nope" }; int index = random(10); return messages[index]; }
-
2024-03-14
03/14/2024 at 11:09 • 0 commentsWhat we did today:
- coding the gyroscope
- connecting it to the screen
- thinking about the construction of our ball (inside and outside)
Things to do next time:
- complete the instructions
- finish our list of components
-
2024-03-07
03/14/2024 at 09:13 • 0 commentsThis is our action plan for our improved Magic 8 Ball:
- have a better and bigger screen, with more pixels and with wich we could display more than 16 letters, potentially even showing pictures
- voice speaker to read the message when it's displayed
- improve the structure of the ball, make it smaller (with a transparent part to show the screen), inspired by Jon Paul's balls
- have a better LED composition
- add an accelerometer giroscope
- incrustation -> prevision
- create eyes like a furby
And to improve our user's guide:
- implement a sensor to open the book automatically
- E-paper for the text