12 smart cooler project with picobricksCategoriesLed Raspberry Pi Pico Uncategorized

#12 Smart Cooler Project with PicoBricks

Air conditioners are used to cool in the summer and warm up in the winter. Air conditioners adjust the degree of heating and cooling according to the temperature of the environment. While cooking the food, the ovens try to raise the temperature to the value set by the user and maintain it. These two electronic devices use special temperature sensors to control the temperature. In addition, temperature and humidity are measured together in greenhouses. In order to keep these two values in balance at the desired level, it is tried to provide air flow with the fan.

In PicoBricks, you can measure temperature and humidity separately and interact with the environment based on these measurements. In this project, we will prepare a cooling system that automatically adjusts the fan speed according to the temperature. You will learn the DC motor operation and motor speed adjustment.

Details and Algorithm

First, our code will display the temperature values ​​measured by the DHT11 temperature and humidity sensor on PicoBricks. Then, we will define a temperature limit for the DC motor connected to PicoBricks to start running when the temperature value reaches this limit, and to stop when the temperature value falls below the limit.

Components

1X PicoBricks
1X Sound Sensor
3X Jumper Cable

Wiring Diagram

You can code and run Picobricks’ modules without wiring. If you are going to use the modules by separating them from the board, you should make the module connections with grove cables.

MicroBlocks Codes of the PicoBricks

smart cooler microblocks

You can access the Microblocks codes of the project by dragging the image to the Microblocks Run tab or click the button.

MicroPython Codes of the PicoBricks

				
					from machine import Pin
from picobricks import DHT11
import utime

LIMIT_TEMPERATURE = 20 #define the limit temperature

dht_sensor = DHT11(Pin(11, Pin.IN, Pin.PULL_DOWN))
m1 = Pin(21, Pin.OUT)
m1.low()
dht_read_time = utime.time()
#define input-output pins

while True:
    if utime.time() - dht_read_time >= 3:
        dht_read_time = utime.time()
        dht_sensor.measure()
        temp= dht_sensor.temperature
        print(temp)
        if temp >= LIMIT_TEMPERATURE:     
            m1.high()
            #operate if the room temperature is higher than the limit temperature
        else:
            m1.low()
				
			

Arduino C Codes of the PicoBricks

				
					#include <DHT.h>

#define LIMIT_TEMPERATURE     27
#define DHTPIN 11
#define DHTTYPE DHT11

DHT dht(DHTPIN, DHTTYPE);
float temperature;

void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
  dht.begin();
  pinMode(21,OUTPUT);

}

void loop() {
  // put your main code here, to run repeatedly:
  delay(100);
  temperature = dht.readTemperature();
  Serial.print("Temp: ");
  Serial.println(temperature);
  if(temperature > LIMIT_TEMPERATURE){
    digitalWrite(21,HIGH);
  } else{
    digitalWrite(21,LOW);    
  }


}
				
			

Project Image

Project Proposal 💡

Using the OLED screen on PicoBricks, you can print the temperature on the screen and keep track of the temperature at which the fan is activated.

PicoBricks has a modular structure, modules can be separated by breaking and can be used by connecting to Pico board with Grove cables. By mounting the smart cooling circuit we made onto the robot car chassis, you can develop a project that navigates autonomously in your environment and cools the environment at the same time.

11 magic lamp project with picobricksCategoriesLed Raspberry Pi Pico Uncategorized

#11 Magic Lamp Project with PicoBricks

Most of us have seen lamps flashing magically or doors opening and closing with the sound of clapping in movies. There are set assistants who close these doors and turn off the lamps in the shootings. What if we did this automatically? There are sensors that convert the sound intensity change that we expect to occur in the environment into an electrical signal. These are called sound sensors.

Details and Algorithm

In this project, we will turn the LED module on the picobricks board on and off with the sound. In our project, which we will build using the Picobricks sound level sensor, we will perform the on-off operations by making a clap sound. As in previous projects, in projects where sensors are used, before we start to write the codes, it will make your progress easier to see what values ​​the sensor sends in the operations we want to do by just running the sensor, and then writing the codes of the project based on these values.

Components

1X PicoBricks
1X Sound Sensor
3X Jumper Cable

Wiring Diagram

You can code and run Picobricks’ modules without wiring. If you are going to use the modules by separating them from the board, you should make the module connections with grove cables.

MicroBlocks Codes of the PicoBricks

magic lamp microblocks

You can access the Microblocks codes of the project by dragging the image to the Microblocks Run tab or click the button.

MicroPython Codes of the PicoBricks

				
					from machine import Pin #to access the hardware on the pico
sensor=Pin(1,Pin.IN) #initialize digital pin 1 as an INPUT for Sensor
led=Pin(7,Pin.OUT)#initialize digital pin 7 as an OUTPUT for LED
while True:
    #When sensor value is '0', the relay will be '1'
    print(sensor.value())
    if sensor.value()==1:  
        led.value(1)  
    else:
        led.value(0)
           
				
			

Arduino C Codes of the PicoBricks

				
					void setup() {
  // put your setup code here, to run once:
  pinMode(1,INPUT);
  pinMode(7,OUTPUT);
  //define the input and output pins
}

void loop() {
  // put your main code here, to run repeatedly:
  
  
  Serial.println(digitalRead(1));

  if(digitalRead(1)==1){
    digitalWrite(7,HIGH);
    delay(3000);
  }
  else{
    digitalWrite(7,LOW);
    delay(1000);
  }
}
				
			

Project Image

Project Proposal 💡

You can present the player with instructions and notifications on the OLED screen.

3 autonomous lighting project with picobricksCategoriesLed Raspberry Pi Pico

#3 Autonomous Lighting Project with PicoBricks

It is called the state of being autonomous when electronic systems make a decision based on the data they collect and perform the given task automatically. The components that enable electronic systems to collect data from their environment are called sensors. Many data such as the level of light in the environment, how many degrees the air temperature is, how many lt/min water flow rate, how loud the sound is, are collected by the sensors and transmitted to PicoBricks as electrical signals, that is data. There are many sensors in Picobricks. Knowing how to get data from sensors and how to interpret and use that data will improve project ideas like reading a book improves vocabulary. 

In this project, with PicoBricks, we will enable the LED to turn on when the amount of light decreases in order to understand the working systems of the systems where the lighting is turned on automatically when it gets dark.

Details and Algorithm

Sensors are electronic components that detect data in external environments and send data to microcontrollers. The LDR sensor also detects the amount of light in the environment and sends analog values. In our project, we will first check the incoming data when the environment is light and dark by reading the LDR sensor values, then we will set a limit according to these data, and if the amount of light is below this limit, we will turn off the RGB LED of Picobricks, if not, we will turn off the LED.

Components

1X PicoBricks

Wiring Diagram

You can code and run Picobricks’ modules without wiring. If you are going to use the modules by separating them from the board, you should make the module connections with grove cables.

MicroBlocks Codes of the PicoBricks

189669043 7d190f31 b42c 4e8f 9be6 ce5312df8a95

You can access the Microblocks codes of the project by dragging the image to the Microblocks Run tab or click the button

MicroPython Codes of the PicoBricks

				
					import time
from machine import Pin, ADC
from picobricks import  WS2812
#define the library

ldr = ADC(Pin(27))
ws = WS2812(6, brightness=0.4)
#define the input and output pins

#define colors
RED = (255, 0, 0)
GREEN = (0, 255, 0)
BLUE = (0, 0, 255)

COLORS = (RED, GREEN, BLUE)
#RGB color Code

while True:#while loop
    print(ldr.read_u16()) #print the value of the LDR sensor to the screen.
    
    if(ldr.read_u16()>10000):#let's check the ldr sensor
        for color in COLORS:
            
            #turn on the LDR
            ws.pixels_fill(color)
            ws.pixels_show()
                
    else:
        ws.pixels_fill((0,0,0))  #turn off the RGB
        ws.pixels_show()
				
			

Arduino C Codes of the PicoBricks

				
					#include <Adafruit_NeoPixel.h>
#define PIN            6
#define NUMLEDS        1
#define LIGHT_SENSOR_PIN 27

Adafruit_NeoPixel leds = Adafruit_NeoPixel(NUMLEDS, PIN, NEO_GRB + NEO_KHZ800);
//define the libraries

int delayval = 250; // delay for half a second

void setup() 
{
  leds.begin(); 
}

void loop() 
{
  int analogValue = analogRead(LIGHT_SENSOR_PIN);
  for(int i=0;i < NUMLEDS;i++)
  {
      if (analogValue > 200) {
          // pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
          leds.setPixelColor(i, leds.Color(255,255,255));
          leds.show(); // This sends the updated pixel color to the hardware.
          delay(delayval); 
      }
       else {
         leds.setPixelColor(i, leds.Color(0,0,0));  //white color code.
         leds.show(); // This sends the updated pixel color to the hardware.
      }
    }
    delay(10);
}
				
			

Project Image

Project Video

Project Proposal 💡

In this project, we turned on the LED on the LDR sensor data on Picobricks if the environment was dark, and turned off the LED if it was bright. By processing the LDR sensor data, you can code a nightlight or table lamp in your home to turn on automatically in the dark. You can use the relay on Picobricks for this.

2 action – reaction project with picobricks2CategoriesLed Raspberry Pi Pico Uncategorized

#2 Action – Reaction Project with PicoBricks

As Newton explained in his laws of motion, a reaction occurs against every action. Electronic systems receive commands from users and perform their tasks. Usually a keypad, touch screen or a button is used for this job. Electronic devices respond verbally, in writing or visually to inform the user that their task is over and what is going on during the task. In addition to informing the user of these reactions, it can help to understand where the fault may be in a possible malfunction.

In this project, you will learn how to receive and react to a command from the user in your projects by coding the button-LED module of Picobricks

Details and Algorithm

Different types of buttons are used in electronic systems. Locked buttons, push buttons, switched buttons… There is 1 push button on Picobricks. They work like a switch, they conduct current when pressed and do not conduct current when released. In the project, we will understand the pressing status by checking whether the button conducts current or not. If it is pressed, it will light the LED, if it is not pressed, we will turn off the LED.

Components

1X PicoBricks

Wiring Diagram

MicroBlocks Codes of the PicoBricks

189668240 62ec66eb 0c51 49b1 830a 1f8d95a5d274

You can access the Microblocks codes of the project by dragging the image to the Microblocks Run tab or click the button

MicroPython Codes of the PicoBricks

				
					from machine import Pin#to acces the hardware picobricks
led = Pin(7,Pin.OUT)#initialize digital pin as an output for led
push_button = Pin(10,Pin.IN,Pin.PULL_DOWN)#initialize digital pin 10 as an input
while True:#while loop
    logic_state = push_button.value();#button on&off status
    if logic_state == True:#check the button and if it is on
        led.value(1)#turn on the led
    else:
        led.value(0)#turn off the led
				
			

Arduino C Codes of the PicoBricks

				
					void setup() {
  // put your setup code here, to run once:
  pinMode(7,OUTPUT);//initialize digital pin 7 as an output
  pinMode(10,INPUT);//initialize digital pin 10 as an input
  

}

void loop() {
  // put your main code here, to run repeatedly:
  if(digitalRead(10)==1){//check the button and if it is on
    digitalWrite(7,HIGH);//turn the LED on by making the voltage HIGH
    
  }
  else{
    digitalWrite(7,LOW);//turn the LED off by making the voltage LOW 
  }
  delay(10);//wait for half second

}
				
			

Project Image

Project Video

Project Proposal 💡

In this project, the LED turns on when the button is pressed, and the LED turns off when the button is released. You can write the necessary codes for the LED to turn on when the button is pressed once and to turn the LED off when it is pressed again.

1 get started with picobricks3CategoriesLed Raspberry Pi Pico Uncategorized

#1 Get Started with PicoBricks – PicoBlink

In real life, the employee, who has just started to learn the job, first undertakes the most basic task.The cleaner first learns to use the broom, the cook learns to use the kitchen utensils, the waiter to carry a tray. We can increase these examples. The first code written by newcomers to software development is known as “Hello World”. Printing “Hello World” as soon as the program starts on the screen or console window in the language they use is the first step in programming. Like a baby starting to crawl… The first step to robotic c oding, also known as physical programming, is the Blink application. It means winking at robotic coding.

Details and Algorithm

There are 1 x 5mm red LED and 1 x WS2812B RGB LED on Picobricks. While normal LEDs can light up in one color, RGB colors can light up in different colors, both primary and secondary colors. In this project we will use the red LED on Picobricks.

In the project, we will write the necessary codes to turn on the red LED on Picobricks, turn it off after a certain time, turn it on again after a certain time, and repeat these processes continuously.

Components

1X PicoBricks

Wiring Diagram

MicroBlocks Codes of the PicoBricks

189116357 6116b522 d348 4503 81b9 71581c26c834

You can access the Microblocks codes of the project by dragging the image to the Microblocks Run tab or click the button

MicroPython Codes of the PicoBricks

				
					from machine import Pin #to access the hardware on the pico
import utime #time library
led = Pin(7,Pin.OUT)#initialize digital pin 7 as an output for LED
while True: #while loop
    led.toggle()# LED on&off status
    utime.sleep(0.5)#wait for a half second
				
			

Arduino C Codes of the PicoBricks

				
					void setup() {
  // put your setup code here, to run once:
  pinMode(7,OUTPUT);//initialize digital pin 7 as an output

}

void loop() {
  // put your main code here, to run repeatedly:
  digitalWrite(7,HIGH);//turn the LED on by making the voltage HIGH
  delay(500);//wait for a half second
  digitalWrite(7,LOW);//turn the LED off by making the voltage LOW
  delay(500);//wait for a half second

}
				
			

Project Image

Project Video

Project Proposal 💡

Can we light the LED with different time intervals? For example; flashing of the LED several times per second, several times every half second.