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
Skunkduster
Jul 15, 2005




edmund745 posted:

They are usually carbon-composition or carbon-film resistors (a lower-quality type) that have been painted the base color usually used for metal-film resistors (metal-film is a higher-quality type).

If you scrape the insulation away, can you tell just by looking at them what they are made of?

Adbot
ADBOT LOVES YOU

edmund745
Jun 5, 2010

SkunkDuster posted:

If you scrape the insulation away, can you tell just by looking at them what they are made of?
You usually can, but that is not the most reliable test. Switch the Google search to an image search and you get some pictures.

The best way is to measure the resistance at room temperature, then heat them up to 175~200°F, and then measure them when they are hot.
Metal-film resistors will show a very-slight increase in resistance when hot. Either type of carbon resistor will show a significant decrease in resistance when hot.

What they *look* like doesn't really matter.
If a China company had found a way to make carbons work like metal-films, hey, , , , that would be great!!! --But it's probably more likely that they're just painting carbons light blue and misrepresenting them.

Also note that this isn't a new issue. Some of the first-page results of the Google search about this date from 2009.
If you want some 1% resistors, you are pretty much wasting your time trying to buy them on the direct-China sites.

edmund745 fucked around with this message at 21:40 on Jul 24, 2016

Data Graham
Dec 28, 2009

📈📊🍪😋



Data Graham posted:

A childhood buddy of mine just launched an autonomous solar oceangoing boat:

http://www.seacharger.com

It's running a Mega, and I helped out with some code issues :woop:

On its way to Hawaii right now.



:buddy:

Sagebrush
Feb 26, 2012

That's awesome. Did he set any records? I could see it certainly being "cheapest autonomous pacific crossing" or the like.

Seat Safety Switch
May 27, 2008

MY RELIGION IS THE SMALL BLOCK V8 AND COMMANDMENTS ONE THROUGH TEN ARE NEVER LIFT.

Pillbug
Cool project!

quote:

There were a few hiccups with the boat not wanting to let me take over with the R/C transmitter and manually steer it in, so those of you watching the tracking map will have seen it going back and forth a bit. In the end, I just aimed it right into the harbor and my wife jumped in with flippers and a snorkel to save it from the rocks and steer it the last few yards to where my brother and I pulled it out of the water.
Its time on the high seas changed it.

Hadlock
Nov 9, 2004

What kind of software struggles did he run in to that were particularly hard problems. At It's heart it seems like a really simple problem, steer towards the waypoint, throttle down/off when battery voltage drops below X. I'm sure it's way more complicated than that.

Data Graham
Dec 28, 2009

📈📊🍪😋



One of the main issues had to do with watchdog restarts and power management. The core functionality's simple, yes, but the tricky stuff was all in detecting the battery level and shutting itself off and then re-powering-up and reconnecting to the C&C.

He was using a Seeeduino Mega which had apparently come with an old bootloader that didn't handle wdt_enable() without bricking the board. There's a lot of weirdness out there around that issue, different manufacturers and different batches with silent revs. In any case he was just kind of new at ferreting out these issues; he's not a programmer really, he's more of a hard-core model plane builder, MIT aerospace guy. I remember him building huge foam RC gliders and flying them down the backyard mountain when we were like in middle school. It was nice to be able to contribute something of my own experience for once.

ReelBigLizard
Feb 27, 2003

Fallen Rib

This is fantastic. I will be mining the build log for ideas - I'm helping with a local autonomous watercraft project for our makerspace with a group of kids, we're going to try and go inter-island first. We're in the British Channel Islands, just off the north coast of France. We have multiple islands to target from <1-25mi apart. Playing with the idea of a waterborne delivery drone for small packages like medical supplies. Ekranoplans have been mentioned, Hydrofoils too. No idea what will come of it, it's really a skill building, team work and thinking exercise for the kids.

Data Graham posted:

He was using a Seeeduino Mega which had apparently come with an old bootloader that didn't handle wdt_enable() without bricking the board.

ReelBigLizard posted:

the likeliness of weird issues increases square to how much I cheap out on eBay.

I know seeed isn't really cheaping out, but I've given up on buying clone for anything but the simple projects.

ReelBigLizard fucked around with this message at 14:49 on Jul 26, 2016

Sagebrush
Feb 26, 2012

For a project like that, I'd probably have gone with something like a Teensy. Paul at PJRC is super good about supporting his products and posts on all the Arduino, Adafruit, etc. forums, so if you told him about a bug he'd probably have it fixed within a couple of days.

