element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
7-Segment Display
  • Challenges & Projects
  • Project14
  • 7-Segment Display
  • More
  • Cancel
7-Segment Display
Blog Pico Parker
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: dougw
  • Date Created: 19 Jun 2022 11:12 PM Date Created
  • Views 13594 views
  • Likes 9 likes
  • Comments 9 comments
  • doug wong
  • 7segmentdisplaysch
  • vehicle parking aid
  • pi pico
Related
Recommended

Pico Parker

dougw
dougw
19 Jun 2022

image

The Pico Parker displays the distance from the Maxbotix ultrasonic transducer to the nearest object in cm - in this case the nearest object will be a car and the distance will be the distance to the end of the garage as it tries to park..

Intro

This blog describes my attempt to make a vehicle parking aid. Our garage is a very tight fit for a car, requiring parking accuracy of a few inches. This project addresses the issue of parking close to the end of the garage without bumping into the anything. There are other ways to achieve this goal, but I also want to explore how to make a large seven segment LED display with well formed segments.

There are other objectives as well. Since the project is going to involve video blogging, I want to design an LED display that can be videoed without any ugly and distracting blinking or partial displays due to multiplexing of LEDs, where each LED spends a significant portion of the time in the off condition. The eye doesn't notice LEDs blinking off if their refresh rate is fast, but the camera easily catches LEDs in the off condition and it makes for poor presentation of a project. To achieve this, the LEDs will not be multiplexed, but the BCD digits will use a bus to keep the number of MCU pins to a minimum. The BCD nibbles will be latched, eliminating LED flicker.

The display needs to be large so it can easily be read at 3 meters, but the PCB shop I use has a price break for PCBs under 10 cm, so this dictates the digits will be about 10 cm high. This height dictates that 3 digits will be wider than 10 cm, so each digit needs to be on a separate PCB. This does not affect costs, because the minimum number of PCBs is 10. The cost of 10 PCBs is $5. The following video describes how these PCBs implement a 3 digit seven segment display.

Pico Parker Development

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

Pico Parker DEMO

The next video shows my better half parking with the display. It is a good test of a project if someone else can figure out how to use it.

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

The engine sounds are actually just sound effects - her car is actually pretty silent.

Schematic

image

Firmware

// Pico Parker
// Ultrasonic range display
// Doug Wong
// 2022-06-19

const int ledPin =  LED_BUILTIN;// the number of the LED pin
int ledState = LOW;             // ledState used to set the LED

//BCD Pins
int BCD1 = 2; //BCD Bit 0
int BCD2 = 3; //BCD Bit 1
int BCD3 = 4; //BCD Bit 2
int BCD4 = 5; //BCD Bit 3

//BCD Selects
int S1 = 14;  //BCD digit select 1
int S2 = 15;  //BCD digit select 2
int S3 = 16;  //BCD digit select 3
int S4 = 17;  //BCD digit select 4

int n=0;        //Setting initial value of sonar reading n to 0
float sn;       //need a bigger number than an integer to scale sonar readings
int d1, d2, d3; // digits
int digit;      //digit number
int sonar, cm, light;
int SonarPin = 26;


void setup()
{

// Serial.begin(9600);

pinMode(ledPin, OUTPUT);

pinMode(2,OUTPUT);   //BCD Bit 0
pinMode(3,OUTPUT);   //BCD Bit 1
pinMode(4,OUTPUT);   //BCD Bit 2
pinMode(5,OUTPUT);   //BCD Bit 3
pinMode(14,OUTPUT);  //BCD digit select 1
pinMode(15,OUTPUT);  //BCD digit select 2
pinMode(16,OUTPUT);  //BCD digit select 3
pinMode(17,OUTPUT);  //BCD digit select 4
pinMode(18,OUTPUT);  //BCD digit select 5
pinMode(19,OUTPUT);  //BCD digit select 6
pinMode(20,OUTPUT);  //BCD digit select 7
pinMode(21,OUTPUT);  //BCD digit select 8

pinMode(26,INPUT);    //sonar - analog
pinMode(27,INPUT);    //digital light
pinMode(28,INPUT);    //analog light
}

