Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Splode
Jun 18, 2013

put some clothes on you little freak
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.

Adbot
ADBOT LOVES YOU

Splode
Jun 18, 2013

put some clothes on you little freak

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?

code:
#include <IRremote.h>

const int RECV_PIN = 6;
const int RIGHT_WHEEL_PIN = 3;
const int LEFT_WHEEL_PIN = 5;

IRrecv irrecv(RECV_PIN);

decode_results results;

void setup()
{
  pinMode(RIGHT_WHEEL_PIN, OUTPUT);
  pinMode(LEFT_WHEEL_PIN, OUTPUT);
  
  irrecv.enableIRIn();
}

void loop() {
  analogWrite(RIGHT_WHEEL_PIN, 250);
  analogWrite(LEFT_WHEEL_PIN, 250);
}
Edit: Wow Fritzing is cool! Here's my current setup:


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.

Splode
Jun 18, 2013

put some clothes on you little freak

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.

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,

There are special tools for that, but they're not always perfect. A small Flathead screwdriver and care is usually just as good.

Splode
Jun 18, 2013

put some clothes on you little freak
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.

Splode
Jun 18, 2013

put some clothes on you little freak

Jamsta posted:

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.

oooooh cool

Splode
Jun 18, 2013

put some clothes on you little freak
It's really difficult to get good at soldering without somebody standing over your shoulder going "No you idiot, you have to do THIS". It's really hard to learn and teach though, because it's just a thing you can suddenly do well, and it's really difficult to articulate what you're doing differently. It's a 'knack'.

Splode
Jun 18, 2013

put some clothes on you little freak

Hadlock posted:

I'm seeing these USB-C noise cancelling headphones and the electronics look itty bitty, their solution probably has some fancy custom DSP, but it can't be that hard to read a waveform, then inject the inverse waveform into the audio stream? I don't get how these guys are getting $200 for what should be pretty simple technology.

The Arduino is probably woefully underpowered for this task, but Ti probably has some off the shelf DSP that's up to the task that you can program via i2c?

If you find something please report back. There is a lot of bullshit pricing in audio tech, so you might be on to something.

Splode
Jun 18, 2013

put some clothes on you little freak

bad posts ahead!!! posted:

I have, but it doesn't seem like I can learn to write from scratch from this

Steal code from tutorials and slowly try and work out what each line does and why. Learning C may be more helpful than C++ depending on your educational background and how your brain works.

Splode
Jun 18, 2013

put some clothes on you little freak
PlatformIO is nice of you start writing stuff for arduino longer than a few pages. I used it for a work project and highly recommend it.

The Arduino IDE is usually good enough but it's missing a few quality of life features that you get with serious ides

Splode
Jun 18, 2013

put some clothes on you little freak
If you're an electronics, servo motors are your best bet. They're cheap and way easier than the other options. You can get servo motors that are "continous rotation" as well as the limited angle ones, but the continuous rotation motors are controlled with a speed rather than an angle, do you'd have to work out the timing.

As for mechanisms, you could use a rack and pinion or a crank, the best approach depends on the geometry you're working with, how far you need it to extend and how fast.

Splode
Jun 18, 2013

put some clothes on you little freak
Does anyone have a nice way of making 0.1" pin connections more permanent? Obviously I can desolder the headers but that's a bit of a pain, and if there's a clever way of doing it I'm all ears.

Splode
Jun 18, 2013

put some clothes on you little freak

Sagebrush posted:

Given that this is the Arduino thread, I assume you mean the 0.1" female header blocks on a regular Arduino?

Buy some 0.1" male header strips (pennies on Amazon), solder the wires onto those in a block, plug those into the female headers, and add some hot glue along the edges to keep it all in place.

The board I'm using (Node MCU) actually has male header blocks (which came pre-soldered, gee thanks), though that is a really good trick!
I guess I could buy female blocks and do the same thing in reverse.

Hot gluing jumper leads should work nicely

Splode fucked around with this message at 07:02 on Jul 7, 2017

Splode
Jun 18, 2013

put some clothes on you little freak
I was going to recommend something from adafruit.

Screens are kind of hard to use, but code libraries are available and with a library, it's something that takes time and fiddling rather than skill. If you can put an "a" on the screen somewhere then it's only a matter of time before you can put whatever you like on the screen.

Splode
Jun 18, 2013

put some clothes on you little freak
Also edit out your Wi-Fi password

Splode
Jun 18, 2013

put some clothes on you little freak
Post pictures of the physical set up!

You've made me want to try using IFTTT with an esp8266 now

Splode
Jun 18, 2013

put some clothes on you little freak
Every parrallel set up I've seen for a display is different to every other one unless they're based on the same controller chip (is it visible?). The i2c adaptor won't be able to handle anything other than the display controller ic it was designed to convert. You might luck out though, there are a few very popular controllers out there

Splode
Jun 18, 2013

