|
cakesmith handyman posted:Hello thread, I've a project in mind and wondered if an arduino was the right way to go with it. I want to control Lego contraptions without a PC. Years ago I'd have used the RCX controller I got with a mindstorms kit, but it's very limited (3in/3out) and to program it now would require faffing about with Windows 98 and obsolete patches. An Uno is typically the best to start with. Far and away the most info is out for it, and most hardware is designed for it as well. And they need an external drivers to run motors. Motors take too much power to drive natively, and the inductive kickback can damage the pins.
|
# ? Dec 31, 2016 01:40 |
|
|
# ? May 30, 2024 07:45 |
|
Okay, how about this then: http://www.sniff.org.uk/2016/03/lego-dacta-control-lab-b.html?m=1 The whatsit about half way down the page is basically a Lego IO rack with H-bridge motor drivers, however it's serial controlled via M-F DB9 null modem cable. Is there any way I could control this with arduino?
|
# ? Dec 31, 2016 19:14 |
|
cakesmith handyman posted:Okay, how about this then: Yes. There are 2 possible sticking points I can imagine. You might have a voltage incompatibility. The Arduino is 0-5v only. (Or 3.3 for the due and pro mini) Some serial (TTL serial)is those voltages but the official RS 232 is up to -25 to +25, with typical being +/-12v. There are chips and modules that take care of this. Another is that you may not know the commands to actually send over the serial connection. There's a good chance someone has documented it, or you could sniff the bus as it runs with the Arduino. (after taking care of the voltage)
|
# ? Jan 1, 2017 06:26 |
|
I'll do some research then thank you. The final probably saner alternative is just protoboarding a big bunch of relays, but where's the fun in that?
|
# ? Jan 1, 2017 11:43 |
|
cakesmith handyman posted:Hello thread, I've a project in mind and wondered if an arduino was the right way to go with it. I want to control Lego contraptions without a PC. Years ago I'd have used the RCX controller I got with a mindstorms kit, but it's very limited (3in/3out) and to program it now would require faffing about with Windows 98 and obsolete patches. If you just need to drive the motors forwards at full power, and not change direction rapidly, you can get a multi-channel relay board for super cheap on Amazon. https://www.amazon.com/JBtek-Channel-Relay-Arduino-Raspberry/dp/B00KTELP3I/ If you want bidirectional drive or PWM control (variable speed) then you need something with solid-state H-bridges, like these L298 boards: https://www.amazon.com/C-J-Bridge-Stepper-Controller-arduino/dp/B00XAGRQTO/ each one of those can drive two motors. The L298 isn't a super efficient chip but it should work fine for small LEGO motors. If you need to drive bigger stuff, look for MOSFET-based driver chips/boards instead.
|
# ? Jan 1, 2017 18:29 |
|
Looks like I need those 298 boards for the Lego, though those relay boards look like they can drive 250VAC? I'm sure I can find a few uses for those too. I assume input 1 & 2 will map to motor 1 forwards and backwards? Simple enough if so. Thank you, very helpful.
|
# ? Jan 1, 2017 19:54 |
|
cakesmith handyman posted:Looks like I need those 298 boards for the Lego, though those relay boards look like they can drive 250VAC? I'm sure I can find a few uses for those too. Cakesmith found dead in home in February 2017 over device with following masking tape labels on leads: "Motor control a" "motor control B" " "Tazer" "capacitor bank A" "capacitor bank B" "inverter" "motor control c" "motor control D"
|
# ? Jan 1, 2017 20:30 |
|
The relay boards can theoretically handle 250 volts, yeah, implying that you could use them to toggle lamps and stuff...but IMHO installing cheap Chinese DIY electronics in your house wiring is a great way to burn it down and then get your insurance denied. They're great for stuff that you keep an eye on and that won't kill you if they fail.
|
# ? Jan 1, 2017 20:37 |
|
Okay I feel dumb but it's been almost 20 years since I messed around in C - how do I write an exponent, ie "X^Y"? I'm working on re-inventing the wheel by making a binary clock (eventually I plan to remove the arduino and have it be entirely run off components as a learning exercise but I'm a good way before I reach that point). I want to use a decrementing "for" loop to run modulo on whatever time I have going, so I don't need to write eseentially the same statement several times but I can't remember how to code in C and I dunno where my old reference books are (probably in my family's barn in another city). edit: aha, the pow() function. And it seems as though there's no need to include the math.h library from C..? coyo7e fucked around with this message at 03:03 on Jan 3, 2017 |
# ? Jan 3, 2017 02:48 |
|
Yeah, that's the one. And you don't have to add math.h manually because Arduino.h (the huge macro file that gets inserted at the beginning of every Arduino sketch before it gets punted to the compiler) already includes it. If you're interested in seeing exactly what makes up the "Arduino language", the file you're looking for is C:\path\to\arduinofolder\hardware\arduino\avr\cores\arduino\Arduino.h
|
# ? Jan 3, 2017 03:15 |
|
Also if all you want to do is integer powers of two (for binary bit twiddling) you'll probably be better off using the left and right bit-shift operators << and >> .
|
# ? Jan 3, 2017 07:36 |
|
Hobnob posted:Also if all you want to do is integer powers of two (for binary bit twiddling) you'll probably be better off using the left and right bit-shift operators << and >> . (X << Y) is equivalent to (X * 2^Y) and (X >> Y) is equivalent to (X * 2^-Y) So substitute that in any place you can for integer operations.
|
# ? Jan 3, 2017 17:07 |
|
How does the Zero compare to the MKR zero? It talks about having the same pins (and the data sheets look the same to me), is it literally the same thing except smaller, lighter, and cheaper? Are there any downside to getting it?
gonadic io fucked around with this message at 23:02 on Jan 4, 2017 |
# ? Jan 4, 2017 21:25 |
|
A while back I funded a kickstarter for the Onion Omega2 (onion.io) because it looked nifty. I picked up an Arduino Dock v.2 with it, and they finally showed up a bit ago. The documentation is still scarce and I'm still totally new to all this but after installing the package for the arduino on the omega I can now flash the board via wifi. It's got identical pinouts to the uno so it's supposed to be compatible with all the shields and I should be able to communicate with the omega linux unit via a serial connection. Not as fast as a pi but way more compact, uses even less power, and the omega also has its own gpio ports. Tested a blink sketch last night which worked great because the built-in led is bright and I wanted to see less of it, gonna pull out the breadboard tomorrow and pick up where I left off a while ago with turning on/off leds.
|
# ? Jan 10, 2017 07:29 |
|
I used a little Wi-Fi module and an arduino to muck around with web server stuff. Hoping to get it to the point where I can log in to a web page and change stuff on the arduino. It's much easier than I expected, all these pre-programmed AT command gadgets around are fantastic. A while back I used another arduino and a relay to make a time and temperature based switch for my room heater. I hope to merge the two projects so that I can configure it using a browser.
|
# ? Jan 10, 2017 10:19 |
|
I'm currently leading some workshops in Colombia and we bought parts before we came and we got a 2 pin microphone instead of the 3 pin microphone that's designed to work out of the box with an Arduino. It looks a bit complicated to build a system with the 2 pin microphone. The goal of the workshop is to have lights that turn on when loud sounds are detected. What would be the simplest circuit that could detect loud sounds?
|
# ? Jan 13, 2017 18:29 |
|
A mic with two leads would act as a resistor i believe, so you could probably use something like this http://oomlout.com/a/products/ardx/circ-09/ would probably work if u look up syntax for the mic, and have an LED get brighter or dimmer with room noise. Wouldn't a 3 prong mic work like a transistor (switch)? That's more complicated by a bit I would think. http://www.learningaboutelectronics.com/Articles/Arduino-microphone-circuit.php coyo7e fucked around with this message at 20:37 on Jan 13, 2017 |
# ? Jan 13, 2017 20:35 |
|
coyo7e posted:A mic with two leads would act as a resistor i believe, so you could probably use something like this http://oomlout.com/a/products/ardx/circ-09/ would probably work if u look up syntax for the mic, and have an LED get brighter or dimmer with room noise. I tried setting up that first one as a photo resistor with no luck. The second one would work but I was hoping to avoid so many components.
|
# ? Jan 13, 2017 21:13 |
|
gonadic io posted:How does the Zero compare to the MKR zero? It talks about having the same pins (and the data sheets look the same to me), is it literally the same thing except smaller, lighter, and cheaper? Are there any downside to getting it? The Zero has the traditional form factor, which means it should be mostly compatible with the last decade worth of Arduino shields. That form factor is also a bit more human scale, less cramped, less likely to accidentally short something MKR is smaller but harder to work with (unless you have Trump sized hands) and only works with specific shields, unless you buy/build some kind of adapter. Unless you have a specific use case or you live in a tokyo/sf sized apartment I think you're better off with the larger one
|
# ? Jan 13, 2017 22:32 |
|
gonadic io posted:How does the Zero compare to the MKR zero? It talks about having the same pins (and the data sheets look the same to me), is it literally the same thing except smaller, lighter, and cheaper? Are there any downside to getting it?
|
# ? Jan 13, 2017 23:49 |
|
Disclaimer that I am a gigantic noob. I bought this Elegoo starter pack and despite my best efforts managed to setup this circuit to control a DC motor. That worked alright powered through the USB, problem is I'm trying to power this with batteries and my 9V battery pack plugged into the power port on the Arduino is not up for the task. The motors are KNEX motors that can be powered independently with 2 AA batteries (i've tried and it works just wonderfully) but I need to control them programatically. When I tried to naively substitute the 5V and ground in the above diagram for the + and - of my improvised battery pack I got nothing for 2 through 5 batteries (wired in series). The battery pack definitely works for example 3 batteries gave me around +4.5V when tested with a volt meter (each battery is 1.5V). Any ideas? I am aware a motor shield is probably a good idea but I would love it if I could get 'er done with this circuit (or at least the parts in my elegoo starter kit). Thanks! Edit: This is what I tried to no avail: awesomeolion fucked around with this message at 04:36 on Jan 14, 2017 |
# ? Jan 14, 2017 04:25 |
|
You need a shared ground.
|
# ? Jan 14, 2017 05:22 |
|
Platystemon posted:You need a shared ground. IT WORKS! Thank you so much!
|
# ? Jan 14, 2017 16:36 |
|
New question for y'all. Now that I've got both motors running on batteries I'm trying to control them using an IR sensor. If I have "irrecv.enableIRIn();" in setup then only one motor runs. If I comment it out both motors run. I know that the IR receiver can block but why would it stop only one motor from working?code:
awesomeolion fucked around with this message at 19:00 on Jan 14, 2017 |
# ? Jan 14, 2017 18:37 |
|
awesomeolion posted:New question for y'all. Now that I've got both motors running on batteries I'm trying to control them using an IR sensor. If I have "irrecv.enableIRIn();" in setup then only one motor runs. If I comment it out both motors run. I know that the IR receiver can block but why would it stop only one motor from working? I may have found your issue https://forum.arduino.cc/index.php?topic=93994.0 Your arduino might have run out of hardware timers. Apparently that ir library you're using uses one, and analogWrite uses one too.
|
# ? Jan 15, 2017 00:41 |
|
I'm still working on my u8glib editor Now you can edit a picture in gimp and directly load it in my tool. I've been trying to find efficient ways to store those imported binary images on an 8 bit AVR. So far there's a rudimentary RLE algorithm. For example compresses to a 249 elements long array of 8 bit ints code:
What's the proper way to use longer arrays, I think I need several ? My problem is I know mostly gently caress all about C The display code is this code:
unpacked robinhood fucked around with this message at 20:07 on Jan 15, 2017 |
# ? Jan 15, 2017 12:45 |
|
Splode posted:I may have found your issue Thanks! After reading that thread I ended up using digital write and that allows everything to play nice together
|
# ? Jan 15, 2017 21:59 |
|
I bought one of those Elegoo starter kits and apart from a couple of slightly bent pins (yes I just grabbed some pliers) mechanically it's been fine, however the tutorials & the code & the accompanying schematics and drawings don't always match, which is frustrating when you're trying to learn something & you have to find where they sent you wrong. Also I did the shift register tutorials and now I cant get the chip off the breadboard and I'm afraid I'll destroy it. Is there a special tool I need? Hell is there a little toolkit anyone could recommend? I don't have anything at this scale,
|
# ? Jan 15, 2017 22:14 |
|
cakesmith handyman posted:I bought one of those Elegoo starter kits and apart from a couple of slightly bent pins (yes I just grabbed some pliers) mechanically it's been fine, however the tutorials & the code & the accompanying schematics and drawings don't always match, which is frustrating when you're trying to learn something & you have to find where they sent you wrong. There are special tools for that, but they're not always perfect. A small Flathead screwdriver and care is usually just as good.
|
# ? Jan 15, 2017 22:32 |
|
cakesmith handyman posted:I bought one of those Elegoo starter kits and apart from a couple of slightly bent pins (yes I just grabbed some pliers) mechanically it's been fine, however the tutorials & the code & the accompanying schematics and drawings don't always match, which is frustrating when you're trying to learn something & you have to find where they sent you wrong. My breadboard cutouts were "correct" but they were a little off-scale or something and anyway after the first two or three you should be picking up enough to do them from eyeball, imho. What's giving you trouble? Share a pic or code or something if possible.
|
# ? Jan 16, 2017 10:52 |
|
coyo7e posted:how do you mean they were wrong? Are they like the arduino stuff I got from adafruit where it has a cut-out piece of paper that goes over the breadboard, or something else like you're looking at DCDs and they're not working? I'm at work so I'll share later but the rgb led fade program behaved strangely until I realised it counted up instead of down or vice versa. Some tutorials have drawings and pictures, some have schematics and drawings. Honestly if the schematic is there it's always better, the drawings have been wrong by a pin or two sometimes. Nothing terrible just annoying.
|
# ? Jan 16, 2017 11:44 |
|
I had an issue last night with an arduino clone board: the Vin pin wasn't actually connected to anything. I'm going to have to be more careful about which knock off clones I buy from eBay in future. This one didn't have a test LED either which you really miss when it's gone.
|
# ? Jan 16, 2017 22:17 |
|
unpacked robinhood posted:I'm still working on my u8glib editor This is the best, thanks sir
|
# ? Jan 17, 2017 04:49 |
|
unpacked robinhood posted:It works really well as long as the array stays under 255 elements long (because I'm on a 8 bit I guess ?) unpacked robinhood posted:
Declaring i with a wider width (uint16_t) should fix that issue.
|
# ? Jan 18, 2017 23:57 |
|
Talking of u8glib, u8g2 is out now: https://github.com/olikraus/u8g2 Finally supports Arduino on ESP8xxx. Has framebuffers and lots of other cool stuff too. Now I can upgrade my homemade Arduino lawn trimmer to be WiFi enabled along with it's OLED screen.
|
# ? Jan 19, 2017 00:12 |
|
JawnV6 posted:You could break it into several arrays, but that's not your problem. This is a fix: ffs Corrected, thanks à lot !
|
# ? Jan 19, 2017 09:00 |
|
Jamsta posted:Talking of u8glib, u8g2 is out now: oooooh cool
|
# ? Jan 19, 2017 09:21 |
|
Is there a standard or best wifi data logger (temperature) project for the esp8266? There's about 2000 just doing a cursory look
|
# ? Jan 19, 2017 18:40 |
|
An ESP8266, FTDI programmer, the relevant Arduino cores, a couple of digital sensors (like the DHT22) and thingspeak.io makes it pretty simple.
|
# ? Jan 19, 2017 22:33 |
|
|
# ? May 30, 2024 07:45 |
|
Do any of you guys know of an electronically controlled, adjustable gas valve that can be hooked into an Arduino? Think like the gas valve on your stove, where you turn a dial to adjust the output to exactly what you want, but instead of a dial, it'd be connected directly to the controller. I'm googling around, but I'm having trouble finding anything that looks like it would work.
|
# ? Feb 11, 2017 13:54 |