|
I'm contemplating making some overly fancy card game tokens that slowly light up after you flip them to their "on" side and fade back out if you flip them to "off" again. It's keys for the game Keyforge if that means anything to you and a player needs exactly three so i'm not gonna be making a million of these. Looking into fade-in/fade out circuits for LEDs a bit i happened upon people commonly using ATTiny85s for this. They are far smaller than any analog circuit i could realistically rig up to do the same thing. And they seem to be compatible with the Arduino enviroment which is why i'm asking here. What i have in mind is an SW-200D tilt switch that closes when the token is right side up and then the ATTiny start fading in three LEDs via PWM output. The LEDs i picked draw 25mA a piece so i can't run more than one from each of the output pins since they are rated for 40mA. Now where it gets confusing is that i'm finding conflicting information on whether the ATTiny85 can do two or three PWM outputs. The official documentation says pins 5 and 6 function as PWM outputs but some people say you can use pin 3 as well. If it's only two does anyone have a recommendation for a different microcontroller or an alternate way to hook up three 25mA LEDs without blowing anything? Indiviadual control of the LEDs would be a nice bonus but i care more about having three. There's a bunch of different ATTiny85 variants too but those seem to mostly refer to the shape of the package and pins, is there anything i should watch out for specifically? Everything everything would be powered by a 1/2 AA 3.6V battery since it seems to be a good compromise of size and capacity. It seems to be plenty for the microcontroller as well. Here's a wiring diagram assuming i can get three PWM pins: And here's a quick mock-up of the whole thing with components loosely thrown in for scale: One last question would be if anyone can recommend me a power switch that's as tiny as possible? There's plenty of tiny buttons but switches tend to be larger than i'd like.
|
# ? Mar 2, 2019 19:16 |
|
|
# ? May 29, 2024 20:43 |
|
Bistromatic posted:One last question would be if anyone can recommend me a power switch that's as tiny as possible? There's plenty of tiny buttons but switches tend to be larger than i'd like. APEM NK236? 0.1" pin spacing, .4" LOA, 0.1" wide...
|
# ? Mar 5, 2019 02:03 |
|
Thanks, those seem perfect!
|
# ? Mar 5, 2019 16:21 |
|
Bistromatic posted:Thanks, those seem perfect! Always glad to do some DigiKey parametric searches!
|
# ? Mar 7, 2019 00:35 |
|
sharkytm posted:Always glad to do some DigiKey parametric searches! Snarky sharky
|
# ? Mar 15, 2019 13:32 |
|
CarForumPoster posted:Snarky sharky No snark intended. I really like DigiKey's search. It's almost as good as McMaster Carr.
|
# ? Mar 15, 2019 15:23 |
|
I need a pair of microcontrollers with:
Does anyone make such a thing? I could piece it together on top of an ESP32 feather but I'd really like to keep it as small as possible.
|
# ? May 13, 2019 14:05 |
|
evil_bunnY posted:I need a pair of microcontrollers with: Something like this? https://www.aliexpress.com/item/TTGO-T-Beam-ESP32-433-868-915Mhz-WiFi-wireless-Bluetooth-Module-ESP-32-GPS-NEO-6M/32967228739.html
|
# ? May 13, 2019 14:44 |
|
evil_bunnY posted:I need a pair of microcontrollers with: This plus this, they also make a GPS feather as well, but it would probably be easier to just wire the GPS directly in.
|
# ? May 13, 2019 16:35 |
|
Gonna get one these I think:evil_bunnY posted:No but this looks like it'll be perfect for both ends
|
# ? May 14, 2019 10:17 |
|
I've run into an Atmel micro problem, so it's kinda Arduino-related. I'm reprogramming some boards with ATTiny 45's on them. The code is open source and Arduino-based, I made some changes, and I'm trying to program a bunch of these devices. I've had two of these just up and die, and ten successful programming results. I'm confused as to what could cause the micro to stop communicating. 1. One failure was using a soldered-on header, the other was from a pogo-pin jig. The program uploads, but fails on verification. Once it fails, the micro never talks again. I get "device signature 0x0000" if I use my Arduino as ISP, and a similar device initialization failure using a USBasp. USBasp was run in both normal and slow clock mode to try and get things working. Device runs the micro on 5V, and my programmers both run 5V. I tried 3.3V and no change. 2. Fuses are unchanged, and I've verified power and external clock signal are correct and intact. 3. I could get ahold of a HVPP, but I'm hoping there's something else I can try. Thoughts?
|
# ? May 21, 2019 05:43 |
|
Are you programming with jtag, or via the Arduino bootloader?
|
# ? May 21, 2019 06:45 |
|
Splode posted:Are you programming with jtag, or via the Arduino bootloader? Bootloader.
|
# ? May 21, 2019 11:58 |
|
How? The tiny 45 doesn't have an internal serial port. The only way to program them is through isp (or hv I guess).
Sagebrush fucked around with this message at 14:26 on May 21, 2019 |
# ? May 21, 2019 14:24 |
|
Sagebrush posted:How? The tiny 45 doesn't have an internal serial port. The only way to program them is through isp (or hv I guess). There's a programming header on the board, and I'm using an ISP to do the programming, so not using the bootloader. Sorry. I know it's not JTAG. It's a 6-pin: MISO, MOSI, SCK, Reset, plus +5V, Gnd. I'm very much not an AVR person, I mostly run PICs, so the tools are pretty foreign to me. sharkytm fucked around with this message at 18:10 on May 21, 2019 |
# ? May 21, 2019 18:05 |
|
I tried to program some more of these boards, and captured the output when one fails.code:
|
# ? May 22, 2019 22:01 |
|
So it successfully detects the chip and burns the program, and then the program fails verification from byte zero and the signature disappears? It sounds like your programmer (or something about the way you've got it set up in the circuit) is frying the chips. Do you have any loose Tiny45s? Can you try burning the same program onto them several times to see if you get the same failure when they're not in the circuit?
|
# ? May 23, 2019 05:00 |
|
Sagebrush posted:So it successfully detects the chip and burns the program, and then the program fails verification from byte zero and the signature disappears? I'll order some. If I can program them outside and solder them onto the board, it'll save the $400 in paperweights that I have now. This is what I get for using a COTS product instead of designing from scratch. I talked to their engineering team, and apparently once the full board is assembled, it needs to be powered separately as other components are drawing too much power and can cause glitches. I'll give that a shot today. sharkytm fucked around with this message at 15:13 on May 23, 2019 |
# ? May 23, 2019 05:12 |
|
Nope, that didn't help. The board (which is part of an LED light) was powered by a 12V bench supply, and being programmed by my Arduino as ISP. The LED flashed very quickly during the programming, which isn't surprising, because the LED driver is connected to Pin 6 of the micro (shared by the MISO connection). I got a the same mismatch error, and this was repeatable (I could keep sending the program and getting the flashes and error). Once I powered the board down, the micro went silent. I've got 25 ATTiny45's on their way, I'll try programming them off-board and installing them. It's really odd that I had a reasonable number of successes, and now I'm at about 25% success rate. I was previously using my desktop, and now I'm on a laptop, but the settings are identical. Any thoughts?
|
# ? May 23, 2019 16:55 |
|
I haven't looked at the circuit itself, but I'd almost put money at this point on it being a problem with programming it in circuit. The fact that it's running on 12v and that the MISO pin is connected to the LED driver is skeeving me out. Get the bare chips and some sockets and see how you make out.
|
# ? May 23, 2019 17:22 |
|
Sagebrush posted:I haven't looked at the circuit itself, but I'd almost put money at this point on it being a problem with programming it in circuit. The fact that it's running on 12v and that the MISO pin is connected to the LED driver is skeeving me out. Get the bare chips and some sockets and see how you make out. No way to socket them, it's all SMD. And on a MCPCB, to boot, soldering is a royal pain. I just hot-air gunned one out, and it doesn't talk to AtmelStudio. The MFR has some forum posts about programming them in-circuit, which is why I thought it would work (and it did several times).
|
# ? May 23, 2019 17:26 |
sharkytm posted:No way to socket them, it's all SMD. Test socket not an option? https://www.adafruit.com/product/1282?gclid=CjwKCAjwiZnnBRBQEiwAcWKfYjLqviSuIiy7AtPv0tpno2pNzkr7lllCfoR0uWkRypLi2honzI9uBRoCJrcQAvD_BwE
|
|
# ? May 23, 2019 17:40 |
|
Test socket might be an option. I'll think about it. So... I programmed the last 4 lights with no failures. I went back to my original setup: Arduino as ISP, soldered headers, and flying leads from the Arduino to the header. No problems. I'm wondering if the Pogo Pins are causing a problem, or maybe something else that I missed. Is there a big difference between "Upload" and "Upload using programmer" when using Arduino as ISP? I know you have to use "Upload using programmer" with the USBAsp, but not sure about the Arduino as ISP. all 4 of these latest ones used "Upload as programmer", but I swear I used "Upload" previously. sharkytm fucked around with this message at 13:10 on May 24, 2019 |
# ? May 24, 2019 13:05 |
|
My nephew is into toys now and the original plan was to build a wooden car but his dad keeps bringing home these light up toys from China I was thinking about hollowing out a section of the car and throwing a tiny86 in there, a strip of LEDs and some sort of battery Since he likes shaking things and banging them around. What kinds of sensors can I hook up to detect a toddler banging it around? I'm thinking detecting forces above 2G? Someone had asked long ago about a very low energy jiggle sensor on a spring, I think. The sensor would change the color of the LEDs, or light pattern, etc.
|
# ? Jun 15, 2019 20:54 |
|
Yeah, just Google spring shock sensor, they'll come right up. I have a little plastic ball, think marble sized, with one of those and some flashy LEDs. It's lasted literally ten years, somehow gets moved with me, keeps turning up in drawers and surprises me when it gets bumped and starts flashing for a minute
|
# ? Jun 15, 2019 22:54 |
|
a solid state accelerometer (LIS3DH is cheap) will do the same thing.
|
# ? Jun 15, 2019 23:00 |
|
Not as cool and harder to use though
|
# ? Jun 16, 2019 00:23 |
|
Yeah the very next day my nephew comes over and his mom has a bouncy ball that lights up when you throw it against the ground. Just gonna get one of those and harvest the guts from it, wire it up to some extra LEDs and maybe maybe a bigger battery. Arduino is absolute overkill for what I need to do. Then I can just epoxy everything in place.
|
# ? Jun 18, 2019 04:33 |
|
Does anyone know if the soon-to-be-available Arduino Nano 33 BLE will be able to act as an HID?
|
# ? Jun 24, 2019 16:43 |
|
So I *think* an Arduino is the right tool to accomplish what I want to do, and I'm here for some help/clarification on that. I've got a project car (an electric conversion, AI thread here) and I need to add a realtime display of my battery temperature. My batteries already have a total of 10 thermistors in them, which are connected to a Battery Management System (BMS). The BMS continuously monitors these temperatures, and throws an error if they are over the warning limit (illuminates a light on my dash). There are two ways to interface with the BMS: a CAN-BUS interface, and a serial connection on a 3.5mm TRS jack (looks like a headphone jack). The CAN-BUS is not suitable for my needs (it doesn't output temperatures, headers would be wrong for CAN gauges anyway). The serial connection allows one to connect a laptop to the BMS via a usb-serial cable that comes with it. Using a terminal client like PuTTY, this is how the BMS is configured and how I can query information it's monitoring, like thermistor temperatures. There is a simple text command to query themistor readings, and they are returned in a predictable text format. But I don't want to drive around with a laptop on the passenger seat, I want a nice gauge in the dash. So, I've got a suitable gauge on order, which takes a simple 0-5V input. I should then be able to set up an Arduino to connect to the BMS serial connection, write a bit of code to periodically query thermistor temps from the BMS, parse the output, and convert that into a 0-5V analog (or likely PWM) output signal for the gauge. I think I understand how to do nearly all that from what I've researched thus far, except the serial communication. It is not clear to me how easy or difficult that is. Maybe it's a simple as connecting the right pins and then a couple lines of code: code:
bawfuls fucked around with this message at 23:01 on Aug 5, 2019 |
# ? Aug 5, 2019 22:33 |
|
It's real simple as long as you can get the duino to physically talk to the BMS.
|
# ? Aug 5, 2019 22:52 |
|
What make and model BMS do you have? I'd mostly be concerned about verifying the voltage on that serial port before you risk frying a pin, any other configuration needs can be handled in software. RS-232 / 9600 baud / 8 data bits / 1 stop bit / no parity is pretty standard but you never know if you've got an oddball until you check.
|
# ? Aug 5, 2019 22:57 |
|
Yeah I guess troubleshooting that is what worries me. Guess I need to get an additional display just to have a way to verify the communication?
|
# ? Aug 5, 2019 22:57 |
|
My BMS is this: https://www.thunderstruck-ev.com/bms/ The documentation says 9600 baud, 8 data bits, 1 stop but. It doesn’t mention RS232 or otherwise.
|
# ? Aug 5, 2019 22:59 |
|
Nah just work out what voltage is coming out of the serial port from the battery manager. Pray it's 5 volts, anything else will require additional hardware. Otherwise it's pretty easy, if you can connect with putty you have your serial settings already
|
# ? Aug 5, 2019 23:01 |
|
They mention using a USB-serial converter so that makes it 99.99% chance its RS232. Hmm, it connects with a 3.5mm jack so maybe lower that to 98%.
|
# ? Aug 5, 2019 23:02 |
|
Is an Uno the right board for this? I assume a PWM voltage output will be fine for this, shouldn’t need a true analog voltage output. And I’ll need to power the Arduino separately since it can’t pull power from the BMS. Looks like I should be able to power it with my existing 12V sources in the car.
|
# ? Aug 5, 2019 23:14 |
|
Based on this documentation filename coming up from googling the driver filename, I'm confident it's 232. Now gotta figure out which wires on the stereo plug are Tx / Rx / GND
|
# ? Aug 5, 2019 23:20 |
|
taqueso posted:They mention using a USB-serial converter so that makes it 99.99% chance its RS232. RS232 is specifically -15V / +15V, and it's really doubtful that that's it. A USB-Serial converter, and this BMS, probably, will be UART (which is pretty standard serial), but that still doesn't answer the question of whether it's 5V or 3.3V. Most modern stuff has moved over to 3.3V, and I'd recommend picking up some sort of 3.3V-compatible Arduino-alike. The Teensy is supposed to be good, I guess.
|
# ? Aug 6, 2019 01:05 |
|
|
# ? May 29, 2024 20:43 |
|
ante posted:RS232 is specifically -15V / +15V, and it's really doubtful that that's it. Arduino UNO has a single UART so I don't think you could easily connect a computer and your BMS simultaneously. The bigger arduinos(like Mega or Due) have more UARTs but all the other IO they provide is overkill for what you need. I would personally go with an ESP32 (3.3V based so still need to be cautious of voltage levels, so get the MAX3232 above), which iirc has 3 UARTs and can also interface with computer over wifi if you want. edit: forgot to mention ESP32 is compatible with Arduino IDE, so you can keep your code basically the same, except maybe changing some pin #s. peepsalot fucked around with this message at 02:38 on Aug 6, 2019 |
# ? Aug 6, 2019 02:34 |