Raspberry Pi – Controlling two DC motors and 7-segment led display


Hello there, I want to show my newest project. This time it is not a game, hehe. I have bought Raspberry Pi (model B) to start to learn electronics (or to review what I have actually know) and to have some fun with programming (controlling motors, leds for example ). So I want to describe and tell some details of my creation.

In this project I am able to control two DC motors (from old cd-roms I think) using L293D chip. Also I added two digit 7-segment led display so I can show speed of motor.

Parts used:

– two DC motors

– L293D chip

– 7-segment led display FJ-5261B


– wires

– 9 resistors (around 100-300 ohms will be good)

– two NPN transistors

Language used: Java with Pi4J libraries.

Source code: https://github.com/morrky89/RaspberryPi

I don’t want to describe everything from begin, because I have got good reference articles.

My display had a little difference, tech specifications here: http://pliki.aksotronik.pl/fj5261.pdf

and I had to connect 3,3V to power display. Also I don’t use any multiplexing libraries – I just switch between digits, fast enough to trick your eyes. View source code to see more.

This lesson shows what I did, I just also added one more motor to in and out pins of chip.

If you have any questions, comment or mail me.

example video:


my interests: Game development (atm programming in java) 3D Graphics (Favourite program: Blender)

Tagged with: , , , , ,
Posted in Raspberry Pi projects

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s



my interests: Game development (atm programming in java) 3D Graphics (Favourite program: Blender)

Personal Links

Verified Services

View Full Profile →

Ad time
prywatne pożyczki pod zastaw nieruchomości bez BIK BIG i KRD
%d bloggers like this: