-
-
I've got the following code from the tutorial running
But the function is being called when my finger is very close, but not yet touching, the shield around the pico button
It gets called when I touch any of the pads on the back of the pico
I can touch pretty much anywhere else w/no effect
I thought this was very strange, so I tried this on another pico that had 1v80 and it did not do this - then I flashed that pico to 1v86 and it shows the problem
setWatch(function(e) { digitalWrite(LED1, e.state); console.log('btn',e.state); }, BTN, { repeat: true });
-
-
-
This is great !! I'll report back in a week or so as to how well it worked out !!
Pico has become my absolute go-to computer for all hardware stuff.
I've ditched all my Arduino's -- I tried a Tessel2, but it's actually running OpenWRT and just executes the Javascript, might as well be a Pi or something with a real OS
Thanks!!
-
Can I talk to the computer that I am plugged into over the USB connection?
I have to make a motion sensor that can be 'noticed' by a webpage on a kiosk
I say 'noticed' because the webpage doesn't need to know how much motion there is, just that some has been seen. I am the one writing the webpage so I can do anything I need there
I won't have a wi-fi network, and the Ethernet jack is in use already on the kiosk computer.
It would be so nice if I could tell that computer I am a mouse and that the mouse has moved.
-
-
-
Ah, let's all come to the same page: http://www.pretorianuk.com/j-pad
I have one of these, and the person I'm doing this for can't operate the joystick, I chose the device also because it has the option to attach external switches.
I want to make touch-pads so that I can close those [external switch] circuits programmatically.
Gordon, those optocouplers are gorgeous -- I saw something like them in my searching last night but couldn't figure out if I could drive them from the pico as they didn't seem to mention Volts... Those mention 6v but in ways that I don't understand, and I don't know what your reference to 50mA means, the pico has 250mA to spread around so I'll have enough to drive these? Or I'll fry them unless I add a resistor? Anyway I'll grab some and see if I can make them work for me. I can swap the tip and ring on the external switch connections easily enough.
-
Tage, thanks for your concern. But I think there may be some confusion. I am not trying blindly to substitute relays to get rid of the problems with the EMI. I'll be decoupling the 5v DC power to try to finish accomplishing that. That being said, if you think the sain-smart relays were a bad choice to drive little 1&2 amp loads, I'd sure like to know what I might replace them with.
You do raise an interesting point tho' as my contraption does have wires coming out of it that are not intended to carry mains voltage. Are you are saying that if there was some arcing situation within the powerstrip that mains current could exit it via the signal wires and be available for contact? In that case I think I'd be lucky in that the pico would die and the circuit would then be unable to be closed by contact, yes?
In any case, would it be sufficient to place GFCI protection between the mains and my contraption? something like this: http://www.petsolutions.com/C/Aquarium-Power-Strips-Timers/I/GFCI-Outlet-Adapters.aspx (just to pick one that I found in a few moments searching.)
Now these other relays are for a different project, and I should have started a different thread. This other project has absolutely nothing to do with the mains.
The smaller relays that I'm looking at are to achieve conductivity between two wires to replace mechanical switches that are used in a battery operated device that considers the closing of the contacts a reason to send a complicated signal via bluetooth to a computer.
-
I fear my ignorance is showing....
I am looking for some way to induce conductivity between two wires -- I thought these might do it, but they rely on sharing a ground with the wires being connected...
I have a device that exposes two leads, when they are connected with a mechanical switch then the device is actuated.
I want to connect those two leads using the pico, but I can't introduce any current into them.
I don't really want to use a mechanical relay for this (like the ones in the powerstrip) but I will if I have to.
A relay would do the job since it's powered totally independently from the wires being switched
I guess I'll go search for solid-state 3.3v controlled relays
I should have started a new thread for this question...
Something like this?
-
At this point - 48hrs in - the only ouija activity has been internal to the powerstrip. Twice so far I've heard relays click with nothing but EMI to cause it. I'll be decoupling the 5v power next - then re-doing the boards && then publishing it in the projects section.
I am looking for some way to induce conductivity between two wires - FET/MOSFET look good but I can't find the 3.3v ones mentioned in the tut.
-
-
Well I'm glad your diagram showed the resistors going to ground, I was going to put them inline
I had to substitute 0.1uF polarized for your unpolarized 100nF (I love google)
--- Do you have a suggestion for something that I can use to create continuity between two wires, without introducing any current into them ---
-
Also - what is FET ? Is that MOSFET ?
I need something that will let me turn on conductivity between two wires -- these look ideal http://www.espruino.com/mosfets but I can't find the one they say is good (3v version) for sale anywhere
thanks!
-
-
All of this is to set up some switches for my mom who is bedridden and has little use of only her left hand -- the coiled wire runs from the wall to the rolling beside table (keeping itself off the floor) so I am limited to 4 wires. Your diagram perfectly explains my diode arrangement.
I've not done the decoupling and diode yet - I was waiting to see if I had to have a 1000uf as you had first suggested. I'll try with the 100uf.
The problem is not so much jittering (not staying put once set) but rather that outside power use affects the system. She has an electric hospital bed and when we run it down, that can cause the circuit to switch off the light -- it seems to me that it's not just affecting the shift register or the relays at that point, because the lcd says the switch is off.
Will it be all right to decouple the circuit more than once? I'd like to decouple it for the shift register as well as at the pico.
thanks for that extra code, I'll let you know how it works if I try it.
-
Ok, so now everything is 5v (except for the clock/data lines to the shift register) -- I have a 100uF cap - will that do? I'm ordering a set with 1000's in it. How do you know how big to use? What's a good ref for a total newbie (who's bad at math) for this kind of stuff? if I wanted to order optoisolators what kind would I order?
-
No real improvement in ouija action... More reaction to relays I think...
I want to do the decoupling thing now, I can figure out where to put the cap & diode thanks to aO's diagram -- and I have these caps but don't know which ones to use http://www.amazon.com/Projects-EPC-201-Value-Capacitor-Pack/dp/B00CQOM1IC
aO: the switches code has been rewritten to be much clearer about it's intent. It's working a lot better now. I've attached the latest copy, I meant to upload it last night with the update to the control.js file (see reply #8)
-
Ok, everything is 5v now and I rewrote the switches.js to behave a little better when I hook up multiple switches in the future -- thanks!
I'm still interested this talk of decoupling and capacitors -- but I don't really know where to put them exactly, or what strength to use...
And I found a ferrite tube and some ferrite rings, so I can thread the cable thru the tube and re-crimp the end -- but I can also thread individual wires inside the control box. Suggestions?
I'll report back as to any reduction (or otherwise) in ouija activity
(update) I found some clamp on ferrites in my pile of servo stuff !! So I've clamped both the cables after they come into the pico Box -- I have two more of these as well as the rings, what else should I apply them to?
The wires that go to the relays are too thick for these, but I could pass them thru a few rings (not long enough to twine around rings unless I replace.)
Oh, and I took the pico off the board and tipped it up so you can see the female header on the pico and the male header on the board -- make sit easy to swap in a pico with updated code.
And, I love having female header on the pico so that I can just use it as it's own mini breadboard for testing code. (A big THANKS goes out to allObjects for that idea !! http://forum.espruino.com/conversations/276831/ )
-
Gordon: I have lots of old USB cables with ferrites on them, if I clip one of those onto the black cable which end should it go near ?
AllObjects: I powered the shift register with 3v -- should I switch that to 5v ?
AllObjects: I am interested in the 'decoupling' could you please re-state it more concretely ?
Here are more pictures, a better description, a parts inventory, and the code I used
Thanks,
Al; -
-
I'm a purely software guy, I fart around w/hardware but this is the most complex thing I've ever done
I have built a pico controlled power strip - I opened up a USB wall-wart and stuck it in the powerstrip and ran 5v up to the Pico - then I ran 3v back down to the power strip to toggle the relays (using a shift register chip.) The intermediate box uses an old 5v LCD I had from my Arduino days. The relays are powered via 5v and triggered w/3v. The final box is just a connector for switches. I figured out how to stack diodes so that I can handle 7 switches from 4 wires.
problem #1 -- we call this thing the ouija-switch because turning other lights and/or tv's on/off in the room can make this thing turn outlets on/off, it's particularly bizzare to me because the LCD readout says that the relay has toggled. And of course it's getting driven by the Pico, so how can EMI (which it has to be) get up through the Pico out into the 3v world and make the software think I hit a switch?
answer #1 -- a guy at work with an EE background says that I'm getting power fluctuations causing harmonics which are screwing up the works, and that they can run rampant all over the place. He gave me 5-6 solutions using terms I had no idea (shunts, capacitors, inductors, etc.) until the 7th -- power the Pico from a battery, if all your problems go away then you can think about cleaning the power to the Pico. (and have I read notes from people on other projects involving relays say things like: use a decoupling capacitor and liberally sprinkle capacitors around your circuit. Liberally Sprinkle ?? I have no idea what-all he was talking about)
The Big Question -- if I throw a 9v battery into the middle box and connect that to the Pico then I will have 9v & 3v sharing the same ground, I used to have the 5v and 3v sharing the same ground. Is it alright to share the ground between 9v & 3v? Was the shared ground between 5v and 3v the source of my problems anyway? What should I do? I would rather not add a battery but rather fix whatever the original problem is that is causing the ouija-switch behaviors.
-
This code is a direct port of the ADAFRUIT: USB + Serial RGB Backlight Character LCD Backpack
https://learn.adafruit.com/usb-plus-serial-backpack/command-reference
There is some test code appended to this module
Has anyone attempted to flash one of these with the Espruino build ?