GobiasIndustries
Dec 14, 2007

Lipstick Apathy
I decided to pick up an Arduino kit last week and am having a lot of fun with it so far; I'm going through the poorly translated tutorials that came with the kit and enjoy both the coding and electric aspects of the included projects (my first real entrance into both). I haven't played with any of the included sensors yet but I had an idea for a small project once I get more familiar with the platform:
The east facing wall of my apartment has a huge window with blinds that have the long hanging rod to open-close them. It'd be cool to automate that set of blinds to open & close with sunrise/sunset times. I figure it'd involve a motor to rotate the blinds open+shut as well as some way to either capture light (maybe not possible if I have a lamp on at night but I don't know how light sensors would work) or a wifi shield that could pull weather data and gradually open/close the blinds based on the times pulled.
Is this a feasible project for an arduino or would I need to bring in a Pi or something else to help out?

Collateral Damage
Jun 13, 2009

Nah that's perfectly doable with an Arduino. Basically all you need is a sunlight sensor, a stepper controller chip and a stepper motor to turn the blinds. The hard part will be to fab a mount for the motor to let it drive the blinds.

GobiasIndustries
Dec 14, 2007

Lipstick Apathy

Collateral Damage posted:

Nah that's perfectly doable with an Arduino. Basically all you need is a sunlight sensor, a stepper controller chip and a stepper motor to turn the blinds. The hard part will be to fab a mount for the motor to let it drive the blinds.

Oh cool, the kit came w/ both a (small) stepper motor & controller! I'm hoping to rig something that connects the bottom of the blind wand to the motor, but that's quite a few steps down the line.

Sagebrush
Feb 26, 2012

GobiasIndustries posted:

Oh cool, the kit came w/ both a (small) stepper motor & controller! I'm hoping to rig something that connects the bottom of the blind wand to the motor, but that's quite a few steps down the line.

That's what a 3D printer is for! :madmax:

Just a heads-up: The easiest thing to get started with will be opening and closing the blinds based on the amount of light. Somewhere in the middle is controlling it by a clock (you need an external clock module). Connecting to the internet and parsing online data is pretty complex if you've never programmed before, and should be left for a later version.

Normal Barbarian
Nov 24, 2006

I'm gonna use a Teensy to get sensor data (uS and IR) to my robot's Pi Zero, but I don't know how to set up the (Teensy's) software.

Should I have it:
1) wait for a query from the Pi, then read the indicated sensor, then send the data?
2) poll all sensors continuously, keep a running average (or do other ~smoothing~), and send requested data when prompted?
3) poll all sensors continuously, save the results of the voltage->distance conversions for the IR, send requested data when prompted?

#1 seems simplest, but having the Teensy just idling waiting for requests seems wasteful. On the other hand, the Pi could handle the math from 2 and 3 far faster than a Teensy, and having the Teensy running calculations could add minor delays to getting the data to the Pi, maybe? But having the Teensy do those calculations could free up more of the Pi Zero, which is no powerhouse, to do other higher-level poo poo. I'm not sure.

Sagebrush
Feb 26, 2012

scandoslav posted:

I'm gonna use a Teensy to get sensor data (uS and IR) to my robot's Pi Zero, but I don't know how to set up the (Teensy's) software.

Should I have it:
1) wait for a query from the Pi, then read the indicated sensor, then send the data?
2) poll all sensors continuously, keep a running average (or do other ~smoothing~), and send requested data when prompted?
3) poll all sensors continuously, save the results of the voltage->distance conversions for the IR, send requested data when prompted?

#1 seems simplest, but having the Teensy just idling waiting for requests seems wasteful. On the other hand, the Pi could handle the math from 2 and 3 far faster than a Teensy, and having the Teensy running calculations could add minor delays to getting the data to the Pi, maybe? But having the Teensy do those calculations could free up more of the Pi Zero, which is no powerhouse, to do other higher-level poo poo. I'm not sure.

You may not be making the right assumptions here. I don't know what kind of sensors you're going to read from, but I'm pretty sure that the Teensy will be able to poll them far faster than it can send the data across to the Raspberry Pi. If you're doing integer math, that will also be extremely fast on the Teensy -- a few cycles per calculation. The serial connection will probably be the bottleneck. So it makes sense to do #2.

Consider also that the Raspberry Pi doesn't run in real time; the pre-emptive operating system means that you can't rely on it to respond to (e.g.) sensor data in a consistent or predictable length of time. If timing and consistency is important, it will pay to do as much as possible on the microcontroller, reserving the Pi for higher level stuff like computer vision and networking.

