0

I am trying to write a simple program using Pi4J. Them main project is to start a motor. I connected it to a GPIO. And then, everything seems that is working fine except for...the pins!

I decided to play a little with the gpio in terminal. First step was gpio mode 7 out and then I tried both of the following:

  • gpio write 7 1
  • while true; do gpio write 7 1; done

I run the above also with superuser privileges.

The gpio readall command sais that I have this pin in Out Mode (The V column means voltage? And why is it stuck at 0 at GPIO. 7?).

+-----+-----+---------+------+---+---Pi 3---+---+------+---------+-----+-----+
 | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |
 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
 |     |     |    3.3v |      |   |  1 || 2  |   |      | 5v      |     |     |
 |   2 |   8 |   SDA.1 |   IN | 1 |  3 || 4  |   |      | 5v      |     |     |
 |   3 |   9 |   SCL.1 |   IN | 1 |  5 || 6  |   |      | 0v      |     |     |
 |   4 |   7 | GPIO. 7 |  OUT | 0 |  7 || 8  | 0 | IN   | TxD     | 15  | 14  |
 |     |     |      0v |      |   |  9 || 10 | 1 | IN   | RxD     | 16  | 15  |
 |  17 |   0 | GPIO. 0 |   IN | 0 | 11 || 12 | 0 | IN   | GPIO. 1 | 1   | 18  |
 |  27 |   2 | GPIO. 2 |   IN | 0 | 13 || 14 |   |      | 0v      |     |     |
 |  22 |   3 | GPIO. 3 |   IN | 0 | 15 || 16 | 0 | IN   | GPIO. 4 | 4   | 23  |
 |     |     |    3.3v |      |   | 17 || 18 | 0 | IN   | GPIO. 5 | 5   | 24  |
 |  10 |  12 |    MOSI |   IN | 0 | 19 || 20 |   |      | 0v      |     |     |
 |   9 |  13 |    MISO |   IN | 0 | 21 || 22 | 0 | IN   | GPIO. 6 | 6   | 25  |
 |  11 |  14 |    SCLK |   IN | 0 | 23 || 24 | 1 | IN   | CE0     | 10  | 8   |
 |     |     |      0v |      |   | 25 || 26 | 1 | IN   | CE1     | 11  | 7   |
 |   0 |  30 |   SDA.0 |   IN | 1 | 27 || 28 | 1 | IN   | SCL.0   | 31  | 1   |
 |   5 |  21 | GPIO.21 |   IN | 1 | 29 || 30 |   |      | 0v      |     |     |
 |   6 |  22 | GPIO.22 |   IN | 1 | 31 || 32 | 0 | IN   | GPIO.26 | 26  | 12  |
 |  13 |  23 | GPIO.23 |   IN | 0 | 33 || 34 |   |      | 0v      |     |     |
 |  19 |  24 | GPIO.24 |   IN | 0 | 35 || 36 | 0 | IN   | GPIO.27 | 27  | 16  |
 |  26 |  25 | GPIO.25 |   IN | 0 | 37 || 38 | 0 | IN   | GPIO.28 | 28  | 20  |
 |     |     |      0v |      |   | 39 || 40 | 0 | IN   | GPIO.29 | 29  | 21  |
 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
 | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |
 +-----+-----+---------+------+---+---Pi 3---+---+------+---------+-----+-----+

The motor and the cables are working (I plugged them at 3.3V).

Is it possible for the pins to be damaged, or disabled? If not, how could I see my motor working?

Here you can find more info about the system

PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
NAME="Raspbian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

and

Linux raspberrypi 4.9.80-v7+ #1098 SMP Fri Mar 9 19:11:42 GMT 2018 armv7l GNU/Linux

I also run sudo ./x_pigpio which sais PASS at every line and ./gpiotest which sais

Skipped non-user gpios: 0 1 28 29 30 31 
Tested user gpios: 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 
Failed user gpios: None
  • I don't know which GPIO or pins you are talking about. If you have driven a motor using the GPIO you may have destroyed the Pi. Look at pinout.xyz – joan Mar 30 '18 at 19:42
  • @joan why this could destroy the pi? The motor is 3V-6V. I did something like this (hackster.imgix.net/uploads/attachments/328805/…) but with a motor! Instead of 3.3V I plugged it in GPIO. 7. I also run some tests (see edit) – LiTTle Mar 30 '18 at 19:59
  • You need to edit the question and tell us what you have done. Saying you did something like something else does not help. Without knowing what you have done it's not possible to know if you have damaged the Pi or not. – joan Mar 30 '18 at 20:04
  • I connected a motor at GPIO. 7 and I would like to start it using the gpio command line tool. That's what I want to make a start. – LiTTle Mar 30 '18 at 20:10
  • If we accept what you say at face value you will destroy your Pi. You need to use a motor driver board or implement the equivalent using transistors and diodes. – joan Mar 30 '18 at 20:35
2

The v column means Digital Value (Raspberry Pi has not analog GPIO ports), 0 means off and 1 means on

So, you have the GPIO 7. on OUT mode and it's turned off (0 on Digital)

About the motors, Raspberry Pi was not done to connect motors to it, so maybe you destroyed the GPIO, see the motor capacity and see if it is more or less than the Raspberry Pi,

You can use a external font to give energy to the motors and use a H bridge to connect to the Raspberry Pi; this way is less dangerous.

| improve this answer | |
  • but is ever better to use Terminal – yanko Apr 3 '18 at 21:42
  • To add more info the GPIO pins are inadequate to start a motor, due to small amperage. I need more power from the VDC pins of the Pi. That's something I did know about! – LiTTle Apr 4 '18 at 13:12
  • @LiTTle You can use a 5V Relay connected to the RPi – yanko Apr 4 '18 at 14:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.