Go to advanced search

by joan
Mon Aug 18, 2014 7:22 am
Forum: Python
Topic: Ultrasonic Sensor Problems
Replies: 18
Views: 7245

Re: Ultrasonic Sensor Problems

... the one. If you are using PWM then RPIO is likely to be better (especially for servos). There is no evidence of the trigger being sent to the HC-SR04. I'm surprised you get any readings at all. Could you check that you have posted the complete code. Are you attempting to send the trigger pulse ...
by nizam
Mon Aug 18, 2014 1:39 am
Forum: Python
Topic: Ultrasonic Sensor Problems
Replies: 18
Views: 7245

Re: Ultrasonic Sensor Problems

Thanks joan.. I already read your link. But my hc-sr04 was tested in fixed condition actually. If i'm wrong please correct me :(. From the graph, i tested within 7 cm range, but the results is terrible :( . Is it because my time.sleep (10ms) ? Btw ...
by BMS Doug
Sat Aug 16, 2014 10:06 pm
Forum: Automation, sensing and robotics
Topic: Starter electronics kit
Replies: 4
Views: 1406

Re: Starter electronics kit

... sensor 1x VS1838B Universal Infrared Receiving Head - usable 1x 830 tie point Breadboard - usable 1X Micro servo 9G SG90 - usable 1x HC-SR04 Ultrasonic Distance Sensor - usable 1x Sainsmart opto-couple 1 channel relay - usable 1x 4 x 4 Matrix Array 16 Key Membrane Switch Keypad - usable ...
by nizam
Thu Aug 14, 2014 7:48 am
Forum: Python
Topic: Ultrasonic Sensor Problems
Replies: 18
Views: 7245

Ultrasonic Sensor Problems

hi im a beginner in programming and currently working with hc-sr04 and raspberry pi.
I just wanna your opinion on how to filter the hc-sr04 result.
i wanna take its previous data if the present data is too impossible. What is the best algorithm? or do u hav any opinion?
by KenT
Sat Aug 09, 2014 1:18 pm
Forum: Graphics, sound and multimedia
Topic: Pi Presents: Beta of a major upgrade now available
Replies: 130
Views: 42759

Re: Pi Presents: Beta of a major upgrade now available

... animate_begin_text to animate_end_text I'll update github tomorrow Ken Hi, I'm trying to achieve this: 1 Video start triggered by gpio in (hc-sr04 sensor) 2 When video starts a gpio out is sent to turn on lights 3 When video ends a gpio out is sent to turn off lights 1 and 2 work fine, 3 does ...
by tonyrh
Wed Aug 06, 2014 1:09 pm
Forum: Graphics, sound and multimedia
Topic: Pi Presents: Beta of a major upgrade now available
Replies: 130
Views: 42759

Re: Pi Presents: Beta of a major upgrade now available

Hi, I'm trying to achieve this: 1 Video start triggered by gpio in (hc-sr04 sensor) 2 When video starts a gpio out is sent to turn on lights 3 When video ends a gpio out is sent to turn off lights 1 and 2 work fine, 3 does not work. I'm pretty sure pins configuration ...
by nizam
Sun Aug 03, 2014 11:51 pm
Forum: Python
Topic: problems with HC-SR04 ultrasonic sensor
Replies: 2
Views: 1212

Re: problems with HC-SR04 ultrasonic sensor

That is an infinite loop although it will try printing the distance about 200 times a second which isn't going to happen so you may want to add a sleep after the print. Dave. thanks dave. I already put time.sleep(0.05) after print..but still it stop and give unstable reading. Thanks again for reply...
by davef21370
Sat Aug 02, 2014 3:07 pm
Forum: Python
Topic: problems with HC-SR04 ultrasonic sensor
Replies: 2
Views: 1212

Re: problems with HC-SR04 ultrasonic sensor

That is an infinite loop although it will try printing the distance about 200 times a second which isn't going to happen so you may want to add a sleep after the print.

Dave.
by nizam
Thu Jul 31, 2014 1:55 am
Forum: Python
Topic: problems with HC-SR04 ultrasonic sensor
Replies: 2
Views: 1212

problems with HC-SR04 ultrasonic sensor