Finally, what's the actual data rate you need? How many samples per second? If you're okay with scanning at, say, 30Hz or less, it's all a moot point because you should have no problem achieving that with any half-decent code.

Normal Barbarian
Nov 24, 2006

Sagebrush posted:

You may not be making the right assumptions here. I don't know what kind of sensors you're going to read from, but I'm pretty sure that the Teensy will be able to poll them far faster than it can send the data across to the Raspberry Pi. If you're doing integer math, that will also be extremely fast on the Teensy -- a few cycles per calculation. The serial connection will probably be the bottleneck. So it makes sense to do #2.

Consider also that the Raspberry Pi doesn't run in real time; the pre-emptive operating system means that you can't rely on it to respond to (e.g.) sensor data in a consistent or predictable length of time. If timing and consistency is important, it will pay to do as much as possible on the microcontroller, reserving the Pi for higher level stuff like computer vision and networking.

Finally, what's the actual data rate you need? How many samples per second? If you're okay with scanning at, say, 30Hz or less, it's all a moot point because you should have no problem achieving that with any half-decent code.

This is all very good to know, thank you.

The Teensy will be reading 4-6 Sharp IR sensors and 2-4 cheap HC-SR04s on a robot that will be driving around at no great speed. The Pi will be running an action selection algorithm and, if it can swing it, RatSLAM. The fact that the Teensy can (and probably should?) handle lower level stuff would let me bypass the Pi for basic navigation, which is neat. Instead of waiting to send sensor data to the Pi, which would then send commands to the servo/motor controller, I can probably just SPI or I2C or UART the commands straight to the controller from the Teensy, and take higher-level suggestions from the Pi at leisure.

JawnV6
Jul 4, 2004

So hot ...
Be careful selecting the library for the ultrasonic. If you're sensing up to 5 meters out, the round trip on one sensor alone will limit you to 30Hz. And some libraries handle the condition where no echo is received by blocking for huge amounts of time, like a full second.

Ideally, you'd kick off each of them without waiting for the response in the application code loop and relying on an interrupt to handle the echo. Before moving things over to the Pi, you might want to drive things from a full PC with a UART cable or even a second Arduino acting like an I2C bridge to the console.

ArcticZombie
Sep 15, 2010
I have a garage alarm system which consists of a wall panel (detects state of door and houses RFID antenna for reading fobs) and a base unit (houses the beefier battery and car horns used for the alarm). Both the wall panel and base unit are Arduino-based. The wall panel currently talks to the base unit over a fairly long wire, but I'd like to make it wireless. It's all battery powered as the garage is detached from the house and is impossible to run power to. Currently the wall panel also recieves power from the base unit, but that will need to change. I have a 3.3v LIPO battery kicking around I can use for the wall panel. A 12v LIPO battery powers the horns and base unit (through a step-down converter).

Is Bluetooth LE my best choice here to get the 2 units talking? Battery life is my primary concern.

Sagebrush
Feb 26, 2012

I personally would use something like an NRF24L01 module in that case. Cheap and effective, and you don't have to deal with all the headaches that bluetooth creates.

Normal Barbarian
Nov 24, 2006

JawnV6 posted:

Be careful selecting the library for the ultrasonic. If you're sensing up to 5 meters out, the round trip on one sensor alone will limit you to 30Hz. And some libraries handle the condition where no echo is received by blocking for huge amounts of time, like a full second.

Ideally, you'd kick off each of them without waiting for the response in the application code loop and relying on an interrupt to handle the echo. Before moving things over to the Pi, you might want to drive things from a full PC with a UART cable or even a second Arduino acting like an I2C bridge to the console.

I figured I'd use the newping arduino library, since I was just gonna use Teensyduino anyhow, but implementing the interrupt-based method sounds like more fun.

good call on the initial console sanity checks.

Sash!
Mar 16, 2001


I'm dabbling with this stuff for the first time, trying to build a system to control model trains. But that part's not important. I'm using a Chinese Arudino Mega clone. I have my sketch and when I try to upload it, the upload fails, and I get an error that seems to be indicating the sketch is too big, but that doesn't make any sense because it actually says:

Sketch uses 17,828 bytes (7%) of program storage space. Maximum is 253,952 bytes.

Any idea why its doing this? I've looked all over and can't find anyone with a problem like this.

rawrr
Jul 28, 2007
Could you post the entire error message? The part you quoted seems like regular debug stuff that will be shown even if upload completes successfully.

Sagebrush
Feb 26, 2012

Sash! posted:

Sketch uses 17,828 bytes (7%) of program storage space. Maximum is 253,952 bytes.

That's normal. It's just telling you how much space your program takes up and how much is available on the board you have selected.

Do you have the correct serial port and board type selected in the menu? Do you have the drivers installed, if applicable? Can you get the basic Blink sketch (in File > Examples) to upload and work correctly?

peepsalot
Apr 24, 2007

        PEEP THIS...
           BITCH!

The chinese arduino clones often use a CH34x serial converter chip, as opposed to the FTDI chip use in authentic ones. You likely need to install a driver for that serial converter if its not flashing right, but as sagebursh says the part of the message you posted so far is normal.

DreadLlama
Jul 15, 2005
Not just for breakfast anymore

Data Graham posted:

A childhood buddy of mine just launched an autonomous solar oceangoing boat:

http://www.seacharger.com

It's running a Mega, and I helped out with some code issues :woop:

On its way to Hawaii right now.

Your boat is awesome and you are awesome.

How did you keep the batteries charged? I know it's a solar charged boat, but I mean specifically, did you buy an MPPT or homebrew a buck boost converter or...?

Data Graham
Dec 28, 2009

📈📊🍪😋



You'll have to ask him on his site; much as I'd like to claim credit for more than a little bit of code consulting, it's all him :)

PDP-1
Oct 12, 2004

It's a beautiful day in the neighborhood.

peepsalot posted:

The chinese arduino clones often use a CH34x serial converter chip, as opposed to the FTDI chip use in authentic ones. You likely need to install a driver for that serial converter if its not flashing right, but as sagebursh says the part of the message you posted so far is normal.

If I could only give one piece of advice to someone just starting out with Arduinos for the first time it's to just pony up the extra $5-$10 to get an authentic version rather than a knock-off. The authentic versions are well documented and pretty much every known potential pitfall has been discussed in detail on the internet somewhere. The knock offs introduce a ton of subtle issues (like serial -> usb interface chips) that can cause infinite frustration to new people who don't have the experience to differentiate between normal and unexpected behaviors.

Also that boat thing is amazing, nice job even if it was just helping out with the code! :)

Data Graham
Dec 28, 2009

📈📊🍪😋



Apparently Guinness doesn't have a separate category for specifically solar autonomous boats :argh:

DreadLlama
Jul 15, 2005
Not just for breakfast anymore
That boat is goddamn awesome and here am I just trying to figure out a buck boost converter for my solar panels.

Rapulum_Dei
Sep 7, 2009
Could someone point help me out with using Deep Sleep?

I have the following running on a WeMos D1 Mini and its working fine. I use a slider on my phone to set the position of a servo 0-180. but I Don't need to change it that often and I don't need the servo to actively hold this position. So I would like to use deep sleep for battery management.

The behavior I'm trying to achieve is; Startup, connect to wifi, sync servo position with the server, sleep for 5 minutes. I figure by doing this I can power system for a year on a small 12v battery.

I don't really know what I'm doing though; the tutorials I've found are usually "Today we're going to blink an LED. Copy this code and it'll make the LED blink". If I take Blynk.run out of the void loop then the servo does nothing but while its there the board never sleeps.

Hardware wise I have the servo signal line to D8 and both are powered from a 12v supply with a 5v regulator on the board and a 6v one on the servo.

If anyone has a recommendation for a good tutorial series that'd be great too.


Its opening and closing a hen house door, in case you were wondering.


code:
/*                                                ESP8266 Servo Code
/*
 *  This sketch demonstrates how to scan WiFi networks.
 *  The API is almost the same as with the WiFi Shield library,
 *  the most obvious difference being the different file you need to include:
 */
#define BLYNK_PRINT Serial    // Comment this out to disable prints and save space
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <Servo.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "biglongauthcode";

Servo servo;
void setup()
{
  Serial.begin(9600);
  Blynk.begin(auth, "MySSID", "MyPassword");  // replace with your WiFi router details
  servo.attach(15);
}
// This function will run every time Blynk connection is established
BLYNK_CONNECTED() {
 // if (isFirstConnect) {
    // Request Blynk server to re-send latest values for all pins
    Blynk.syncAll();
}
BLYNK_WRITE(V15)
{

  servo.writeMicroseconds(param.asInt());  
 
}


void loop()

{
 Blynk.run();
}


Sagebrush
Feb 26, 2012

First of all, where is the sleep code? I don't see that in there anywhere. When you take Blynk.run() out of your loop, nothing will happen, yes, but that's just because the Arduino stops executing any code. It's still powered up. Do you have a library that you're planning to use to implement the deep sleep functionality?

I'm not familiar with Blynk, but right now your logic appears to work basically like this:

- create a Blynk object
- on every cycle of the loop, check to see if the Blynk object has received a write command on channel(?) "V15"
- if it has received a write command, move the servo
- go back and keep running the Blynk object to wait for more commands

What you want to be doing, probably, is more like

- wake up the Arduino
- connect the blynk object
- check to see if there are any stacked-up commands
- execute any commands that are found
- disconnect blynk
- go back to sleep

Incidentally, I now hate the word Blynk. Why the hell this trend of naming products by misspelling a boring word ever took off I have no idea. Ugh.

Rapulum_Dei
Sep 7, 2009
Virtual pin 15 (V15) is D8 on the pinout which is the servo signal line. The sleep code is

System_deep_sleep(10000);
Delay(1000);

Which I can't figure the right place to put it to make it work. Your assessment of what I want to do is right.


I agree with your loathing of blynk. I blame imgur personally. But the service itself is a pretty easy to use MQTT implementation.

First Time Caller
Nov 1, 2004

My wife misses the bus all the time because she has to check her phone over and over again for bus warnings and updates. I wanted to build a simple display that we can put on the coffee table that will just tell her when the next bus comes.

Here's the prototype.

Arduino UNO communicating with an ESP8266-01 over a logic level converter that queries the NextBus API and sends the number of minutes to a couple shift registers powering two 7 segment displays.



Question: What resources should I look at for figuring out how to design a PCB so I can fit this into a small box?

JawnV6
Jul 4, 2004

So hot ...
Why can't you stuff that into a box? The time, cost, and complexity to make a real PCB is difficult, that looks like it solves the use case now.

Also, you might want a LED to indicate if that's a Real or Predicted value, nextbus can be tricky.

First Time Caller
Nov 1, 2004

I want to design and build a PCB for learning purposes more than practicality purposes. But you're right if I wanted a quick option I could just breadboard the arduino and move / solder everything onto a perfboard so nothing comes loose.

Edit: another question, i have modified the circuit in the picture to have a single 9v power supply that is regulated with a 7805 to 5v for the arduino and display circuit. I then draw from the 5v with an LD33 regulator to get the 3.3v supply for the esp8266. Everything works. Is there any weirdness to be aware of with using voltage regulators in this way? 9v->5v->3.3v? The 3.3 regulator only needs 4.3v or higher to function normally.

First Time Caller fucked around with this message at 20:24 on Aug 3, 2016

CommieGIR
Aug 22, 2006

The blue glow is a feature, not a bug


Pillbug
I have a ton of ESP8266s since I bought a mystery box on an electronics site, and it turned out to be a box of 200 of them.

Seat Safety Switch
May 27, 2008

MY RELIGION IS THE SMALL BLOCK V8 AND COMMANDMENTS ONE THROUGH TEN ARE NEVER LIFT.

Pillbug

CommieGIR posted:

I have a ton of ESP8266s since I bought a mystery box on an electronics site, and it turned out to be a box of 200 of them.

That's a pretty good mystery.

CommieGIR
Aug 22, 2006

The blue glow is a feature, not a bug


Pillbug

Seat Safety Switch posted:

That's a pretty good mystery.

A shame it wasn't a box of the Huzzah ones.

simplefish
Mar 28, 2011

So long, and thanks for all the fish gallbladdΣrs!


First Time Caller posted:

I want to design and build a PCB for learning purposes more than practicality purposes. But you're right if I wanted a quick option I could just breadboard the arduino and move / solder everything onto a perfboard so nothing comes loose.

Edit: another question, i have modified the circuit in the picture to have a single 9v power supply that is regulated with a 7805 to 5v for the arduino and display circuit. I then draw from the 5v with an LD33 regulator to get the 3.3v supply for the esp8266. Everything works. Is there any weirdness to be aware of with using voltage regulators in this way? 9v->5v->3.3v? The 3.3 regulator only needs 4.3v or higher to function normally.

A few years ago I had a PCB etching kit that used a sharpie to draw the tracks then you dipped the whole thing in ferric chloride. At least, I think that was how it worked. Anyway just look for a PCB etching kit.

Adbot
ADBOT LOVES YOU

Rapulum_Dei
Sep 7, 2009
im sure I saw a cheap service to get small amounts of pcb designs printed and delivered.

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