User avatar
HomoFaciens
Posts: 42
Joined: Wed Jan 25, 2012 9:19 pm
Location: Hessen, Germany
Contact: Website

I/O board of my video

Tue Aug 14, 2012 8:24 am

Many asked for it, here is the result:
http://www.homofaciens.de/technics-comp ... navion.htm

Note the warning section of the page!

...and always remember this is not a Gertboard, it's a quick and dirty layout!

I have opened a new topic, because I am waiting for your questions, remarks, hints and feedback.


:D

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

Re: I/O board of my video

Tue Aug 14, 2012 11:29 am

Love it :)
The connection between Raspberry Pi and board is done by half of an old SCSI cable. Unfortunately there is no mechanical protection against faulty plugging of the cable at the Raspberry. What can go wrong... but my Raspberry survived, because of the 16kΩ series resistors!
Is one of the best bits of advice for DIY newbies :)

Also, DAC - H-Bridge etc etc :)

Simon
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

User avatar
liz
Raspberry Pi Foundation Employee & Forum Moderator
Raspberry Pi Foundation Employee & Forum Moderator
Posts: 5212
Joined: Thu Jul 28, 2011 7:22 pm
Contact: Website

Re: I/O board of my video

Tue Aug 14, 2012 11:45 am

Oh - VERY nice. Thank you - I'll add it to the video post and let the Twitter hoards know about it!
Director of Communications, Raspberry Pi

Ravenous
Posts: 1956
Joined: Fri Feb 24, 2012 1:01 pm
Location: UK

Re: I/O board of my video

Tue Aug 14, 2012 2:00 pm

Great piece of work - not just in building the board, but in writing it up in such a way that beginners can use it.

User avatar
Gert van Loo
Posts: 2487
Joined: Tue Aug 02, 2011 7:27 am
Contact: Website

Re: I/O board of my video

Tue Aug 14, 2012 8:09 pm

Where you write "frequency generator" I assume you mean "Digital to Analogue converter".

User avatar
HomoFaciens
Posts: 42
Joined: Wed Jan 25, 2012 9:19 pm
Location: Hessen, Germany
Contact: Website

Re: I/O board of my video

Thu Aug 16, 2012 5:40 am

Gert van Loo wrote:Where you write "frequency generator" I assume you mean "Digital to Analogue converter".
Yes, of course. I have introduced those fast switched DAC as "frequency generator" at the video, painting Lissajous figures. That's why I used the headline. I have pointed out that more clearly now.
Thanks for your hint.

malaclypsedj
Posts: 12
Joined: Sat Jan 19, 2013 3:41 pm

Re: I/O board of my video

Tue Jan 22, 2013 9:32 pm

HomoFaciens wrote:Many asked for it, here is the result:
http://www.homofaciens.de/technics-comp ... navion.htm
To HomoFaciens:
Thank you so much for this great document about building the I/O Board.
It’s really helpful to understand how to protect the PI.

The board will be my first “self soldered” experiment and it’s a good challenge to plan the layout, get into the data sheets and get into the calculations etc. I’m really impressed how HomoFaciens can manage to put so many components on that small board showed on his website.

The I/Os Board I plan to build will have less functions:

GPIO 0-7:
  • 8 small Transistor for 4 H-Bridges
    Or used as Input Pins as suggested
GPIO 8-15:
  • 8 Input’s for reading sensors only
Maybe someone could have a look at the layout and give his pinion if I’m going to do create a big piece of electronic trash :oops::

https://dl.dropbox.com/u/95408065/Raspb ... g_V0p1.png

Blue Lines will be soldering on the bottom of the board.
Other lines will be wired on Top.
Onyl one H-Bridge is connectet in drawing.

User avatar
HomoFaciens
Posts: 42
Joined: Wed Jan 25, 2012 9:19 pm
Location: Hessen, Germany
Contact: Website

Re: I/O board of my video

Wed Jan 23, 2013 8:22 am

Hi malaclypsedj,

