Go to advanced search

by nickc10
Thu Jan 10, 2019 10:24 pm
Forum: Automation, sensing and robotics
Topic: Python button script stopped working
Replies: 8
Views: 724

Re: Python button script stopped working

Updated my diagram to show 1K resistor added, does not matter which side of switch as log as its in series. https://i.imgur.com/qrwzvdB.jpg great thanks. that's really good to know. I was wondering earlier about whether there should be a resistor on the switch as many diagrams don't show one. very ...
by nickc10
Thu Jan 10, 2019 10:02 pm
Forum: Automation, sensing and robotics
Topic: Python button script stopped working
Replies: 8
Views: 724

Re: Python button script stopped working

The 1K resistor is just there so that if you set the switch gpio pin to an output and your switch shorts it to a low/high voltage pin you don't damage the gpio pin due to high current flow. Ok thanks. Sounds like a good idea. So in my setup with the script I just posted I put the 1k on the switch a...
by nickc10
Thu Jan 10, 2019 9:39 pm
Forum: Automation, sensing and robotics
Topic: Python button script stopped working
Replies: 8
Views: 724

Re: Python button script stopped working

The code you say works has a pull up on the button, your original code and my code has a pull down on the button For your original code and my code to work wire button/LED like this. https://i.imgur.com/dCJCHHN.jpg I would recommend adding a 1K protection resistor in the switch circuit in series wi...
by nickc10
Thu Jan 10, 2019 9:02 pm
Forum: Automation, sensing and robotics
Topic: Python button script stopped working
Replies: 8
Views: 724

Re: Python button script stopped working

Well running your program the LED turns on as soon as the program is run pressing the button turns it off then the program exits as per the program. added notes print "LED ON" GPIO.output(10,GPIO.HIGH) #turns LED on while True: input_state = GPIO.input(7) if input_state == True: print "LED OFF" #tu...
by nickc10
Thu Jan 10, 2019 8:11 pm
Forum: Automation, sensing and robotics
Topic: Python button script stopped working
Replies: 8
Views: 724

Python button script stopped working

Hi The following script is designed to turn on an LED whilst a button is in a depressed state and turn the LED off when the button is released. When run however the LED comes on whether or not the button is held down and stays on regardless. I've tried all day to find out what the problem is but to ...
by nickc10
Sun Dec 30, 2018 9:39 pm
Forum: Automation, sensing and robotics
Topic: rotation sensor/counter?
Replies: 2
Views: 236

Re: rotation sensor/counter?

scotty101 wrote:
Sun Dec 30, 2018 7:46 pm
IR reflection sensor and then a white/black strip on the shaft.
Perfect. Thanks!
by nickc10
Sun Dec 30, 2018 7:22 pm
Forum: Automation, sensing and robotics
Topic: rotation sensor/counter?
Replies: 2
Views: 236

rotation sensor/counter?

Hello I have a setup whereby a 5cm diameter shaft rotates about once per second. I want to be able to count the number of rotations and then stop the shaft turning after 10 rotations. What would be the best i.e. simply, cost effective yet accurate mechanical solution for this i.e. switch, sensor etc...
by nickc10
Sun Dec 30, 2018 2:16 pm
Forum: Automation, sensing and robotics
Topic: Using two different rated motors with L293D
Replies: 14
Views: 588

Re: Using two different rated motors with L293D

One interesting observation however is that the motor (which has a load by the way) is turning less quickly via the chip than when it was connected directly to the power supply. Given what you have said I'm assuming this must be caused by a voltage drop since the load is exactly the same. I haven't...
by nickc10
Sun Dec 30, 2018 2:02 pm
Forum: Automation, sensing and robotics
Topic: Using two different rated motors with L293D
Replies: 14
Views: 588

Re: Using two different rated motors with L293D

I suggest you try it an see what happens. Running an 8v motor on 18V is going to run it very hard, if you do it continously it could overheat. Also if there is a gearbox, it might strip the teeth under high torque because it's not designed for that much. But if it's not used in continous operation,...
by nickc10
Sun Dec 30, 2018 10:39 am
Forum: Automation, sensing and robotics
Topic: Using two different rated motors with L293D
Replies: 14
Views: 588

Re: Using two different rated motors with L293D

If you PWM the output of the L293D the average voltage is indeed lower. However, the maximum voltage that the motor see is still the 18V and that could be to much for the motor itself. It could damage the part inside of the motor. A other simple solution would be to buy a motor that is also rated f...
by nickc10
Sun Dec 30, 2018 10:18 am
Forum: Automation, sensing and robotics
Topic: Using two different rated motors with L293D
Replies: 14
Views: 588

Re: Using two different rated motors with L293D

The simple answer is to just use a second L293D and power it with the correct voltage. A pwm output from your L293D will still apply 18V to your motor its just that the output is turn on and off very quickly so the average voltage will be less. so a longer off time on the pwm will result in a low a...
by nickc10
Sun Dec 30, 2018 9:26 am
Forum: Automation, sensing and robotics
Topic: Using two different rated motors with L293D
Replies: 14
Views: 588

Using two different rated motors with L293D

Hi I need to add a second motor to an existing setup. The current motor is rated at 18v and so I have a 16v power supply on pin 8 of the chip. The motor I wish to add however is rated at only 8v. I am wondering therefore the best way to supply the correct voltage? Using PWM as in this tutorial - htt...
by nickc10
Mon Oct 08, 2018 6:44 pm
Forum: Automation, sensing and robotics
Topic: Python over SSH - event not detected
Replies: 5
Views: 753

Re: Python over SSH - event not detected

@pcmanbob

OK thanks for looking into further. I will perhaps come back to it at some point but for now the system is working which is the main thing

many thanks again for your interest and input!
by nickc10
Sat Oct 06, 2018 4:53 pm
Forum: Automation, sensing and robotics
Topic: Python over SSH - event not detected
Replies: 5
Views: 753

Re: Python over SSH - event not detected

I have solved this using the following code import RPi.GPIO as GPIO import time from time import sleep GPIO.setmode(GPIO.BOARD) GPIO.setwarnings(False) GPIO.setup(10, GPIO.IN, pull_up_down=GPIO.PUD_DOWN) GPIO.setup(11,GPIO.OUT) GPIO.setup(13,GPIO.OUT) GPIO.setup(15,GPIO.OUT) # Start motor GPIO.outpu...
by nickc10
Sat Oct 06, 2018 2:08 pm
Forum: Automation, sensing and robotics
Topic: Python over SSH - event not detected
Replies: 5
Views: 753

Re: Problem running Python script remotely via SSH

topguy wrote:
Sat Oct 06, 2018 1:53 pm
Do you see the "Button was pressed" message ?
Do you really need to run the script with sudo ?
I am sending from a machine running Ubuntu. When I run the shell script I don't see anything.

Yes. It doesn't run without it.
by nickc10
Sat Oct 06, 2018 11:38 am
Forum: Automation, sensing and robotics
Topic: Stop motor with event trigger - L293D, Pi, Python
Replies: 8
Views: 731

Re: Stop motor with event trigger - L293D, Pi, Python

@pcmanbob

OK thanks. Well it's working fine as it is except for one thing which you may or may not be able to help me with - actually I just posted a new questions about it as you will probably see. Problems running the script over SSH.

Nick
by nickc10
Sat Oct 06, 2018 10:33 am
Forum: Automation, sensing and robotics
Topic: Python over SSH - event not detected
Replies: 5
Views: 753

Python over SSH - event not detected

Hello I am running a Python script on the Pi remotely to control a motor. This is the script - import RPi.GPIO as GPIO from time import sleep GPIO.setmode(GPIO.BOARD) GPIO.setwarnings(False) GPIO.setup(10, GPIO.IN, pull_up_down=GPIO.PUD_DOWN) GPIO.setup(11,GPIO.OUT) GPIO.setup(13,GPIO.OUT) GPIO.setu...
by nickc10
Sat Oct 06, 2018 12:25 am
Forum: Automation, sensing and robotics
Topic: Stop motor with event trigger - L293D, Pi, Python
Replies: 8
Views: 731

Re: Stop motor with event trigger - L293D, Pi, Python

What makes you think you have destroyed the motor driver chip ? if you were only trying different code variations I cant see how you would destroy the chip, as your options are limited to on/off for the enable pin and high/low for the direction pins, assuming you have not changed any connections. w...
by nickc10
Fri Oct 05, 2018 4:31 pm
Forum: Automation, sensing and robotics
Topic: Stop motor with event trigger - L293D, Pi, Python
Replies: 8
Views: 731

Re: Stop motor with event trigger - L293D, Pi, Python

What makes you think you have destroyed the motor driver chip ? if you were only trying different code variations I cant see how you would destroy the chip, as your options are limited to on/off for the enable pin and high/low for the direction pins, assuming you have not changed any connections. w...
by nickc10
Fri Oct 05, 2018 4:17 pm
Forum: Automation, sensing and robotics
Topic: Stop motor with event trigger - L293D, Pi, Python
Replies: 8
Views: 731

Re: Stop motor with event trigger - L293D, Pi, Python

What makes you think you have destroyed the motor driver chip ? if you were only trying different code variations I cant see how you would destroy the chip, as your options are limited to on/off for the enable pin and high/low for the direction pins, assuming you have not changed any connections. w...
by nickc10
Fri Oct 05, 2018 3:10 pm
Forum: Automation, sensing and robotics
Topic: Stop motor with event trigger - L293D, Pi, Python
Replies: 8
Views: 731

Re: Stop motor with event trigger - L293D, Pi, Python

Some thing like this should work assuming the enable pin on your motor controller board is connected to pin 11. import RPi.GPIO as GPIO from time import sleep GPIO.setmode(GPIO.BOARD) GPIO.setwarnings(False) GPIO.setup(10, GPIO.IN, pull_up_down=GPIO.PUD_DOWN) GPIO.setup(11,GPIO.OUT) GPIO.setup(13,G...
by nickc10
Fri Oct 05, 2018 3:46 am
Forum: Automation, sensing and robotics
Topic: Stop motor with event trigger - L293D, Pi, Python
Replies: 8
Views: 731

Stop motor with event trigger - L293D, Pi, Python

Hello I wish to stop a motor with an event trigger. This is the motor script import RPi.GPIO as GPIO from time import sleep GPIO.setmode(GPIO.BOARD) GPIO.setup(11,GPIO.OUT) GPIO.setup(13,GPIO.OUT) GPIO.setup(15,GPIO.OUT) GPIO.output(11,GPIO.HIGH) GPIO.output(13,GPIO.LOW) GPIO.output(15,GPIO.HIGH) GP...
by nickc10
Tue Oct 02, 2018 4:49 am
Forum: Automation, sensing and robotics
Topic: Motor torque and gearing
Replies: 6
Views: 591

Re: Motor torque and gearing

Mortimer wrote:
Mon Oct 01, 2018 12:47 pm
Lego is pretty powerful stuff : https://youtu.be/slv5fvS6e9Q

The chap in the video builds a Lego machine that gave a measured pull of 102kgs!
Many thanks. That's pretty impressive. I didn't realise lego had all these sorts of parts. It would make certainly make things a lot easier and fun .
by nickc10
Tue Oct 02, 2018 4:42 am
Forum: Automation, sensing and robotics
Topic: Motor torque and gearing
Replies: 6
Views: 591

Re: Motor torque and gearing

I am working on a project which involves the Pi controlling a motor. The motor needs to lift a 750g weight to a height of a 60cm. How quickly? That's 4.4 Joules of work, the amount of time spent for the lift determines the power required. In the event there is somebody on this forum who can offer a...
by nickc10
Mon Oct 01, 2018 12:39 pm
Forum: Automation, sensing and robotics
Topic: Motor torque and gearing
Replies: 6
Views: 591

Re: Motor torque and gearing

750g is nothing. With a bog standard lego, motor and solar panel kit, I've seen 7-10 year old kids build something that can lift over 2kg. Worm and wheel gears would be a good idea as they both give a high step down ratio and won't allow the wheel to be driven the weight that is lifted won't fall b...

Go to advanced search