put some clothes on you little freak

Sagebrush posted:

I think the chances of a 16x2 character display using the same controller as a QVGA (etc) TFT are infinitesimally small.

Yeah I think I skimread the post. I shouldn't post in here at midnight.

thegasman2000 posted:

How complicated is it to get 2 micro controllers to exchange data over Bluetooth? I am thinking of the esp32 with built in Bluetooth and wifi with one unit being the main and the other controlling a couple of leds and sending their state back to the main?

Depends. You can buy a bluetooth module, hook it up to your Arduino's UART, and have serial comms with a laptop instantly, with just the regular serial code as it functions as a bluetooth serial port.
Setting up one of the bluetooth modules to be a host is marginally more complex (in that it won't be set up out of the box) but still like, an hour's work max.

HC05 bluetooth module is what you want

Splode
Jun 18, 2013

put some clothes on you little freak
That is a mess. I'm phone posting so I can't get the sketch I based my code around for you, but check out the ESP8266WebServer library and it's example, I used it and it's a lot less messy.

Splode fucked around with this message at 20:41 on Oct 26, 2017

Splode
Jun 18, 2013

put some clothes on you little freak
There's a nice way to do that, I had the user set the temperature that way, hang on...

Fake edit:


code:

void updateSetTemp() {
  if (server.hasArg("setTempArg")){
    setTemp = server.arg("setTempArg").toInt();
    Serial.print("New Set Temperature: ");
    Serial.println(setTemp);
  }
}

This requires you to set up a form on your html page

code:

pageControls += "<form action = \"\" method=\"post\"> Set Temperature: <br> <input type=\"text\" name=\"setTempArg\" value = \"";
  pageControls += (String)setTemp;
  pageControls += "\"><input type=\"submit\" value=\"Set\"></form></p>";

My web page was set up in the code as a bun of strings that I could gently caress with depending on what the user did

Splode
Jun 18, 2013

put some clothes on you little freak

thegasman2000 posted:

'class WiFiServer' has no member named 'hasArg'

:/ Never ending

Are you using this library?

https://github.com/esp8266/Arduino/tree/master/libraries/ESP8266WebServer

Use it, check out the examples

Splode
Jun 18, 2013

put some clothes on you little freak
I often have a second arduino that I use as a development device for stuff like that (where I need to test higher level logic or comms).

It's always a good idea to just have piles of arduino compatible microcontroller boards lying around.

Splode
Jun 18, 2013

put some clothes on you little freak
If it's any consolation, nobody other than you will ever notice

Splode
Jun 18, 2013

put some clothes on you little freak
I'm working on a project that will pull time from NTP servers, but I'm going to run into an issue with daylight savings (Australian Eastern Standard Time).

I've got some code already that I found online and used in a few previous projects that pings the ntp server pool (time.nist.gov), pulls the NTP time (seconds since Jan 1st, 1900), converts it to unix time, and then extracts the current hour and minute (which is all I needed for time control until now).

However, Australian Daylight Savings are, like most daylight saving systems, dumb and complicated for no reason:
Daylight Saving Time begins at 2am on the first Sunday in October, when clocks are put forward one hour. It ends at 2am (which is 3am Daylight Saving Time) on the first Sunday in April, when clocks are put back one hour.

Is there an easier way to pull the current time from the internet somewhere for a specific time zone, or am I going to have to actually program the above in to my device?

Splode
Jun 18, 2013

put some clothes on you little freak

Collateral Damage posted:

Take ten minutes to watch this

-snip-

Then go find a timezone library. A quick google search came up with https://github.com/JChristensen/Timezone which seems to do what you need.

aaaaaaaAAAAAAAAAAAAAAAAAA

Why do we do this to ourselves.

That library looks great, thanks.

Splode fucked around with this message at 11:32 on Dec 14, 2017

Splode
Jun 18, 2013

put some clothes on you little freak
That library worked a treat, thanks guys. I'll post project details later (after christmas)

Splode
Jun 18, 2013

put some clothes on you little freak

babyeatingpsychopath posted:

Posting back-to-back, but that was last month.

Just wanted to post about my success with an Arduino project.

A mouse tried to make a nest inside my hot tub controller this winter and managed to let the smoke out (of himself). All the wiring inside was burned, so I decided to rewire it. Also, it's a janky controller from 1993 that never worked quite right. Arduinos to the rescue!

I bought a SainSmart 8-relay module and some Gikfun oneWire temperature sensors (nominally Dallas/Maxim DS18B20s) from Amazon, plus some veroboard. Parts I had on hand were a SainSmart 16x2 LCD shield (with buttons!), some momentary rocker switches, a 120VAC->5VDC converter, and all the old stuff out of the controller (GFCI, 240VAC contactors, pressure switch, etc).

I programmed up an Uno I had lying around with the LCD shield to display current temperature, set point, and the status of the contactors (heater, lights, pump, jets). A piece of acrylic and some waterproof momentary rockers later, and I've got a waterproof control panel tubside.

Due to space limitations, I didn't have room for a fullsize Uno inside the enclosure, so I soldered a bare Atmel 328 to the veroboard with some headers, then flashed my code with an arduino-as-isp. This bare-board arduino reads serial data from the control panel and outputs to the relay module, which control the 240VAC contactors. There's a contactor each for the pump's HI and LO speeds, and one for the heater. The lights are 12V submersible lights of some flavor, and are just fed off a power-limited 120VAC->12VAC isolation transformer. These get their own relay. The bubbler pump is only rated for 5A, so I let the relay module control the 120VAC power for this, too.

All in, I think I spent $50 or so to get the hot tub controller working again. A bare-bones bargain considering the retail price of a replacement.

Nice work! Take a photo, I'm always interested in how people approach one-off enclosures (as it's the part where all my projects turn to poo poo)