thanks for all the compliments. The disadvantage of placing too many components on a single board is that the layout becomes confusing, so it was a wise decision to use fewer and make a clear layout.
In principle the wiring and soldering seems to be ok, assuming that the order of base, collector, emitter is from the left to the right at the transistors of the H bridges (type?).
I am a bit confused about the values of the resistors you are using (or probably I am mixing some colours like brown/orange). Could you add the values as text? The Zener diodes should be in the range of 2.7V to 3.0V. The input voltage of the sensors is also 12V?
The small signal transistors (I used MOSFET Type 2N7000) must be ON at a voltage of approximately 3.0V.
Keep in mind, that the H bridges are actuated by the input signals, when using the GPIO 0-7 as input and output! So disconnect the peripherals from the H bridges when using the GPIOs as input (what can go wrong will go wrong...).
The sensors must be connected to ground, too, so place a ground clamp on the board.

malaclypsedj
Posts: 12
Joined: Sat Jan 19, 2013 3:41 pm

Re: I/O board of my video

Wed Jan 23, 2013 8:02 pm

Thank you again for your additional help :mrgreen: . There is a layout updated with text on the dropbox:

https://dl.dropbox.com/u/95408065/Raspb ... g_V0p3.png

I use most components as suggested on your board (2N7000, IRF9Z34N, IRLZ24N, Zenner 3V, 500mw). I also tried the circuit on my breadboard and H-Bridges work very well.

I have some questions about the input Part:
Somehow I read in your documentation it’s ok to use R2 = 100K with a Z-Diode instead of R1.
If I try this on my bread board I get only 1,7V at GPIO, using 12V at the Sensor. I substitute R2 with 1K and using 12V Sensor Input I get 3,3V as I wish. Using a 220k Pull-Down makes no difference in both cases. I’m not sure jet about the sensors I will connect. Could be 5V or 12V. Maybe I need to make R2 changeable?

My thoughts about the R2 dimensions:
Using: 1k Resister (R2), 12V Sensorvoltage and max. 500mW allowed for the Zener-Diode
- > 12mA -> 12V x 12mA = 144mW
Questions1: Is 1K in principle ok (means are my calculations ok?)?

About the GPIO voltage needed:
Using 5V as Sensor Input I only get 2,6V at the GPIO.

Question 2: Are 2,6V enough to get a “True” at the Raspberry GPIO
I also have a question about the ground connection.
Is it fine, to connect ground from Raspberry with Ground from 12V power supply from the platine? Is there any protection necessary to prevent current caused by different ground levels?

Thanks alot in advance

User avatar
HomoFaciens
Posts: 42
Joined: Wed Jan 25, 2012 9:19 pm
Location: Hessen, Germany
Contact: Website

Re: I/O board of my video

Wed Jan 23, 2013 9:59 pm

The value of R2 depends on the current your sensor can provide 100k are very high (safety first) and I got a signal when operating my magnet-sensor with 12V. When you had the test run with your bread board, detecting just 1.7V: Were the GPIOs in input mode? If they were in output and switched to ground, the 1.7V would make sense to me. Remember there is a voltage divider between the 100k (R2) and the 16k series resistors connected to the GPIOs.
1k is in principle ok, but there is a higher current running when something is going wrong with the sensor voltage. The power dissipation at the Zener diodes is lower than 144mW, because the voltage across the diodes is just 3V (3V x 12mA = 36mW).
I had a test run with my Pi and the GPIOs detect a voltage of approximately 1.4V as true, so 2.6V should be ok.
You have to connect the ground of your Raspberry with those of the power supply and your sensors or else you will have different ground levels! The connection of the ground pins must be done without any resistors or something like that between the clamps. The protection is done by the resistors at the positive level (16k, GPIOs).

malaclypsedj
Posts: 12
Joined: Sat Jan 19, 2013 3:41 pm

Re: I/O board of my video

Fri Jan 25, 2013 11:25 am

The Raspberry was not connected while I tested the circuit. Just measured the between ground and GPIO PIN on the bread board. Today I changed 1K to 10K. Now is get 2.1V at GPIO using 5V at sensor and 2.5V using 10k. As far as your test run with 1.4V was ok as an Input, 2.1V should be fine if I use R2 = 10k.

Thanks again for helping me! I’m exited now. Soldering can be done by next week

An update about the results will be given (hopefully no magic smoke) :o

User avatar
HomoFaciens
Posts: 42
Joined: Wed Jan 25, 2012 9:19 pm
Location: Hessen, Germany
Contact: Website

