An electronic business card on a board

By on August 30, 2017
Pin It

 

 

 

 

How to make an electronic business card that says something about you.

For people working in the electronics business, especially for manufacturing companies of printed circuits, it is now fashionable to give away your business card engraved on a PCB. Starting from this idea, we went beyond and ask ourselves: “Since we are making a PCB, why don’t we print one corresponding to a real, programmable circuit, and possibly even complete it with components in order to use it to make a device that says something about us?”
So… Here we are! That’s how Bi-Card, the board described in these pages, was born, something akin to an electronic business card which, completed with its components and connected to a PC via USB cable, points to the web browser or other applications. It is, in short, a business card-sized board on which the track is not fake but it is effectively an electronic circuit, which circuit diagram is shown in these pages. The thickness is really small thanks to new, all-SMD, very low-profile components (the thickest one is the micro USB connector, if you don’t mount the expansion connectors).

Tanks to the Arduino Leonardo architecture (the micro is an ATmega 32u4… the same of the popular board) which is the base of the circuit and in this case simulates the keyboard (HID peripheral), the USB connection, often manually opening the browser, and the command is inputted for each of the keys pressed opening the website, the web may client with the predefined email address, Facebook page, Twitter… The keys are however customizable in order to implement other functions such as PDF for displaying your resume or your works, partnerships, links to intro videos on YouTube, links to other social networks such as LinkedIn.

 

Circuit diagram

As mentioned above, the circuit of our business card is an Arduino Leonardo board with Arduino-compatible format and side connectors (so it can mount strip connectors to support shields) and the ICSP one, but it lacks the Vin power section, therefore it gets 5 V. Vin is not brought on the connectors. The 3.3 V needed by the logics of possible shields and found on the side contact 3V3 are taken from the 5 V of the USB through a timeshare regulator, which is U1 to be exact.

The heart of the circuit is the U2 microcontroller, which is an Atmel 32u4 and it internally has a device-type USB interface; this micro is powered by the 5 V of the USB and it internally gets 3 V for its logics. The lines for in-circuit programming are brought back on the standard ICSP connector of Arduino boards (2 files with 3 contacts, 2.54 mm step). As usual, the reset line (RST) is used to start the sketch loading through the bootloader and, in the diagram, it is connected to the ever-present pull-up resistor and to the button that brings it to ground when you have to manually reset the microcontroller (automatic reset is managed by the PC through the USB connection).

 

 

The other five buttons, connected to lines PD7, PC6, PD4, PD0 and PD1 (P1, P2, P3, P4, P5 respectively) allow, when pressed, to activate the related functions (predefined ones are website homepage, email address, Facebook page, Twitter page and Google+ page respectively, but they can be changed by firmware). The keys line are repeated on the side contacts D6, D5, D4, D3, D2 of Arduino for possible other uses; each one, moreover, has a pull-up resistors which is internally set to the microcontroller by software.

The two LEDs on the circuit are handled by the microcontroller to signal sketch launch, loading and USB activity; in the last case, LD2 is TX LED and LD1 is RX LED of Arduino. Besides, LD1 (red) blinks when, after connection and recognition by the PC, the board launches the sketches and it is ready to use. LD2 (yellow) on the other hand, blinks whenever you press one of the P1÷P5 buttons to access their functions. The micro’s clock comes from the internal oscillator, which relies on Q1 quartz and C4 and C5 capacitors.

AREF pin, filtered by C2 capacitor, brings the reference voltage of the ADC inside the Atmega 32u4micro on the Arduino standard VREF pin: UCAP (6-pin of the microcontroller, that is the output line of Atmega’s internal 3 V regulator) is filtered by the C6 capacitor.

 

 

Practical construction

Building the Bi-Card electronic business card requires some level of familiarity with superficial mounting of components, besides preparing a double side printed base, on a double copper plate.

The tools needed are a 20 W soldering iron with a very fine tip, with a soldier wire no thicker than 0.5 mm, low-density flux paste (very useful especially if you use Rohs soldering alloy, which is known to “grip less” then lead-based paste), a magnifier and a pair of tweezers to correctly place the components (the magnifier will also help you check for the presence of short-circuits caused by tin smudges when soldiering is over).

Once your printed circuit is ready, you can move on to mounting the few needed components. The first component to place is the microcontroller, which is to be oriented as shown by the mounting diagram you can see in these pages, well centered in its pads, after spreading some flux paste on the pads: using the solder iron, you solder one pad and then another one on the opposite side in order to keep the component from moving, after that you continue with the other pads, alternating sides to help the chip cooling down. You always want to first spread the flux paste (which will help the solder alloy to melt down and be placed on the electrodes, decreasing at the same time the chance to “attack” nearby pads…) go on and mount the remaining components, starting from passive components and ending with active components. For the USB connector, reinforce the side mechanic anchor tags by using a lot of solder alloy, to make sure that it won’t detach after you insert the USB cable for connecting it to the computer a couple times. To correctly orient the active components (LEDs and voltage regulator) follow the mounting scheme found in these pages.

When mounting is over and you have checked that everything is firmly in place (shiny and well executed solder points, with no tin smudges that might short-circuit the tracks or contiguous components) you will be able to connect the circuit to the programmer and load the bootloader, then connect it to the PC via USB and load the sketch, that you can find available for download on our website along with the other files needed for the project. If you purchase the pre-mounted board, you will find the boot loader already in the microcontroller and all you have to do is load the sketch from the PC, through the Arduino IDE, indicating Arduino Leonardo as the board.

 

 

Use

Using the Bi-card is quite simple: once connected to the PC, after the red LED starts blinking, it is ready to be used; in order to display the website, so in order for P1 to be effective, you have to open the Internet browser and go to the homepage of a search engine, such as Google. Once done that, if you press P1 you will access the website saved in the sketch in a few seconds, and you will be able to navigate it as usual. The access can be done because the microcontroller simulates a keyboard and composes the URL address followed by Enter.

By opening the email client and pressing P2, you launch the composition of an email to the email address contained in the sketch. With the browser still open, P3 refers to the Facebook page contained in the sketch, P4 to twitter and P5 to the Google+ account.

Note that by pressing the respective keys when a text editor is open, the related links will be shown and, for the email, the related address. Therefore, in case of issues with direct access you can just copy and paste them.

 

Firmware

Now, let’s take a look at the Bi-card sketch (it is fully reported in List 1) and analyze the points regarding the customizable data, i.e. the lines containing the web address, the email and the possible Facebook, Twitter and Google+ accounts.

The first one contains the web URL to point to when P1 is pressed and it is:

void loop() {

 // read the pushbutton:

 int buttonState = digitalRead(2);

 // if the button state has changed,

 if (digitalRead(6)==0) {

   Keyboard.println(“www.open-electronics.org”);

   delay(2000);

 }

 

This is the loop testing the five buttons and, in this case, it refers to the action related to logic state zero on the 6-pin. In the line Keyboard.println(“www.open-electronics.org”), instead of www.open-electronics.org, you can write your own web address. The structure allows to write the text in parenthesis and quotes and send it to the USB just like if the same keys were pressed.

The next loop section is:

   if (digitalRead(5)==0) {

   Keyboard.print(“mailto”);

   Keyboard.write(62);

   Keyboard.println(“info@open-electronics.org”);    

   delay(2000);

 }

 

and it specifies the email address in the line Keyboard.println(“info@open-electronics.org”);. The instruction is the same of the previous one and, in quotes, you can write down your email address.

Let’s move on to the third loop section now, which refers to when P3 is pressed (referring to digital line D4 of our Arduino) and uses the same instruction:

 

 if (digitalRead(4)==0) {

   Keyboard.println(“www.facebook.com/OpenElectronics”);

  // Keyboard.print(“]+”);

   delay(2000);

 }

 

in the line Keyboard.println(“www.facebook.com/OpenElectronics”); you can write the URL of your Facebook page.

The fourth loop section of the sketch refers to when P4 is pressed (digital line D3) and, in the line Keyboard.println(“www.twitter.com/OpenElectronics”);” you can specify your twitter page.

Now, let’s take a look at the loop section regarding the address for reaching your twitter account, which is:

 if (digitalRead(3)==0) {

   Keyboard.println(“www.twitter.com/OpenElectronics”);

   delay(2000);

 }

 

 

In the same instruction Keyboard.println(“www.twitter.com/OpenElectronics”); between quotes you can indicate your Twitter account, if you have one.

Finally, let’s take a look at the last loop section, which specifies, using the same Keyboard.println instruction, a possible address for your Google+ account:

 

 if (digitalRead(2)==0) {

   Keyboard.println(“https://plus.google.com/+OpenelectronicsOrgPage”);

   delay(2000);

 }

As usual, you can indicate the URL for your Google plus account”.

Note that, if you want, you can replace the text in quotes in the above-mentioned loop sections, thus changing the keys functionalities; for instance, you can call more webpages or other services accessible via Internet, in order to create your customized business card.

Listing1

/*
Keyboard Button test
For the Arduino Leonardo, Micro and Due boards.
Sends a text string when a button is pressed.
The circuit:
* pushbutton attached from pin 2 to +5V on AVR boards
and to +3.3V to the Arduino Due
* 10-kilohm resistor attached from pin 2 to ground
created 24 Oct 2011
modified 27 Mar 2012
by Tom Igoe
This example code is in the public domain.
http://www.arduino.cc/en/Tutorial/KeyboardButton
*/
int previousButtonState = HIGH;
// for checking the state of a pushButton
int counter = 0; // button push counter
void setup() {
// make the pushButton pin an input:
pinMode(2, INPUT);
digitalWrite (2,HIGH);
pinMode(3, INPUT);
digitalWrite (3,HIGH);
pinMode(4, INPUT);
digitalWrite (4,HIGH);
pinMode(5, INPUT);
digitalWrite (5,HIGH);
pinMode(6, INPUT);
digitalWrite (6,HIGH);
pinMode(8, INPUT);
digitalWrite (8,HIGH);
// initialize control over the keyboard:
Keyboard.begin();
}
void loop() {
// read the pushbutton:
int buttonState = digitalRead(2);
// if the button state has changed,
if (digitalRead(6)==0) {
Keyboard.println(“www.open-electronics.org”);
delay(2000);
}
if (digitalRead(5)==0) {
Keyboard.print(“mailto”);
Keyboard.write(62);
Keyboard.println(“info@open-electronics.org”);
delay(2000);
}
if (digitalRead(4)==0) {
Keyboard.println(“www.facebook.com/OpenElectronics”);
// Keyboard.print(“]+”);
delay(2000);
}
if (digitalRead(3)==0) {
Keyboard.println(“www.twitter.com/OpenElectronics”);
delay(2000);
}
if (digitalRead(2)==0) {
Keyboard.println
(“https://plus.google.com/+OpenelectronicsOrgPage”);
delay(2000);
}
if (digitalRead(8)==0) {
Keyboard.println(“A”);
Keyboard.write(‘A’);
// for (int i=0;i<200;i++) Keyboard.write(i);
//Keyboard.write(‘@’);
delay(2000);
}
// save the current button state for comparison next time:
previousButtonState = buttonState;
}

 

From openstore

Bi-Card

 

About Boris Landoni

Boris Landoni is the technical manager of Open-Electronics.org. Skilled in the GSM field, embraces the Open Source philosophy and its projects are available to the community.

Leave a Reply

Your email address will not be published. Required fields are marked *