Splode
Jun 18, 2013

put some clothes on you little freak
That is a lot of Arduinos! May I recommend you replace the breadboards with veroboard or some other more permanent solution? Looks great though.

Splode
Jun 18, 2013

put some clothes on you little freak

Sockser posted:

Those are adafruit permaprotos, regular perfboard laid out like a standard breadboard. They’re great and pretty much all I ever use.

Ahh fair enough, I've never seen them before

Splode
Jun 18, 2013

put some clothes on you little freak
I couldn't get either the mouse or keyboard libraries to work when I used platform io to compile, but they worked fine with the Arduino IDE. I skimread somewhere that there was some issue fixed in 1.6.6 of the arduino IDE that fixed something related to this?

Splode
Jun 18, 2013

put some clothes on you little freak

taqueso posted:

Does anyone know of an arduino or teensy or similar carrier board that has some isolated IO?

Not off the top of my head, (I checked and the ruggeduino isn't isolated), but you'll probably have more luck finding an external module or shield.

Splode
Jun 18, 2013

put some clothes on you little freak
I used the esp8266 to pull time from time servers rather than use an RTC, but that might not be viable for whatever you're doing.

I haven't seen any boards with both an esp8266 and rtc though. you'll probably need to design your own or live with seperate modules.

Splode
Jun 18, 2013

put some clothes on you little freak
It's worth noting once you are messing with registers and peripherals you may have more luck asking questions in the embedded programming microthread or the electronics thread. Feel free to ask here too though.

Sorry about no links, phone posting

While I'm here, I use a lot of Arduino Dues at work because it's not my money lol.
That said, they're physically huge. Does anyone have any recommendations for Arduino compatible boards with shitloads of IO in a smaller package? A nice fast arm processor is nice too but pretty unnecessary.

Splode fucked around with this message at 21:46 on Mar 27, 2018

Splode
Jun 18, 2013

put some clothes on you little freak

Sagebrush posted:

The Teensy 3.2 or 3.6 are good options.

Perfect thanks, I'd forgotten about teensy

Splode
Jun 18, 2013

put some clothes on you little freak

evil_bunnY posted:

Then cludge something with mosfets!

If you have a 5V rail, this is probably the easiest solution.

Splode
Jun 18, 2013

put some clothes on you little freak
Can you not use the arduino libraries with the ESP32? I've done arduino projects with an ESP8266 and it was painless.

Splode
Jun 18, 2013

put some clothes on you little freak
It's not that big a downside honestly. It costs more and requires more space but it's easier than sorting out interrupts or writing a sequencer or something. I would personally use UART to have the two devices communicate, but i2c and SPI will also work fine.
My approach would be to set up the arduino as a slave, so your ESP can send it a command and recieve back the relevant data from whichever sensor it asked for. It wouldn't be very difficult, and it'll be really easy to debug them seperately.

Splode
Jun 18, 2013

put some clothes on you little freak
I've used LEDs with forward voltage drops as high as 3.4V, you may need to reconsider your power system.

As for the turning off problem, measure the pin assigned to reset with a multimeter (or better yet an oscilloscope if you have one) and see what it's doing. That should give you an idea about how to fix it.

Splode
Jun 18, 2013

put some clothes on you little freak
Surely you can just drive them with mosfets? Optoisolators for 5v relays seems excessive.

Splode
Jun 18, 2013

put some clothes on you little freak
You can absolutely manually set registers in the Arduino IDE, I do it all the time when I want to mess with timers and interrupts.

I'm planning to jump from the arduino ide to vscode + the arduino package. I've tried platformIO but it's flaky as hell, so i'm hoping this is better

Adbot
ADBOT LOVES YOU

Splode
Jun 18, 2013

put some clothes on you little freak
Yeah if you download the board package for ESP8266/ESP32/NodeMCU (it's all the same package) I bet it'll work. The board package comes with heaps of example sketches so it'll be reasonably easy to test.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply