Notifications
Clear all

Hello everybody. RCLawn Arduino Robot Car with nRF24L01+

51 Posts
5 Users
0 Likes
5,066 Views
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2532
 
Posted by: @rclawn

@robotbuilder 

Thank You for response.

I don't have pictures. Try these...microswitch, zero turn, drive motor, toro Model #: 20031,power wheels toy. I'm not trying to be smart. I am only trying to comply. The thing is if I have to pull start it I could just rig up some way junkier mower and fix the fancy one and sell it.

199655204 Honeywell V15 Standard Basic Switch
s50xt 2 2
s l200
ypxffl1v5m
56e2e6bb 2d3d 4fd2 978d 79e127bfe0ac 1.5b0e812f9a5813a3b4155320222de500

 

 

The mower is an electric start, self propelled, gas powered, push mower(the fanciest thing I've ever seen). It has a micro switch(honeywell brand) operated by cable and lever by the safety cross bar(if you let go it stops the engine). It also has a momentary Key switch (to turn it on, or you can pull the string...while holding the crossbar of course).

I don't really think that you'll need the micro switch for the automated mower. It's not like anybody is there to hold it in a "safe" position, so you may as well junk it and substitute a stop button to shut the mower down.

It seems that it would also a lot safer to mount 4 "bumpers" about 6" high covering all 4 sides of the mower. Each would have a switch triggered by any inward motion of the bumper and would instantly cut power to the mower at the battery when activated.

In case control is lost (radio failure e.g) that would prevent the mower from running amok and damaging anything in it's path (especially dogs, cats, small children, large children and idiots "hold my beer and watch this").

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
robotBuilder
(@robotbuilder)
Member
Joined: 5 years ago
Posts: 2043
 

@will 

Thanks for integrating it, I'm much too lazy to re-indent the whole thing and I also wasn't sure whether he might revert to Bill's original sketch.

They were Bill's original sketches!!

It was a quick insert of your code I haven't had time to really go through all the ins and outs.

I'm not sure RCLawn can debug it? I get the impression he knows less about programming than I do. I notice posters come here hoping that an "expert" will give them a working solution for a one off project and have no interest in learning to program.  In another thread when I got what I think was a working solution there was no feedback as to its success or failure. You either love solving these code problems or you don't.
https://forum.dronebotworkshop.com/arduino/kayak-lantern-with-sos/paged/2/#post-22362

I might order a couple of nRF24L01's and their adapters today and maybe have something working the weekend following this coming one. It is an easy project and an RF connection between Arduinos is of interest to me.

 


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2532
 
Posted by: @robotbuilder

@will 

Thanks for integrating it, I'm much too lazy to re-indent the whole thing and I also wasn't sure whether he might revert to Bill's original sketch.

They were Bill's original sketches!!

I wish I'd known that before I started trying to work through it 🙂

It was a quick insert of your code I haven't had time to really go through all the ins and outs.

Same here, it was a quick-n-dirty patchwork to implement buttons in the TX and drive some LEDs in the RX. The idea was to move to the next step of adding the hardware (buttons for the TX and test LEDs for the RX) so they could be tested and decisions made about how to move on to the next steps.

I'm not sure RCLawn can debug it? I get the impression he knows less about programming than I do. I notice posters come here hoping that an "expert" will give them a working solution for a one off project and have no interest in learning to program.  In another thread when I got what I think was a working solution there was no feedback as to its success or failure. You either love solving these code problems or you don't.

Most don't seem to like working on code and, having seen some of it, I don't blame them 🙂

https://forum.dronebotworkshop.com/arduino/kayak-lantern-with-sos/paged/2/#post-22362

Yeah, I was in on that one too, but I don't expect any thanks (or even return comments), so I'm never really disappointed, On the other hand, with only a few exceptions, I expect the OP to do some of the work.

I might order a couple of nRF24L01's and their adapters today and maybe have something working the weekend following this coming one. It is an easy project and an RF connection between Arduinos is of interest to me.

The 433MHz are good too, if you don't need much range 🙂

By the way, I'm not much of a roboteer, but is this article of any interest to you ?

https://www.a1k0n.net/2021/01/22/indoor-localization.html

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
robotBuilder
(@robotbuilder)
Member
Joined: 5 years ago
Posts: 2043
 

@will

By the way, I'm not much of a roboteer, but is this article of any interest to you ?
https://www.a1k0n.net/2021/01/22/indoor-localization.html

Fast reactions!! Some robot vacuums use the ceiling for navigation. I have experimented with that but that is for another thread for those interested in that sort of thing.


   
ReplyQuote
(@rclawn)
Member
Joined: 2 years ago
Posts: 47
Topic starter  

@will

Hi Will, Sorry for the delayed response. Thank You for your work.

This is a summary of results and changes made.

Both the initial code in the *.ino files with the cmd 7 change and the the complete changes to tx and rx all have the LEDs on continuously regardless of the state of the

buttons.

I did change the pin numbers so they were not the same as some of the motor controls.

I changed some of the variable names on the rx file digital write statements to stopPin, hornPin, lightsPin.

I added but never used some serial.print Buf 4-7 statements I //struck them out in the file.

I am still very exited for your changes. I'm sure it's something silly making the LEDs stay on I'm supposed to find but I failed.

The good thing is that I did get the initial sketches going again. I really think there is something flaky with the unos i have. nano#2 worked 1st try. When We(You) added the additional code We didn't break anything codewise. 

LED board is connected from output through 270R to GND

Switch board is from i/o to switches 1-4 to GND

Whats POLA?


   
ReplyQuote
(@rclawn)
Member
Joined: 2 years ago
Posts: 47
Topic starter  

@robotbuilder 

Hello again.

I am certain I know less about code than many people one the forum.

What's POLA?

I would like it if you looked at the *.INO files I posted in response to @Will. I need a hint on how to make the LEDs not light all the time.

Bill's original sketches are the baseline.

 

I have no kids or dog(anymore). surrounded by trees on 3 sides but I will consider some safety stops if I get it going.

Thanks, Mike


   
ReplyQuote
robotBuilder
(@robotbuilder)
Member
Joined: 5 years ago
Posts: 2043
 

@rclawn 

What's POLA?

No idea.

I would like it if you looked at the *.INO files I posted in response to @Will. I need a hint on how to make the LEDs not light all the time.

Ok will have to look at it again tomorrow if @will doesn't come up with an answer.

It is 10:50pm here,  time for sleep.

I ordered two nRF24L01's so hopefully they will turn up before the end of the week and I can get two Arduino's communicating. Then I can test any code before posting.

 


   
ReplyQuote
(@rclawn)
Member
Joined: 2 years ago
Posts: 47
Topic starter  

Sounds good.

Not pretty but here is current state of rx and tx.

20211115 053259
20211115 054949

   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2532
 
Posted by: @robotbuilder

@rclawn 

What's POLA?

No idea.

POLA stands for the Principle Of Least Astonishment and refers to the general rule that the operational parts of a GUI should not be unexpected.

For instance, you should not have to press the START button to stop the machine or vice versa. But, if you label it START/STOP then the operator will not be astonished at its behaviour.

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2532
 

@rclawn 

I see a couple of errors (probably from my original updates).

//////////////////////////////////////////////////////////////////////
if (buf[3] = HIGH) {
   digitalWrite(startPin,HIGH);
}else{
   digitalWrite(startPin,HIGH);
}

The start procedure is unknown to me, and in operation you'd only need to start it once. But this code for testing, should have the second digitalWrite(startPin,HIGH); be digitalWrite(startPin,LOW); else the LED will stay on once it has been triggered,

 

Similarly, the horn section should be more like

if (buf[5] = HIGH) {
    digitalWrite(hornPin,HIGH);
    delay(5000); // Honk horn for 5 seconds
    digitalWrite(hornPin,LOW);

}

The original paused for 5 milliseconds and then left, leaving the horn on as it went.

I'm curious what the Serial.print would show for the 4 LEDs in the rx module and same for the tx module. I'm somewhat at a loss because I don't have the libraries nor the hardware so I can't even compile the code.

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
(@rclawn)
Member
Joined: 2 years ago
Posts: 47
Topic starter  

@will 

I changed if (buf[5] = HIGH) {
digitalWrite(hornPin,HIGH);
delay(5000); // Honk horn for 5 seconds
digitalWrite(hornPin,LOW);

TO if (buf[5] ==HIGH) {
digitalWrite(hornPin,HIGH);
delay(5000); // Honk horn for 5 seconds
digitalWrite(hornPin,LOW); and I think it's working


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2532
 

@rclawn 

I goofed, good catch !

I'm glad it's working now.

By the way, you should probably change the TX sketch to set motor control spots 3-7 to zero (LOW) at the beginning of each loop, just to make sure that they're off when the loop starts.

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
(@rclawn)
Member
Joined: 2 years ago
Posts: 47
Topic starter  

@Will

@Robotbuilder

Bill@Dronebotshop

You People are soooo awesome

Thankyou very much. The Buf thing was very important.


   
ReplyQuote
(@rclawn)
Member
Joined: 2 years ago
Posts: 47
Topic starter  

@will I was looking at the button example sketch. either way I couldn't have done it without your work.


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2532
 

@rclawn 

Yeah, it's tricky when you first see it and try to wrap your head around the problem. It's annoying that something as simple as a button requires that much processing. But, once you understand the problem you're home free.

You'll find more problems with buttons as you progress.

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
Page 3 / 4