User stocky6409 - Chiphacker most recent 30 from http://chiphacker.com 2010-08-01T09:10:58Z http://chiphacker.com/feeds/user/503 http://www.creativecommons.org/licenses/by-nc/2.5/rdf http://chiphacker.com/questions/1742/flyback-protection-for-a-dc-latching-soelnoid Flyback protection for a dc latching soelnoid? Stocky6409 2010-03-05T05:28:33Z 2010-03-05T12:36:01Z <p>Hi Guys n Gals,</p> <p>I'm looking for a solution for "flyback" protection when driving a 2 wire DC latching solenoid. You cant use the traditional diode solution as the polarity of the coil is reversed to open or close the solenoid.</p> <p>My cct uses two relays to switch the solenoid - the first (SPST) applies power to the second relays contacts (DPDT) which does the polarity reversal for the power to the solenoid coil.</p> <p>Of course my relay coils already have conventional flyback diodes connected - what i'm looking to protect against is the back EMF from the actual solenoid coil itself.</p> <p>Ideas?</p> <p>Stocky</p> http://chiphacker.com/questions/1537/newbie-code-query-arduino-ds18b20/1542#1542 Answer by Stocky6409 for newbie code query => Arduino & DS18B20 Stocky6409 2010-01-28T05:56:46Z 2010-01-28T05:56:46Z <p>Thanks all who contributed. My code works and I have learnt about hardware serial, rf comms, software serial, cast, floats, serial LCD and dallas onewire all in 2 days :-)</p> http://chiphacker.com/questions/1537/newbie-code-query-arduino-ds18b20 newbie code query => Arduino & DS18B20 Stocky6409 2010-01-27T07:49:32Z 2010-01-28T05:56:46Z <p>Hi all - been using picaxe for a few years but now playign with arduino and trying to learn how it all works.</p> <p>I have a couple of arduinos talking via the HOPERF library successfully and now want to send some meaningful data over the link.</p> <p>I have the code for the DS18B20 running on the client aurduino and "printing" the temp value to the PC via USB but just not sure how to get it into the HOPERF commands to send over the RF. Here is a bit of the code. The 2nd line is where the data is sent over the HOPERF. What i need to do is replace the string "test" with the data returned by the (sensors.getTebyCByIndex(0)) command from the 4th line.</p> <pre><code>sensors.requestTemperatures(); // Send the command to get temperatures client.sendto(11, (uint8_t*)"test\n", 6); // Includes the NUL at the end of the string Serial.print("sending\n"); Serial.print(sensors.getTempCByIndex(0)); //prints the temp value over the USB </code></pre> <p>Any clues anyone?? I prefer to learn but doing stuff like this - and yes i did do the "BLINK" thing first! I find doing something i find useful helps me learn faster :-)</p> <p>I am struggling a bit with working out the docs as there doesnt seem to be a nice "manual" liek the picaxes to follow :-(</p> http://chiphacker.com/questions/1742/flyback-protection-for-a-dc-latching-soelnoid/1744#1744 Comment by Stocky6409 Stocky6409 2010-03-05T10:49:19Z 2010-03-05T10:49:19Z So to clarify your &quot;back to back - series connected&quot; comment: does that mean both cathodes together with anodes to each solenoid terminal? OR 2 zeners in parallel A to K and one junction to each solenoid terminal? http://chiphacker.com/questions/1742/flyback-protection-for-a-dc-latching-soelnoid/1744#1744 Comment by Stocky6409 Stocky6409 2010-03-05T10:47:29Z 2010-03-05T10:47:29Z Cheers - i think i have some suitable zeners on hand - will look in the morning. Thanks http://chiphacker.com/questions/1742/flyback-protection-for-a-dc-latching-soelnoid Comment by Stocky6409 Stocky6409 2010-03-05T10:46:45Z 2010-03-05T10:46:45Z because i had suitable relays and not suitable transistors :-) The original cct i am using drove a 2 wire dc motor operated valve which only needed power in one polarity or the other for 1-2 seconds to change state. The solenoid is similar in that it only needs a short pulse of one polarity or the other to change state. It was deemed quicker to adapt the current cct that wait for parts to do something differnt. http://chiphacker.com/questions/1537/newbie-code-query-arduino-ds18b20/1540#1540 Comment by Stocky6409 Stocky6409 2010-01-28T05:55:03Z 2010-01-28T05:55:03Z .....and after a tidy-up saved over 700bytes to boot :-) http://chiphacker.com/questions/1537/newbie-code-query-arduino-ds18b20/1539#1539 Comment by Stocky6409 Stocky6409 2010-01-28T05:54:02Z 2010-01-28T05:54:02Z Downloaded........... http://chiphacker.com/questions/1537/newbie-code-query-arduino-ds18b20/1540#1540 Comment by Stocky6409 Stocky6409 2010-01-28T04:12:04Z 2010-01-28T04:12:04Z Working! Codes not pretty but it works :-) Thanks again! http://chiphacker.com/questions/1537/newbie-code-query-arduino-ds18b20/1540#1540 Comment by Stocky6409 Stocky6409 2010-01-28T01:45:53Z 2010-01-28T01:45:53Z YAY - many thanks! With a little bit of adjustment I got that to work properly. I now have my temp to 2 decimal places being sent over the RF and displayed in the serial monitor window. I'm also using SoftwareSerial to display data on an LCD. using LCD.print(tempC) gives an error even though serial.print(tempC) works fine. I had a read of the SoftwareSerial library page and changed the line to LCD.print(tempC, DEC) which works but only gives me the whole part of the temp whereas the serial.print gives me the whole plus decimal. I'll keep reading to see if I can sort it out :-) Many thanks! http://chiphacker.com/questions/1537/newbie-code-query-arduino-ds18b20/1538#1538 Comment by Stocky6409 Stocky6409 2010-01-27T20:38:48Z 2010-01-27T20:38:48Z Thank you for the extra description - some of this is starting to make sense now :-) http://chiphacker.com/questions/1537/newbie-code-query-arduino-ds18b20/1540#1540 Comment by Stocky6409 Stocky6409 2010-01-27T20:38:02Z 2010-01-27T20:38:02Z Thanks - that looks like it should work. Its sort of what i expected it to be but as I'm still getting my head around the program structures (being ex BASIC) i just couldn't work it out. I'll give it bash this morning and see what results i get - thank you! :-) http://chiphacker.com/questions/1537/newbie-code-query-arduino-ds18b20/1539#1539 Comment by Stocky6409 Stocky6409 2010-01-27T20:35:57Z 2010-01-27T20:35:57Z I've been trying to learn on PC - brain too stuck in the world of Basic! I've actually learnt more about &quot;C - like&quot; programming in a week of Arduino than months trying to work it our on the PC. I'm just weird sorry :P Thanks for the link - I'll have a look anyway http://chiphacker.com/questions/1537/newbie-code-query-arduino-ds18b20 Comment by Stocky6409 Stocky6409 2010-01-27T11:34:02Z 2010-01-27T11:34:02Z libraries used are HOPERF &amp; DallasTemperature http://chiphacker.com/questions/1537/newbie-code-query-arduino-ds18b20/1538#1538 Comment by Stocky6409 Stocky6409 2010-01-27T11:22:06Z 2010-01-27T11:22:06Z so if what i am getting returned is a &quot;float&quot; (floating point number????) is there some way I can convert it into a string?? I tried putting the (sensor.getTempCByIndex) command into the client.sendto() without any luck - i just got errors about &quot;cast&quot; that i simple dont understand yet :-( http://chiphacker.com/questions/1537/newbie-code-query-arduino-ds18b20/1538#1538 Comment by Stocky6409 Stocky6409 2010-01-27T11:20:14Z 2010-01-27T11:20:14Z sensors.getTempCByIndex returns a value of XX.xx in degreesC You lost me on the the rest - still trying to get my head around &quot;cast&quot; &quot;Float&quot; and all these other unfamiliar terms (i'm from a BASIC background - sorry!)