hi, im just a noob in robotics. im doing a research on robotic and ultrasonic sensor. When using a hc-sr04 and connected to raspberry pi with 50ms and lower time.sleep, my data seems not very stable. I want to use an infinite loop for my sensor..but i dun know how to use it ...
by joan
Wed Jul 30, 2014 6:53 am
Forum: Automation, sensing and robotics
Topic: Problems with the HC-SR04 Ultrasonic Sensor
Replies: 15
Views: 21822

Re: Problems with the HC-SR04 Ultrasonic Sensor

hi, im a beginner i robotic and sensor. im doing a research on robotic and ultrasonic sensor. When using a hc-sr04 and connect to raspberry pi with 25ms time.sleep, my data seems not very stable. Is it ordinary case or it just an usual one? It's probably best to start a new thread ...
by nizam
Wed Jul 30, 2014 1:59 am
Forum: Automation, sensing and robotics
Topic: Problems with the HC-SR04 Ultrasonic Sensor
Replies: 15
Views: 21822

Re: Problems with the HC-SR04 Ultrasonic Sensor

hi,
im a beginner i robotic and sensor.
im doing a research on robotic and ultrasonic sensor. When using a hc-sr04 and connect to raspberry pi with 25ms time.sleep, my data seems not very stable. Is it ordinary case or it just an usual one?
by aurelazy
Sun Jul 27, 2014 3:30 pm
Forum: Automation, sensing and robotics
Topic: Ultrasonic sensor HC-SR04 with Python nanpy
Replies: 18
Views: 6569

Re: Ultrasonic sensor HC-SR04 with Python nanpy

Hi Ame,
I thank you for this, i will dig this part, it can be interesting,
Anyway i thank you both of you, it's my first time in this forum and I feel really welcome .
Thank you so much
by ame
Sat Jul 26, 2014 11:47 pm
Forum: Automation, sensing and robotics
Topic: Ultrasonic sensor HC-SR04 with Python nanpy
Replies: 18
Views: 6569

Re: Ultrasonic sensor HC-SR04 with Python nanpy

http://stackoverflow.com/questions/20107700/serial-receiving-from-arduino-to-raspberry-pi-with-pyserial-stops-after-a-while Ok, i thank you so much for your help, i wanted to use python and not the arduino language, and can i take a little bit of your time :mrgreen: ? How you send the result to the ...
by aurelazy
Sat Jul 26, 2014 9:25 pm
Forum: Automation, sensing and robotics
Topic: Ultrasonic sensor HC-SR04 with Python nanpy
Replies: 18
Views: 6569

Re: Ultrasonic sensor HC-SR04 with Python nanpy

Hi Joan,
I'm not very good in electronic and i don't want to burn my gpio. But i know that i have to jump more in electro if i want to go further in it, i will try this after buying some components.

Thanks to you, have a good night.
by joan
Sat Jul 26, 2014 7:06 pm
Forum: Automation, sensing and robotics
Topic: Ultrasonic sensor HC-SR04 with Python nanpy
Replies: 18
Views: 6569

Re: Ultrasonic sensor HC-SR04 with Python nanpy

... to the pi with serial ? Do you have a link on a tuto ? Thank you so much again. Alternatively you could ignore the Arduino and connect the HC-SR04 directly to the Pi. You'd need to voltage divide the 5V echo line to 3V3 to act as a Pi safe input. For that you'd need a couple of resistors. ...
by aurelazy
Sat Jul 26, 2014 6:23 pm
Forum: Automation, sensing and robotics
Topic: Ultrasonic sensor HC-SR04 with Python nanpy
Replies: 18
Views: 6569

Re: Ultrasonic sensor HC-SR04 with Python nanpy

Ok, i thank you so much for your help, i wanted to use python and not the arduino language, and can i take a little bit of your time :mrgreen: ?
How you send the result to the pi with serial ? Do you have a link on a tuto ? Thank you so much again.
by ame
Sat Jul 26, 2014 1:04 am
Forum: Automation, sensing and robotics
Topic: Ultrasonic sensor HC-SR04 with Python nanpy
Replies: 18
Views: 6569

