Use my laptop direc...
 
Notifications
Clear all

Use my laptop directly for GPIO interaction

12 Posts
6 Users
2 Likes
4,150 Views
 Amin
(@amin)
Member
Joined: 4 years ago
Posts: 5
Topic starter  

Not sure if this has been suggested but I was wondering if we can have a video where you show us how we can use our own personal computer (a laptop for example) to control things rather than write a program in some IDE on the laptop or desktop and then transfer it to another microprocessor for execution.  Is there a bank of GPIO that we can hook up to the USB port of the laptop where we can execute the sketch to control things directly?  After all, my laptop has 16GB of memory with at least two processors.    I'm writing the program (in my case C#) on my laptop anyway.  It would be nice if I we can eliminate the middle hardware and just have a bank of GPIO that I control directly from my laptop.  The vision here is that, right now you can buy a 7-inch display Windows 10 tablet very cheaply.  If I can have a bank of GPIO connected to that Windows 10 tablet, I just saved myself a bunch of time bread-boarding, hooking up LCD displays, worry about storage, wifi is included, Bluetooth is available, camera is already hooked up, etc.

Thanks.  Great videos! 


   
Quote
robotBuilder
(@robotbuilder)
Member
Joined: 5 years ago
Posts: 2042
 
Posted by: @amin  Is there a bank of GPIO that we can hook up to the USB port of the laptop where we can execute the sketch to control things directly? 

@amin

There are no direct access to ports but you can make your own GPIO virtual ports with hardware that plugs into a USB port of a computer and then write a set of functions such as OUT(PORT,DATA) and data = IN(PORT) to call from your own code written in c# or whatever language you choose.

I used the k8055 board in a robot project which enables you to program the hardware in your high level language of choice.

https://forum.dronebotworkshop.com/user-robot-projects/k8055-robot/#post-4101

I was working on making my own interface board using the Arduino and writing a set of i/o functions but haven't been able to muster up enough enthusiasm to finish the project.

 


   
ReplyQuote
byron
(@byron)
No Title
Joined: 5 years ago
Posts: 1121
 

@amin

It is possible to control the GPIO pins on a Rpi from another computer or PC.    You could get an inexpensive Rpi  and link it it via USB to your computer and control its GPIO pins from a program running on your PC.   You may need to do some googling as to what is possible for you and I suspect you will find the example are all in Python.   I quote from the Rpi GPIO Zero documentation as shown on the recent DroneBot Workshop article below:

****

4. Configuring Remote GPIO

GPIO Zero supports a number of different pin implementations (low-level pin libraries which deal with the GPIO pins directly). By default, the RPi.GPIO library is used (assuming it is installed on your system), but you can optionally specify one to use. For more information, see the API - Pinsdocumentation page.

One of the pin libraries supported, pigpio, provides the ability to control GPIO pins remotely over the network, which means you can use GPIO Zero to control devices connected to a Raspberry Pi on the network. You can do this from another Raspberry Pi, or even from a PC.

See the Remote GPIO Recipes page for examples on how remote pins can be used.

*****

Alternatively you could get a GPIO board for your PC - see this link

https://uk.pi-supply.com/products/ryanteck-rtk-gpio-pc-gpio-interface

However why get a Ryanteck PC GPIO board when you could get a Rpi Zero board for similar money and control the Rpi's gpio with a computer, and have a Rpi Zero to use on its own if you want to.

 

 


   
ReplyQuote
 Amin
(@amin)
Member
Joined: 4 years ago
Posts: 5
Topic starter  

Thank you.  Found this and it seems interesting.  

https://numato.com/product/32-channel-usb-gpio-module-with-analog-inputs


   
ReplyQuote
talamasca
(@talamasca)
Member
Joined: 4 years ago
Posts: 9
 

how about sshing into the rpi? or curl into a wemos board. that's how i turn on my relays. i don't touch the wemos webpage. just curl onto the page of the process that i want it to execute. like setting the relay high or low.


   
ReplyQuote
Robo Pi
(@robo-pi)
Robotics Engineer
Joined: 5 years ago
Posts: 1669
 
Posted by: @amin

Thank you.  Found this and it seems interesting.  

That board seems a bit pricey to me.  Couldn't you just use an Arduino and leave it connected to the computer via the USB serial port?   Then you could just send your commands to the Arduino board.  I don't see where that would be much different.  And you can obtain an Arduino for a lot less than $44.00.

DroneBot Workshop Robotics Engineer
James


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

@robo-pi

The board just seems to be a modern version of the k8055 board I was using.

You would need a mega to match it in terms of i/o.  Also if you used an Arduino board (which is what I was doing) you have to write your own interface protocol for the language you are using on the pc and for the Arduino to send commands,

#Send "adc read" command
serPort.write("adc read "+ str(analogChannel) + "\r")

and input data from the board.

response = serPort.read(25)
print response[10:-3]

The advantage of making your own pc i/o board using an Arduino is you can tailor it to your specific needs.

 


   
Amin reacted
ReplyQuote
Robo Pi
(@robo-pi)
Robotics Engineer
Joined: 5 years ago
Posts: 1669
 
