Getting started with pyBoard & electronics
Getting started with pyBoard & electronics
Hi All,
I hope this is the right place, I purchased a Pyboard when they first came out, originally my employer was interested in using the board for RFID/Bluetooth purposes but went with a off the shelf solution.
I came up with a little project for myself of building a robot utilising servo motors to drive wheels and IR sensors to detect obstacles, now my only problem is I have never done anything electrical before. I haven't ever used GPIO Pins, used a soldering iron, built a circuit, or even touched a breadboard so I'm a total noob in this dept.
Is there any recommended tutorials/books to get me going to learn about what all the different pins mean and how to utilise them without blowing something up or frying my board? I have been loaned a breadboard and an LCD screen from a friend, I'll try and post a picture tomorrow to see if anyone can identify the model as I cannot see any names/serials.
My first idea is to order a soldering iron and solder on female headers to enable me to start playing about, any objections?
Thanks
HLA91
I hope this is the right place, I purchased a Pyboard when they first came out, originally my employer was interested in using the board for RFID/Bluetooth purposes but went with a off the shelf solution.
I came up with a little project for myself of building a robot utilising servo motors to drive wheels and IR sensors to detect obstacles, now my only problem is I have never done anything electrical before. I haven't ever used GPIO Pins, used a soldering iron, built a circuit, or even touched a breadboard so I'm a total noob in this dept.
Is there any recommended tutorials/books to get me going to learn about what all the different pins mean and how to utilise them without blowing something up or frying my board? I have been loaned a breadboard and an LCD screen from a friend, I'll try and post a picture tomorrow to see if anyone can identify the model as I cannot see any names/serials.
My first idea is to order a soldering iron and solder on female headers to enable me to start playing about, any objections?
Thanks
HLA91
Re: Getting started with pyBoard & electronics
Soldering on female headers is certainly a good idea.
I'd recommend you find your local hackspace, where you'll probably find someone who can help.
Be very careful with boards which only support 3.3v - don't feed 5v into the inputs, otherwise you may let the "magic smoke" out i.e. destroy your chip.
For inputs, always put a big(ish) resistor, say 1k, in series with a digital input especially if you're not 100% sure it's the correct pin.
Mark
I'd recommend you find your local hackspace, where you'll probably find someone who can help.
Be very careful with boards which only support 3.3v - don't feed 5v into the inputs, otherwise you may let the "magic smoke" out i.e. destroy your chip.
For inputs, always put a big(ish) resistor, say 1k, in series with a digital input especially if you're not 100% sure it's the correct pin.
Mark
Re: Getting started with pyBoard & electronics
I have just ordered some resistors so once they arrive I can start playing a bit more. I have found an online guide teaching me how to use a breadboard and a Raspberry Pi so I'm going to try and work out how to use the PyBoard in place of the Pi. Out of interest I have a led screen being loaned to me does anyone know if it will work with my PyBoard.
Sent from my iPhone using Tapatalk
Sent from my iPhone using Tapatalk
Re: Getting started with pyBoard & electronics
The LCD itself looks like one of the HD44780 ones.
I have code for driving those using gpio, or a couple of different I2C backpacks.
https://github.com/dhylands/python_lcd/tree/master/lcd
I'm not familiar with the backpack on your LCD, so I don't know if it will work or not. The markings tend to indicate that its a serial (i.e. UART) based interface.
I have code for driving those using gpio, or a couple of different I2C backpacks.
https://github.com/dhylands/python_lcd/tree/master/lcd
I'm not familiar with the backpack on your LCD, so I don't know if it will work or not. The markings tend to indicate that its a serial (i.e. UART) based interface.
Re: Getting started with pyBoard & electronics
Thanks for the replies, much appreciated. After purchasing some resistors I finally actually did something with my PyBoard last night and hooked up an LED via a breadboard I'm quite proud of myself at this little achievement.
One thing that has confused me though, I had a wire going from X1 -> resistor -> Anode of LED, and from the Cathode of the LED straight to GND, yet on another diagram I've seen they suggest putting the resistor on the cathode side of the LED ? Does it make any difference when side the resistor goes?
Is there a good way of learning what each Pin on the board actually does in simple terms that I would understand?
Thanks again
HLA91
One thing that has confused me though, I had a wire going from X1 -> resistor -> Anode of LED, and from the Cathode of the LED straight to GND, yet on another diagram I've seen they suggest putting the resistor on the cathode side of the LED ? Does it make any difference when side the resistor goes?
Is there a good way of learning what each Pin on the board actually does in simple terms that I would understand?
Thanks again
HLA91
Re: Getting started with pyBoard & electronics
Which side the resistor goes on doesn't make any difference.
Here's a good thread which provides some introduction to some of the common functionality you'll find (SPI, I2C, UART).
http://electronics.stackexchange.com/qu ... -how-do-th
Here's a good thread which provides some introduction to some of the common functionality you'll find (SPI, I2C, UART).
http://electronics.stackexchange.com/qu ... -how-do-th
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: Getting started with pyBoard & electronics
The link seems to have wound up in /dev/nulldhylands wrote:... Here's a good thread which provides some introduction to some of the common functionality you'll find (SPI, I2C, UART).
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: Getting started with pyBoard & electronics
Thanks - I went back and edited my post and added the link.pythoncoder wrote:The link seems to have wound up in /dev/nulldhylands wrote:... Here's a good thread which provides some introduction to some of the common functionality you'll find (SPI, I2C, UART).
Stupid computers still do what I say, not I what I want
Re: Getting started with pyBoard & electronics
Thanks for the link, I had a read and it all makes a bit more sense to me now. My next question is, I have a Obstacle Avoidance IR sensor with 3 pins, GND, VCC & OUT. Now I read the pin sheet and I figured the VCC should go to the 3V3 pin, as the sensor can take from 3.3->5 [so I don't need a resistor I assume], I connected the GND to the GND on the PyBoard, now my next move is to connect the OUT, now am I right in thinking I can use any of the Yellow labled X or Y pins shown here?
Also, once I've got the OUT connected to a pin [i.e. X2] I could use the code
in a loop to continually read the input, or at least notify my of a change?
Thanks
Also, once I've got the OUT connected to a pin [i.e. X2] I could use the code
Code: Select all
p_in = Pin('X2', Pin.IN, Pin.PULL_UP)
p_in.value() # get value, 0 or 1
Thanks
Re: Getting started with pyBoard & electronics
If it's a digital output from the IR Sensor, then you can use any of the yellow pins.
Your code snippet looks ok to me (I didn't test it to see if something subtle was missing).
You can use ExtInt to detect when a pin changes without having to poll.
http://docs.micropython.org/en/latest/p ... xtInt.html
Here's an example that uses the switch as the input:
https://github.com/dhylands/upy-example ... _toggle.py
Your code snippet looks ok to me (I didn't test it to see if something subtle was missing).
You can use ExtInt to detect when a pin changes without having to poll.
http://docs.micropython.org/en/latest/p ... xtInt.html
Here's an example that uses the switch as the input:
https://github.com/dhylands/upy-example ... _toggle.py