Re: Ultrasonic sensor HC-SR04 with Python nanpy

Yes, that's what I meant by latency. It takes too long to send and receive the information about the pin state.

Actually, I don't see the point of nanpy.

Anyway, the simplest way to do this is to make the Arduino do all the calculations and send the result to the pi using the serial port.
by aurelazy
Fri Jul 25, 2014 5:15 pm
Forum: Automation, sensing and robotics
Topic: Ultrasonic sensor HC-SR04 with Python nanpy
Replies: 18
Views: 6569

Re: Ultrasonic sensor HC-SR04 with Python nanpy

So I'm at home and tried some things ! put in a tight loop which prints the value of the echo pin I did this and my echo sending me 0 on a loop of 30. I tried to change the baudrate but it raise a "Serial Timeout!" So I think it's what you both said "latency" or "Turnaround" is not good for ultrason...
by joan
Fri Jul 25, 2014 2:49 pm
Forum: Automation, sensing and robotics
Topic: Ultrasonic sensor HC-SR04 with Python nanpy
Replies: 18
Views: 6569

Re: Ultrasonic sensor HC-SR04 with Python nanpy

Do you know the turnaround time is between sending a message to the Arduino and receiving a response? I wonder if the echo is complete by the time it's being sampled.
by ame
Fri Jul 25, 2014 9:15 am
Forum: Automation, sensing and robotics
Topic: Ultrasonic sensor HC-SR04 with Python nanpy
Replies: 18
Views: 6569

Re: Ultrasonic sensor HC-SR04 with Python nanpy

Yes, something like that.

No time to reply now. Sorry. Try it.
by aurelazy
Fri Jul 25, 2014 9:10 am
Forum: Automation, sensing and robotics
Topic: Ultrasonic sensor HC-SR04 with Python nanpy
Replies: 18
Views: 6569

Re: Ultrasonic sensor HC-SR04 with Python nanpy

Ok,

So, if I understand well i put just before the loop, an other loop like this:

Code: Select all

i = 5
while i < 5:
    print a.digitalRead(echo)
?
I thank you so much for your help !
by ame
Fri Jul 25, 2014 8:36 am
Forum: Automation, sensing and robotics
Topic: Ultrasonic sensor HC-SR04 with Python nanpy
Replies: 18
Views: 6569

Re: Ultrasonic sensor HC-SR04 with Python nanpy

OK, well it sounds like the hardware works. Perhaps there is too much latency between the pi and the arduino? After generating the trigger pulse I suggest you put in a tight loop which prints the value of the echo pin. If you never see a transition then it's possible that nanpy makes things too slow...
by aurelazy
Fri Jul 25, 2014 7:47 am
Forum: Automation, sensing and robotics
Topic: Ultrasonic sensor HC-SR04 with Python nanpy
Replies: 18
Views: 6569

Re: Ultrasonic sensor HC-SR04 with Python nanpy

Morning Ame, Thanks for your answer, Yes I am using the Arduino for this. I tried directly with Arduino and it worked well. I tried with other Python modules, don't remember the name (something like Python-Arduino, or pyserial, don't remember, and i'm not at home to verify). And it worked but the mo...
by ame
Thu Jul 24, 2014 11:17 am
Forum: Automation, sensing and robotics
Topic: Ultrasonic sensor HC-SR04 with Python nanpy
Replies: 18
Views: 6569

Re: Ultrasonic sensor HC-SR04 with Python nanpy

Are you using an Arduino?

For this project to work you will need a Pi, an Arduino and an HC-SR04 sensor.

It's possible that the sensor does not work.

Have you tried using it with an Arduino first? If it works, then you can try using the Pi.
by aurelazy
Wed Jul 23, 2014 7:16 am
Forum: Automation, sensing and robotics
Topic: Ultrasonic sensor HC-SR04 with Python nanpy
Replies: 18
Views: 6569

Ultrasonic sensor HC-SR04 with Python nanpy

Morning everyone, First of all sorry for my bad english . So I tried for hours the way to use my HC-SR04 with nanpy, but my script block when I want to read the echo return, and I really don't know why ! Here my code: ############################################################# ...

Go to advanced search