Posted by: @casey

You would need a mega to match it in terms of i/o

I was actually thinking of a Mega looking at the picture.  However using 74HC595 shift registers would allow any Arduino to be used.   In fact, I just ordered a bunch of ATtiny13 chips.  Just because they are small and cheap.  They look like they might be fun to play with.  In any case even with those my first thought was to extend their I/O capabilities with shift registers.

Posted by: @casey

The advantage of making your own pc i/o board using an Arduino is you can tailor it to your specific needs.

That's my thoughts as well.  But then again I'm not clear on how the board that was linked to would be interfaced.  If you need to write your own programs to control it, then there's probably not much of a limitation to it.  You're just basically turning things on and off. The power would be in the program you write on the PC.

In any case, the board looks pretty nice.  Just a bit pricey I think.  But then again it does come with nice connectors. ? 

Although it appears all the GPIOs are TTL or 3.3v signals anyway.  So if a person is going to control anything hefty they're going to need to add additional drivers.  In other words, the hefty connectors aren't going to do a whole lot as additional drivers are going to be required anyway.

It seems to me that I've seen I/O boards with hefty relays on them for that price.   I don't see any relays on that board.  For 44 bucks I think they should include some relays.

DroneBot Workshop Robotics Engineer
James


   
Amin reacted
ReplyQuote
 Amin
(@amin)
Member
Joined: 4 years ago
Posts: 5
Topic starter  

@robo-pi

I agree with you and thank you for your feedback.  While i love Arduino (thanks to Bill's videos to spark my interest), for this project, I'm trying to save time.  It's not just one or two things. For this project, I need to have a good display and I need to have a camera.  Then I need  a bit of disk storage.  Power and charging is another consideration.  So I figured a Windows 10 tablet is the fastest way to go with a bank of GPIO.  Plus, I'm mostly a software guy these days...you don't want me to fix your toaster, believe me.  


   
ReplyQuote
Robo Pi
(@robo-pi)
Robotics Engineer
Joined: 5 years ago
Posts: 1669
 
Posted by: @amin

Plus, I'm mostly a software guy these days...you don't want me to fix your toaster, believe me. 

That's cool. ? 

A product like that board might be just the ticket for your needs.   You'll have to forgive me.  I have a ton of Arduino boards laying around, and I know how to use them.  I'm thinking of having a card made up:

~~~ "Have Arduino, Will Travel" ~~~

I'm an Arduino glutton.  When I first got into Arduino I refused to pay $25 for the real thing.  So I ordered 10 of them from China for only $6 a piece.  I figured I'd like to have 10 of them laying around to play with.  That's was $60 instead of $250.   Big difference. ?

Moreover, the company I ordered them from made a mistake on the order.  Two days after I got the package of 10 I received a second package of 10 more from the same company!  I checked my credit card and no additional charges had been made.  So I ended up with 20 UNOs for $3 a piece.

And I've almost gone through all of them!  Not that I'm burning them up mind you.  They all still work and I haven't had any problems with any of them.   I just have that many different projects laying around.  It's nice to be able to build projects and not have to take them back apart to start a new one.

And as if this wasn't bad enough I've been ordering Mega's quite regularly for several months now.  Every time I make an order from China I tack on a $7 Mega board just for fun.  So I've been collecting those as well. ? 

But wait, I'm not anywhere near done yet.   I've also been ordering Blue Pills and Black Pills at 10 pieces each order to.  So I have several dozen of those boards that I've been playing with too.

You might wonder what I could possibly do with all these microcontrollers.  But trust me, they are being used pretty quickly.   I just can't seem to get enough microcontrollers.

Oh yeah, and then there's the Raspberry Pies.  I won't go into that.  But let's just say I have enough pies to start a bakery shop.

And then there's the Jetson Nanos too!  I must be a microcontroller freak.   I think I'm trying to make up for when I was a kid and couldn't afford to buy all this stuff. ? 

Although I still really can't afford it.   The Jetson Nanos have been the biggest ticket item.  Don't believe the $99 baloney.  More like $350 by the time you buy all the useful accessories.

DroneBot Workshop Robotics Engineer
James


   
ReplyQuote
Spyder
(@spyder)
Member
Joined: 5 years ago
Posts: 846

   
ReplyQuote
Robo Pi
(@robo-pi)
Robotics Engineer
Joined: 5 years ago
Posts: 1669
 
Posted by: @spyder

@amin @robo-pi

https://uk.pi-supply.com/products/ryanteck-rtk-gpio-pc-gpio-interface?_pos=1&_sid=c9b28c976&_ss=r

$15.37 USD

A much more realistic price. ?   Still pretty steep compared to what I've been paying for Arduinos. ? 

They have one answered question on their products page and apparently have a support email address too.  So that's nice.   This board doesn't look quite as nice as the $44 board.  But it probably provides the same functionality.   In either case relays are going to be needed if the board is expected to turn any actual lights or appliances on and off.

 

DroneBot Workshop Robotics Engineer
James


   
ReplyQuote