Wake Up and Run - Fun!
Get ready for a fun-filled and interactive morning with the "Wake Up and Run" project! This project is a unique take on Goldberg's machine, combining the Circuit Playground Express, Node-RED, and MQTT technologies for a one-of-a-kind experience. Say goodbye to boring mornings and hello to a fun and energizing start to your day.
As you snooze in bed, the alarm will ring, but don't hit snooze just yet! To turn off the alarm, you will have to put your temperature-sensing skills to the test by heating up the temperature sensor on the Circuit Playground Express until it reaches 30 degrees. Then, it's time to play a light game that's just like Simon, where you will have to repeat the sequence of lights in the correct order. Get ready to let out a loud scream, as you face the scream challenge, where you will have to shout as loud as you can to complete it. Finally, it's time to break a sweat with some star jumps for 20 star jumps, which the accelerometer on the Circuit Playground Express will recognize.
All the while, your computer will be by your side, guiding you through each challenge with a fun and interactive dashboard. When you've completed all the challenges, you'll be ready to hit the pavement and go for a run, feeling motivated and energized. So, let's start the day off with a blast and "Wake Up and Run"!
Go to the flow section below for more details!
Supplies
In order to use Wake Up And Run we need
To build the system:
1. Circuit Playground Express
2. ESP8266 connects to the Circuit Playground by UART
3. AAA Batteries - X3
4. Holds batteries
5. USB Cable
To program the backend:
1. Arduino - IDE
2. Node Red
3. Mqtt
For the challenge:
1. Sports clothes
Preparations
1. The UART connection:
- Gather necessary materials: You will need the Circuit Playground Express, a computer, and four jumper wires.
- Connect the Ground (GND) wire: Take one of the jumper wires and connect one end to the GND pin on the Circuit Playground Express. Connect the other end to the GND pin on the computer. This will ensure that both devices have a common reference for electrical signals.
- Connect the Voltage (VCC) wire: Take another jumper wire and connect one end to the VCC pin on the Circuit Playground Express. Connect the other end to the VCC pin on the computer. This will supply power to the Circuit Playground Express.
- Connect the Transmit (TX) wire: Take another jumper wire and connect one end to the TX pin on the Circuit Playground Express. Connect the other end to the Receive (RX) pin on the computer. This will allow the Circuit Playground Express to transmit data to the computer.
- Connect the Receive (RX) wire: Take the last jumper wire and connect one end to the RX pin on the Circuit Playground Express. Connect the other end to the Transmit (TX) pin on the computer. This will allow the computer to receive data from the Circuit Playground Express.
2. Download Arduino IDE (the desktop version) using the following link: https://www.arduino.cc/en/Main/Software
3. Download and install the driver to the board using the following link: http://bit.ly/adafruit-windows-drivers
4. Install the SAMD board manager using the following link: http://bit.ly/playground-arduino
5. Download Telegram app in your phone.
NodeRED + Mosquito
1. Open Terminal on your computer
2. Download mosquito using - brew install mosquitto
3. Download node.js using - brew install node
3. Download node red using - sudo npm install -g --unsafe-perm node-red
4. Update mosquito.conf by adding two lines in the beginning:
bind_address 0.0.0.0 + allow_anonymous true
5. Update using open /usr/local/etc/mosquitto/mosquitto.conf -a TextEdit
5. Run mosquito sqs using /usr/local/sbin/mosquitto -c /usr/local/etc/mosquitto/mosquitto.conf (The -c option followed by /usr/local/etc/mosquitto/mosquitto.conf specifies that we want to use this configuration file).
6. Run node red using node-red
7. On web browser write in address localhost:1880 for node red.
8. On web browser write in address localhost:1880/UI for node red dashboard.
9.Import the node red configuration - the attached file
Downloads
Telegram Configuration
1.Creating a Telegram bot, Open Telegram and search for “BotFather”. Using this bot you can create, delete and manage all your bots. Start creating your bot using the /newbot command. You will receive a token that will be used by Node-RED to access Telegram
2.Configure your bot Click the Telegram sender node in the flow. Click the pencil icon to change to your new botNext we have to enter a “Bot-Name” and a “Token”. You created them in step 1.All done. Your bot is ready!
3. Find your Telegram ID, in your telegram go to "Telegram Bot Raw". press /setup and use the "id" param from json as your ID.
4. Send your first message! First you have to start your bot. Search for it in Telegram and click on Start.
5. change your Id in the node - as in the picture
Your telgram node is all set!
Arduino + Code
Ready to get started with "Wake Up and Run"? Here's what you need to do:
- Open the attached code using the Arduino Integrated Development Environment (IDE) on your computer.
- Connect your Circuit Playground Express (CPX) to your computer using a USB cable.
- Configure your Wi-Fi settings - This can be done by following the instructions in the attached picture. Once you've successfully configured your Wi-Fi, you're ready to go!
With these simple steps, you'll be ready to face the challenges and start your day with a blast. So, let's get started and "Wake Up and Run!"
Downloads
Optional Changes (steps 5 - 7) - Different Game Level
Get ready to customize your "Wake Up and Run" experience to your desired difficulty level! With the ability to change the game settings, you can make the challenges as easy or as challenging as you like. Whether you're looking for a quick and easy morning boost or a more intense workout, the flexibility to adjust the game settings gives you the power to make "Wake Up and Run" perfectly suited to your needs. So, let's start the day off with a blast and "Wake Up and Run" - your way!
When Should I Wake Up?
Want to change the time you wake up each morning? It's as easy as changing the value in the code, just like you would adjust the time on your favorite alarm clock! Check out the picture above to see exactly where to make the switch. Start your day on time, every time!
The Heat Challenge - Difficulty Level
Get ready to make your mornings even more exciting! By simply tweaking the temperature value in the code, you can change up the temperature challenge and keep things fresh. So, let's add some extra heat to your mornings and make your Wake Up and Run experience even more thrilling!
The Lights Challenge - Difficulty Level
Want to make the light game even more challenging? It's as easy as changing the code! Just follow the instructions in the picture above and you'll be able to adjust the sequence to your desired level of difficulty. It's time to put your memory skills to the test and have some fun with the Circuit Playground Express and the lighting game!