Re: I/O board of my video

Fri Jan 25, 2013 12:27 pm

Yes, I confirmed that. It's because the resistance of a 3.0V Zener diode is decreasing clearly below 100k at a voltage of approximately 1.5V. The current-voltage characteristic isn't as steep as I expected - the layout of the board was done "on the fly".

There is a picture from Wikipedia illustrating the correlation:
Image

So a 10k resistor is required to reliably detect a "true" at a sensor voltage of just 5V.
I have added a remark on my homepage - thanks for your hint and good luck while creating your board!
I am waiting for your report.

malaclypsedj
Posts: 12
Joined: Sat Jan 19, 2013 3:41 pm

Re: I/O board of my video

Wed Jan 30, 2013 7:23 pm

Thank you for an additional lesson about the diode.

Weather was too great to do soldering work at the weekend, so my project slowed a little bit down. Now I did the first part of the soldering and connected all the inputs and LEDs. With the PI I can turn off and on all the LEDs using Transistor 2N7000.

There is only one mysterious behavior. Two of the LEDs don’t shine bright (very dark). All the others are bright and shining. Connection should be fine. Is it possible, that this two LED are half damaged because of too hot (or to long) soldering?

User avatar
HomoFaciens
Posts: 42
Joined: Wed Jan 25, 2012 9:19 pm
Location: Hessen, Germany
Contact: Website

Re: I/O board of my video

Wed Jan 30, 2013 8:43 pm

What about the voltage across the two dark LEDs?
I think it takes a really long time to damage an LED during soldering and if they are damaged they won't shine at all.
You could try to short the connection between source and drain at the two transistors (disconnect the Pi). If the LEDs start shining bright, the LEDs are O.K.
What about the voltage at the gate pins of the transistors?
Is the polarity of all Zener diodes correct and what about the values of all resistors?
And finally what about the voltage at the GPIOs?

malaclypsedj
Posts: 12
Joined: Sat Jan 19, 2013 3:41 pm

Re: I/O board of my video

Fri Feb 01, 2013 6:50 am

So this morning i try to find the problem. With your great advice i think i got a step forward:

1. I short the connection between source and drain at the transistor and the LED is bright and shining.

2. During this process I figured out that only one transistor really switch true (Measuring 0V between ground and drain) if gate is supplied by the pi:

GPIOs have 3.3 V if nothing is connected but 1.8 V if connected to the board.
Measuring ground to gate: 1.8V with all the not bright shining LEDs.
Measuring ground to gate with the bright shining LED: 3,3V.
Measuring ground to drain: 9-11 V with all the not bright shining LEDs (gate 1,8V) -> not ok.
Measuring ground to drain: 0 V with all the not bright shining LEDs (gate 3.3V) -> ok.

So back to my bread board I rebuild the circuit and figured out that there must something wrong with the Z-Diode. If I use the circuit as drawn (some post before) with Z-Diode parallel to the pull down (both between gate and ground) I see the bad behavior.

If i withdraw the Z-Diode from the circuit the transistor switch fully true and LED shine bright.
The black ring at the Z-Diode (cathode) is showing to gate, other side to ground. If I switch direction on the board, the circuit doesn’t work at all.

Do you have any idea?

User avatar
HomoFaciens
Posts: 42
Joined: Wed Jan 25, 2012 9:19 pm
Location: Hessen, Germany
Contact: Website

Re: I/O board of my video

Fri Feb 01, 2013 8:58 am

Yes, the black ring must point to the gate pin or else you won't get above 0.7V at the gate and the transistor will never turn ON.
So you have replaced those two "bad" zener diodes by new ones? Or did you use the same ones when building the circuit at your bread board?
You can test the zener diode by connecting the side with the ring to a resistor (between 1k and 10k). Now connect the other side of the Z-diode to the negative terminal of a voltage source and the other side of the resistor to the positive terminal (5V or 12V). It's a linear circuit of the diode and a resistor. Now the voltage drop at the zener diode must be around 3V.

malaclypsedj
Posts: 12
Joined: Sat Jan 19, 2013 3:41 pm

Re: I/O board of my video

Fri Feb 01, 2013 1:06 pm

On the bread board i use a new Z-Diode. I tested the Diode as suggested and came to following results:

Using 10k Resistor and the Diode in series and connect it with 12V I can measure 3 V between Diode and Ground on the brad board.

If I use 16k resistor and only 3.3V Supply (GPIO Output) as on the platine, then I measure 1.8V at the Diode on the bead board as well.

2N7000 needs worst case 3V voltage at the gate (Ugs).
Tolerance is 0.8V – 3V, this could explain the different LED brightness, some work, some not.
Do you think that’s could be the Problem?

If so, I think this could be options:
1. Substitute the 16k resistor with a lower one (min. 2k, to prevent current > 2mA)
-> I tested with 1.5k and got 2.2V -> to less for the transistor -> not an option
2. Substitute 2N7000 Transistor with one that needs less minimum gate voltage
-> I’m not sure about the right one. Any Idea? Using TO-92 would be great.
http://www.mikrocontroller.net/articles ... 9Cbersicht
3. Substitute the Z-Diode???

What do you think? I’m I complete wrong?

User avatar
HomoFaciens
Posts: 42
Joined: Wed Jan 25, 2012 9:19 pm
Location: Hessen, Germany
Contact: Website

Re: I/O board of my video

Fri Feb 01, 2013 4:01 pm

It's the same issue with the input voltage at the sensors: The current-voltage characteristic of the Zener diode is not as steep as expected. I used just three of the GPIOs as input and output (meaning there is a Z-diode between gate and source). Luckily (for me) they are turning fully on at a gate voltage of just 1.7V. So reducing the value of the series resistors from 16k (which is really high) to a lower value should fix the problem. I had a test run with a 2.7k resistor at the GPIOs resulting in a gate voltage of 2.2V which should be sufficient to turn the 2N700 on. Or replace the two "faulty" transistors by new ones who might turn on at the lower voltage because the are (hopefully) at the lower end of the tolerance.
I can't give you a recommendation for another type of n-channel MOSFET with a lower gate voltage in a rush. If I will find a suitable type some later I will give you a hint.
I added another remark at my homepage - thanks again for giving the feedback.

User avatar
HomoFaciens
Posts: 42
Joined: Wed Jan 25, 2012 9:19 pm
Location: Hessen, Germany
Contact: Website

Re: I/O board of my video

Fri Feb 01, 2013 5:02 pm

...or use an additional diode and alter the layout slightly:
Image

Now the current coming out of the GPIO is blocked from running through the zener diode by the second diode (a normal one). The voltage at the base of the 2N7000 should be 3V now.
When using the GPIO in input mode, the input voltage is reduced for approximately 0.7V caused by the second diode, so you should eventually reduce the value of R2 to just 3k when operating 5V sensors. The 3.0V zener diode should still do the job, but I suggest using 3.3V when building your next board.

I had another update at the project page.

malaclypsedj
Posts: 12
Joined: Sat Jan 19, 2013 3:41 pm

Re: I/O board of my video

Fri Feb 01, 2013 8:38 pm

I substitute 2N7000 with BSN10A (gate-source-threshold = 1.8V) and the board is working fine now. H-Bridges are working perfectly as well. I also tested one input switch and pi says true and false as it should do :D (even my sensor delivers only 4.5V).

The data sheet of BSN10A:
http://www.produktinfo.conrad.com/daten ... BSN10A.pdf

I might do some documentation about the board layout. If you or anyone else interested in the layout I can provide it after some corrections are done.

So thank you so much for all your advice and help!!! I also want to try your new idea with the second diode soon.

User avatar
HomoFaciens
Posts: 42
Joined: Wed Jan 25, 2012 9:19 pm
Location: Hessen, Germany
Contact: Website

Re: I/O board of my video

Tue Feb 19, 2013 8:18 pm

I substitute 2N7000 with BSN10A (gate-source-threshold = 1.8V) and the board is working fine now. H-Bridges are working perfectly as well.
I have ordered some BSN10A to test those MOSFETs- thanks for the hint.

The chapter about H bridges at my project page is online:
http://www.homofaciens.de/technics-base ... navion.htm

...just to make you see, that the H bridges at my I/O board are indeed not perfect. So use them with care concerning shoot-through and the missing flyback diodes.

Return to “Automation, sensing and robotics”