The Circuit Playground

This post is written by my 9 year old daughter.

The Ladyblog

This summer I went to a Bootcamp to learn about LEDs. So later that weekend, I made a tiny little program that measures the temperature inside the room that you are in.

What is Circuit Playground?

The Circuit Playground is a small board that has a lot of LEDs, buttons, and Sensors. The sensor that we used is temperature sensor in this demo. Circuit Playground is useful to help people practice programing. Once you get the hang of it, you can start doing wondrous things just with a little bit of programing in a Circuit Playground, and most importantly fun! The sensors in a Circuit Playground are:

  • Audio
  • Temprature
  • Light
  • X, Y ,Z Motion sensor

It also has an speaker, 10 LEDs and buttons.

A Simple Program

Now lets program the Circuit Board to measure the room temperature and check is it is to hot. If so, we will play an alarm that will tell you to get out of the room and all the  LEDs will flash rapidly.

#include <Adafruit_CircuitPlayground.h>

float tempF;

void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
CircuitPlayground.begin();

}
void loop() {

// put your main code here, to run repeatedly:
tempF = CircuitPlayground.temperatureF();

Serial.print(” Tempture in the room degree is “);
Serial.println(tempF);

if(tempF > 85)
{
Serial.println(“Room is Really Hot!!!!!!! Get out!!!!!!!!!”);
CircuitPlayground.redLED(HIGH);
CircuitPlayground.setPixelColor(0,65, 244, 244 );
CircuitPlayground.setPixelColor(1, 244, 66, 161);
CircuitPlayground.setPixelColor(2, 65, 244, 244);
CircuitPlayground.setPixelColor(3, 244, 66, 161);
CircuitPlayground.setPixelColor(4, 65, 244, 244);

CircuitPlayground.setPixelColor(5,244, 66, 161);
CircuitPlayground.setPixelColor(6,65, 244, 244);
CircuitPlayground.setPixelColor(7,244, 66, 161 );
CircuitPlayground.setPixelColor(8,65, 244, 244);
CircuitPlayground.setPixelColor(9,244, 66, 161);

CircuitPlayground.playTone(500, 100);
delay(500);
CircuitPlayground.setPixelColor(0, 0, 0, 0);
CircuitPlayground.setPixelColor(1, 0, 0, 0);
CircuitPlayground.setPixelColor(2, 0, 0, 0);
CircuitPlayground.setPixelColor(3, 0, 0, 0);
CircuitPlayground.setPixelColor(4, 0, 0, 0);

CircuitPlayground.setPixelColor(5, 0, 0, 0);
CircuitPlayground.setPixelColor(6, 0, 0, 0);
CircuitPlayground.setPixelColor(7, 0, 0, 0);
CircuitPlayground.setPixelColor(8, 0, 0, 0);
CircuitPlayground.setPixelColor(9, 0, 0, 0);

}else
{
Serial.println(“Enjoy the room”);
}

delay(1000);
}

Lets try to understand what I wrote in this code. First we Read the temperature in degree F. Next we check if the temperature is greater than 75 degree F, then we tell it to turn on all the LEDs and start honking noise. We turn off LED after 1 second. This repeats until temperature reduces or battery dies.

Let me tell you how to decide the RGB value to get the color(s). All you need to do is go to google and search RGB color picker. Screen Shot 2018-08-19 at 3.33.08 PM.png

3D Printing a Case

Did you know I have a 3D printer? To keep the Circuit safe and to make the finished product, I 3D printed a case that is also made by Adafruit. We attached a small battery and stuck it with tape on the back.

 

 

We bought the M3 screws from Home Depot. To show a demo of how it works, I will keep my finger on the Temperature sensor.

Overall

Overall, I thought it was a great and clean way to learn programing as well as making something useful. You could make several things with Circuit Playground. For example, you could make a device that can alarm when Sun comes up in the morning or blink lights when you ride a bike.

So what would you like to make?