void loop()
{
sonar =0;
for (int i = 1; i < 11; i++)
{
  sonar = analogRead(SonarPin) + sonar;
  delay (6);
}
sonar = sonar / 10;
sn = sonar * 240/170 - 25;    // scale sonar  reading to cm

    if (ledState == LOW) {
      ledState = HIGH;
    } else {
      ledState = LOW;
    }
    digitalWrite(ledPin, ledState);
    delay (200);

// Serial.print(n);
 if (sn > 999)
 {
  n = 999;
 }
  else
  {
    n = int (sn);
  }

 d3 = n / 100;      //extract MSD
 n = n - d3 * 100;  
 d2 = n/ 10;        // extract 2nd digit
 n = n - d2 *10;
 d1 = n;            //grab LSD
// Serial.print ("  ");
// Serial.print(d3);
// Serial.print ("  ");
// Serial.print(d2);
// Serial.print ("  ");
// Serial.print(d1);
// Serial.println();

 disp(d1);                //output digit 1 in BCD
 digitalWrite(S1, LOW);   //strobe digit 1
 delay(2);                //stay low for 1 ms
 digitalWrite(S1, HIGH);  //latch digit 1
 disp(d2);                //output digit 2 in BCD
 digitalWrite(S2, LOW);   //strobe digit 2
 delay(2);                //stay low for 1 ms
 digitalWrite(S2, HIGH);  //latch digit 2
 disp(d3);                //output digit 3 in BCD
 digitalWrite(S3, LOW);   //strobe digit 3
 delay(2);                //stay low for 1 ms
 digitalWrite(S3, HIGH);  //latch digit 3
 
 delay(200);    // delay to dictate count rate

}
void disp(int num)
{
  if(num == 0)  //0000
  {
    digitalWrite(BCD1, LOW); 
    digitalWrite(BCD2, LOW);
    digitalWrite(BCD3, LOW);
    digitalWrite(BCD4, LOW);
  }
  if(num == 1)  //0001
  {
    digitalWrite(BCD1, HIGH);
    digitalWrite(BCD2, LOW);
    digitalWrite(BCD3, LOW);
    digitalWrite(BCD4, LOW);
  }
  if(num == 2)  //0010
  {
    digitalWrite(BCD1, LOW);//0
    digitalWrite(BCD2, HIGH);//1
    digitalWrite(BCD3, LOW);//0
    digitalWrite(BCD4, LOW);//0
  }
  if(num == 3)  //0011
  {
    digitalWrite(BCD1, HIGH);//1
    digitalWrite(BCD2, HIGH);//1
    digitalWrite(BCD3, LOW);//0
    digitalWrite(BCD4, LOW);//0
  }
  if(num == 4)  //0100
  {
    digitalWrite(BCD1, LOW);//0
    digitalWrite(BCD2, LOW);//0
    digitalWrite(BCD3, HIGH);//1
    digitalWrite(BCD4, LOW);//0
  }
  if(num == 5)  //0101
  {
    digitalWrite(BCD1, HIGH);//1
    digitalWrite(BCD2, LOW);//0
    digitalWrite(BCD3, HIGH);//1
    digitalWrite(BCD4, LOW);//0
  }
  if(num == 6)  //0110
  {
    digitalWrite(BCD1, LOW);//0
    digitalWrite(BCD2, HIGH);//1
    digitalWrite(BCD3, HIGH);//1
    digitalWrite(BCD4, LOW);//0
  }
  if(num == 7) //0111
  {
    digitalWrite(BCD1, HIGH);//1
    digitalWrite(BCD2, HIGH);//1
    digitalWrite(BCD3, HIGH);//1
    digitalWrite(BCD4, LOW);//0
  }
  if(num == 8) //1000
  {
    digitalWrite(BCD1, LOW);//0
    digitalWrite(BCD2, LOW);//0
    digitalWrite(BCD3, LOW);//0
    digitalWrite(BCD4, HIGH);//1
  }
  if(num == 9)  //1001
  {
    digitalWrite(BCD1, HIGH);//1
    digitalWrite(BCD2, LOW);//0
    digitalWrite(BCD3, LOW);//0
    digitalWrite(BCD4, HIGH);//1
  }
  delay (2);
}

BoM

Item  Cost 
Pico  $   4.00
LEDs  $   2.00
electronic components  $   3.00
3 PCBs  $   1.50
connectors  $   1.00
plastic case  $   2.00
voltage booster  $   2.00
cables  $   2.00
USB power  $   3.00
SubTotal  $ 20.50
   
Maxbotix EZ0  $ 34.00
Total  $ 54.50

Summary & Discussion

This project involved schematic and PCB design, mechanical design, 3D printing of the case, optical design and firmware design, so it is a nice multi-disciplinary project. Achieving good optical performance was one of the most difficult aspects of the design. The costs were kept reasonable by using a Raspberry Pi Pico and adhering to low cost PCB constraints - the whole display system cost less than the sensor. It is nice when you can finish the project off and make it look like a product you might buy. I am happy with the results - the display looks great and works well for its intended application.

Relevant Links

/challenges-projects/project14/7segmentdisplay/b/blog/posts/project14-build-projects-using-7-segment-displays?ICID=7segmentdisplays-p14-3step

  • Sign in to reply
Parents
  • beacon_dave
    beacon_dave over 3 years ago

    In the old days we used to have to make do with stop signs mounted on a spring bases. Slight smile

    This is much more fun... 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • dougw
    dougw over 3 years ago in reply to beacon_dave

    I used to have a tennis ball hanging down to just touch the windshield, but it was tough to adjust for different cars and it wasn't all that easy to judge its distance, especially in the dark (headlights reflect up but you only see the dark side of the ball). Plus the curved windshield made a difference depending on lateral position of the vehicle.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • dougw
    dougw over 3 years ago in reply to beacon_dave

    I used to have a tennis ball hanging down to just touch the windshield, but it was tough to adjust for different cars and it wasn't all that easy to judge its distance, especially in the dark (headlights reflect up but you only see the dark side of the ball). Plus the curved windshield made a difference depending on lateral position of the vehicle.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
  • ralphjy
    ralphjy over 3 years ago in reply to dougw

    I still use a ball connected to the garage door that comes down when the door is open and is up out of the way when the door closes.  Luckily, I have had my 4Runner since 2019 - so, I’ve had lots of practice Smile.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • ralphjy
    ralphjy over 3 years ago in reply to ralphjy

    It's funny how the brain doesn't work sometimes - and it doesn't help when you can't edit comments Relaxed.  I've had my 4Runner since 1999...

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • dougw
    dougw over 3 years ago in reply to ralphjy

    Car years are like dog years, so that is one old machine. Congrats for keeping it alive this long.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube