Raspberry Pi4 PC Project

Getting started with my mini dream PC



3D modeling and 3D Printing

Printing the whole body and working parts are not that hard, It’s very easy when you get ready made 3d stl file, here I share you all the ready to print stl file for printing, Just Download the files.


Required Materials

*UPS plus

*5V3A with switching power cord (British standard)

*Tower radiator

*Dual fan radiator

*Cooling Fan

*OLED Display

*Game Pad

*Cooling Fan

*7 inch capacitive touch screen

*Raspberry Pi4

PCB Gerber file

I made a appropriate designed PCB circuit for control the air outlet fins, Sliding mechanism and cooling fan with LEDs.




Just download the Gerber file and upload it on NextPCB and order it at Zero dollar.


Making connections

You need to power up the whole circuit and the Raspberry pi with this 52pi UPS plus, Just follow the circuit and Make all the connection.



Uploading code

Just copy and paste all the code in the Arduino Software.

/*************************************************************

  Rotate a servo using a slider!

  App project setup:
    Slider widget (0...180) on V3
 *************************************************************/

// Template ID, Device Name and Auth Token are provided by the Blynk.Cloud
// See the Device Info tab, or Template settings
//#define BLYNK_TEMPLATE_ID           "TMPLxxxxxx"
//#define BLYNK_DEVICE_NAME           "Device"
#define BLYNK_AUTH_TOKEN            " bt8OxIoRjw****diUAIPQ-**********"


// Comment this out to disable prints and save space
#define BLYNK_PRINT Serial


#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <Servo.h>

char auth[] = BLYNK_AUTH_TOKEN;

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "TecH BoyS ToyS";
char pass[] = "********";

Servo servo1;
Servo servo2;
int poss = 0;
int poss2 = 45;
BLYNK_WRITE(V0){
  digitalWrite(D8,(param.asInt()));}
BLYNK_WRITE(V1)
{
 
  int x = param.asInt();
  if(x == HIGH){
  for(x = 1; x<=140; x++) {
 servo1.write(x);
delay(30);
}
}
else{
  for(x = 140; x>=0; x--) {
 servo1.write(x);
delay(30);
}
}}
BLYNK_WRITE(V2)
{
 
  int y = param.asInt();
  if(y == HIGH){
  for(y = 45; y>=00; y--) {
 servo2.write(y);
delay(30);
}
}
else{
  for(y = 0; y<=45; y++) {
 servo2.write(y);
delay(30);
}
}}

void setup()
{
  // Debug console
  Serial.begin(115200);

  Blynk.begin(auth, ssid, pass);
  // You can also specify server:
  //Blynk.begin(auth, ssid, pass, "blynk.cloud", 80);
  //Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,100), 8080);
  pinMode(D8,OUTPUT);
  digitalWrite(D8,LOW);
  servo1.write(poss);
  servo1.attach(5);
 servo2.write(poss2);
  servo2.attach(4);

}

void loop()
{
  Blynk.run();
}


Note

*You must select the NodeMCU 1.0 (ESP-12E Module) Board
*Select Right type of com port to upload
*When you sign up in the Blynk app, you get a auth token to your registered gmail ID just copy the code and paste it to the code auth token.
*Fill your all WiFi user-id and password in the code.

*Special Instruction(Servo Motor Problem Solved)

Servo motors can move 1 to 180 degrees but due to the NodeMCU board library safety limitation motors are limited to move max 90 degrees, so you need to edit the library code of servo motors.

Navigate this Address (C:\Users\bhaid\Documents\ArduinoData\packages\esp8266\hardware\esp8266\3.0.2\libraries\Servo\src\Servo.h)



Open Servo.h file in VSCode Software and edit #define DEFAULT_MIN_PULSE_WIDTH 1000 to 500 and #define DEFAULT_MAX_PULSE_WIDTH 2000 to 2500
Save the code and close VSCode Software.



Now your code is ready to upload, Just click the upload button
After uploading done NodeMCU WiFi will automatically be connected.

Set the blynk app

After signed up You got auth token in your registered email id and copy that code and paste to the Arduino code.




Now work with blynk app interface just add three blynk buttons and set the Virtual pin V0,V1 and V2, Logical state should be 0 to 1.

Assembly

Just follow the video procedure to assemble all the parts.

LED Display connection

Below are the connections of OLED module with Raspberry Pi 4 Model B:​

SDA ==> GPIO 2(pin 3)
SCL ==> GPIO 3(pin 5)
VCC ==> 3.3V(pin 1)
GND ==> GND(pin 14)

*After Done all the hardware work, Connect all the accessories to the UPS Plus and here you go.


*Raspberry pi OS


Mostly I am using twister OS or Windows OS, there are tons of videos are available in YouTube about OS installation on Rpi4.

Finally You have made a wonderful project and Thanks to be with our Article.

Leave a reply

Please enter your comment!
Please enter your name here

Related Articles