|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools |
Rating:
|
Display Modes |
|
|
|
#1
|
||||
|
||||
|
Re: Arduino + Ethernet Shield Help
Quote:
I deleted my post above because it was going off on a tangent of it's own. http://www.amazon.com/SainSmart-8-Ch.../dp/B0057OC5WK The PCB layout image at your Amazon link says something like: Code:
Input control signal LOW state current: 2.5V at 0.1mA 3.3V at 0.18mA 5V at 0.35mA Look at the specification sheets for the Atmel AVR chips in question and this link: http://forums.adafruit.com/viewtopic.php?f=24&t=17802 Here's the thing....it seems unlikely that board uses so little control current as it appears that the input goes through a resistor into the opto-isolator if you look at the blurry schematic. From the pictures that board appears to have 817C opto-isolators (the close up shows B1312 and 817C). The datasheet for that is likely here: http://www.futurlec.com/LED/PC817.shtml That part lists 50mA maximum forward current and is setup for a nominal 20mA current. I suspect having thought about this that the numbers as shown on the layout provided are wrong. How does one operate a 20mA LED with 20x less current and expect that to work? So either I am wrong and those transistors are the buffer or there is no buffer and those specifications are wrong. 1. Wire that thing up. 2. Disconnect the Arduino. 3. Take a DC ammeter or a suitably configured DMM and measure the current when you close the circuit between one control input pin and the system ground. If that current exceeds 30mA you do not want to drive it with the Arduino directly. I suspect the inputs source more than that which is why the reviewers are complaining they can only turn on 5 with the Raspberry Pi. The safe bet here, given how easy it is to test, is to test this. If the measured current exceeds say 30mA greatly then drive the 8 relays with a ULN2803 (8 Darlington transistors) or 8 discrete transistors. Just remember to account for the junction voltage drops. If the measured current is between 30mA and 40mA look at the TTL 7407 or 7417 chips. Just keep in mind that TTL 7417s are rarely available from any company except Texas Instruments. 7407, 74LS07 and even 74HC07 (open-drain CMOS equivalent) are a bit easier to find these days. If the measured current is around 20mA or less then it should be fine but just remember 20mA x 8 circuits = 160mA. If you make all 8 Arduino outputs low then that 160mA will consume a large portion of total maximum drive the chip can handle. So be careful about what, besides that board, you put on there while it's like that. If the potential for 160mA concerns you, then again, look at the 7407 because that will dramatically reduce the current demand on the Arduino (roughly 1/60 the current for all 8 circuits). Last edited by techhelpbb : 01-08-2013 at 01:03. |
|
#2
|
||||
|
||||
|
Re: Arduino + Ethernet Shield Help
Back to the code, what do you get printed on the serial port when you press the buttons?
|
|
#3
|
|||||
|
|||||
|
Re: Arduino + Ethernet Shield Help
Quote:
... Alright testing now. Accessed the webpage, serial printed... Code:
HTTP favicon.i,, Prints the same. No LED. Pressing "Off" Same thing. And no LED. When I press the buttons, the TX and RX leds blink on both the ethernet shield and the R3, and an LED I connected to pin 13 (it is not in the code though, it's just there to show me if the Arduino LED blinks) gets a little bit brighter when the TX and RX leds blink. Last edited by jwallace15 : 01-08-2013 at 11:14. |
|
#4
|
||||
|
||||
|
Re: Arduino + Ethernet Shield Help
Quote:
What voltage and current is the power source rated for? Are you using the USB port for power? The potential code issues aside make sure that you are not fooling yourself by powering that assembly with a power source that is not sufficient. |
|
#5
|
|||||
|
|||||
|
Re: Arduino + Ethernet Shield Help
Quote:
I know that it is sufficient, I recently made a sketch with my MEGA that had 15+ LED's that would scroll in a marquee and the delay could be adjusted from a trim pot (all the way down to a ~10ms delay). I also ran a servo off of the mega while doing that, and 3 more trim pots that could adjust the colour of an RGB LED. |
|
#6
|
|||
|
|||
|
Re: Arduino + Ethernet Shield Help
Can you add some print statements after the conditional logic steps in your code, and tell us what they give you?
I wonder if favicon.i is an icon? I hope not, because that would not make any sense. It's good to see another person that loves trains. Last edited by daniel_dsouza : 01-08-2013 at 12:14. Reason: i like trains |
|
#7
|
|||||
|
|||||
|
Re: Arduino + Ethernet Shield Help
Quote:
and say the led is off if the Off button is pressed? EDIT: ^ I added that sort of statement and when I press either the on of off buttons nothing is printed. ![]() http://www.chiefdelphi.com/forums/at...9&d=1346106255 (as of last year. Much has changed since then. MUCH.) Last edited by jwallace15 : 01-08-2013 at 12:34. |
|
#8
|
||||
|
||||
|
Re: Arduino + Ethernet Shield Help
I put my Arduino Ethernet Shield R3 onto my Arduino Duo R3.
I cut a network cable in half. Made an ethernet 'cross-over cable' like so: Orange/White (one half) - Green/White (the other half) White/Orange (one half) - White/Green (the other half) Vice-versa I used Scotch Tape as an insulator after twisting wires together. MacGyvering during lunch....check. Good thing that was a high quality dollar store cable ($1.34). I put my 'cross-over cable' into my laptop (Dell E6400...yes I have several laptops) ethernet port. I put the other end into the Arduino Ethernet Shield. I disabled IPV6 (blah) on my laptop wired ethernet interface. Set my wired connection in Windows 7 to: 192.168.1.131 Looked at the supplied code and it uses: 192.168.1.130 Set the gateway as: 192.168.1.1 Set the netmask to: 255.255.255.0 Loaded up your stored page in Firefox. Regardless of what webpage button I press (On/Off) I get "HTTP" out the serial monitor. When I get a chance I'll check the output pins. However I do not get this: Care to clarify if you are using Internet Exploder....I mean Internet Explorer ![]() I have version 1.05 stable of the Arduino software. Last edited by techhelpbb : 01-08-2013 at 14:48. |
|
#9
|
|||||
|
|||||
|
Re: Arduino + Ethernet Shield Help
Nope, Chrome. I openly admitted to using IE at robotics last year and recieved a major lashing for such blasphemy. Then I downloaded Chrome.
|
|
#10
|
||||
|
||||
|
Re: Arduino + Ethernet Shield Help
I only get the 'favicon.i' if the serial monitor is open when the board first connects. Other than that just "HTTP" out of the serial monitor.
It did not appear on my DMM that either pin 7 or 8 was toggling with the webpage button presses (not sure if it's one or zero oriented). Will look into it more later. What I suspect is wrong here is that: 1. If you look there is only one call to serial to output from this code. 2. What you should see is what is in the buffer. 3. When you alter the form it fires a POST event. 4. That should cause the page to reload (with the same content). 5. During that post event parameters follow. 6. We both only see "HTTP". 7. However this is a POST so look at this link: http://www.jmarshall.com/easy/http/#postmethod (Link altered to something more related and friendly) 8. Therefore when the code reloads and tries to parse these parameters...it can not find what is not in the buffer. 9. Therefore the page simply reloads but does not change the pins (it thinks it's the first time you loaded it). 10. This *might* have worked for someone at some point but this is likely time sensitive. 11. The browser is doing all the work to display the HTML form. 12. When the browser toggles something it's just a silly drawing to the browser. 13. Even if this was a slider (it's a button) it would likely slide as you might expect. 14. Even if the browser does not successfully communicate the change it will tend to draw the changes. 15. HTTP is stateless so unless you put something more intelligent like Javascript in there you can't ask the browser after the fact what happened without another HTML form submission. 16. If your HTML forms never send valid data you are trapped in a vicious loop where things *appear* to be happening. This is a typical problem for web applications of any sort. Often form submissions recall the same code and that code needs to get parameters (either GET or POST). If that code does not get parameters HTTP is stateless so it thinks you were *never there before*. So since I am not the student here ![]() Put a serial print statement *inside* the conditional that toggles the pin. See if it ever prints. You sort of did this already above just put *only* the print statement not any additional conditionals. Then we can go from there. BTW when was this book you have written? Look at the copyright date. It's this book right: http://shop.oreilly.com/product/9780596802486.do Whistles innocently: https://bugzilla.mozilla.org/show_bug.cgi?id=260500 Last edited by techhelpbb : 02-08-2013 at 00:54. |
|
#11
|
|||||
|
|||||
|
Re: Arduino + Ethernet Shield Help
Quote:
|
|
#12
|
||||
|
||||
|
Re: Arduino + Ethernet Shield Help
Try my suggestion above.
In the conditional already in the example code just try to print anything out the serial port. Things change and when someone writes a *tiny* webserver they sometimes forget that they control the part they write. They do not control the browser part that is written by someone to whom they have no immediate contact. So let's think about this: What happens when the browser part does something different then it did before? How does the example written in a hard copy book evolve when the authors and editors of the book can't predict the future? It doesn't. This code is obsolete (for people with current browsers) but it's actually not terribly hard to fix it. So let's do this step by step. Start with my request above. Tell us if you ever see that line print. Last edited by techhelpbb : 01-08-2013 at 18:01. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|