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
Sebbe
Feb 29, 2004

I've got a bit of a puzzling conundrum I wonder if anyone here has run into.

I got myself a RC522 RFID reader (which seems pretty popular). To use it, I've been using this library, and it seems to be working mostly fine. However, I've run into something that puzzles me.

The component came with a MiFare Classic 1K card, and MiFare Classic 1K key fob. It reads both of these just fine.

My apartment complex uses a MiFare Classic 1K key fob for authentication to the laundromat; it reads that just fine as well. (With some sectors encrypted, and thus unreadable without the key, of course.)

The part that puzzles me, however, is this: I have a university access card. This card won't register at all with the reader. As in, it doesn't even respond to the REQA/WUPA (aka the "is there any card here?"-probe the reader sends into the ether, to figure out if anything's nearby); I just get nothing. Mind you, it's not just the one card. I have tried a good 4-5 different ones (all from the university), to no avail.

Now, one may say, it could be a different kind of card. However, I'm fairly sure that those card also are MiFare Classic 1K cards:
  • My Nexus 7 tablet is able to recognize (though not read) all the cards/fobs in question, and report them to be MiFare Classic 1K.
  • Some friends of mine have been looking into the cards for an RFID project at university, and they say the same thing, that it's MiFare Classic 1K.

I'm really lost as to what can be wrong, so here's a long shot: Has anyone else run into something like this with the RC522 module?

Adbot
ADBOT LOVES YOU

JawnV6
Jul 4, 2004

So hot ...
I haven't used that particular kit. There are a lot of different protocols at 13.56MHz, MiFare's based on 14443-A. There's also 15693, 14443-B, 18092, then a whole host of proprietary formats that my readers choke on during Anticollision checks. Can the tablet pull the UID off the card (if it's one of the right flavors?) or could it be another protocol that the tablet's just getting far enough to assume MiFare before giving up?

Sebbe
Feb 29, 2004

JawnV6 posted:

I haven't used that particular kit. There are a lot of different protocols at 13.56MHz, MiFare's based on 14443-A. There's also 15693, 14443-B, 18092, then a whole host of proprietary formats that my readers choke on during Anticollision checks. Can the tablet pull the UID off the card (if it's one of the right flavors?) or could it be another protocol that the tablet's just getting far enough to assume MiFare before giving up?

I'm entirely sure it's a MiFare, and fairly (let's say 99%) sure it's a MiFare Classic 1K (and hence 14443-A), due to the people I know doing a security analysis on it for a project, and what they did was dependent on it being MiFare Classic.

I suppose I can get them to scan it again with their Proxmark3, just to be sure, but I'm pretty sure that's the case.

JawnV6
Jul 4, 2004

So hot ...
Are there any sensitivity adjustments you can make? I have a few different kits, the one I've been happiest with is from ST Micro (link). I can adjust the sensitivity to the point where it will register card detect on air.

I'd guess the card's coil geometry isn't getting enough power from your current kit to respond? Do you have commands that are below REQA? Like, forget 14443-A, do you have a way to ask the RC522 "is there anything absorbing the 13.56MHz field"? Some mode that a 15693 tag would trip.

Blue On Blue
Nov 14, 2012

Oh boy I found the right thread:

I stumbled into a google hole on modding roombas.

Now I have an itchy spot I need to fill, and have never ever tinkered with Arduino / Raspberry Pi stuff before.

But I have zero idea how to begin and a soldering iron... how bad can it get?

I'd love to try out the bluetooth/wifi stuff for roombas, but prefer to build it myself as opposed to buying a pre-made kit you just plug in. Defeats the whole purpose for me.

That or make it smarter at mapping an area.

SoundMonkey
Apr 22, 2006

I just push buttons.


Sappo569 posted:

Oh boy I found the right thread:

I stumbled into a google hole on modding roombas.

Now I have an itchy spot I need to fill, and have never ever tinkered with Arduino / Raspberry Pi stuff before.

But I have zero idea how to begin and a soldering iron... how bad can it get?

I'd love to try out the bluetooth/wifi stuff for roombas, but prefer to build it myself as opposed to buying a pre-made kit you just plug in. Defeats the whole purpose for me.

That or make it smarter at mapping an area.

Well, make sure it's a GOOD soldering iron at least.

If your goal is "do things via wifi", the ESP8622 is the current hotness for a super-budget chipset, but for a few more dollars the CC3x00-based boards look really nice too (and probably better supported.) That and an appropriate arduino board (appropriate to the logic voltages you need, etc) and you're off to the races for a whole bunch of pretty simple stuff.

While an RPi and USB wifi dongle is also an easy solution, then you have to work out how to power that, and work out how to twiddle the GPIOs, etc. Both are good solutions but with the Arduino you're a little "closer to the metal" which is probably a good thing if all you want is to drive your roomba around with your phone.

I'd recommend getting a decent whatever-voltage board like a Leonardo or something to get the hang of the whole Arduino thing, then see what sort of communication you end up needing (there's some real decent new BTLE modules that recently came out too.)

Blue On Blue
Nov 14, 2012

SoundMonkey posted:

Well, make sure it's a GOOD soldering iron at least.

If your goal is "do things via wifi", the ESP8622 is the current hotness for a super-budget chipset, but for a few more dollars the CC3x00-based boards look really nice too (and probably better supported.) That and an appropriate arduino board (appropriate to the logic voltages you need, etc) and you're off to the races for a whole bunch of pretty simple stuff.

While an RPi and USB wifi dongle is also an easy solution, then you have to work out how to power that, and work out how to twiddle the GPIOs, etc. Both are good solutions but with the Arduino you're a little "closer to the metal" which is probably a good thing if all you want is to drive your roomba around with your phone.

I'd recommend getting a decent whatever-voltage board like a Leonardo or something to get the hang of the whole Arduino thing, then see what sort of communication you end up needing (there's some real decent new BTLE modules that recently came out too.)

Is there a smilie of eyes glazing over?

I understood the words you typed, but I'm not really sure what to do with them.

Hadlock
Nov 9, 2004

SoundMonkey posted:

If your goal is "do things via wifi", the ESP8622 is the current hotness for a super-budget chipset,

Followup, for those of you following along at home, the current title is actually about the ESP8266.

Also, mine finally arrived and no you can't just bend those pins, I'm probably going to get to learn how to solderer finally. What a dumb design (the white ones, specifically)/

SoundMonkey
Apr 22, 2006

I just push buttons.


Sappo569 posted:

Is there a smilie of eyes glazing over?

I understood the words you typed, but I'm not really sure what to do with them.

Go to a nerd site such as SparkFun.com or AdaFruit or something. Purchase something called an "Arduino Leonardo." An Arduino Uno would be just fine too. Maybe also some kind of accessory that sounds cool to you, like a heart rate sensor or temperature sensor or something. Maybe even GPS! While waiting for your order to arrive, go to arduino.cc and learn to code.

That's basically what I meant.

Blue On Blue
Nov 14, 2012

SoundMonkey posted:

Go to a nerd site such as SparkFun.com or AdaFruit or something. Purchase something called an "Arduino Leonardo." An Arduino Uno would be just fine too. Maybe also some kind of accessory that sounds cool to you, like a heart rate sensor or temperature sensor or something. Maybe even GPS! While waiting for your order to arrive, go to arduino.cc and learn to code.

That's basically what I meant.

Thanks that I can work with :laugh:

Roomba poo poo aside, I noticed lots of tiny little cameras being produced for Raspberry and Arduino, I can imagine so many cool things to do with those

SoundMonkey
Apr 22, 2006

I just push buttons.


Sappo569 posted:

Thanks that I can work with :laugh:

Roomba poo poo aside, I noticed lots of tiny little cameras being produced for Raspberry and Arduino, I can imagine so many cool things to do with those



An Arduino can't do much with a camera, except maybe to trigger it to record to its own internal storage or something. Bear in mind this is something whose RAM is measured in single digit kilobytes.

An RPi, on the other hand, can do quite a lot with a camera, and has a connector just for that.

Hadlock
Nov 9, 2004

I think Raspbian has a precompiled OpenCV package

"What is OpenCV and what can I do with it?" you say? I'm glad you asked!

https://www.youtube.com/watch?v=YbNmL6hSNKw

ReelBigLizard
Feb 27, 2003

Fallen Rib
EDIT: Actually I have a question. Anyone have any tips, tricks, go-to modules about getting safe, smooth power to an Arduino in an automotive application? I have a spare Arduino mini clone someone gave me and I think I'm going to pot it and throw it on my motorbike to monitor battery level, maybe fuel consumption and stuff.

Sappo569 posted:

Thanks that I can work with :laugh:

Even better, get a basic Arduino "starter kit". It will likely include a breadboard and a bunch of basic parts like sensors switches/buttons, buzzers, resistors, LEDs and prototyping wires. This will allow you to mock up your circuits and easily connect up modules and such without ever touching the soldering iron.

https://www.sparkfun.com/products/12060 - This one has sparkfuns version of the UNO and a bunch of cool stuff like an LCD display and interesting sensors.

The prototyping kit is useful for developing stuff on the Pi too, and Arduinos can even be used as a peripheral to the Pi in a sort of voltron-esque fashion to expand capabilities.

ReelBigLizard fucked around with this message at 15:11 on Mar 17, 2015

Collateral Damage
Jun 13, 2009

Additionally the Arduino starter kit includes a book with a bunch of more or less silly experiments that still teach you basic electronics and arduino coding. It's basically the same experiments as in the tutorials section on the Arduino web site.

Amberskin
Dec 22, 2013

We come in peace! Legit!

ReelBigLizard posted:

The prototyping kit is useful for developing stuff on the Pi too, and Arduinos can even be used as a peripheral to the Pi in a sort of voltron-esque fashion to expand capabilities.

Be careful if you do that, since the Arduino works with 5V and the Pi (and most of the single board ARM computers around) work at 3.3V. If you want to interface an Arduino and a Pi you must convert the levels so the Pi does not get burnt.

SoundMonkey
Apr 22, 2006

I just push buttons.


Amberskin posted:

Be careful if you do that, since the Arduino works with 5V and the Pi (and most of the single board ARM computers around) work at 3.3V. If you want to interface an Arduino and a Pi you must convert the levels so the Pi does not get burnt.

Or, alternatively, make your life easy and get an Arduino that runs at 3.3V (Pro Micro, Due(?), etc), if you play to have it chatting with a Pi.

Amberskin
Dec 22, 2013

We come in peace! Legit!

SoundMonkey posted:

Or, alternatively, make your life easy and get an Arduino that runs at 3.3V (Pro Micro, Due(?), etc), if you play to have it chatting with a Pi.

Yep, the DUE runs at 3.3V. The Teensy 3.X are also 3.3V machines.

SoundMonkey
Apr 22, 2006

I just push buttons.


For some reason I thought the Leonardo was 3.3V (it quite plainly is 5V), now I have to get goddamn level shifters to use this ESP8622.

Sebbe
Feb 29, 2004

Hadlock posted:

Followup, for those of you following along at home, the current title is actually about the ESP8266.

Also, mine finally arrived and no you can't just bend those pins, I'm probably going to get to learn how to solderer finally. What a dumb design (the white ones, specifically)/

Speaking of the ESP8266; DealExtreme finally got a breadboard friendly kit. Requires soldering, but it's the ESP-12 version which exposes 9 GPIO pins, so that's nice.

dirtycajun
Aug 27, 2004

SUCKING DICKS AND SQUEEZING TITTIES
Hey, I am working on a MIDI project and all the examples I can find online are using an old version of the library, the new example of how to do MIDI input into the arduino uses callbacks. I am new to callbacks and am having trouble understanding all the functions inside the library. I was hoping I could get some help just getting it to serial.write the note whenever a note on or note off is received. The way the example is written it doesn't seem like I need to set the serial rate and that kind of confuses me.

code:
#include <MIDI.h>

MIDI_CREATE_DEFAULT_INSTANCE();

// -----------------------------------------------------------------------------

// This function will be automatically called when a NoteOn is received.
// It must be a void-returning function with the correct parameters,
// see documentation here:
// [url]http://arduinomidilib.fortyseveneffects.com/a00022.html[/url]

void handleNoteOn(byte channel, byte pitch, byte velocity)
{
    // Do whatever you want when a note is pressed.

    // Try to keep your callbacks short (no delays ect)
    // otherwise it would slow down the loop() and have a bad impact
    // on real-time performance.
}

void handleNoteOff(byte channel, byte pitch, byte velocity)
{
    // Do something when the note is released.
    // Note that NoteOn messages with 0 velocity are interpreted as NoteOffs.
}

// -----------------------------------------------------------------------------

void setup()
{
    // Connect the handleNoteOn function to the library,
    // so it is called upon reception of a NoteOn.
    MIDI.setHandleNoteOn(handleNoteOn);  // Put only the name of the function

    // Do the same for NoteOffs
    MIDI.setHandleNoteOff(handleNoteOff);

    // Initiate MIDI communications, listen to all channels
    MIDI.begin(MIDI_CHANNEL_OMNI);
}

void loop()
{
    // Call MIDI.read the fastest you can for real-time performance.
    MIDI.read();

    // There is no need to check if there are messages incoming
    // if they are bound to a Callback function.
    // The attached method will be called automatically
    // when the corresponding message has been received.
}

TheLastManStanding
Jan 14, 2008
Mash Buttons!
The readme says the begin method sets up the serial at 31250. Have you looked through the examples in the extended reference?

dirtycajun
Aug 27, 2004

SUCKING DICKS AND SQUEEZING TITTIES

TheLastManStanding posted:

The readme says the begin method sets up the serial at 31250. Have you looked through the examples in the extended reference?

No, but I am going to now!

n0tqu1tesane
May 7, 2003

She was rubbing her ass all over my hands. They don't just do that for everyone.
Grimey Drawer

ReelBigLizard posted:

EDIT: Actually I have a question. Anyone have any tips, tricks, go-to modules about getting safe, smooth power to an Arduino in an automotive application? I have a spare Arduino mini clone someone gave me and I think I'm going to pot it and throw it on my motorbike to monitor battery level, maybe fuel consumption and stuff.

Depending on what board it is exactly, you might be able to feed it straight 12v, and it'll convert on-board.

Otherwise, the quick and dirty using parts that you could probably source at a Radio Shack* would be a 7805 and a couple filter caps.

*Assuming all the ones in your area didn't close, and actually still have some stuff in stock. Even so, they used to fairly reliably have at least a 7805 and some capacitors.

SoundMonkey
Apr 22, 2006

I just push buttons.


n0tqu1tesane posted:

Depending on what board it is exactly, you might be able to feed it straight 12v, and it'll convert on-board.

Otherwise, the quick and dirty using parts that you could probably source at a Radio Shack* would be a 7805 and a couple filter caps.

*Assuming all the ones in your area didn't close, and actually still have some stuff in stock. Even so, they used to fairly reliably have at least a 7805 and some capacitors.

Please do not do this. Automotive power is not a clean 12V source.

TI makes a line of pin-compatible-with-78xx regulators (in this case the LM2937-5.0) that are designed to handle the ridiculous transients (like 60V) and filthy voltage coming from a vehicle's 12V bus. Only two external caps required.

A 7805 or something MIGHT work until a transient blows it up when the load from the starter gets dumped when the engine starts, but the on-board regulator on Arduino boards will not fare well at all, and if you're feeding the board directly on its 5V input, I'm pretty sure that bypasses the polyfuses (if they exist on that board), so you really want to make sure your supply voltage isn't hosed up.

SoundMonkey fucked around with this message at 10:10 on Mar 23, 2015

ReelBigLizard
Feb 27, 2003

Fallen Rib
Yeah, I was asking because automotive electrics have crazy noise. I have 7805s and stuff, I just figured they wouldn't be enough. The only plus of car/moto systems is you don't really have to worry about efficiency, there's almost always a surplus of power from the stator/alternator, so a linear is fine.

I'll look up the LM2937. I was kind of hoping to find a nice pre-made deal with screw terminals or spade connectors or something. Maybe I should knock something up and throw it on Tindie...

SoundMonkey
Apr 22, 2006

I just push buttons.


ReelBigLizard posted:

Yeah, I was asking because automotive electrics have crazy noise. I have 7805s and stuff, I just figured they wouldn't be enough. The only plus of car/moto systems is you don't really have to worry about efficiency, there's almost always a surplus of power from the stator/alternator, so a linear is fine.

I'll look up the LM2937. I was kind of hoping to find a nice pre-made deal with screw terminals or spade connectors or something. Maybe I should knock something up and throw it on Tindie...

The LM2937 is literally "7805 but for cars." They're pretty drat cheap, easy to use, and are exactly what you're looking for. You could probably just point-to-point solder or wire-wrap the filtering caps on and not even bother with a PCB or anything (that's actually my plan for a current Arduino-based automotive thing, although I'm also trying to get away with halfassing the heat dissipation because it's only going to be drawing like 100mA.)

With automotive stuff it's not so much the crazy noise (I mean that's an issue, but caps are cheap), it's the huge voltage swings as heavy loads are applied to and dumped from the power source.

What it really boils down to is that if the starter is drawing 200 amps, and the battery chemistry accommodates (after a pretty significant voltage dip), when the load drops back down to 2 or 3 amps, the battery chemistry is still doing the same poo poo, just with a tenth of the current draw, so you'd best believe the voltage is going to spike like hell. You can even see it in the console lights of kinda-older vehicles, everything dims/flickers when the starter's cranking, then spring brightly to life once it starts. That same voltage is going to your project.

This kinda stuff even happens with grid power - at an old poorly-wired theatre I used to work at, if I decided for whatever reason to turn the entire lighting rig on to full intensity at once (so zero current draw to ~150,000W, instantly), the line voltage sagged to nearly 90V for about a second and browned out the lighting console (until we hooked it up through a power conditioner / UPS.)

edit: to save you having to look it up... http://www.ti.com/lit/ds/symlink/lm2937.pdf

SoundMonkey fucked around with this message at 11:43 on Mar 23, 2015

ravenkult
Feb 3, 2011


Is there any decent starter guide? I bought one of those Funduinos and I can't really get it to work.

Collateral Damage
Jun 13, 2009

ravenkult posted:

Is there any decent starter guide? I bought one of those Funduinos and I can't really get it to work.

http://arduino.cc/en/Tutorial/HomePage

Jamsta
Dec 16, 2006

Oh you want some too? Fuck you!

SoundMonkey posted:

The LM2937 is literally "7805 but for cars." They're pretty drat cheap, easy to use, and are exactly what you're looking for. You could probably just point-to-point solder or wire-wrap the filtering caps on and not even bother with a PCB or anything (that's actually my plan for a current Arduino-based automotive thing, although I'm also trying to get away with halfassing the heat dissipation because it's only going to be drawing like 100mA.)

With automotive stuff it's not so much the crazy noise (I mean that's an issue, but caps are cheap), it's the huge voltage swings as heavy loads are applied to and dumped from the power source.

What it really boils down to is that if the starter is drawing 200 amps, and the battery chemistry accommodates (after a pretty significant voltage dip), when the load drops back down to 2 or 3 amps, the battery chemistry is still doing the same poo poo, just with a tenth of the current draw, so you'd best believe the voltage is going to spike like hell. You can even see it in the console lights of kinda-older vehicles, everything dims/flickers when the starter's cranking, then spring brightly to life once it starts. That same voltage is going to your project.

This kinda stuff even happens with grid power - at an old poorly-wired theatre I used to work at, if I decided for whatever reason to turn the entire lighting rig on to full intensity at once (so zero current draw to ~150,000W, instantly), the line voltage sagged to nearly 90V for about a second and browned out the lighting console (until we hooked it up through a power conditioner / UPS.)

edit: to save you having to look it up... http://www.ti.com/lit/ds/symlink/lm2937.pdf

That's really interesting - thanks. I was thinking of doing something like this to save the LEDs I put in the car which blow due to dirty alternator power.

I've got lots of premade LM2596 boards which do 2-3A, are these just as good or are they missing something for doing auto power regulation?

Sh4
Feb 8, 2009
While we are talking about automotive applications, would it be reliable to use an arduino with gps as speedo or would it be only useful at high speed ?

SoundMonkey
Apr 22, 2006

I just push buttons.


Sh4 posted:

While we are talking about automotive applications, would it be reliable to use an arduino with gps as speedo or would it be only useful at high speed ?

I'm sure there's an official number somewhere, but empirically, once the GPS has 3 satellites, it's good for anything above 5-10km/h.

edit: if all you're doing is a speedo, you may as well just chat with the OBD port unless you distrust what the car thinks its speed is

SoundMonkey fucked around with this message at 13:58 on Mar 23, 2015

SoundMonkey
Apr 22, 2006

I just push buttons.


Jamsta posted:

That's really interesting - thanks. I was thinking of doing something like this to save the LEDs I put in the car which blow due to dirty alternator power.

I've got lots of premade LM2596 boards which do 2-3A, are these just as good or are they missing something for doing auto power regulation?

I'm no expert, but those ICs do not look like they have the stones to deal with automotive power, and I can't speak for the rest of the board but most of them look pretty much like the application diagram from the datasheet.

Were I you, I wouldn't trust it with automotive.

ReelBigLizard
Feb 27, 2003

Fallen Rib

SoundMonkey posted:

You could probably just point-to-point solder or wire-wrap the filtering caps on and not even bother with a PCB or anything

For moto stuff, especially stuff that's likely just to piggyback some part of the wiring loom, I usually just dead-bug solder it and pot it in resin. Bikes are terrible for vibration and water.

Thanks for the info, if the project comes to anything I'll post a result.

Blue On Blue
Nov 14, 2012

Does anyone have a recommendation for LCD screens ?

I see quite a few in the $60 range on amazon

Sh4
Feb 8, 2009
Anyone interested about working together on a motorbike computer project, was thinking about functions like speedo, mileage, fuel level, oil warning, water temp, maybe RPM too but I have no idea how to proceed.
I'm decent at code but I have never did any electronics. I'm pretty sure there's a market for it too, as all my racing 2 strokes buddies are complaining all the time that aftermarket computers are terrible or way too expensive.

Fanged Lawn Wormy
Jan 4, 2008

SQUEAK! SQUEAK! SQUEAK!

Sappo569 posted:

Does anyone have a recommendation for LCD screens ?

I see quite a few in the $60 range on amazon

I got one using the ili9340 chipset from adafruit, I really like it. Mines 2.2" I think. I've been pretty pleasantly surprised with the refresh rate.

Hadlock
Nov 9, 2004

There's a bunch of 1" 128x64 OLED screens that use the now extremely common SSD1306 driver for about $4 a piece shipped

Blue On Blue
Nov 14, 2012

Sorry I should have specified, looking for something closer to the 5" or 7" range.

Or whichever would have the largest size to refresh rate ratio

TheresaJayne
Jul 1, 2011
I have a couple of N35 Acer Palmtops, I was planning to grab the screens off them (their batteries are deader than Cobol)
Just wondering whether its possible to also use the Touch screen part as well as the lcd panel part?

Adbot
ADBOT LOVES YOU

Collateral Damage
Jun 13, 2009

Sh4 posted:

Anyone interested about working together on a motorbike computer project, was thinking about functions like speedo, mileage, fuel level, oil warning, water temp, maybe RPM too but I have no idea how to proceed.
I'm decent at code but I have never did any electronics. I'm pretty sure there's a market for it too, as all my racing 2 strokes buddies are complaining all the time that aftermarket computers are terrible or way too expensive.
If your bike has an OBD plug (or some other CAN bus access) there are a few CAN/OBD shields which will let you get a lot of that data straight from the engine controller.

Though if you want something for a non-ECU engine you probably have to put a bunch of sensors all over it yourself.

Collateral Damage fucked around with this message at 10:19 on Mar 25, 2015

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