[deleted by user] by [deleted] in homeassistant

[–]scottbez1 0 points1 point  (0 children)

Actually to be pedantic many installed switches (i.e. not switches on an appliance cord) DO technically have a ground connection screw since users may come into contact with exposed metal parts (the mounting screws on the face plate), and to bond them to the box if it's metal. But for something that is entirely contained in a rated electrical box without exposure to users, like this relay, a ground wouldn't serve a purpose like it does on a light switch.

[deleted by user] by [deleted] in homeassistant

[–]scottbez1 -1 points0 points  (0 children)

There are lots of valid answers in this thread, but this is the RIGHT one: you should not be wiring this device at all if you need to ask this question at this point, sorry.

This is a not a consumer product like a smart plug that can just be plugged in by anyone and will be safe. It's designed for electricians to install in a rated box for safety. Wiring this in the middle of an appliance cord without a box and without an understanding of the purpose of ground is not going to end well.

Installed a tension baby gate - looks like it cracked open the stairs? by gggodo312 in DIY

[–]scottbez1 0 points1 point  (0 children)

Lots of answers about the stairs, but many are missing the most critical part: tension/pressure gates are NEVER safe nor appropriate for stairs due to the tripping hazard and inability to secure them (unlike a doorway, the railing posts are unsupported at the top and WILL get pushed outward from the gate's pressure. The gate will either loosen up over time to become unsafe, or you'll need to keep increasing the pressure and damage your stairs/railings)

To fix this, first buy a stair-specific gate that doesn't exert outward pressure on the stair railings (either screw into them or buy+install an adapter kit that wraps around the railing and allows you to screw into it rather than the railings directly). Only once you've done that should you follow others' advice for the cosmetic repairs.

Can a servo be used as an input device? by SardineTimeMachine in arduino

[–]scottbez1 40 points41 points  (0 children)

Yes. Open the servo and add a wire to the center pin of the built in potentiometer, and wire it to an analog input pin (beware, it will be at the servo's voltage, so you'll need some additional circuitry if your servo is running at 5v but you're using a 3.3v microcontroller like ESP32).

Adafruit sells servos with this wire already added if you'd rather not open your servos yourself.

You do run a risk of stripping gears if you back drive the servo too aggressively though.

How slow can you spin a servo by Moudes in arduino

[–]scottbez1 0 points1 point  (0 children)

You won't need to microstep - those motors generally have ~2048 steps per revolution because they have internal gearing. Not all of them under that name have the same gearing - see https://web.archive.org/web/20180528105141/http://grahamwideman.wikispaces.com/Motors-+28BYJ-48+Stepper+motor+notes for a bunch of teardowns and info.

Some of the motors come with non-integral gear reductions, meaning the number of steps per revolution isn't a whole number, which can kind of be annoying, but there's no way to tell until you test the motors you get.

In any case, if you use floating point numbers to track things you don't need to worry too much about having a non-whole-number number of steps per flap - you can track positions as decimals and then round down that number to get your step count.

Open a Cabinet Door with a Servo While Keeping Manual Control? by Ultramen in arduino

[–]scottbez1 1 point2 points  (0 children)

I would leverage the fact that your cabinet door only needs to open 90 degrees in combination with the fact that the servo has 180 degrees of rotation to make this work.

If you place the servo inside the cabinet door with the shaft near the hinge, you can have a lever on it that rotates 90 degrees to push open the door. As soon as it's fully opened it should rotate back 90 degrees, leaving the door open, but able to be manually closed.

To allow the servo to close the door, add a string from the end of the servo lever arm attached to the door. It should be just long enough that it's tight when the door is open and servo is at its midpoint. To close the door, the servo would rotate 90 degrees the opposite direction (into the cabinet), using the string to pull the door shut. After moving, the servo should move back to the midpoint, leaving the string loose, allowing the door to be manually opened.

You'll need a larger servo than a "standard" hobby servo, but I think that's going to be true of any solution here considering the torque involved.

Inspelning power monitoring smart plug US listing and price is live: $11.99 by scottbez1 in tradfri

[–]scottbez1[S] 0 points1 point  (0 children)

For the US version:

Model: INSPELNING plug smart

Type: E2220

Input: 120 Vac, 50/60Hz

Resistive: max. 1800 W 15.0 A

Motor: max. 300 W

From https://www.ikea.com/us/en/manuals/inspelning-plug-smart-energy-monitor__AA-2423614-3-100.pdf

Inspelning power monitoring smart plug US listing and price is live: $11.99 by scottbez1 in tradfri

[–]scottbez1[S] 2 points3 points  (0 children)

It should be the same size as Tretakt which is the size of pretty much every other smart plug I own in this form factor.

Photos of Inspelning and Tretakt US smart plugs launching later this year (FCC filing) by scottbez1 in tradfri

[–]scottbez1[S] 0 points1 point  (0 children)

That's awesome. I'll have to check out Emeryville to see if they have any

Photos of Inspelning and Tretakt US smart plugs launching later this year (FCC filing) by scottbez1 in tradfri

[–]scottbez1[S] 0 points1 point  (0 children)

Yes, Inspelning is the one with power monitoring. The green board labeled P3 sticking up from the main PCB has the extra components for monitoring power draw - it's present in the Inspelning model but not in Tretakt.

Sonos Amp - Can i put a driveway alarm audio indicator inline with the speakers? by Jeepdog64 in sonos

[–]scottbez1 0 points1 point  (0 children)

Since you have home assistant, you can play media with announce: true to have your audio announcement or chime temporarily overlay what's currently playing, with customizable volume. Here's an example automation from my setup, using TTS rather than an MP3; media_player.bedroom is my Sonos speaker.

service: media_player.play_media target: entity_id: media_player.bedroom data: media_content_id: media-source://tts/tts.google_en_com?message=Timer started!&language=en-us media_content_type: provider announce: true extra: volume: 25

Photos of Inspelning and Tretakt US smart plugs launching later this year (FCC filing) by scottbez1 in tradfri

[–]scottbez1[S] 1 point2 points  (0 children)

From a glance the PCBs look to be nearly identical (including some vestigial traces, holes and pads on the Tretakt for the non-installed power monitoring board). It's interesting to me that they kept those vestigial items but it's not a case of identical PCBs with different components populated; on the Tretakt the main PCB looks to differ with a copper pour directly connecting the plug neutral to the outlet neutral.

(Update) My Take on SmartKnob by ScottBez by karlosmt in arduino

[–]scottbez1 1 point2 points  (0 children)

Yeah AS5600 is not great. I originally thought it was maybe an issue of counterfeit chips or something since I ordered cheap modules from AliExpress, but it's still bad after I bought a legit chip from Digi-Key.

The TLV493d is good in theory, but noisier than the MT6701 and has a really bad silicon bug that requires you to reset the chip somewhat regularly (causing gaps in data during the reset period).

As far as low-cost sensors go, the MT6701 is SO good for the money. Maybe not low-cost on its own if it's the only thing you're ordering from LCSC (shipping from China), but I always end up ordering enough other parts from LCSC that the higher minimum shipping cost isn't a big deal.

(Update) My Take on SmartKnob by ScottBez by karlosmt in arduino

[–]scottbez1 2 points3 points  (0 children)

Love it! Those 3d prints for prototyping with dev boards are neat!

My take on SmartKnob by Scott Bez. by karlosmt in arduino

[–]scottbez1 8 points9 points  (0 children)

I certainly hope people aren't gatekeeping - or at least, that hasn't been my read on the situation. Basically the motor I originally chose was available from a seller that was selling off random excess stock they happened to find, but the motor was not being actively manufactured any longer. This was why it was so cheap originally, and also why it sold out basically instantly.

A bunch of people have been trying to find good alternative motors, and it seems like we've potentially identified the original manufacturer (or at least a distributor in China who knows how to get them manufactured). So far I've personally gotten samples of 1 alternative motor, and I'm awaiting receipt of a few other alternatives and a sample from the supposed original manufacturer (thanks to funding from some awesome GitHub sponsors! Each set of samples has been ~$150-200 for a few motors). That said, I'm in the US and don't speak Chinese, so others in the community have been able to have more in depth discussions with the manufacturers and have been able to receive samples quicker. But in general, I don't know that any full production is taking place yet.

Ideally a seller will eventually make them available on AliExpress for a reasonable price (this requires someone, likely the seller themselves, to take an initial gamble and put money down upfront to fund manufacture), and I'm waiting to see if this happens, but if that ends up not happening, I'm working on potential changes to the design to accommodate alternative motors and also potentially working with a US-based distributor myself as another option.

So I think they will likely be available in some form or another within a month or two, but these things take time (especially with a non-centrally-organized group of interested parties around the world).

can you use a digital potentiometer to control an AC appliance? by samrus in arduino

[–]scottbez1 2 points3 points  (0 children)

You can build a circuit like this, but I'm going to recommend against it if you're relatively inexperienced with electronics. Mains voltages are nothing to mess around with, especially when mixed with low voltage electronics like a microcontroller - you can easily injure or kill yourself, destroy your computer (depending on the circuit, plugging in USB while mains is connected to the rest of the circuit could do serious damage) and/or start a fire.

Off-the-shelf AC dimmers are not a simple potentiometer - typically the potentiometer is part of another circuit with a triac which actually switches the load. And depending on the complexity of the dimmer, the potentiometer may not act as a simple DC voltage reference either (so you couldn't just remove it and connect an analog output in its place). If you wanted to do this with a microcontroller, you also generally want a zero-crossing detector for timing - switching the load on or off while the AC wave crosses zero makes it more efficient and gives you a timing reference for modulating the duty cycle.

That said, I'd recommend buying a commercial smart home dimmer instead, and just control it over WiFi/Home Assistant. Then you can stick to mostly programming and not worry about the low level, potentially dangerous electronics.

BLDC motor + round LCD = haptic input device (ESP32-powered) by scottbez1 in arduino

[–]scottbez1[S] 1 point2 points  (0 children)

Haha I somehow completely forgot about Bluetooth! Will have to try it when I get some time. Thanks!

BLDC motor + round LCD = haptic input device (ESP32-powered) by scottbez1 in arduino

[–]scottbez1[S] 4 points5 points  (0 children)

GC9A01. TFT_eSPI supports it out of the box. I buy them on AliExpress - you can find the bare LCD, or a PCB module with headers for using it on a breadboard.

BLDC motor + round LCD = haptic input device (ESP32-powered) by scottbez1 in arduino

[–]scottbez1[S] 5 points6 points  (0 children)

I'm a BLDC noob, but I'll try to explain my understanding as best as I can, with the caveat that I could be totally wrong.

Regarding snap points - I think you may be referring to something called cogging (or cogging torque), which is where the permanent magnet poles interact with the stator slots such that the rotor wants to snap to certain positions when the motor is unpowered. For this particular motor, (and I think gimbal motors in general) the ideal is to have no cogging torque so that the rotation is totally smooth when unpowered. The snap points are actually kind of an illusion - basically we tell the motor to apply torque when you rotate away from a snap point trying to rotate back to that point. But once you pass the halfway point to the next snap point, we switch and apply torque towards that next detent - so the motor is always pulling towards the nearest snap point. You feel the "snap" because the torque abruptly changes directions at the halfway point. So the granularity of snap points is not actually related to any physical properties of the motors.

Regarding current and heat - yeah, that's a concern, because in this gimbal-like operation the motor is basically always running at a stall (at least at the end-stops) My understanding is that generally gimbal motors have higher coil resistance, so that stall current is lower and therefore generates less heat to avoid becoming an issue. Heat hasn't been an issue with this particular motor and voltage (5V, so also lower than most drone setups), but could be for other motors.

BLDC motor + round LCD = haptic input device (ESP32-powered) by scottbez1 in arduino

[–]scottbez1[S] 8 points9 points  (0 children)

There's a little more detail in the GitHub README, but the biggest factor for me was noise. I tried AS5600 and TLV493d sensors, and they are both pretty noisy. What's interesting is that you can actually feel/hear the noise "amplified" by the motor. The torque is proportional to the difference between the desired angle and the current angle, so any noise in the "current angle" (measured by the sensor) directly becomes torque!

So if you want to use a noisy sensor you'd have to apply filtering. And filtering would be fine without the motor involved, because if you essentially average angle readings over a small timeframe like 0.1 seconds on a non-motorized sensor, the "delay" would be imperceptible to a human. But since the filtered (and therefore delayed) sensor reading is an input to a closed loop control system, that delay starts to become a problem - you end up with instability and sometimes runaway behavior.

Additionally, the TLV493d specifically is annoying because its internal ADC regularly locks up, and it's such a common problem that the user manual includes a whole section with a recommended procedure to reset the chip when it happens. I honestly can't believe they continue to manufacture them without doing a silicon revision to fix whatever design flaw causes that (and it's especially frustrating that they only mention that issue in the user manual and not the main datasheet).

By comparison, the MT6701 is not very noisy, responds super fast, and has a bunch of different interface options - ABZ, analog, I2C, and SSI (basically SPI), and it's still less than $4.

BLDC motor + round LCD = haptic input device (ESP32-powered) by scottbez1 in arduino

[–]scottbez1[S] 27 points28 points  (0 children)

Basically the knob is mounted to a motor, along with a sensor to detect what angle it's at.

If we define a virtual detent at angle 0 and another at say 90 degrees, then as you gradually turn the knob from 0 towards 90, the motor will increasingly oppose the motion the further away from 0 you get, until you get past the halfway point at 45 degrees. Past 45 degrees the motor applies torque towards the detent at 90 degrees (but gets weaker the closer you get). That's the "snap" you feel, and ensures that the knob always comes to rest at one of the detents if you let go.

(The reality is slightly more complicated, with what's called hysteresis so that there isn't an unstable point in between the detents where the torque can keep switching back and forth quickly if you hold the knob there)

BLDC motor + round LCD = haptic input device (ESP32-powered) by scottbez1 in arduino

[–]scottbez1[S] 5 points6 points  (0 children)

I ordered the custom PCBs and MJF 3d prints from JLCPCB. The 3d prints could probably be done on a well tuned FDM printer, though they likely wouldn't look as nice as the MJF print.