Chemuel
Posts: 2
Joined: Wed Jul 12, 2017 6:49 pm

help a noob control 8 motors and a sensor

Wed Jul 12, 2017 7:11 pm

Greetings, everyone!

I have come to humbly ask/beg for help from someone who is already immersed in this amazing technology... a friend of mine, an artist, intends to create a piece using sensors and moving parts and we decided to use the raspi to control things. Sadly, I have been severely sick over the past few weeks and have not been able to do my research properly, now time is running out.

What we need: A system that can pick up info from at least one sensor (motion or distance) and control at least eight motors individually - only direction and on/off, speed should be constant, along with a power supply that will work and not fry anything. Controlling and supplying some LEDs would be nice but is not required.

I am an acceptable programmer, not good with all the new library stuff but I can build obscure drivers (stopped coding about 15 years ago...) and my friend is willing and capable of building/soldering just about anything. We do have a basic grasp on how to assemble and run the pi, however the sheer amount of options thereafter is completely overwhelming for a new-comer and all the details that need attention make it hard to just "find my thing" as mistakes seem to be able to fry builds easily. It probably does not help that I totally sogg in all things e-tech, so I would ask You to be patient and mention "basic" stuff that might be obvious to anyone less incompetent. We don't need a beautiful and elegant solution, anything will do, as long as it works.

I realize that it's not exactly great style to ask someone to basically do the brain work for us, but I hope someone who is up to date on the material would find this trivial and could point us in the right direction.

tech-mech
Posts: 114
Joined: Sun Feb 23, 2014 9:51 pm
Location: Portland, Oregon USA
Contact: Yahoo Messenger

Re: help a noob control 8 motors and a sensor

Thu Jul 13, 2017 4:57 am

Reading a 'sensor' is a broad issue as different sensors have different interfaces.

There are many types of motors and each needs a different control interface. If you want low power and low speed the easiest would be continuous rotation servos as they have a builtin controller.

What language will you use?

More info will get more specific help.

Dale

User avatar
B.Goode
Posts: 8274
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: help a noob control 8 motors and a sensor

Thu Jul 13, 2017 6:36 am

Have a look at the gpiozero library for python.

It contains a 'recipe' for a button controlled robot.

(This shows how to use 4 motors, and the button is a simple example of a sensor so is a good step towards your project.)

https://gpiozero.readthedocs.io/en/stab ... lled-robot

Chemuel
Posts: 2
Joined: Wed Jul 12, 2017 6:49 pm

Re: help a noob control 8 motors and a sensor

Fri Jul 14, 2017 8:05 am

Thank You for replying so quickly!

As usual I seem to be terrible at communicating. We have no clear set-up in mind, neither hardware nor software, but are actually looking for suggestions on what to use and combine. As mentioned, there are lots of options on what motors or sensors to use, and how to control them, what boards, connections, adapters etc. could work, might work, should work, but for someone like me it's just a huge pile of items with lots of specifications each that I fail to sort out, therefore an unspecific request for an as-yet unspecific solution. As in "you can use a raspi robot board, this sensor and these motors to build a car that does not run into walls", now I need "you could use this board and these motors to build a thing that matches the description above". I can figure things out once i have a starting point, but the sheer mass of available hardware is daunting and trying to figure things out for each of the options would probably take the time to do a full degree...

BMS Doug
Posts: 3824
Joined: Thu Mar 27, 2014 2:42 pm
Location: London, UK

Re: help a noob control 8 motors and a sensor

Fri Jul 14, 2017 9:27 am

There is a very common generic Yellow Motor and gearbox that is used in most cheap robots everywhere.

You can control two of them from one L298N dual H-bridge motor controller.

you'll need some Dupont cables to connect the Pi to the L298N

you will need to solder some thicker wire to the motors to connect them to the L298N.

A beefy 5V 10A power supply will be enough to run the Pi and the motors.


I don't know what sort of sensor you have in mind.
Doug.
Building Management Systems Engineer.

BMS Doug
Posts: 3824
Joined: Thu Mar 27, 2014 2:42 pm
Location: London, UK

Re: help a noob control 8 motors and a sensor

Fri Jul 14, 2017 9:56 am

If you want the art installation to be flexible in response to human interaction you could use a Flick panel and use their library to change the installations response based on the gesture used.
Available gestures: Swipe (east to west, west to east, north to south, south to north), tap and double tap (center, east, west, north, south) and airwheel (clockwise, anti-clockwise)
.

If you want to add LEDs then WS2812 addressable LEDs are great, they come in a variety of formats and only use 1 GPIO pin on the raspberry pi regardless of how many you want to add.

Other (commonly used) sensor options:
HC-SR04 ultrasonic distance sensor
DS18B20 Temperature sensor
Doug.
Building Management Systems Engineer.

MarkR
Posts: 154
Joined: Fri Jan 25, 2013 1:55 pm

Re: help a noob control 8 motors and a sensor

Fri Jul 14, 2017 10:20 am

I would certainly recommend using "continuous rotation servo" motors.

These can be bought very cheaply and use only one gpio pin each, to control in either direction and with variable speed. The pigpio library allows accurate PWM output and works well with even the tiniest, cheapest continous servos.

You'll need motors which have torque and electrical characteristics sutiable for your application; in many cases you can connect the control wire directly to the Pi's GPIO, but don't drive the power through the Pi's power pins (e.g. if using 5v supply).

User avatar
mikronauts
Posts: 2717
Joined: Sat Jan 05, 2013 7:28 pm
Contact: Website

Re: help a noob control 8 motors and a sensor

Sun Jul 16, 2017 4:19 pm

you need to figure out the mass of the objects you want to move before you can find the motors you need
http://Mikronauts.com - home of EZasPi, RoboPi, Pi Rtc Dio and Pi Jumper @Mikronauts on Twitter
Advanced Robotics, I/O expansion and prototyping boards for the Raspberry Pi

Return to “Beginners”