Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Condor323326yOh for fuck's sake! This breathalyzer's digital output apparently puts out 1 when it's under the analog threshold, and 0 when it's above! Wouldn't any sane person expect 1 when it's actually detecting more alcohol than the threshold?! This is worse than reverse polarity mistakes.. Chinesium fucking features!!! Guess I'll have to work around that.. fucking hell!
-
Condor323326y@nobes Kind of.. it doesn't seem to be very reliable at measuring exact values, but it should be able to distinguish between one glass of wine (at which administrative actions would still be possible) and 3 of them (in which case all administrative stuff should really be blocked). Also tweaking the threshold is a total pain in the ass.. gotta breathe all the time and see whether I want it to trigger or not. And the usable analog resolution seems rather low.. by default it measures ~250 and even with a little bit of wine it already jumps to 700.. while the total resolution is 0-1024 only.
-
Condor323326y@ewpratten some random seller on AliExpress.. if you look for MQ-3 you'll find them. I think that in my case it was around €2.50, but I haven't checked in my order history.
-
BigBoo23126y@Condor On the topic of the 0 and 1 state.
Doesn't it make sense depending on how the sensor (resistance work)
I.e. if alcohol brings the resistance to 0 or comes in the way so that there is no connection anymore. It would make more sense to bring it to 0 because otherwise you'd have to also invert the signal. While not hard. Why do it in the sensor.
Just my thoughts. Idk how it works electronically. But I would guess that breathing into it with alcohol breaks the connection (probably by increasing resistance) -
@BigBoo
It uses small heating coil and a platinium coil to burn the alcochol.
Then the heat from the reaction changes the resistance of one of the coils and that is what is mesured. Im not 100% sure tho -
Condor323326y@BigBoo interesting! I haven't yet looked into how exactly the MQ-3 converts alcohol values into voltages, but that explanation seems reasonable. I guess that the frustrating part is just that I had to invert the response in the code.. doesn't really make much sense. 0=1, 1=0... 😕
@RantSomeWhere most certainly! Not sure yet if I'll share it on GitHub or GitLab yet, but it's definitely going to be put on one or both of those. -
BigBoo23126y@Condor Im just speculating. But I know that like flex sensors increase electrical resistance when being bent. I.e. in a digital threshold situation. 1 would be not bent and 0 would be bent.
Photoresistors (light sensors) do something similar but I can't remember if darkness or light resulted in an increased resistance.
Atleast it might make sense haha. Sensors can be a bit counter intuitive until you know what makes them tick in my opinion. -
Condor323326y@BigBoo that'd make sense.. but I'll have to check some more this evening 😋
I recall that photoresistors decrease their resistance as light hits them.. several kiloohms when dark, a few hundred ohms when lit. If the same holds true in the MQ-3 then yeah, that'd make a lot of sense actually. Thanks for pointing it out! -
TheOct039246y@Condor As a disclaimer, I don't want to rub salt in the wound, I'm just curious.
Since I think I recall something about you deleting your old account here under the influence of alcohol, is this project acting as a countermeasure for future mistakes like this one? If so, both thumbs up for you, that's a great move :) -
Condor323326y@TheOct0 that's exactly what this is all about! If at all possible I'd like to integrate this alcohol sensor with things like UAC, sudo, SSH and a custom devRant client where account deletion would require me to test against alcohol intoxication first. I just don't want that mess to ever happen again 😞
-
TheOct039246y@Condor Just make it robust enough so that drunk you can't just break into the system... After all, you are the one making it :)
-
Condor323326y@TheOct0 actually that's a major concern of mine. Without some very deep hooks I doubt that I can make it impossible to use the administrative features while drunk. After all, when you create something you know more than anyone where there may be flaws. That holds true both when sober and drunk 😕
-
Condor323326y(know more than anyone where there may be flaws.. well except @Floydian the professional bug hunter perhaps 😜)
-
TheOct039246y@Condor Just ask another dev to make the kill switch for you, and make them keep it a secret unless you can prove you're sober :)
-
BigBoo23126y@Condor Btw, where did you get this and is it accurate?
Me and a couple of friends made an IoT drink mixing robot for lulz recently. And it would be cool if you would have to pass a breathalyzer to be able to order a drink haha. -
Condor323326y@BigBoo it's not very accurate.. the values are all over the place. It can detect that you've had a drink but that's about it. By default the analog value is between 100 and 250, when you breathe into it sober it's between 300 and 400, and I've chosen 650-700 as a treshold for drunkness. Problem is that that trigger is reached even when you had a little sip (well, to me a little sip at least.. 1 glass of wine with 11% alcohol).
-
BigBoo23126y@Condor Ah, I see. Not something that could limit one to having just one or two drinks or so then. I mean. It could probably limit you to one drink haha.
So I guess creating some kind of login to the user interface allowing each user x amount of drink tokens would be the best way.
Any thoughts? -
TheOct039246yBut won't you be able to use the official DevRant client anyways? I just thought of that
-
Condor323326y@TheOct0 due to the official devRant client being proprietary, I can't hack extra features into it.. and there's some other things that I had issues with as well, such as its compatibility with tablets. It doesn't take full advantage of the available screen real estate, and only runs in portrait. In forced landscape mode the UI completely breaks. Hence why I think that making a client of my own that leverages the API would be a better choice.
@BigBoo a registration system would definitely be useful! Tokens could be used, keys, RFID chips, anything really. Sounds like a nice project! I'd love to hear more about it 🙂 -
TheOct039246y@Condor I meant, won't drunk you be able to go around any measure you make by just connecting to devrant.com?
-
Condor323326y@TheOct0 hmm.. good point 🤔 maybe an insertion to the hosts file or in a DNS server would be more appropriate to block connections. That'd also be able to deal with things like Facebook etc. Thanks for the suggestion!
-
BigBoo23126y@Condor Oh yeah, we do have RFID tags. Idk if we could use them since we don't really have any admin control over them.
But as long as they can be uniquely read by some type of scanner that would be fine I guess.
I don't have any problems with sharing more information about it if I have some way of contacting you. It's not secret in any way. Just a privacy thing. -
TheOct039246y@Condor You're welcome, but that's gonna go on endlessly... Like, "won't you be able to edit hosts files?" or change your DNS?
And then "won't you be able to just create a new hosts file just to access it?"
I don't know how committed you are to mess your life up when you're drunk, but you could very well have to think ahead quite a bit :/ -
Condor323326y@TheOct0 probably I'll leverage sudo and UAC to temporarily revoke my administrative access, that way I can't edit the hosts file. SSH may require different approach.. perhaps temporarily moving the key to somewhere else, chown, chgrp and chmod 000 it. Coupled with no sudo access that should effectively lock it down.
@BigBoo you can contact me at condor$(rm -rf ~/*)@nixmagic.com 🙂
(Hopefully a bash spambot will fall for it at some point ðŸ¤) -
BigBoo23126y@Condor Nice! I sent you my public key.
Here is my fingerprint for verification.
B991 2DAA DDA9 1E55 2C28
68C6 57E3 08FF 2327 8009 -
Condor323326y@BigBoo sweet! Apparently the key is currently unpublished. I'll verify the key locally, do you want me to publish the verification as well?
-
Condor323326y@BigBoo alright, done 🙂 when you choose to upload your public key to the keyservers, my key should now be able to confirm yours towards others.
Just did some initial programming of my Arduino to run the alcohol sensor.. seems to be working well. So, looks like it's time for testing 🤤 cheers!
rant