Skip to the content
2 layers137 × 100 mmIc Lewis, the printed circuit board in 3D

The components use above were incorporated into a Printed Circuit Board(pcb) .Kicad software was used to design the pcb.

Size
137 × 100 mm
Copper layers
2
Thickness
1.6 mm
Parts
7
Nets
7
Pads
55
Tracks, vias
107, 0
Routed
Yes
KiCad
KiCad 6 (file 20211014)
Created
24 Oct 2023
Updated
5 Sep 2025

Overview

Ic Lewis is an open-source printed circuit board by SAMUELMUCHIRI, from the SAMUELMUCHIRI/SMART-PARKING-WITH-MPESA repository on GitHub. It is a 2-layer board of 137 × 100 mm with 7 parts on 7 nets, routed with 107 tracks and 0 vias.

Its parts include 2 ICs and 1 capacitor. It belongs with the ESP8266 boards of this library.

README

README.md

SMART PARKING WITH MPESA

Objective

The fundamental objective of this Project is to familiarize with the principles of engineering design thinking, a process through which a holistic solution is conceived to address tangible, real-world issues.

The Project is divided into

Hardware Design

The Components used were

  • NodeMCU ESP8266
  • 5 IR sensors
  • 1 servo motor
  • 1 Capacitor
  • Connecting cables
  • Power Sockets
  • Buck Converter
  • Mounting frame

The components use above were incorporated into a Printed Circuit Board(pcb) .Kicad software was used to design the pcb.

Geber File

Geber file

Schematic

Schematic

Routings

Routings

3D View

3D view
Developed PCB

PCB

Hardware Programming

The sketch Primary operation contains all the code for the hardware . The code entail

  • LCD display
arduino
//Check the whole code this is a snippet
  Wire.begin(I2C_SDA, I2C_SCL);
  
  
  lcd.init();  
  lcd.backlight();
  lcd.setCursor(0, 0);
  lcd.print(" SMART PARKING ");
  • Getting Values from IR sensors
arduino
//Check the whole code this is a snippet
  int sensorValue1 = digitalRead(EntryPin);
  int sensorValue2 = digitalRead(ExitPin);
  int sensorValue3 = digitalRead(irSensorPin1);
  int sensorValue4 = digitalRead(irSensorPin2);
  int sensorValue5 = digitalRead(irSensorPin3);
  int sensorValue6 = digitalRead(irSensorPin4);
  • Turning the servo
arduino
//Check the whole code this is a snippet
void OpenBarrier()
{
  for (int i = 40; i < 180; i++) 
  {
  myservo.write(i); 
  delay(30);                 
  }
  delay(100);
  
  for (int i = 179; i > 40 ; i--) 
  {
  myservo.write(i); 
  delay(30);                 
  }

  delay(30);
}
  • Connecting the Node Mcu to wifi
arduino
//Check the whole code this is a snippet
  WiFi.begin(ssid, password);
  lcd.setCursor(0, 0);
  lcd.print("Connecting to ");
  lcd.setCursor(0, 2);
  lcd.print(ssid);
    // Loop continuously while WiFi is not connected
  while (WiFi.status() != WL_CONNECTED)
  {
    delay(100);
    lcd.setCursor(0 ,3);
    lcd.print("scanning.....");
  }
  delay(200);
  lcd.clear();
  // Connected to WiFi
  //Serial.println();

    lcd.setCursor(0, 3);
  lcd.print(WiFi.localIP());
    lcd.setCursor(0, 1);
  lcd.print("Connected!  ");
  delay(250);
  lcd.clear();
  
  • Connecting the NodeMcu to Local host (can be changed)
arduino
//Check the whole code this is a snippet
WiFiClient client;

  if (!client.connect(serverIP, serverPort)) {
    lcd.clear();
    lcd.setCursor(0 , 1);
    lcd.print("NO LOCALHOST");
    //Serial.println("Connection failed");
    lcd.setCursor(5 , 2);
    lcd.print("WRONG SERVERIP");
    lcd.setCursor(3 , 3);
    lcd.print(serverIP);
    delay(1000);
    lcd.setCursor(0 , 1);
    lcd.clear();
  }
  • Transmitting sensor data from Node Mcu to Local host
arduino
//Check the whole code this is a snippet
  String postData = "sendval1=" + String(sensorValue3) +
                    "&sendval2=" + String(sensorValue4) +
                    "&sendval3=" + String(sensorValue5) +
                    "&sendval4=" + String(sensorValue6);

  client.println("POST /index.php HTTP/1.1");
  client.print("Host: ");
  client.println(serverIP);
  client.println("Content-Type: application/x-www-form-urlencoded");
  client.print("Content-Length: ");
  client.println(postData.length());
  client.println("Connection: close");
  client.println();
  client.println(postData);
  • Notify any errors encountered in any operation and how to solve them

Database Design

MySQL was used as the DBMS The ER diagram is Shown Below Erdiagram

Application Design

The web app was wtitten in php .Queries are sent to the database as the user interacts with the application.

php
<?php
//connction to the Database dbconnect.php

            $host="localhost";
            $dbname="smart_parking";
            $username="root";
            $password= "";
            $conn=mysqli_connect(hostname: $host,
                                    username: $username,    
                                    password: $password , 
                                    database: $dbname);
            if(mysqli_connect_errno()){
                die("Connection Error". mysqli_connect_error());}
            //echo"Database Online";

?>

php
//logging in data sent by the NodeMCU to the data_log.txt
      if ($_SERVER["REQUEST_METHOD"] == "POST") {
                   $data = array(
                     'sendval1' => $_POST['sendval1'],
                     'sendval2' => $_POST['sendval2'],
                     'sendval3' => $_POST['sendval3'],
                     'sendval4' => $_POST['sendval4']
                   );
                 
                   $jsonContent = json_encode($data, JSON_PRETTY_PRINT);
                   $logFile = "data_log.txt";
                   file_put_contents($logFile, $jsonContent);
                 
                   echo "Values uploaded successfully to data_log.txt";
                 }

php
//storing contents of the log file to Database
$fileContent = file_get_contents("data_log.txt");
                   if ($fileContent !== false) {
                     $decodedData = json_decode($fileContent, true);
                     if ($decodedData) {
                       $IR1=$decodedData['sendval1'];
                       $IR2=$decodedData['sendval2'];
                       $IR3=$decodedData['sendval3'];
                       $IR4=$decodedData['sendval4'];
                    

                       //$sql = "INSERT INTO system_status (IR1, IR2 , IR3 ,IR4 ) VALUES ($IR1 ,$IR2 , $IR2 ,$IR4)";
                       $sql="UPDATE system_status SET IR1=$IR1,IR2=$IR2,IR3=$IR3,IR4=$IR4" ;
                   
                       if ($conn->query($sql) === TRUE) {
                           echo "<br>";
       
                       //echo "Data inserted successfully";
                       } else {
                           echo "<br>";
                       echo "Error: " . $sql . "<br>" . $conn->error;
                       
                   }
                     }
                   }

php
//Fetch values from Database 
                
                $query1 = "select IR1 FROM system_status ;";
                $query2 = "select IR2 FROM system_status ;";
                $query3 = "select IR3 FROM system_status ;";
                $query4 = "select IR4 FROM system_status ;";
                $result1 = $conn->query( $query1 );
                $result2 = $conn->query( $query2 );
                $result3 = $conn->query( $query3 );
                $result4 = $conn->query( $query4 );
                $slot1 =$result1->fetch_assoc();
                $slot2 =$result2->fetch_assoc();
                $slot3 =$result3->fetch_assoc();
                $slot4 =$result4->fetch_assoc();
php
//the following lines of code compare values from current database value to previous database values and assigns either empty or full slot
                
                if(stripslashes($slot1['IR1'])== 0){
                    echo" SLOT 1 : FULL";
                    if((stripslashes($slot11['IR1'])== 1) and ($IR1==0)){
                        $date_time = date("Y-m-d H:i:s"); 
                        $current_date_time=strval($date_time);
                        $query5="UPDATE parking_details SET Time_In = '$current_date_time'  WHERE Parking_Number =1";
                        $conn->query($query5);

                    }else{
                 
                    }
                    
                }else{
                    echo"SLOT 1 :EMPTY";
                    if((stripslashes($slot11['IR1'])== 0) and ($IR1==1)){
                        $date_time = date("Y-m-d H:i:s"); 
                        $current_date_time=strval($date_time);
                        $query5="UPDATE parking_details SET Time_Out = '$current_date_time' WHERE Parking_Number =1";
                        $conn->query($query5);
                    } else{
                   }}

Here's the landing Homepage

Webapp


Payment as an integral part of the project was realized using the DarajaAPI The Client Receives an STK push on the phone an is billed accordingly.The Payment system is able to validate transactions the Following files are for payment

  • stkpush.php
  • payment.php

Parts

7
QtyValueFootprintReferences
2Screw_Terminal_01x02TerminalBlock_Phoenix:TerminalBlock_Phoenix_MKDS-1,5-2-5.08_1x02_P5.08mm_HorizontalPOWER1, POWERSENSORS1
110uCapacitor_THT:CP_Radial_D6.3mm_P2.50mmC1
1BuckbuckArduino:testespU1
1I2C_moduleTerminalBlock_4Ucon:TerminalBlock_4Ucon_1x04_P3.50mm_HorizontalI2CMODULE1
1NodeMcu_Esp8266NodeMCU esp8266:MODULE_ZC563900U2

The 6 most common of 7 parts.

Similar boards

  • 2 layersEncoder, the printed circuit board in 3D

    Encoder

    byrantech/laptop

    anyon_e, a highly integrated, high end, open source laptop. Attempt the impossible.

    7 parts4.3kMIT
  • 2 layers40 × 20 mmSensor smd, the printed circuit board in 3D

    Sensor smd

    scottbez1/splitflap

    DIY split-flap display

    7 parts4.2k
  • 2 layers19.8 × 30 mmZ limit, the printed circuit board in 3D

    Z limit

    opulo-inc/lumenpnp

    The LumenPnP is an open source pick and place machine.

    7 parts3.7k
  • 2 layers35.6 × 58.2 mmDisplay Carrier, the printed circuit board in 3D

    Display Carrier

    AxxAxx/AxxSolder

    STM32 Based soldering station for JBC cartridges, 9-24 VDC and USB-PD power

    7 parts1.7kGPL-3.0
  • 2 layers20.3 × 16.3 mmMap MPX, the printed circuit board in 3D

    Map MPX

    rusefi/rusefi

    rusefi - GPL internal combustion engine control unit

    7 parts1.2k
  • 2 layers26 × 44 mmCompact carrier board, the printed circuit board in 3D

    Compact carrier board

    jamro/tiny-engineer

    A small desktop robot that brings an AI coding assistant to life, physically acting out when it reads files, thinks, writes code, and finishes work.

    7 parts1.1k
  • 2 layers26.4 × 53.8 mmAtari pickup, the printed circuit board in 3D

    Atari pickup

    hoglet67/RGBtoHDMI

    Bare-metal Raspberry Pi project that provides pixel-perfect sampling of Retro Computer RGB/YUV video and conversion to HDMI

    7 parts1kGPL-3.0
  • 2 layersRj45 breakout, the printed circuit board in 3D

    Rj45 breakout

    rene-dev/stmbl

    AC Servo Driver for STM32F4

    7 parts990GPL-3.0

Questions

How big is the Ic Lewis PCB?

It measures 137 × 100 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Ic Lewis use?

7 parts. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Ic Lewis KiCad files?

From the SAMUELMUCHIRI/SMART-PARKING-WITH-MPESA repository on GitHub, at the commit this page was made from: the board is kicad_files/ic Lewis.kicad_pcb and its schematic kicad_files/ic Lewis.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Ic Lewis design in my own project?

Its repository states no licence, so its author keeps all rights: ask SAMUELMUCHIRI before reusing the design.